Re: RFC: Overloaded arrays

2000-03-29 Thread Chris Okasaki
Simon Marlow wrote: class HasBounds a = IArray a e where (!) :: Ix ix = a ix e - ix - e array :: Ix ix = (ix,ix) - [(ix,e)] - a ix e class (Monad m, HasBounds a) = MArray a e m where read:: Ix ix = a ix e - ix - m e

Re: RFC: Overloaded arrays

2000-03-29 Thread Chris Okasaki
Simon Marlow wrote: Actually, I'm slightly concerned about your use of small arrays: the static (one-off) cost of allocating an array is quite high compared to eg. tuples or records. Are arrays the only solution here? You're right of course that arrays are quite expensive, but it is not