Keith Sheppard wrote:
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

As others have said, there are cases where non-strictness is what you want. And if you are using a type that is strict (the common case), GHC's optimizations will catch it.

The historical reason for this is that foldl' is not Haskell 98, only foldl.

- Jake
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to