Copyright | (c) 2011 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. All definitions are generalised versions of those in Data.Comp.Annotation.
Synopsis
- data (f :&: a) (g :: Type -> Type) e = (f g e) :&: a
- class DistAnn (s :: (Type -> Type) -> Type -> Type) p s' | s' -> s, s' -> p where
- class RemA (s :: (Type -> Type) -> Type -> Type) s' | s -> s' where
- liftA :: RemA s s' => (s' a :-> t) -> s a :-> t
- ann :: (DistAnn f p g, HFunctor f) => p -> CxtFun f g
- liftA' :: (DistAnn s' p s, HFunctor s') => (s' a :-> Cxt h s' a) -> s a :-> Cxt h s a
- stripA :: (RemA g f, HFunctor g) => CxtFun g f
- propAnn :: (DistAnn f p f', DistAnn g p g', HFunctor g) => Hom f g -> Hom f' g'
- project' :: (RemA f f', s :<: f') => Cxt h f a i -> Maybe (s (Cxt h f a) i)
Documentation
data (f :&: a) (g :: Type -> Type) e infixr 7 Source #
This data type adds a constant product to a signature. Alternatively, this could have also been defined as
data (f :&: a) (g :: Type -> Type) e = f g e :&: a e
This is too general, however, for example for productHHom
.
(f g e) :&: a infixr 7 |
Instances
DistAnn f p (f :&: p) Source # | |
(ShowHF f, Show p) => ShowHF (f :&: p) Source # | |
HFoldable f => HFoldable (f :&: a) Source # | |
Defined in Data.Comp.Multi.Ops hfold :: Monoid m => (f :&: a) (K m) :=> m Source # hfoldMap :: forall m (a0 :: Type -> Type). Monoid m => (a0 :=> m) -> (f :&: a) a0 :=> m Source # hfoldr :: forall (a0 :: Type -> Type) b. (a0 :=> (b -> b)) -> b -> (f :&: a) a0 :=> b Source # hfoldl :: forall b (a0 :: Type -> Type). (b -> a0 :=> b) -> b -> (f :&: a) a0 :=> b Source # hfoldr1 :: (a0 -> a0 -> a0) -> (f :&: a) (K a0) :=> a0 Source # hfoldl1 :: (a0 -> a0 -> a0) -> (f :&: a) (K a0) :=> a0 Source # | |
HFunctor f => HFunctor (f :&: a) Source # | |
HTraversable f => HTraversable (f :&: a) Source # | |
Defined in Data.Comp.Multi.Ops hmapM :: forall (m :: Type -> Type) (a0 :: Type -> Type) (b :: Type -> Type). Monad m => NatM m a0 b -> NatM m ((f :&: a) a0) ((f :&: a) b) Source # htraverse :: forall (f0 :: Type -> Type) (a0 :: Type -> Type) (b :: Type -> Type). Applicative f0 => NatM f0 a0 b -> NatM f0 ((f :&: a) a0) ((f :&: a) b) Source # | |
RemA (f :&: p) f Source # | |
DistAnn s p s' => DistAnn (f :+: s) p ((f :&: p) :+: s') Source # | |
RemA s s' => RemA ((f :&: p) :+: s) (f :+: s') Source # | |
class DistAnn (s :: (Type -> Type) -> Type -> Type) 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 :-> t) -> s a :-> t Source #
This function transforms 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.
ann :: (DistAnn f p g, HFunctor f) => p -> CxtFun f g Source #
This function annotates each sub term of the given term with the given value (of type a).
liftA' :: (DistAnn s' p s, HFunctor s') => (s' a :-> Cxt h s' a) -> s a :-> Cxt h s a Source #
This function transforms 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.