Bertram Felgenhauer | 1 Nov 15:14 2008

Re: Array bug?

Andrew Coppin wrote:
> Consider the following GHCi session:
> GHCi, version 6.8.2:  :? 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

It's somewhat ironic that this behaviour was introduced by a patch
that made arrays safer to use in other respects.