[Haskell-cafe] Simple list processing
lemming at henning-thielemann.de
Thu Jun 12 05:20:06 EDT 2008
On Wed, 11 Jun 2008, Thomas M. DuBuisson wrote:
> Why is there no mapAccumL' (strict)? Just a library deficiency that we
> can remedy or am I missing something?
The strictness in foldl' is needed to avoid that unevaluated computations
accumulate until the end of the list. In mapAccumL and scanl this danger
is smaller. If you process the elements of the output list in order then
the intermediate states are also computed step by step. However, if you
evaluate only the last element of the output list you have the same
problem like with foldl.
More information about the Haskell-Cafe