patterns
patterns copied to clipboard
Fold pattern discussion should mention Iterator::scan
In the Fold page, it mentions how similar it is to Iterator::map
but is more flexible. It should also mention Iterator::scan
which allows carrying state forward across iterations, solving the earlier nodes can affect the operation on later nodes
use case. In fact, a folder as described might make a good state object to carry through a scan.
I wonder if this pattern could be renamed to Scanner
or something, since as mentioned in #54 the name Fold is mixed up with other programming concepts right next door to it.