Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Tom Hvitved <hvitved@diku.dk> |
Safe Haskell | Safe-Inferred |
This module provides operators on difunctors.
- data (f :+: g) a b
- caseD :: (f a b -> c) -> (g a b -> c) -> (f :+: g) a b -> c
- class sub :<: sup where
- data (f :*: g) a b = (f a b) :*: (g a b)
- ffst :: (f :*: g) a b -> f a b
- fsnd :: (f :*: g) a b -> g a b
- data (f :&: p) a b = (f a b) :&: p
- class DistAnn s p s' | s' -> s, s' -> p where
- class RemA s s' | s -> s' where
- remA :: s a b -> s' a b
Documentation
Formal sum of signatures (difunctors).
:<: f g => f :<: (:+: h g) | |
f :<: (:+: f g) | |
(Difunctor f, Difunctor g) => Difunctor (:+: f g) | |
(Ditraversable f, Ditraversable g) => Ditraversable (:+: f g) | |
(EqD f, EqD g) => EqD (:+: f g) |
|
(OrdD f, OrdD g) => OrdD (:+: f g) |
|
(ShowD f, ShowD g) => ShowD (:+: f g) | |
(Desugar f h, Desugar g h) => Desugar (:+: f g) h | |
DistAnn s p s' => DistAnn (:+: f s) p (:+: (:&: f p) s') | |
RemA s s' => RemA (:+: (:&: f p) s) (:+: f s') | |
(Eq (f a b), Eq (g a b)) => Eq (:+: f g a b) | |
(Ord (f a b), Ord (g a b)) => Ord (:+: f g a b) | |
(Show (f a b), Show (g a b)) => Show (:+: f g a b) |
caseD :: (f a b -> c) -> (g a b -> c) -> (f :+: g) a b -> cSource
Utility function to case on a difunctor sum, without exposing the internal representation of sums.
Signature containment relation for automatic injections. The left-hand must
be an atomic signature, where as the right-hand side must have a list-like
structure. Examples include f :<: f :+: g
and g :<: f :+: (g :+: h)
,
non-examples include f :+: g :<: f :+: (g :+: h)
and
f :<: (f :+: g) :+: h
.
This data type adds a constant product to a signature.
(f a b) :&: p |