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

Safe HaskellNone
LanguageHaskell98

Data.Vector.Fixed.Boxed

Contents

Description

Vector which could hold any value.

Synopsis

Immutable

data Vec (n :: Nat) a Source #

Vector with fixed length which can hold any value.

Instances

Arity n => VectorN Vec n a Source # 
Arity n => Functor (Vec n) Source # 

Methods

fmap :: (a -> b) -> Vec n a -> Vec n b #

(<$) :: a -> Vec n b -> Vec n a #

Arity n => Applicative (Vec n) Source # 

Methods

pure :: a -> Vec n a #

(<*>) :: Vec n (a -> b) -> Vec n a -> Vec n b #

liftA2 :: (a -> b -> c) -> Vec n a -> Vec n b -> Vec n c #

(*>) :: Vec n a -> Vec n b -> Vec n b #

(<*) :: Vec n a -> Vec n b -> Vec n a #

Arity n => Foldable (Vec n) Source # 

Methods

fold :: Monoid m => Vec n m -> m #

foldMap :: Monoid m => (a -> m) -> Vec n a -> m #

foldr :: (a -> b -> b) -> b -> Vec n a -> b #

foldr' :: (a -> b -> b) -> b -> Vec n a -> b #

foldl :: (b -> a -> b) -> b -> Vec n a -> b #

foldl' :: (b -> a -> b) -> b -> Vec n a -> b #

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

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

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

null :: Vec n a -> Bool #

length :: Vec n a -> Int #

elem :: Eq a => a -> Vec n a -> Bool #

maximum :: Ord a => Vec n a -> a #

minimum :: Ord a => Vec n a -> a #

sum :: Num a => Vec n a -> a #

product :: Num a => Vec n a -> a #

Arity n => Traversable (Vec n) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Vec n a -> f (Vec n b) #

sequenceA :: Applicative f => Vec n (f a) -> f (Vec n a) #

mapM :: Monad m => (a -> m b) -> Vec n a -> m (Vec n b) #

sequence :: Monad m => Vec n (m a) -> m (Vec n a) #

Arity n => Vector (Vec n) a Source # 

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

(Typeable Nat n, Arity n, 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) #

(Arity n, 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) => Show (Vec n a) Source # 

Methods

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

show :: Vec n a -> String #

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

(Arity n, Semigroup a) => Semigroup (Vec n a) Source # 

Methods

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

sconcat :: NonEmpty (Vec n a) -> Vec n a #

stimes :: Integral b => b -> Vec n a -> Vec n a #

(Arity n, 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, Arity n) => 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, NFData a) => NFData (Vec n a) Source # 

Methods

rnf :: Vec n a -> () #

type Dim (Vec n) Source # 
type Dim (Vec n) = n
type Mutable (Vec n) Source # 
type Mutable (Vec n) = MVec n

type Vec1 = Vec 1 Source #

type Vec2 = Vec 2 Source #

type Vec3 = Vec 3 Source #

type Vec4 = Vec 4 Source #

type Vec5 = Vec 5 Source #

Mutable

data MVec (n :: Nat) s a Source #

Mutable unboxed vector with fixed length

Instances

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

Methods

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

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

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

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

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

type DimM (MVec n) Source # 
type DimM (MVec n) = n