Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Vector.VectorC
Description
This modulo provides VectorC
and MVectorC
, which given a existing vector implementation and a
representation type, it stores elements by coercing the element type into representation type.
Using this, we can have elements with algebraic structures (like Monoid
used in
this package) but stored in efficient unboxed vectors.
Documentation
data VectorC (vector :: Type -> Type) rep elem Source #
Immutable vectors corresponding to MVectorC
. Use functions in Vector
to create and
modify these vectors.
Instances
(Coercible elem rep, Vector vector rep) => Vector (VectorC vector rep) elem Source # | |
Defined in Data.Vector.VectorC Methods basicUnsafeFreeze :: Mutable (VectorC vector rep) s elem -> ST s (VectorC vector rep elem) basicUnsafeThaw :: VectorC vector rep elem -> ST s (Mutable (VectorC vector rep) s elem) basicLength :: VectorC vector rep elem -> Int basicUnsafeSlice :: Int -> Int -> VectorC vector rep elem -> VectorC vector rep elem basicUnsafeIndexM :: VectorC vector rep elem -> Int -> Box elem basicUnsafeCopy :: Mutable (VectorC vector rep) s elem -> VectorC vector rep elem -> ST s () | |
type Mutable (VectorC vector rep) Source # | |
Defined in Data.Vector.VectorC |
data MVectorC (vector :: Type -> Type -> Type) rep s elem Source #
Given a mutable vector type vector
and representation type rep
, the type contructor
is a valid vector type that stores elements that are coercible to MVectorC
vector reprep
.
Use functions in MVector
to create and modify these vectors.
Instances
(Coercible elem rep, MVector vector rep) => MVector (MVectorC vector rep) elem Source # | |
Defined in Data.Vector.VectorC Methods basicLength :: MVectorC vector rep s elem -> Int basicUnsafeSlice :: Int -> Int -> MVectorC vector rep s elem -> MVectorC vector rep s elem basicOverlaps :: MVectorC vector rep s elem -> MVectorC vector rep s elem -> Bool basicUnsafeNew :: Int -> ST s (MVectorC vector rep s elem) basicInitialize :: MVectorC vector rep s elem -> ST s () basicUnsafeReplicate :: Int -> elem -> ST s (MVectorC vector rep s elem) basicUnsafeRead :: MVectorC vector rep s elem -> Int -> ST s elem basicUnsafeWrite :: MVectorC vector rep s elem -> Int -> elem -> ST s () basicClear :: MVectorC vector rep s elem -> ST s () basicSet :: MVectorC vector rep s elem -> elem -> ST s () basicUnsafeCopy :: MVectorC vector rep s elem -> MVectorC vector rep s elem -> ST s () basicUnsafeMove :: MVectorC vector rep s elem -> MVectorC vector rep s elem -> ST s () basicUnsafeGrow :: MVectorC vector rep s elem -> Int -> ST s (MVectorC vector rep s elem) |