Adding scanl'

wren ng thornton wren at
Fri Sep 14 01:18:20 CEST 2012

On 9/12/12 2:30 PM, Niklas Hambüchen wrote:
> Was it intentional that sum is defined in terms of foldl and not foldl'?

Yes, because sum is defined in the Report as using foldl. This is silly, 
but it is what it is. With optimizations on, GHC often converts foldl 
into foldl' (when it's semantics-preserving) because of this and other 
functions which "must" use foldl.

Live well,

More information about the Libraries mailing list