fixed-vector-0.1.2.1: Generic vectors with fixed length

Safe HaskellNone

Data.Vector.Fixed.Storable

Contents

Description

Storable-based unboxed vectors.

Synopsis

Immutable

data Vec n a Source

Storable-based vector with fixed length

Instances

(Arity n, Storable a) => VectorN Vec n a 
(Arity n, Storable a) => Vector (Vec n) a 
(Arity n, Storable a) => IVector (Vec n) a 
(Arity n, Storable a, Show a) => Show (Vec n a) 

type Vec2 = Vec (S (S Z))Source

type Vec3 = Vec (S (S (S Z)))Source

Raw pointers

unsafeFromForeignPtr :: Storable a => ForeignPtr a -> Vec n aSource

Construct vector from foreign pointer.

unsafeToForeignPtr :: Storable a => Vec n a -> ForeignPtr aSource

Get underlying pointer. Data may not be modified through pointer.

unsafeWith :: Storable a => (Ptr a -> IO b) -> Vec n a -> IO bSource

Mutable

newtype MVec n s a Source

Storable-based mutable vector with fixed length

Constructors

MVec (ForeignPtr a) 

Instances

(Arity n, Storable a) => MVector (MVec n) a