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

Safe HaskellNone
LanguageHaskell98

Data.Vector.Mixed.Internal

Synopsis

Documentation

data MVector :: * -> * -> * where Source

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

Constructors

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

Instances

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

data Vector :: * -> * where Source

Constructors

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

class (Typeable mv, Typeable v, mv ~ Mutable v, MVector mv a, Vector v a) => Mixed mv v a | mv -> v, v -> mv where Source

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.

Minimal complete definition

Nothing

Methods

mmix :: mv s a -> MVector s a Source

mix :: v a -> Vector a Source

Instances

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)