[Haskell-cafe] ANNOUNCE: vector-bytestring-0.0.0.0

Roel van Dijk vandijk.roel at gmail.com
Tue Oct 18 16:18:08 CEST 2011


2011/10/18 Christian Maeder <Christian.Maeder at dfki.de>:
> you could re-export VS.empty, VS.singleton, etc. directly.

The vector singleton and the vector-bytestring singleton don't have
the same type.

vector:
> singleton :: a -> Vector a

vector-bytestring:
> singleton :: Word8 -> Vector Word8

By choosing the more general type you risk that a previously correct
program becomes ambiguous. (When migrating from bytestring to
vector-bytestring).

I'm not sure if this will actually occur in practive or that it holds
for all the little functions that you could theoretically re-export
directly. Maybe we create an example program which would fail with the
more general type. Proving the opposite (that the more general type is
always safe) will be more difficult.



More information about the Haskell-Cafe mailing list