basement-0.0.7: Foundation scrap box of array & string

Safe HaskellNone
LanguageHaskell2010

Basement.Sized.Vect

Documentation

data Vect (n :: Nat) a Source #

Instances

Functor (Vect n) Source # 

Methods

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

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

Eq a => Eq (Vect n a) Source # 

Methods

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

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

Show a => Show (Vect n a) Source # 

Methods

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

show :: Vect n a -> String #

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

NormalForm a => NormalForm (Vect n a) Source # 

Methods

toNormalForm :: Vect n a -> () Source #

data MVect (n :: Nat) ty st Source #

unVect :: Vect n a -> Array a Source #

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

empty :: Vect 0 ty Source #

singleton :: ty -> Vect 1 ty Source #

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

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

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

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

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

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

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

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

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

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

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 Source #

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

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

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

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

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

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

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

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

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