[Haskell-cafe] Array bug?
bertram.felgenhauer at googlemail.com
Sat Nov 1 10:14:30 EDT 2008
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
> 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
It's somewhat ironic that this behaviour was introduced by a patch
that made arrays safer to use in other respects.
More information about the Haskell-Cafe