Implications of foldr vs. foldl (or foldl’)
The recursion for foldr f x ys where ys = [y1,y2,…,yk] looks like f y1 (f y2 (… (f yk x) …)) whereas the recursion for foldl f x ys looks like f (… (f (f x y1) y2) …) yk An important difference here is that if the result of f x y can … Read more