| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cooked.Skeleton.Families
Description
This module exposes some type families used to either directly constraint values within our skeletons, or constrant inputs of smart constructors for components of these skeletons.
Synopsis
- type (∈) el els = Member el els '[]
- type (∉) el els = NonMember el els '[]
- type family (els :: [a]) ⩀ (els' :: [a]) :: Constraint where ...
- type family (xs :: [a]) ∪ (ys :: [a]) :: [a] where ...
- type Rev els = RevAux els '[]
- type family (els :: [a]) ++ (els' :: [a]) :: [a] where ...
- type family RevAux (els :: [a]) (done :: [a]) :: [a] where ...
- type family Member (el :: a) (els :: [a]) (extras :: [a]) :: Constraint where ...
- type family NonMember (el :: a) (els :: [a]) (extras :: [a]) :: Constraint where ...
Type-level constraints
type family (els :: [a]) ⩀ (els' :: [a]) :: Constraint where ... Source #
Type level disjunction check between lists
Main type-level functions
type family (xs :: [a]) ∪ (ys :: [a]) :: [a] where ... Source #
Type level list union with duplicates
Auxiliary type-level functions
type family RevAux (els :: [a]) (done :: [a]) :: [a] where ... Source #
Reverses a type level with an accumulator
type family Member (el :: a) (els :: [a]) (extras :: [a]) :: Constraint where ... Source #
A type family representing membership. This requires UndecidableInstances
because the type checker is not smart enough to understand that this type
family decreases in els, due to the presence of extras. extras is used
to keep track of the original list and output a relevant message in the empty
case, which could otherwise be omitted altogther at no loss of type safety.
type family NonMember (el :: a) (els :: [a]) (extras :: [a]) :: Constraint where ... Source #
A type family representing non membership. extra is used to keep track of
the already browsed to output a relevant message. It could be omitted with no
loss of type safety.