fixed-vector-0.9.0.0: Generic vectors with statically known size.

Safe HaskellNone
LanguageHaskell98

Data.Vector.Fixed.Unboxed

Contents

Description

Unboxed vectors with fixed length.

Synopsis

Immutable

data family Vec n a Source #

Instances

Unbox n a => VectorN Vec n a Source # 
Unbox n a => Vector (Vec n) a Source # 

Methods

construct :: Fun (Dim (Vec n)) a (Vec n a) Source #

inspect :: Vec n a -> Fun (Dim (Vec n)) a b -> b Source #

basicIndex :: Vec n a -> Int -> a Source #

Arity n => IVector (Vec n) Double Source # 
Arity n => IVector (Vec n) Float Source # 
Arity n => IVector (Vec n) Char Source # 
Arity n => IVector (Vec n) Word64 Source # 
Arity n => IVector (Vec n) Word32 Source # 
Arity n => IVector (Vec n) Word16 Source # 
Arity n => IVector (Vec n) Word8 Source # 
Arity n => IVector (Vec n) Word Source # 
Arity n => IVector (Vec n) Int64 Source # 
Arity n => IVector (Vec n) Int32 Source # 
Arity n => IVector (Vec n) Int16 Source # 
Arity n => IVector (Vec n) Int8 Source # 
Arity n => IVector (Vec n) Int Source # 
Arity n => IVector (Vec n) Bool Source # 
Arity n => IVector (Vec n) () Source # 

Methods

unsafeFreeze :: PrimMonad m => Mutable (Vec n) (PrimState m) () -> m (Vec n ()) Source #

unsafeThaw :: PrimMonad m => Vec n () -> m (Mutable (Vec n) (PrimState m) ()) Source #

unsafeIndex :: Vec n () -> Int -> () Source #

(Arity n, IVector (Vec n) a) => IVector (Vec n) (Complex a) Source # 

Methods

unsafeFreeze :: PrimMonad m => Mutable (Vec n) (PrimState m) (Complex a) -> m (Vec n (Complex a)) Source #

unsafeThaw :: PrimMonad m => Vec n (Complex a) -> m (Mutable (Vec n) (PrimState m) (Complex a)) Source #

unsafeIndex :: Vec n (Complex a) -> Int -> Complex a Source #

(Arity n, IVector (Vec n) a, IVector (Vec n) b) => IVector (Vec n) (a, b) Source # 

Methods

unsafeFreeze :: PrimMonad m => Mutable (Vec n) (PrimState m) (a, b) -> m (Vec n (a, b)) Source #

unsafeThaw :: PrimMonad m => Vec n (a, b) -> m (Mutable (Vec n) (PrimState m) (a, b)) Source #

unsafeIndex :: Vec n (a, b) -> Int -> (a, b) Source #

(Arity n, Vector (Vec n) a, Vector (Vec n) b, Vector (Vec n) c, IVector (Vec n) a, IVector (Vec n) b, IVector (Vec n) c) => IVector (Vec n) (a, b, c) Source # 

Methods

unsafeFreeze :: PrimMonad m => Mutable (Vec n) (PrimState m) (a, b, c) -> m (Vec n (a, b, c)) Source #

unsafeThaw :: PrimMonad m => Vec n (a, b, c) -> m (Mutable (Vec n) (PrimState m) (a, b, c)) Source #

unsafeIndex :: Vec n (a, b, c) -> Int -> (a, b, c) Source #

(Unbox n a, Eq a) => Eq (Vec n a) Source # 

Methods

(==) :: Vec n a -> Vec n a -> Bool #

(/=) :: Vec n a -> Vec n a -> Bool #

(Typeable * n, Unbox n a, Data a) => Data (Vec n a) Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vec n a -> c (Vec n a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vec n a) #

toConstr :: Vec n a -> Constr #

dataTypeOf :: Vec n a -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Vec n a)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vec n a)) #

gmapT :: (forall b. Data b => b -> b) -> Vec n a -> Vec n a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vec n a -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vec n a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Vec n a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Vec n a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vec n a -> m (Vec n a) #

(Unbox n a, Ord a) => Ord (Vec n a) Source # 

