basement-0.0.16: Foundation scrap box of array & string
Safe HaskellNone
LanguageHaskell2010

Basement.Sized.Vect

Documentation

data Vect (n :: Nat) a Source #

Instances

Instances details
Functor (Vect n) Source # 
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) Source # 
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) Source # 
Instance details

Defined in Basement.Sized.Vect

Methods

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

Eq a => Eq (Vect n a) Source # 
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 Source #

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

toVect :: forall (n :: Nat) 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 :: Nat) ty. (KnownNat n, Countable ty n) => ty -> Vect n ty Source #

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

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

index :: forall (n :: Nat) ty. Vect n ty -> Offset ty -> ty Source #

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

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

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

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

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

elem :: forall ty (n :: Nat). Eq ty => ty -> Vect n ty -> Bool Source #

sub :: forall (i :: Nat) (j :: Nat) (n :: Nat) 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 :: Natural) ty. (CmpNat 0 n ~ 'LT, KnownNat n, Offsetable ty n) => Vect n ty -> (ty, Vect (n - 1) ty) Source #

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

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

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

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

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

reverse :: forall (n :: Nat) ty. Vect n ty -> Vect n ty Source #

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

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