Haskell Platform proposal: Add the vector package

Roman Leshchinskiy rl at cse.unsw.edu.au
Mon Jun 18 23:50:01 CEST 2012

On 17/06/2012, at 12:14, Henning Thielemann wrote:

> On Fri, 15 Jun 2012, Johan Tibell wrote:
>> I am, with Roman's support, making a formal proposal to have the
>> vector package included in the Haskell Platform:
>>   http://trac.haskell.org/haskell-platform/wiki/Proposals/vector
>> See the wiki page for details, and a list of open issues for discussion.
>> The vector package itself can be found on Hackage:
>>   http://hackage.haskell.org/package/vector
> I thought about migrating storablevector to vector, but it seems that the vector package needs some GHC-only extensions like type families. I do not plan to make the storablevector package obsolete, but I think it would be useful if both packages would use the same datatype. Is it possible to put the Storable part of 'vector' into a separate package? Would this one be more portable?

There are type families, rank-n types, unboxed types and other goodies deep in the guts of vector so the Storable part is very much GHC-specific. To be honest, I don't think being portable is feasible for high-performance code at the moment, the language standard simply doesn't have enough tools for this. Which is a shame, really.

FWIW, Storable vectors are fundamentally broken, anyway, since a Storable instance can perform arbitrary I/O in its methods but a pure vector based on Storable will necessarily have to unsafePerformIO these operations. Storable should *really* live in ST but it's too late for that now. Which reminds me, I should dig up and finish my ST-based Storable alternative one of these days and provide a safe vector type for interoperating with C.


More information about the Libraries mailing list