Methods

compare :: Vec n a -> Vec n a -> Ordering #

(<) :: Vec n a -> Vec n a -> Bool #

(<=) :: Vec n a -> Vec n a -> Bool #

(>) :: Vec n a -> Vec n a -> Bool #

(>=) :: Vec n a -> Vec n a -> Bool #

max :: Vec n a -> Vec n a -> Vec n a #

min :: Vec n a -> Vec n a -> Vec n a #

(Arity n, Show a, Unbox n a) => Show (Vec n a) Source # 

Methods

showsPrec :: Int -> Vec n a -> ShowS #

show :: Vec n a -> String #

showList :: [Vec n a] -> ShowS #

(Unbox n a, Monoid a) => Monoid (Vec n a) Source # 

Methods

mempty :: Vec n a #

mappend :: Vec n a -> Vec n a -> Vec n a #

mconcat :: [Vec n a] -> Vec n a #

(Storable a, Unbox n a) => Storable (Vec n a) Source # 

Methods

sizeOf :: Vec n a -> Int #

alignment :: Vec n a -> Int #

peekElemOff :: Ptr (Vec n a) -> Int -> IO (Vec n a) #

pokeElemOff :: Ptr (Vec n a) -> Int -> Vec n a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Vec n a) #

pokeByteOff :: Ptr b -> Int -> Vec n a -> IO () #

peek :: Ptr (Vec n a) -> IO (Vec n a) #

poke :: Ptr (Vec n a) -> Vec n a -> IO () #

(Arity n, Unbox n a, NFData a) => NFData (Vec n a) Source # 

Methods

rnf :: Vec n a -> () #

data Vec n Double Source # 
data Vec n Float Source # 
data Vec n Float = V_Float (Vec n Float)
data Vec n Char Source # 
data Vec n Char = V_Char (Vec n Char)
data Vec n Word64 Source # 
data Vec n Word32 Source # 
data Vec n Word16 Source # 
data Vec n Word8 Source # 
data Vec n Word8 = V_Word8 (Vec n Word8)
data Vec n Word Source # 
data Vec n Word = V_Word (Vec n Word)
data Vec n Int64 Source # 
data Vec n Int64 = V_Int64 (Vec n Int64)
data Vec n Int32 Source # 
data Vec n Int32 = V_Int32 (Vec n Int32)
data Vec n Int16 Source # 
data Vec n Int16 = V_Int16 (Vec n Int16)
data Vec n Int8 Source # 
data Vec n Int8 = V_Int8 (Vec n Int8)
data Vec n Int Source # 
data Vec n Int = V_Int (Vec n Int)
data Vec n Bool Source # 
data Vec n Bool = V_Bool (Vec n Word8)
data Vec n () Source # 
data Vec n () = V_Unit
data Vec n (Complex a) Source # 
data Vec n (Complex a) = V_Complex (Vec n (a, a))
data Vec n (a, b) Source # 
data Vec n (a, b) = V_2 !(Vec n a) !(Vec n b)
data Vec n (a, b, c) Source # 
data Vec n (a, b, c) = V_3 !(Vec n a) !(Vec n b) !(Vec n c)
type Dim (Vec n) Source # 
type Dim (Vec n) = n
type Mutable (Vec n) Source # 
type Mutable (Vec n) = MVec n

type Vec1 = Vec (S Z) Source #

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

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

type Vec4 = Vec (S (S (S (S Z)))) Source #

type Vec5 = Vec (S (S (S (S (S Z))))) Source #

Mutable

data family MVec n s a Source #

Instances

Arity n => MVector (MVec n) Double Source # 
Arity n => MVector (MVec n) Float Source # 

Methods

overlaps :: MVec n s Float -> MVec n s Float -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Float -> MVec n (PrimState m) Float -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Float -> MVec n (PrimState m) Float -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Float) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Float -> Int -> m Float Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Float -> Int -> Float -> m () Source #

Arity n => MVector (MVec n) Char Source # 

Methods

overlaps :: MVec n s Char -> MVec n s Char -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Char -> MVec n (PrimState m) Char -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Char -> MVec n (PrimState m) Char -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Char) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Char -> Int -> m Char Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Char -> Int -> Char -> m () Source #

