Copyright | (c) 2010-2011 Patrick Bahr, Tom Hvitved |
---|---|
License | BSD3 |
Maintainer | Tom Hvitved <hvitved@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell98 |
This module defines annotations on signatures.
- data (f :&: p) a b = (f a b) :&: 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
- remA :: s a b -> s' a b
- liftA :: RemA s s' => (s' a b -> t) -> s a b -> t
- liftA' :: (DistAnn s' p s, Difunctor s') => (s' a b -> Cxt h s' c d) -> s a b -> Cxt h s c d
- stripA :: (RemA g f, Difunctor g) => CxtFun g f
- propAnn :: (DistAnn f p f', DistAnn g p g', Difunctor g) => Hom f g -> Hom f' g'
- propAnnM :: (DistAnn f p f', DistAnn g p g', Difunctor g, Monad m) => HomM m f g -> HomM m f' g'
- ann :: (DistAnn f p g, Difunctor f) => p -> CxtFun f g
- project' :: (RemA f f', s :<: f') => Cxt h f a b -> Maybe (s a (Cxt h f a b))
Documentation
data (f :&: p) a b infixr 7 Source
This data type adds a constant product to a signature.
(f a b) :&: p infixr 7 |
data (f :*: g) a b infixr 8 Source
Formal product of signatures (difunctors).
(f a b) :*: (g a b) infixr 8 |
class DistAnn s p s' | s' -> s, s' -> p where Source
This class defines how to distribute an annotation over a sum of signatures.
liftA :: RemA s s' => (s' a b -> t) -> s a b -> t Source
Transform a function with a domain constructed from a functor to a function with a domain constructed with the same functor, but with an additional annotation.
liftA' :: (DistAnn s' p s, Difunctor s') => (s' a b -> Cxt h s' c d) -> s a b -> Cxt h s c d Source
Transform a function with a domain constructed from a functor to a function with a domain constructed with the same functor, but with an additional annotation.
stripA :: (RemA g f, Difunctor g) => CxtFun g f Source
Strip the annotations from a term over a functor with annotations.
propAnn :: (DistAnn f p f', DistAnn g p g', Difunctor 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', Difunctor 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.