Copyright | (c) Artem Chirkin |
---|---|
License | BSD3 |
Maintainer | chirkin@arch.ethz.ch |
Safe Haskell | None |
Language | Haskell2010 |
Provides type-level operations on lists.
Synopsis
- type family (as :: [k]) ++ (bs :: [k]) :: [k] where ...
- type (+:) (ns :: [k]) (n :: k) = Snoc ns n
- type (:+) (a :: k) (as :: [k]) = a ': as
- type Empty = '[]
- type Cons (n :: k) (ns :: [k]) = n :+ ns
- type Snoc (ns :: [k]) (n :: k) = GetSnoc k (DoSnoc k ns n)
- type family Head (xs :: [k]) :: k where ...
- type family Tail (xs :: [k]) :: [k] where ...
- type family Init (xs :: [k]) :: [k] where ...
- type family Last (xs :: [k]) :: k where ...
- type Concat (as :: [k]) (bs :: [k]) = as ++ bs
- type Reverse (xs :: [k]) = Reversed k (DoReverse k xs)
- type family Take (n :: Nat) (xs :: [k]) :: [k] where ...
- type family Drop (n :: Nat) (xs :: [k]) :: [k] where ...
- type family Length (xs :: [k]) :: Nat where ...
- type family All (f :: k -> Constraint) (xs :: [k]) :: Constraint where ...
- type family Map (f :: a -> b) (xs :: [a]) :: [b] where ...
- type family Suffix (as :: [k]) (asbs :: [k]) :: [k] where ...
- type family Prefix (bs :: [k]) (asbs :: [k]) :: [k] where ...
- type family IsPrefix (as :: [k]) (asbs :: [k]) :: Bool where ...
- type family IsSuffix (as :: [k]) (asbs :: [k]) :: Bool where ...
- class (asbs ~ Concat as bs, as ~ Prefix bs asbs, bs ~ Suffix as asbs, IsSuffix bs asbs ~ True, IsPrefix as asbs ~ True) => ConcatList (as :: [k]) (bs :: [k]) (asbs :: [k]) | as bs -> asbs, as asbs -> bs, bs asbs -> as
Basic operations
type (+:) (ns :: [k]) (n :: k) = Snoc ns n infixl 5 Source #
Synonym for a type-level snoc (injective!)
type (:+) (a :: k) (as :: [k]) = a ': as infixr 5 Source #
Synonym for a type-level cons (injective, since this is just a synonym for the list constructor)
type Reverse (xs :: [k]) = Reversed k (DoReverse k xs) Source #
Reverse a type-level list (injective!)
type family All (f :: k -> Constraint) (xs :: [k]) :: Constraint where ... Source #