Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
newtype Vector v (n :: Nat ) a Source #
A wrapper to tag vectors with a type level length.
Be careful when using the constructor here to not construct sized vectors which have a different length than that specified in the type parameter!
Vector (v a) |
Instances
( Unbox a, KnownNat n) => Vector Vector ( Vector Vector n a) Source # | |
Defined in Data.Vector.Unboxed.Mutable.Sized basicUnsafeFreeze :: PrimMonad m => Mutable Vector0 ( PrimState m) ( Vector Vector0 n a) -> m ( Vector0 ( Vector Vector0 n a)) Source # basicUnsafeThaw :: PrimMonad m => Vector0 ( Vector Vector0 n a) -> m ( Mutable Vector0 ( PrimState m) ( Vector Vector0 n a)) Source # basicLength :: Vector0 ( Vector Vector0 n a) -> Int Source # basicUnsafeSlice :: Int -> Int -> Vector0 ( Vector Vector0 n a) -> Vector0 ( Vector Vector0 n a) Source # basicUnsafeIndexM :: Monad m => Vector0 ( Vector Vector0 n a) -> Int -> m ( Vector Vector0 n a) Source # basicUnsafeCopy :: PrimMonad m => Mutable Vector0 ( PrimState m) ( Vector Vector0 n a) -> Vector0 ( Vector Vector0 n a) -> m () Source # elemseq :: Vector0 ( Vector Vector0 n a) -> Vector Vector0 n a -> b -> b Source # |
|
( Unbox a, KnownNat n) => MVector MVector ( Vector Vector n a) Source # | |
Defined in Data.Vector.Unboxed.Mutable.Sized basicLength :: MVector s ( Vector Vector0 n a) -> Int Source # basicUnsafeSlice :: Int -> Int -> MVector s ( Vector Vector0 n a) -> MVector s ( Vector Vector0 n a) Source # basicOverlaps :: MVector s ( Vector Vector0 n a) -> MVector s ( Vector Vector0 n a) -> Bool Source # basicUnsafeNew :: PrimMonad m => Int -> m ( MVector ( PrimState m) ( Vector Vector0 n a)) Source # basicInitialize :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> m () Source # basicUnsafeReplicate :: PrimMonad m => Int -> Vector Vector0 n a -> m ( MVector ( PrimState m) ( Vector Vector0 n a)) Source # basicUnsafeRead :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> Int -> m ( Vector Vector0 n a) Source # basicUnsafeWrite :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> Int -> Vector Vector0 n a -> m () Source # basicClear :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> m () Source # basicSet :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> Vector Vector0 n a -> m () Source # basicUnsafeCopy :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> MVector ( PrimState m) ( Vector Vector0 n a) -> m () Source # basicUnsafeMove :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> MVector ( PrimState m) ( Vector Vector0 n a) -> m () Source # basicUnsafeGrow :: PrimMonad m => MVector ( PrimState m) ( Vector Vector0 n a) -> Int -> m ( MVector ( PrimState m) ( Vector Vector0 n a)) Source # |
|
KnownNat n => Monad ( Vector Vector n) Source # |
Treats a
|
Functor v => Functor ( Vector v n) Source # | |
KnownNat n => Applicative ( Vector Vector n) Source # |
The
|
Defined in Data.Vector.Generic.Sized pure :: a -> Vector Vector0 n a Source # (<*>) :: Vector Vector0 n (a -> b) -> Vector Vector0 n a -> Vector Vector0 n b Source # liftA2 :: (a -> b -> c) -> Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n c Source # (*>) :: Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n b Source # (<*) :: Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n a Source # |
|
Foldable v => Foldable ( Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized.Internal fold :: Monoid m => Vector v n m -> m Source # foldMap :: Monoid m => (a -> m) -> Vector v n a -> m Source # foldMap' :: Monoid m => (a -> m) -> Vector v n a -> m Source # foldr :: (a -> b -> b) -> b -> Vector v n a -> b Source # foldr' :: (a -> b -> b) -> b -> Vector v n a -> b Source # foldl :: (b -> a -> b) -> b -> Vector v n a -> b Source # foldl' :: (b -> a -> b) -> b -> Vector v n a -> b Source # foldr1 :: (a -> a -> a) -> Vector v n a -> a Source # foldl1 :: (a -> a -> a) -> Vector v n a -> a Source # toList :: Vector v n a -> [a] Source # null :: Vector v n a -> Bool Source # length :: Vector v n a -> Int Source # elem :: Eq a => a -> Vector v n a -> Bool Source # maximum :: Ord a => Vector v n a -> a Source # minimum :: Ord a => Vector v n a -> a Source # |
|
Traversable v => Traversable ( Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized.Internal traverse :: Applicative f => (a -> f b) -> Vector v n a -> f ( Vector v n b) Source # sequenceA :: Applicative f => Vector v n (f a) -> f ( Vector v n a) Source # mapM :: Monad m => (a -> m b) -> Vector v n a -> m ( Vector v n b) Source # sequence :: Monad m => Vector v n (m a) -> m ( Vector v n a) Source # |
|
KnownNat n => Distributive ( Vector Vector n) Source # | |
Defined in Data.Vector.Generic.Sized distribute :: Functor f => f ( Vector Vector0 n a) -> Vector Vector0 n (f a) Source # collect :: Functor f => (a -> Vector Vector0 n b) -> f a -> Vector Vector0 n (f b) Source # distributeM :: Monad m => m ( Vector Vector0 n a) -> Vector Vector0 n (m a) Source # collectM :: Monad m => (a -> Vector Vector0 n b) -> m a -> Vector Vector0 n (m b) Source # |
|
KnownNat n => Representable ( Vector Vector n) Source # | |
Eq1 v => Eq1 ( Vector v n) Source # | |
Ord1 v => Ord1 ( Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized.Internal |
|
Show1 v => Show1 ( Vector v n) Source # | |
( KnownNat n, n ~ (1 + m)) => Comonad ( Vector Vector n) Source # |
Non-empty sized vectors are lawful comonads.
e.g.
|
( KnownNat n, n ~ (1 + m)) => ComonadApply ( Vector Vector n) Source # | |
Eq (v a) => Eq ( Vector v n a) Source # | |
( Vector v a, Floating a, KnownNat n) => Floating ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized exp :: Vector v n a -> Vector v n a Source # log :: Vector v n a -> Vector v n a Source # sqrt :: Vector v n a -> Vector v n a Source # (**) :: Vector v n a -> Vector v n a -> Vector v n a Source # logBase :: Vector v n a -> Vector v n a -> Vector v n a Source # sin :: Vector v n a -> Vector v n a Source # cos :: Vector v n a -> Vector v n a Source # tan :: Vector v n a -> Vector v n a Source # asin :: Vector v n a -> Vector v n a Source # acos :: Vector v n a -> Vector v n a Source # atan :: Vector v n a -> Vector v n a Source # sinh :: Vector v n a -> Vector v n a Source # cosh :: Vector v n a -> Vector v n a Source # tanh :: Vector v n a -> Vector v n a Source # asinh :: Vector v n a -> Vector v n a Source # acosh :: Vector v n a -> Vector v n a Source # atanh :: Vector v n a -> Vector v n a Source # log1p :: Vector v n a -> Vector v n a Source # expm1 :: Vector v n a -> Vector v n a Source # |
|
( Vector v a, Fractional a, KnownNat n) => Fractional ( Vector v n a) Source # | |
( KnownNat n, Typeable v, Typeable a, Data (v a)) => Data ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized.Internal gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Vector v n a -> c ( Vector v n a) Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( Vector v n a) Source # toConstr :: Vector v n a -> Constr Source # dataTypeOf :: Vector v n a -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( Vector v n a)) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( Vector v n a)) Source # gmapT :: ( forall b. Data b => b -> b) -> Vector v n a -> Vector v n a Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Vector v n a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Vector v n a -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> Vector v n a -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> Vector v n a -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Vector v n a -> m ( Vector v n a) Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Vector v n a -> m ( Vector v n a) Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Vector v n a -> m ( Vector v n a) Source # |
|
( Vector v a, Num a, KnownNat n) => Num ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized (+) :: Vector v n a -> Vector v n a -> Vector v n a Source # (-) :: Vector v n a -> Vector v n a -> Vector v n a Source # (*) :: Vector v n a -> Vector v n a -> Vector v n a Source # negate :: Vector v n a -> Vector v n a Source # abs :: Vector v n a -> Vector v n a Source # signum :: Vector v n a -> Vector v n a Source # fromInteger :: Integer -> Vector v n a Source # |
|
Ord (v a) => Ord ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized.Internal compare :: Vector v n a -> Vector v n a -> Ordering Source # (<) :: Vector v n a -> Vector v n a -> Bool Source # (<=) :: Vector v n a -> Vector v n a -> Bool Source # (>) :: Vector v n a -> Vector v n a -> Bool Source # (>=) :: Vector v n a -> Vector v n a -> Bool Source # max :: Vector v n a -> Vector v n a -> Vector v n a Source # min :: Vector v n a -> Vector v n a -> Vector v n a Source # |
|
( KnownNat n, Vector v a, Read (v a)) => Read ( Vector v n a) Source # | |
Show (v a) => Show ( Vector v n a) Source # | |
( Ix a, Ord (v a), Vector v a) => Ix ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized.Internal range :: ( Vector v n a, Vector v n a) -> [ Vector v n a] Source # index :: ( Vector v n a, Vector v n a) -> Vector v n a -> Int Source # unsafeIndex :: ( Vector v n a, Vector v n a) -> Vector v n a -> Int Source # inRange :: ( Vector v n a, Vector v n a) -> Vector v n a -> Bool Source # rangeSize :: ( Vector v n a, Vector v n a) -> Int Source # unsafeRangeSize :: ( Vector v n a, Vector v n a) -> Int Source # |
|
( Semigroup g, Vector v g) => Semigroup ( Vector v n g) Source # |
The
|
( Monoid m, Vector v m, KnownNat n) => Monoid ( Vector v n m) Source # |
The
If
|
( KnownNat n, Storable a, Vector v a) => Storable ( Vector v n a) Source # |
Any sized vector containing
|
Defined in Data.Vector.Generic.Sized sizeOf :: Vector v n a -> Int Source # alignment :: Vector v n a -> Int Source # peekElemOff :: Ptr ( Vector v n a) -> Int -> IO ( Vector v n a) Source # pokeElemOff :: Ptr ( Vector v n a) -> Int -> Vector v n a -> IO () Source # peekByteOff :: Ptr b -> Int -> IO ( Vector v n a) Source # pokeByteOff :: Ptr b -> Int -> Vector v n a -> IO () Source # peek :: Ptr ( Vector v n a) -> IO ( Vector v n a) Source # poke :: Ptr ( Vector v n a) -> Vector v n a -> IO () Source # |
|
( Vector v a, Bits (v a), Bits a, KnownNat n) => Bits ( Vector v n a) Source # |
Only usable if
|
Defined in Data.Vector.Generic.Sized (.&.) :: Vector v n a -> Vector v n a -> Vector v n a Source # (.|.) :: Vector v n a -> Vector v n a -> Vector v n a Source # xor :: Vector v n a -> Vector v n a -> Vector v n a Source # complement :: Vector v n a -> Vector v n a Source # shift :: Vector v n a -> Int -> Vector v n a Source # rotate :: Vector v n a -> Int -> Vector v n a Source # zeroBits :: Vector v n a Source # bit :: Int -> Vector v n a Source # setBit :: Vector v n a -> Int -> Vector v n a Source # clearBit :: Vector v n a -> Int -> Vector v n a Source # complementBit :: Vector v n a -> Int -> Vector v n a Source # testBit :: Vector v n a -> Int -> Bool Source # bitSizeMaybe :: Vector v n a -> Maybe Int Source # bitSize :: Vector v n a -> Int Source # isSigned :: Vector v n a -> Bool Source # shiftL :: Vector v n a -> Int -> Vector v n a Source # unsafeShiftL :: Vector v n a -> Int -> Vector v n a Source # shiftR :: Vector v n a -> Int -> Vector v n a Source # unsafeShiftR :: Vector v n a -> Int -> Vector v n a Source # rotateL :: Vector v n a -> Int -> Vector v n a Source # |
|
( Vector v a, Bits (v a), FiniteBits a, KnownNat n) => FiniteBits ( Vector v n a) Source # |
Treats a bit vector as n times the size of the stored bits, reflecting
the
|
Defined in Data.Vector.Generic.Sized finiteBitSize :: Vector v n a -> Int Source # countLeadingZeros :: Vector v n a -> Int Source # countTrailingZeros :: Vector v n a -> Int Source # |
|
( Vector v a, Binary a, KnownNat n) => Binary ( Vector v n a) Source # | |
NFData (v a) => NFData ( Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized.Internal |
|
( Eq a, Hashable a, Unbox a) => Hashable ( Vector Vector n a) Source # | |
( Eq a, Hashable a, Storable a) => Hashable ( Vector Vector n a) Source # | |
( Eq a, Hashable a) => Hashable ( Vector Vector n a) Source # | |
( Unbox a, KnownNat n) => Unbox ( Vector Vector n a) Source # |
This instance allows to define sized matrices and tensors backed by continuous memory segments, which reduces memory allocations and relaxes pressure on garbage collector. |
Defined in Data.Vector.Unboxed.Mutable.Sized |
|
newtype MVector s ( Vector Vector n a) Source # | |
type Rep ( Vector Vector n) Source # | |
Defined in Data.Vector.Generic.Sized |
|
type Mutable ( Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized |
|
newtype Vector ( Vector Vector n a) Source # | |