hybrid-vectors-0.1: Hybrid vectors e.g. Mixed Boxed/Unboxed vectors

Safe HaskellNone




data MVector whereSource

A MVector s a is mutable vector that could have any vector type underneath


MV :: Mixed mv v a => !(mv s a) -> MVector s a 

munboxed :: Unbox a => MVector s a -> MVector s aSource

data Vector whereSource


V :: Mixed mv v a => !(v a) -> Vector a 

class (Typeable2 mv, Typeable1 v, mv ~ Mutable v, MVector mv a, Vector v a) => Mixed mv v a | mv -> v, v -> mv whereSource

Vector doesn't provide a way to recover the type of the immutable vector from the mutable vector type

This would otherwise prevent us from finishing the implementation of basicUnsafeFreeze in Vector

This class captures the invariants necessary to hide the choice of vector type from the user in such a way that we can go from mutable vector to immutabl vector and back again.


mmix :: mv s a -> MVector s aSource

mix :: v a -> Vector aSource


Mixed MVector Vector a 
Unbox a => Mixed MVector Vector a 
Storable a => Mixed MVector Vector a 
Prim a => Mixed MVector Vector a 
Mixed MVector Vector a 
(Mixed u v a, Mixed u' v' b) => Mixed (MVector u u') (Vector v v') (a, b)