Safe Haskell | Safe-Inferred |
---|---|
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 :: Mutable Vector0 s (Vector Vector0 n a) -> ST s (Vector0 (Vector Vector0 n a)) # basicUnsafeThaw :: Vector0 (Vector Vector0 n a) -> ST s (Mutable Vector0 s (Vector Vector0 n a)) # basicLength :: Vector0 (Vector Vector0 n a) -> Int # basicUnsafeSlice :: Int -> Int -> Vector0 (Vector Vector0 n a) -> Vector0 (Vector Vector0 n a) # basicUnsafeIndexM :: Vector0 (Vector Vector0 n a) -> Int -> Box (Vector Vector0 n a) # basicUnsafeCopy :: Mutable Vector0 s (Vector Vector0 n a) -> Vector0 (Vector Vector0 n a) -> ST s () # elemseq :: Vector0 (Vector Vector0 n a) -> Vector Vector0 n a -> b -> b # | |
(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 # basicUnsafeSlice :: Int -> Int -> MVector s (Vector Vector0 n a) -> MVector s (Vector Vector0 n a) # basicOverlaps :: MVector s (Vector Vector0 n a) -> MVector s (Vector Vector0 n a) -> Bool # basicUnsafeNew :: Int -> ST s (MVector s (Vector Vector0 n a)) # basicInitialize :: MVector s (Vector Vector0 n a) -> ST s () # basicUnsafeReplicate :: Int -> Vector Vector0 n a -> ST s (MVector s (Vector Vector0 n a)) # basicUnsafeRead :: MVector s (Vector Vector0 n a) -> Int -> ST s (Vector Vector0 n a) # basicUnsafeWrite :: MVector s (Vector Vector0 n a) -> Int -> Vector Vector0 n a -> ST s () # basicClear :: MVector s (Vector Vector0 n a) -> ST s () # basicSet :: MVector s (Vector Vector0 n a) -> Vector Vector0 n a -> ST s () # basicUnsafeCopy :: MVector s (Vector Vector0 n a) -> MVector s (Vector Vector0 n a) -> ST s () # basicUnsafeMove :: MVector s (Vector Vector0 n a) -> MVector s (Vector Vector0 n a) -> ST s () # basicUnsafeGrow :: MVector s (Vector Vector0 n a) -> Int -> ST s (MVector s (Vector Vector0 n a)) # | |
FoldableWithIndex (Finite n) (Vector Vector n) Source # | Since: 1.6.0 |
Defined in Data.Vector.Generic.Sized ifoldMap :: Monoid m => (Finite n -> a -> m) -> Vector Vector0 n a -> m # ifoldMap' :: Monoid m => (Finite n -> a -> m) -> Vector Vector0 n a -> m # ifoldr :: (Finite n -> a -> b -> b) -> b -> Vector Vector0 n a -> b # ifoldl :: (Finite n -> b -> a -> b) -> b -> Vector Vector0 n a -> b # ifoldr' :: (Finite n -> a -> b -> b) -> b -> Vector Vector0 n a -> b # ifoldl' :: (Finite n -> b -> a -> b) -> b -> Vector Vector0 n a -> b # | |
FunctorWithIndex (Finite n) (Vector Vector n) Source # | Since: 1.6.0 |
TraversableWithIndex (Finite n) (Vector Vector n) Source # | Since: 1.6.0 |
Defined in Data.Vector.Generic.Sized | |
KnownNat n => Representable (Vector Vector n) Source # | |
Foldable v => Foldable (Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized.Internal fold :: Monoid m => Vector v n m -> m # foldMap :: Monoid m => (a -> m) -> Vector v n a -> m # foldMap' :: Monoid m => (a -> m) -> Vector v n a -> m # foldr :: (a -> b -> b) -> b -> Vector v n a -> b # foldr' :: (a -> b -> b) -> b -> Vector v n a -> b # foldl :: (b -> a -> b) -> b -> Vector v n a -> b # foldl' :: (b -> a -> b) -> b -> Vector v n a -> b # foldr1 :: (a -> a -> a) -> Vector v n a -> a # foldl1 :: (a -> a -> a) -> Vector v n a -> a # toList :: Vector v n a -> [a] # null :: Vector v n a -> Bool # length :: Vector v n a -> Int # elem :: Eq a => a -> Vector v n a -> Bool # maximum :: Ord a => Vector v n a -> a # minimum :: Ord a => Vector v n a -> a # | |
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 # | |
Traversable v => Traversable (Vector v n) Source # | |
Defined in Data.Vector.Generic.Sized.Internal | |
KnownNat n => Applicative (Vector Vector n) Source # | The |
Defined in Data.Vector.Generic.Sized pure :: a -> Vector Vector0 n a # (<*>) :: Vector Vector0 n (a -> b) -> Vector Vector0 n a -> Vector Vector0 n b # liftA2 :: (a -> b -> c) -> Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n c # (*>) :: Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n b # (<*) :: Vector Vector0 n a -> Vector Vector0 n b -> Vector Vector0 n a # | |
Functor v => Functor (Vector v n) Source # | |
KnownNat n => Monad (Vector Vector n) Source # | Treats a
|
(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 # | |
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) # collect :: Functor f => (a -> Vector Vector0 n b) -> f a -> Vector Vector0 n (f b) # distributeM :: Monad m => m (Vector Vector0 n a) -> Vector Vector0 n (m a) # collectM :: Monad m => (a -> Vector Vector0 n b) -> m a -> Vector Vector0 n (m b) # | |
(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) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vector v n a) # toConstr :: Vector v n a -> Constr # dataTypeOf :: Vector v n a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vector v n a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vector v n a)) # gmapT :: (forall b. Data b => b -> b) -> Vector v n a -> Vector v n a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vector v n a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vector v n a -> r # gmapQ :: (forall d. Data d => d -> u) -> Vector v n a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vector v n a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vector v n a -> m (Vector v n a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector v n a -> m (Vector v n a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vector v n a -> m (Vector v n a) # | |
(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 # alignment :: Vector v n a -> Int # peekElemOff :: Ptr (Vector v n a) -> Int -> IO (Vector v n a) # pokeElemOff :: Ptr (Vector v n a) -> Int -> Vector v n a -> IO () # peekByteOff :: Ptr b -> Int -> IO (Vector v n a) # pokeByteOff :: Ptr b -> Int -> Vector v n a -> IO () # | |
(Monoid m, Vector v m, KnownNat n) => Monoid (Vector v n m) Source # | The If |
(Semigroup g, Vector v g) => Semigroup (Vector v n g) Source # | The |
(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 # (.|.) :: Vector v n a -> Vector v n a -> Vector v n a # xor :: Vector v n a -> Vector v n a -> Vector v n a # complement :: Vector v n a -> Vector v n a # shift :: Vector v n a -> Int -> Vector v n a # rotate :: Vector v n a -> Int -> Vector v n a # setBit :: Vector v n a -> Int -> Vector v n a # clearBit :: Vector v n a -> Int -> Vector v n a # complementBit :: Vector v n a -> Int -> Vector v n a # testBit :: Vector v n a -> Int -> Bool # bitSizeMaybe :: Vector v n a -> Maybe Int # bitSize :: Vector v n a -> Int # isSigned :: Vector v n a -> Bool # shiftL :: Vector v n a -> Int -> Vector v n a # unsafeShiftL :: Vector v n a -> Int -> Vector v n a # shiftR :: Vector v n a -> Int -> Vector v n a # unsafeShiftR :: Vector v n a -> Int -> Vector v n a # rotateL :: Vector v n a -> Int -> Vector v n a # | |
(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 # countLeadingZeros :: Vector v n a -> Int # countTrailingZeros :: Vector v n a -> Int # | |
(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 # log :: Vector v n a -> Vector v n a # sqrt :: Vector v n a -> Vector v n a # (**) :: Vector v n a -> Vector v n a -> Vector v n a # logBase :: Vector v n a -> Vector v n a -> Vector v n a # sin :: Vector v n a -> Vector v n a # cos :: Vector v n a -> Vector v n a # tan :: Vector v n a -> Vector v n a # asin :: Vector v n a -> Vector v n a # acos :: Vector v n a -> Vector v n a # atan :: Vector v n a -> Vector v n a # sinh :: Vector v n a -> Vector v n a # cosh :: Vector v n a -> Vector v n a # tanh :: Vector v n a -> Vector v n a # asinh :: Vector v n a -> Vector v n a # acosh :: Vector v n a -> Vector v n a # atanh :: Vector v n a -> Vector v n a # log1p :: Vector v n a -> Vector v n a # expm1 :: Vector v n a -> Vector v n a # | |
(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] # index :: (Vector v n a, Vector v n a) -> Vector v n a -> Int # unsafeIndex :: (Vector v n a, Vector v n a) -> Vector v n a -> Int # inRange :: (Vector v n a, Vector v n a) -> Vector v n a -> Bool # rangeSize :: (Vector v n a, Vector v n a) -> Int # unsafeRangeSize :: (Vector v n a, Vector v n a) -> Int # | |
(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 # (-) :: Vector v n a -> Vector v n a -> Vector v n a # (*) :: Vector v n a -> Vector v n a -> Vector v n a # negate :: Vector v n a -> Vector v n a # abs :: Vector v n a -> Vector v n a # signum :: Vector v n a -> Vector v n a # fromInteger :: Integer -> Vector v n a # | |
(KnownNat n, Vector v a, Read (v a)) => Read (Vector v n a) Source # | |
(Vector v a, Fractional a, KnownNat n) => Fractional (Vector v n a) Source # | |
Show (v a) => Show (Vector v n a) 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 (v a) => Eq (Vector v n a) Source # | |
Ord (v a) => Ord (Vector v n a) Source # | |
Defined in Data.Vector.Generic.Sized.Internal | |
(Eq a, Hashable a) => Hashable (Vector Vector n a) Source # | |
(Eq a, Hashable a, Storable a) => Hashable (Vector Vector n a) Source # | |
(Eq a, Hashable a, Unbox 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 # | |