Proposal: Make arrays safer

Isaac Dupree isaacdupree at
Fri Aug 10 11:37:00 EDT 2007

Ian Lynagh wrote:
>     * Add (numElements :: Ix i => a i e -> Int) to IArray class
>     * Array types get an extra field for numElements, e.g.
>          -data UArray i e = UArray !i !i ByteArray#
>          +data UArray i e = UArray !i !i !Int ByteArray#

>                      but check index < numElements)

Also index >= 0, unless it is an unsigned/Word type, in which case that 
will be implicitly checked?


More information about the Libraries mailing list