foldl versus foldr behavior with infinite lists
How folds differ seems to be a frequent source of confusion, so here’s a more general overview: Consider folding a list of n values [x1, x2, x3, x4 … xn ] with some function f and seed z. foldl is: Left associative: f ( … (f (f (f (f z x1) x2) x3) x4) …) … Read more