Array interface refactoring

Simon Marlow simonmar at microsoft.com
Thu Feb 23 05:56:03 EST 2006


On 23 February 2006 01:24, John Meacham wrote:

> On Wed, Feb 22, 2006 at 06:47:19PM +0000, Ben Rudiak-Gould wrote:
>> 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.
> 
> Indeed. this has bothered me a whole lot too. I keep on trying to
> implement an expanding circular buffer and then being sad when it
> can't be done.
> 
> We could fix it fairly easily, we just need to get rid of HasBounds
> as a superclass of MArray and add a new method 'getBounds' that
> returns the bounds in the monad and then modify the default methods
> to use getBounds rather than bounds.  since they are all already in
> the monad this will work just fine.
> 
> it would be almost perfectly backwards compatable, the only change
> would be some code might need to list HasBounds in their type
> signatures seperatly. If we can get this in before the next release
> of ghc that would be really great.

I've added a ticket, scheduled for 6.6.

Cheers,
	Simon


More information about the Haskell-prime mailing list