You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It has come up in the issues section before that the chapter on the Fold pattern is fairly confusing (see issue #54).
A question about the same thing came up recently in URLO, in this thread.
As an answer to that question, I wrote a semi-long answer, describing:
Iterator::fold as a simple left-fold example
A Foldable trait which has the FP sense (Haskell sense to be specific) of a generic right-fold.
An implementation of the Foldable trait on a BinaryTree which performs a depth-first traversal from right to left.
I would like to port this answer to the chapter on Fold. Are there some other things you would like to see in the chapter? Or maybe you want me to remove something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It has come up in the issues section before that the chapter on the Fold pattern is fairly confusing (see issue #54).
A question about the same thing came up recently in URLO, in this thread.
As an answer to that question, I wrote a semi-long answer, describing:
Iterator::fold
as a simple left-fold exampleFoldable
trait which has the FP sense (Haskell sense to be specific) of a generic right-fold.Foldable
trait on aBinaryTree
which performs a depth-first traversal from right to left.I would like to port this answer to the chapter on Fold. Are there some other things you would like to see in the chapter? Or maybe you want me to remove something?
Beta Was this translation helpful? Give feedback.
All reactions