
18 Oct
2011
18 Oct
'11
10:18 a.m.
2011/10/18 Christian Maeder
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.