Proposal: strictify foldl'

Henning Thielemann lemming at henning-thielemann.de
Mon Nov 3 17:40:40 UTC 2014


On Mon, 3 Nov 2014, Niklas Hambüchen wrote:

> On 03/11/14 18:16, Henning Thielemann wrote:
>> If 'seq' is faster than 'deepseq' it leaves things unevaluated and thus
>> builds up unevaluated expressions, right?
>
> Yes.
>
> What I mean is you could write a function function (using repeated
> foldl' inside) that is written such that its return value is fully
> evaluated (by carefully using just as many seqs as necessary for that).
>
> If foldl' did a full deepseq on its return value, then this function
> would seq the same data more times than necessary.

I see.


More information about the Libraries mailing list