Proposal: Strict scanl, scanl1 and mapAccumL

Henning Thielemann lemming at
Mon Nov 12 11:17:09 CET 2012

On Mon, 12 Nov 2012, Bas van Dijk wrote:

> On 12 November 2012 10:41, Henning Thielemann
> <lemming at> wrote:
>> There was already a discussion some weeks ago
> Thanks, I missed that one. It seems it didn't reach a conclusion yet.
> Maybe we can continue the discussion here.

My impression is that making 'seq' available as function without a 
typeclass constraint was a step in the wrong direction. Then foldl' and 
friends were the second step in the wrong direction and scanl' would be 
the third step. For 'seq' I would propose we first start with a cleanly 
typed 'seq' and base foldl' functions on this function instead of the 
built-in 'seq'. But I assume that most of the time where foldl' is used, 
actually a deepseq-foldl' is meant. I have often seen foldl' in Haskell 
library code that had not the intended effect since the accumulator was a 
lazy pair or a Map.

More information about the Libraries mailing list