22 Dec 10:19
Re: Why does this blow the stack?
David Benbennick <dbenbenn <at> gmail.com>
2007-12-22 09:19:28 GMT
2007-12-22 09:19:28 GMT
On 12/22/07, David Benbennick <dbenbenn <at> gmail.com> wrote: > On 12/21/07, Stefan O'Rear <stefanor <at> cox.net> wrote: > > Because they simply aren't the same. > > Good point; thanks. That means that Don's patch could theoretically > break some existing Haskell program: In fact, it's possible to get strictness to avoid stack overflow, and still have laziness to allow undefined: myEnumFrom :: Integer -> [Integer] myEnumFrom a = map (a+) $ enumDeltaIntegerStrict 0 1 where enumDeltaIntegerStrict x d = x `seq` x : enumDeltaIntegerStrict (x+d) d then *Main> (myEnumFrom 42) !! (10^6) 1000042 *Main> length $ take 10 $ myEnumFrom undefined 10
RSS Feed