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:

Prelude> length $ take 10 ([undefined ..] :: [Integer])
10

With his patch, that will throw.

Some other types have the same issue (lazy Enum when it could be
strict, leading to stack overflow):

Prelude> length $ take 10 ([undefined ..] :: [Double])
10
Prelude> length $ take 10 ([undefined ..] :: [Float])
10
Prelude Foreign.C.Types> length $ take 10 ([undefined ..] :: [CFloat])
10
Prelude Foreign.C.Types> length $ take 10 ([undefined ..] :: [CDouble])
10
Prelude Foreign.C.Types> length $ take 10 ([undefined ..] :: [CLDouble])
10
Prelude Data.Ratio> length $ take 10 ([undefined ..] :: [Ratio Int])
10
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to