Proposal: Make arrays safer

Ian Lynagh igloo at earth.li
Fri Aug 10 12:33:35 EDT 2007


On Fri, Aug 10, 2007 at 12:37:00PM -0300, Isaac Dupree wrote:
> 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

Good point, thanks. Fixed locally.


Ian



More information about the Libraries mailing list