[Haskell-cafe] Re: Go Haskell!
rl at cse.unsw.edu.au
Fri Nov 28 18:45:57 EST 2008
On 28/11/2008, at 20:04, Simon Marlow wrote:
> So we have two vector libraries, vector and uvector, which have a
> lot in common - they are both single-dimension array types that
> support unboxed instances and have list-like operations with
> fusion. They ought to be unified, really.
Yes. This shouldn't be too hard to do since both libraries are based
on the internal DPH arrays. Although I have to admit that I never
really looked at Don's code and have no idea how much he has changed.
But it's more than that. The basic idea behind vector is to provide a
common framework for "normal" arrays, ByteString, StorableVector etc.
It's not finished by a long shot but (unsurprisingly) I think it goes
in the right direction. The proliferation of array-like libraries is
> The main difference between these libraries and Haskell's arrays is
> the Ix class. So perhaps Haskell's arrays should be reimplemented
> on top of the low-level vector libraries?
> The Ix class is the root cause of the problems with optimising the
> standard array libraries.
Yes, Haskell arrays should be based on a lower-level array library. I
would also argue that they should be redesigned and given a more
streamlined and efficient interface. The Ix class is not the only
problem wrt efficiency. In particular, the H98 array library relies
quite heavily on lists which makes implementing any kind of array
fusion rather hard. In contrast to Ix, this is completely unnecessary,
More information about the Haskell-Cafe