On 12/22/07, David Benbennick <[EMAIL PROTECTED]> wrote:
> On 12/21/07, Stefan O'Rear <[EMAIL PROTECTED]> 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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to