1 Nov 2008 15:14
Re: Array bug?
Bertram Felgenhauer <bertram.felgenhauer <at> googlemail.com>
2008-11-01 14:14:30 GMT
2008-11-01 14:14:30 GMT
Andrew Coppin wrote: > Consider the following GHCi session: > > GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help > Prelude Data.Array.IO> t <- newArray ((0,0),(5,4)) 0 :: IO (IOUArray (Int,Int) Int) > Prelude Data.Array.IO> getBounds t > ((0,0),(5,4)) > Prelude Data.Array.IO> > > Is this a known bug? Is it likely to be fixed any time soon? (I'm guessing > the bug is as simple is converting indicies to integers and then checking > the integers are in-range, rather than the underlying index type.) Yes, it's a known bug - a conscious choice really. See http://hackage.haskell.org/trac/ghc/ticket/2120 It's somewhat ironic that this behaviour was introduced by a patch that made arrays safer to use in other respects. Bertram
RSS Feed