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
  • 9,239
  • 15
  • 58
  • 85
  • 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

2

Right fold goes from right to left.

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

Incerteza
  • 32,326
  • 47
  • 154
  • 261