Foldl and folr are 2 very important functions for FP and Haskell, but I have never heard much about the unsided fold:
fold f [a,b,c,d] = (f (f a b) (f c d))
That is, a fold that operates on binary associative functions (so the order of application doesn't matter). If I recall correctly, this is very common in databases as it can be parallelized. So, about it, I ask:
- Is it, like foldr, universal?
- Like foldr, can you define every important function using it?
- Is there a fusion rule for it, similar to those for foldr/build and unfoldr/destroy?
- Why is it barely mentioned?
- Any consideration worth mentioning?