Hacker News new | ask | show | jobs
by mbq 5207 days ago
The most of this Zen comes from array paradigm, not functional; still it is nice to see another soul on the path to Renlightenment (-;
1 comments

That's a matter of perspective. Folds and scans exist for all regular data types, not only arrays, so I consider this a part of functional programming and type theory.

Here he is computing the history of states of a random walk as scan (*) initial updates. If you wanted to simulate branching random walks, you'd work over the data type of multiway trees instead of arrays, but the algorithm to compute the history of intermediate states would otherwise be identical, using the scan function for multiway trees.