Arity n => MVector (MVec n) Word64 Source # 
Arity n => MVector (MVec n) Word32 Source # 
Arity n => MVector (MVec n) Word16 Source # 
Arity n => MVector (MVec n) Word8 Source # 

Methods

overlaps :: MVec n s Word8 -> MVec n s Word8 -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Word8 -> MVec n (PrimState m) Word8 -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Word8 -> MVec n (PrimState m) Word8 -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Word8) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Word8 -> Int -> m Word8 Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Word8 -> Int -> Word8 -> m () Source #

Arity n => MVector (MVec n) Word Source # 

Methods

overlaps :: MVec n s Word -> MVec n s Word -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Word -> MVec n (PrimState m) Word -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Word -> MVec n (PrimState m) Word -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Word) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Word -> Int -> m Word Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Word -> Int -> Word -> m () Source #

Arity n => MVector (MVec n) Int64 Source # 

Methods

overlaps :: MVec n s Int64 -> MVec n s Int64 -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Int64 -> MVec n (PrimState m) Int64 -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Int64 -> MVec n (PrimState m) Int64 -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Int64) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Int64 -> Int -> m Int64 Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Int64 -> Int -> Int64 -> m () Source #

Arity n => MVector (MVec n) Int32 Source # 

Methods

overlaps :: MVec n s Int32 -> MVec n s Int32 -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Int32 -> MVec n (PrimState m) Int32 -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Int32 -> MVec n (PrimState m) Int32 -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Int32) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Int32 -> Int -> m Int32 Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Int32 -> Int -> Int32 -> m () Source #

Arity n => MVector (MVec n) Int16 Source # 

Methods

overlaps :: MVec n s Int16 -> MVec n s Int16 -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Int16 -> MVec n (PrimState m) Int16 -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Int16 -> MVec n (PrimState m) Int16 -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Int16) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Int16 -> Int -> m Int16 Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Int16 -> Int -> Int16 -> m () Source #

Arity n => MVector (MVec n) Int8 Source # 

Methods

overlaps :: MVec n s Int8 -> MVec n s Int8 -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Int8 -> MVec n (PrimState m) Int8 -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Int8 -> MVec n (PrimState m) Int8 -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Int8) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Int8 -> Int -> m Int8 Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Int8 -> Int -> Int8 -> m () Source #

Arity n => MVector (MVec n) Int Source # 

Methods

overlaps :: MVec n s Int -> MVec n s Int -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Int -> MVec n (PrimState m) Int -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Int -> MVec n (PrimState m) Int -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Int) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Int -> Int -> m Int Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Int -> Int -> Int -> m () Source #

Arity n => MVector (MVec n) Bool Source # 

Methods

overlaps :: MVec n s Bool -> MVec n s Bool -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) Bool -> MVec n (PrimState m) Bool -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) Bool -> MVec n (PrimState m) Bool -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) Bool) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) Bool -> Int -> m Bool Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) Bool -> Int -> Bool -> m () Source #

Arity n => MVector (MVec n) () Source # 

Methods

overlaps :: MVec n s () -> MVec n s () -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) () -> MVec n (PrimState m) () -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) () -> MVec n (PrimState m) () -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) ()) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) () -> Int -> m () Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) () -> Int -> () -> m () Source #

(Arity n, MVector (MVec n) a) => MVector (MVec n) (Complex a) Source # 

Methods

overlaps :: MVec n s (Complex a) -> MVec n s (Complex a) -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) (Complex a) -> MVec n (PrimState m) (Complex a) -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) (Complex a) -> MVec n (PrimState m) (Complex a) -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) (Complex a)) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) (Complex a) -> Int -> m (Complex a) Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) (Complex a) -> Int -> Complex a -> m () Source #

(Arity n, MVector (MVec n) a, MVector (MVec n) b) => MVector (MVec n) (a, b) Source # 

Methods

overlaps :: MVec n s (a, b) -> MVec n s (a, b) -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) (a, b) -> MVec n (PrimState m) (a, b) -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) (a, b) -> MVec n (PrimState m) (a, b) -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) (a, b)) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) (a, b) -> Int -> m (a, b) Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) (a, b) -> Int -> (a, b) -> m () Source #

