Basement.Sized.Vect

basement-0.0.15: Foundation scrap box of array & string

Safe Haskell | Safe-Inferred
Language | Haskell2010

Basement.Sized.Vect

# Documentation

data Vect (n :: Nat) a #

#### Instances

Instances details

Functor (Vect n) # |
Instance details Defined in Basement.Sized.Vect Methods fmap :: (a -> b) -> Vect n a -> Vect n b # (<$) :: a -> Vect n b -> Vect n a #
Show a => Show (Vect n a) # |
Instance details Defined in Basement.Sized.Vect Methods showsPrec :: Int -> Vect n a -> ShowS # show :: Vect n a -> String # showList :: [Vect n a] -> ShowS #
NormalForm a => NormalForm (Vect n a) # |
Instance details Defined in Basement.Sized.Vect Methods toNormalForm :: Vect n a -> () #
Eq a => Eq (Vect n a) # |
Instance details Defined in Basement.Sized.Vect Methods (==) :: Vect n a -> Vect n a -> Bool # (/=) :: Vect n a -> Vect n a -> Bool #

data MVect (n :: Nat) ty st #

unVect :: Vect n a -> Array a #

toVect :: forall n ty. (KnownNat n, Countable ty n) => Array ty -> Maybe (Vect n ty) #

empty :: Vect 0 ty #

singleton :: ty -> Vect 1 ty #

replicate :: forall n ty. (KnownNat n, Countable ty n) => ty -> Vect n ty #

thaw :: (KnownNat n, PrimMonad prim) => Vect n ty -> prim (MVect n ty (PrimState prim)) #

freeze :: (PrimMonad prim, Countable ty n) => MVect n ty (PrimState prim) -> prim (Vect n ty) #

index :: Vect n ty -> Offset ty -> ty #

map :: (a -> b) -> Vect n a -> Vect n b #

foldl' :: (a -> ty -> a) -> a -> Vect n ty -> a #

foldr :: (ty -> a -> a) -> a -> Vect n ty -> a #

cons :: ty -> Vect n ty -> Vect (n + 1) ty #

snoc :: Vect n ty -> ty -> Vect (n + 1) ty #

elem :: Eq ty => ty -> Vect n ty -> Bool #

sub :: forall i j n ty. ((i <=? n) ~ 'True, (j <=? n) ~ 'True, (i <=? j) ~ 'True, KnownNat i, KnownNat j, Offsetable ty i, Offsetable ty j) => Vect n ty -> Vect (j - i) ty #

uncons :: forall n ty. (CmpNat 0 n ~ 'LT, KnownNat n, Offsetable ty n) => Vect n ty -> (ty, Vect (n - 1) ty) #

unsnoc :: forall n ty. (CmpNat 0 n ~ 'LT, KnownNat n, Offsetable ty n) => Vect n ty -> (Vect (n - 1) ty, ty) #

splitAt :: forall i n ty. (CmpNat i n ~ 'LT, KnownNat i, Countable ty i) => Vect n ty -> (Vect i ty, Vect (n - i) ty) #

all :: (ty -> Bool) -> Vect n ty -> Bool #

any :: (ty -> Bool) -> Vect n ty -> Bool #

find :: (ty -> Bool) -> Vect n ty -> Maybe ty #

reverse :: Vect n ty -> Vect n ty #

sortBy :: (ty -> ty -> Ordering) -> Vect n ty -> Vect n ty #

intersperse :: CmpNat n 1 ~ 'GT => ty -> Vect n ty -> Vect ((n + n) - 1) ty #