22 Dec 09:15
Re: Why does this blow the stack?
David Benbennick <dbenbenn <at> gmail.com>
2007-12-22 08:15:46 GMT
2007-12-22 08:15:46 GMT
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: 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
RSS Feed