[Haskell-cafe] Re: Why purely in haskell?
Don Stewart
dons at galois.com
Thu Jan 10 13:10:21 EST 2008
rendel:
> jerzy.karczmarczuk at info.unicaen.fr wrote:
> >>Although it could be argued that laziness is the cause of some very
> >>obscure bugs... <g> Niko
> >
> >Example, PLEASE.
>
> Prelude> sum [1..1000000]
> *** Exception: stack overflow
>
> Prelude> Data.List.foldl' (+) 0 [1..1000000]
> 500000500000
See,
http://hackage.haskell.org/trac/ghc/ticket/1997
Strictness for for atomic numeric types is inconsitently applied
across the base library. Fixing the inconsitencies would let
fix a range of similar issues.
Note the strictness analyser handles this in compiled code, but doesn't
run in ghci.
-- Don
More information about the Haskell-Cafe
mailing list