basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
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 #
NormalForm a => NormalForm (Vect n a) # |
Instance details Defined in Basement.Sized.Vect Methods toNormalForm :: 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 #
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 :: Nat) ty. (KnownNat n, Countable ty n) => Array ty -> Maybe (Vect n ty) #

empty :: Vect 0 ty #

singleton :: ty -> Vect 1 ty #

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

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

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

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

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

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

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

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

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

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

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 #

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

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

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

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

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

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

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

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

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