Array interface refactoring

Donald Bruce Stewart dons at
Tue Feb 21 23:39:48 EST 2006

> We had a short discussion on the IRC channel the other
> day about Arrays.  I advocated that we do some
> refactoring work and didn't meet with overwhelming
> disagreement, so I wanted to propose that the Arrays
> interfaces be refactored in Haskell'.
> As a Haskell new-ish-bie, the various Array interfaces
> seem a bit inconsistent and make learning/using arrays
> complicated.  I *do* understand how to use arrays in
> Haskell, but I think that the interface could be
> cleaned up.
> Examples of current confusions:
>  IArray and Array are dupes (obvious);
>  listArray for IArray, but newListArray for MArrays;
>  "!" for IArray, but readArray for MArrays.

And unsafeRead/unsafeWrite are too verbose. They are usually (almost
always?) safe (since the code does its own checks), so perhaps this
essential-for-performance interface should have nicer names? 

They're not in the same unsafe league that unsafePerformIO is.  Just
something I pondered during the shootout massacre a couple of weeks


More information about the Haskell-prime mailing list