0

Should I conceptualize a right fold as "folding the list to the right" or as "folding a list from the right"?

In other words, does a right fold go from left-to-right or from right-to-left?

Buttons840
  • 8,647
  • 15
  • 55
  • 82
  • Not an exact duplicate, but for Haskell see http://stackoverflow.com/questions/3950508/haskell-foldr-and-foldl-further-explanation-and-example – Jon Surrell Feb 12 '15 at 10:30

1 Answers1

1

Right fold goes from right to left.

Left fold goes from the left, like you read a text - from left to right.

Incerteza
  • 27,981
  • 42
  • 142
  • 242