Array interface refactoring
Ben Rudiak-Gould
Benjamin.Rudiak-Gould at cl.cam.ac.uk
Wed Feb 22 13:47:19 EST 2006
While we're on the topic, I have a couple of problems with the current array
system that cut deeper than the naming:
* The function for getting the bounds of an MArray is pure, so the
interface can't accommodate resizable arrays.
* unsafeAt, unsafeRead and unsafeWrite take 0-based indices, and the
bounds checking and conversion is handled externally, based on the
bounds you return. This means the interfaces can't support array
windowing, at least in the multidimensional case. I'd be happy with
windowing for one-dimensional arrays only, but there's no way to
restrict your array type to one-dimensional index types.
-- Ben
More information about the Haskell-prime
mailing list