|Maintainer||Uwe Schmidt (email@example.com)|
A map-fold function for interleaved map and fold. The elements of a list are processed like in a binary tree.
Pure version of binary map fold
mapFoldBinary id (+) [1..8] adds the elements of a list in the following order:
Monadic version of a binary map fold
The elements of a list are mapped and folded in the same way as in the pure version. The map and fold operations are interleaved. In the above example the expressions are evaluated from left to right, folding is performed, as early as possible.