Portability | non-portable (GHC Extensions) |
---|---|
Stability | experimental |
Maintainer | Tom Hvitved <hvitved@diku.dk> |
This module defines annotations on signatures.
- data (f :&: p) a b i = (f a b i) :&: p
- data (f :*: g) a b = (f a b) :*: (g a b)
- class DistAnn s p s' | s' -> s, s' -> p where
- class RemA s s' | s -> s' where
- liftA :: RemA s s' => (s' a b :-> t) -> s a b :-> t
- liftA' :: (DistAnn s' p s, HDifunctor s') => (s' a b :-> Cxt h s' c d) -> s a b :-> Cxt h s c d
- stripA :: (RemA g f, HDifunctor g) => CxtFun g f
- propAnn :: (DistAnn f p f', DistAnn g p g', HDifunctor g) => Hom f g -> Hom f' g'
- propAnnM :: (DistAnn f p f', DistAnn g p g', HDifunctor g, Monad m) => HomM m f g -> HomM m f' g'
- ann :: (DistAnn f p g, HDifunctor f) => p -> CxtFun f g
- project' :: (RemA s s', s :<: f) => Cxt h f a b i -> Maybe (s' a (Cxt h f a b) i)
Documentation
This data type adds a constant product to a signature.
(f a b i) :&: p |
Formal product of signatures (higher-order difunctors).
(f a b) :*: (g a b) |
class DistAnn s p s' | s' -> s, s' -> p whereSource
This class defines how to distribute an annotation over a sum of signatures.
liftA :: RemA s s' => (s' a b :-> t) -> s a b :-> tSource
Transform a function with a domain constructed from a higher-order difunctor to a function with a domain constructed with the same higher-order difunctor, but with an additional annotation.
liftA' :: (DistAnn s' p s, HDifunctor s') => (s' a b :-> Cxt h s' c d) -> s a b :-> Cxt h s c dSource
Transform a function with a domain constructed from a higher-order difunctor to a function with a domain constructed with the same higher-order difunctor, but with an additional annotation.
stripA :: (RemA g f, HDifunctor g) => CxtFun g fSource
Strip the annotations from a term over a higher-order difunctor with annotations.
propAnn :: (DistAnn f p f', DistAnn g p g', HDifunctor g) => Hom f g -> Hom f' g'Source
Lift a term homomorphism over signatures f
and g
to a term homomorphism
over the same signatures, but extended with annotations.
propAnnM :: (DistAnn f p f', DistAnn g p g', HDifunctor g, Monad m) => HomM m f g -> HomM m f' g'Source
Lift a monadic term homomorphism over signatures f
and g
to a monadic
term homomorphism over the same signatures, but extended with annotations.
ann :: (DistAnn f p g, HDifunctor f) => p -> CxtFun f gSource
Annotate each node of a term with a constant value.