head, tail, and recursive foldl