
12 Jun
2008
12 Jun
'08
5:20 a.m.
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.