Copyright | (c) 2010-2013 Patrick Bahr |
---|---|
License | BSD3 |
Maintainer | Patrick Bahr <paba@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module defines annotations on signatures.
Synopsis
- data (f :&: a) e = (f e) :&: a
- data (f :*: g) a = (f a) :*: (g a)
- class DistAnn s p s' | s' -> s, s' -> p where
- class RemA s s' | s -> s' where
- remA :: s a -> s' a
- liftA :: RemA s s' => (s' a -> t) -> s a -> t
- liftA' :: (DistAnn s' p s, Functor s') => (s' a -> Cxt h s' a) -> s a -> Cxt h s a
- stripA :: (RemA g f, Functor g) => CxtFun g f
- propAnn :: (DistAnn f p f', DistAnn g p g', Functor g) => Hom f g -> Hom f' g'
- propAnnM :: (DistAnn f p f', DistAnn g p g', Functor g, Monad m) => HomM m f g -> HomM m f' g'
- ann :: (DistAnn f p g, Functor f) => p -> CxtFun f g
- project' :: (RemA f f', s :<: f') => Cxt h f a -> Maybe (s (Cxt h f a))
Documentation
data (f :&: a) e infixr 7 Source #
This data type adds a constant product (annotation) to a signature.
(f e) :&: a infixr 7 |
Instances
DistAnn (f :: k -> TYPE LiftedRep) p (f :&: p :: k -> Type) Source # | |
RemA (f :&: p :: k -> Type) (f :: k -> Type) Source # | |
Defined in Data.Comp.Ops | |
DistAnn s p s' => DistAnn (f :+: s :: k -> Type) p ((f :&: p) :+: s' :: k -> Type) Source # | |
RemA s s' => RemA ((f :&: p) :+: s :: k -> Type) (f :+: s' :: k -> Type) Source # | |
Foldable f => Foldable (f :&: a) Source # | |
Defined in Data.Comp.Ops fold :: Monoid m => (f :&: a) m -> m # foldMap :: Monoid m => (a0 -> m) -> (f :&: a) a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> (f :&: a) a0 -> m # foldr :: (a0 -> b -> b) -> b -> (f :&: a) a0 -> b # foldr' :: (a0 -> b -> b) -> b -> (f :&: a) a0 -> b # foldl :: (b -> a0 -> b) -> b -> (f :&: a) a0 -> b # foldl' :: (b -> a0 -> b) -> b -> (f :&: a) a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> (f :&: a) a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (f :&: a) a0 -> a0 # toList :: (f :&: a) a0 -> [a0] # null :: (f :&: a) a0 -> Bool # length :: (f :&: a) a0 -> Int # elem :: Eq a0 => a0 -> (f :&: a) a0 -> Bool # maximum :: Ord a0 => (f :&: a) a0 -> a0 # minimum :: Ord a0 => (f :&: a) a0 -> a0 # | |
Traversable f => Traversable (f :&: a) Source # | |
Defined in Data.Comp.Ops | |
Functor f => Functor (f :&: a) Source # | |
(ArbitraryF f, Arbitrary p) => ArbitraryF (f :&: p) Source # | |
(NFDataF f, NFData a) => NFDataF (f :&: a) Source # | |
(ShowConstr f, Show p) => ShowConstr (f :&: p) Source # | |
Defined in Data.Comp.Show showConstr :: (f :&: p) a -> String Source # | |
(ShowF f, Show p) => ShowF (f :&: p) Source # | |
HasVars f v => HasVars (f :&: a) v Source # | |
data (f :*: g) a infixr 8 Source #
Formal product of signatures (functors).
(f a) :*: (g a) infixr 8 |
Instances
(Foldable f, Foldable g) => Foldable (f :*: g) Source # | |
Defined in Data.Comp.Ops fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # | |
(Traversable f, Traversable g) => Traversable (f :*: g) Source # | |
(Functor f, Functor g) => Functor (f :*: g) Source # | |
class DistAnn s p s' | s' -> s, s' -> p where Source #
This class defines how to distribute an annotation over a sum of signatures.
injectA :: p -> s a -> s' a Source #
Inject an annotation over a signature.
projectA :: s' a -> (s a, p) Source #
Project an annotation from a signature.
liftA :: RemA s s' => (s' a -> t) -> s a -> 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, Functor s') => (s' a -> Cxt h s' a) -> s a -> Cxt h s a 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, Functor 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', Functor 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', Functor 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.