[Haskell-cafe] curious about sum

Don Stewart dons at galois.com
Mon Jun 15 11:14:24 EDT 2009


keithshep:
> Is there any reason that sum isn't strict? I can't think of any case
> where that is a good thing.
> 
> Prelude> sum [0 .. 1000000]
> *** Exception: stack overflow
> 

It is strict when subject to strictness analysis (try compiling it).

-- Don

    


More information about the Haskell-Cafe mailing list