[Haskell-cafe] bytestring vs. uvector

Manlio Perillo manlio_perillo at libero.it
Fri Mar 13 10:04:45 EDT 2009


Don Stewart ha scritto:
> [...]
>> I think uvector only works with certain types that can be
>> unboxed, while storablevector works with all types that
>> instantiate Foreign.Storable.Storable.  I don't know about
>> vector.  From the description of vector, I have the
> 

One of the nice feature of uvector is the support for UArr (a :*: b).

An UArr (a :*: b) can be easily (with fstU and sndU) transformed in
UArr a and UArr b.

uvector package also suppors Complex and Rational, however the support 
for these type is "hard written", using a UAProd class, and requires 
some boiler plate code (IMHO).

I find StorableVector implementation much more simple; I would like to 
see it in the Haskell Platform.

As for Data.Parallel, uvector and vector, it seems there is some code 
duplication.

Both Data.Parallel and uvector, make us of a strict pair type.
Such a type is also implemented in the strict package [1].

The authors are the same, so I don't understand the reason of code 
replication.


There is also replication in the definition of the Stream data type.



[1] there seems to be an error in the documentation:
http://hackage.haskell.org/packages/archive/strict/0.3.2/doc/html/Data-Strict-Tuple.html

In the description, there is:
"Same as regular Haskell pairs, but (x :*: _|_) = (_|_ :*: y) = _|_"

but in the synopsis, the data constructor is :!:, not :*:.



Regards   Manlio Perillo


More information about the Haskell-Cafe mailing list