Safe Haskell | None |
---|---|
Language | Haskell2010 |
You probably want to use the Control.Monad.Signal.Class module. This module contains internals.
- data Union types where
- absurd :: Union `[]` -> a
- class Elem types a where
- liftSingle :: a -> Union types
- class Subset as bs where
- class All c xs where
- deconstructAll :: proxy c -> Union xs -> (forall x. c x => x -> a) -> a
Documentation
An open union type. A Union xs
type holds a value of type x
where x
is some type from
xs.
absurd :: Union `[]` -> a Source
An empty union can't be constructed so we can get any value from it.
class Elem types a where Source
Elem types
is a class of types from types
. If a
is from types
it can be lifted
into a Union types
liftSingle :: a -> Union types Source
class Subset as bs where Source
If as
is a subset of bs
we can take the value of Union as
and lift it into Union bs
.
If all the elements of xs
satisfy the c
constraint then, given a function that only cares
about that constraint type, we can colapse the union into a concrete type.
For example, if all the types in xs
satisfy the Show
class, then we can use the show
function to turn a Union xs
into a String
.
deconstructAll :: proxy c -> Union xs -> (forall x. c x => x -> a) -> a Source