mutable-fenwick-0.1.1.0: Mutable Fenwick trees
Safe HaskellNone
LanguageHaskell2010

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.

Synopsis

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

Instances details
(Coercible elem rep, Vector vector rep) => Vector (VectorC vector rep) elem Source # 
Instance details

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 ()

elemseq :: VectorC vector rep elem -> elem -> b -> b

type Mutable (VectorC vector rep) Source # 
Instance details

Defined in Data.Vector.VectorC

type Mutable (VectorC vector rep) = MVectorC (Mutable vector) rep

data MVectorC (vector :: Type -> Type -> Type) rep s elem Source #

Given a mutable vector type vector and representation type rep, the type contructor MVectorC vector rep is a valid vector type that stores elements that are coercible to rep. Use functions in MVector to create and modify these vectors.

Instances

Instances details
(Coercible elem rep, MVector vector rep) => MVector (MVectorC vector rep) elem Source # 
Instance details

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)