(Arity n, MVector (MVec n) a, MVector (MVec n) b, MVector (MVec n) c) => MVector (MVec n) (a, b, c) Source # 

Methods

overlaps :: MVec n s (a, b, c) -> MVec n s (a, b, c) -> Bool Source #

copy :: PrimMonad m => MVec n (PrimState m) (a, b, c) -> MVec n (PrimState m) (a, b, c) -> m () Source #

move :: PrimMonad m => MVec n (PrimState m) (a, b, c) -> MVec n (PrimState m) (a, b, c) -> m () Source #

new :: PrimMonad m => m (MVec n (PrimState m) (a, b, c)) Source #

unsafeRead :: PrimMonad m => MVec n (PrimState m) (a, b, c) -> Int -> m (a, b, c) Source #

unsafeWrite :: PrimMonad m => MVec n (PrimState m) (a, b, c) -> Int -> (a, b, c) -> m () Source #

data MVec n s Double Source # 
data MVec n s Double = MV_Double (MVec n s Double)
data MVec n s Float Source # 
data MVec n s Float = MV_Float (MVec n s Float)
data MVec n s Char Source # 
data MVec n s Char = MV_Char (MVec n s Char)
data MVec n s Word64 Source # 
data MVec n s Word64 = MV_Word64 (MVec n s Word64)
data MVec n s Word32 Source # 
data MVec n s Word32 = MV_Word32 (MVec n s Word32)
data MVec n s Word16 Source # 
data MVec n s Word16 = MV_Word16 (MVec n s Word16)
data MVec n s Word8 Source # 
data MVec n s Word8 = MV_Word8 (MVec n s Word8)
data MVec n s Word Source # 
data MVec n s Word = MV_Word (MVec n s Word)
data MVec n s Int64 Source # 
data MVec n s Int64 = MV_Int64 (MVec n s Int64)
data MVec n s Int32 Source # 
data MVec n s Int32 = MV_Int32 (MVec n s Int32)
data MVec n s Int16 Source # 
data MVec n s Int16 = MV_Int16 (MVec n s Int16)
data MVec n s Int8 Source # 
data MVec n s Int8 = MV_Int8 (MVec n s Int8)
data MVec n s Int Source # 
data MVec n s Int = MV_Int (MVec n s Int)
data MVec n s Bool Source # 
data MVec n s Bool = MV_Bool (MVec n s Word8)
data MVec n s () Source # 
data MVec n s () = MV_Unit
data MVec n s (Complex a) Source # 
data MVec n s (Complex a) = MV_Complex (MVec n s (a, a))
data MVec n s (a, b) Source # 
data MVec n s (a, b) = MV_2 !(MVec n s a) !(MVec n s b)
data MVec n s (a, b, c) Source # 
data MVec n s (a, b, c) = MV_3 !(MVec n s a) !(MVec n s b) !(MVec n s c)
type DimM (MVec n) Source # 
type DimM (MVec n) = n

Type classes

class (Arity n, IVector (Vec n) a, MVector (MVec n) a) => Unbox n a Source #

Instances

Arity n => Unbox n Double Source # 
Arity n => Unbox n Float Source # 
Arity n => Unbox n Char Source # 
Arity n => Unbox n Word64 Source # 
Arity n => Unbox n Word32 Source # 
Arity n => Unbox n Word16 Source # 
Arity n => Unbox n Word8 Source # 
Arity n => Unbox n Word Source # 
Arity n => Unbox n Int64 Source # 
Arity n => Unbox n Int32 Source # 
Arity n => Unbox n Int16 Source # 
Arity n => Unbox n Int8 Source # 
Arity n => Unbox n Int Source # 
Arity n => Unbox n Bool Source # 
Arity n => Unbox n () Source # 
Unbox n a => Unbox n (Complex a) Source # 
(Unbox n a, Unbox n b) => Unbox n (a, b) Source # 
(Unbox n a, Unbox n b, Unbox n c) => Unbox n (a, b, c) Source #