Copyright | (c) 2011 Patrick Bahr |
---|---|
License | BSD3 |
Maintainer | Patrick Bahr <paba@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell98 |
Data.Comp.Multi.Annotation
Description
This module defines annotations on signatures. All definitions are generalised versions of those in Data.Comp.Annotation.
Synopsis
- type AnnTerm a fs = HFix (Sum fs :&: a)
- type AnnHFix a f = HFix (f :&: a)
- data (f :&: a) (g :: * -> *) e = (f g e) :&: a
- class RemA (s :: (* -> *) -> * -> *) s' | s -> s' where
- liftA :: RemA s s' => (s' a :-> t) -> s a :-> t
- ann :: HFunctor f => p -> CxtFun f (f :&: p)
- liftA' :: HFunctor s => (s a :-> Cxt h s a) -> (s :&: p) a :-> Cxt h (s :&: p) a
- stripA :: (RemA g f, HFunctor g) => CxtFun g f
- propAnn :: HFunctor g => Hom f g -> Hom (f :&: p) (g :&: p)
- project' :: (RemA f f', s :<: f') => Cxt h f a i -> Maybe (s (Cxt h f a) i)
- isNode' :: (HFunctor g, RemA g g', f :<: g') => Proxy f -> Cxt h g a l -> Bool
- inj' :: f :<: g => (f :&: p) e l -> (g :&: p) e l
- inject' :: f :<: g => (f :&: p) (Cxt h (g :&: p) a) :-> Cxt h (g :&: p) a
- injectOpt :: f :<: g => f (AnnHFix (Maybe p) g) l -> AnnHFix (Maybe p) g l
- caseH' :: forall fs a e l t. Alts (DistAnn fs a) e l t -> (Sum fs :&: a) e l -> t
- caseCxt' :: forall cxt fs a e l t. All cxt fs => Proxy cxt -> (forall f. cxt f => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t
- caseCxt'' :: forall cxt fs a e l t. All cxt (DistAnn fs a) => Proxy cxt -> (forall f. cxt (f :&: a) => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t
- type family DistAnn (fs :: [(* -> *) -> * -> *]) (a :: *) :: [(* -> *) -> * -> *] where ...
- type AnnCxt p h f a = Cxt h (f :&: p) a
- type AnnCxtS p h fs a = AnnCxt p h (Sum fs) a
Documentation
data (f :&: a) (g :: * -> *) 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 :: * -> *) e = f g e :&: a e
This is too general, however, for example for productHHom
.
Constructors
(f g e) :&: a infixr 7 |
Instances
HFunctor f => HFunctor (f :&: a) Source # | |
HFoldable f => HFoldable (f :&: a) Source # | |
Defined in Data.Comp.Multi.Ops Methods 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 # | |
HTraversable f => HTraversable (f :&: a) Source # | |
Defined in Data.Comp.Multi.Ops Methods 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 # | |
(ShowHF f, Show p) => ShowHF (f :&: p) Source # | |
RemA (f :&: p) f Source # | |
Generic (f e l) => Generic ((f :&: p) e l) Source # | |
type Rep ((f :&: p) e l) Source # | |
class RemA (s :: (* -> *) -> * -> *) s' | s -> s' where Source #
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 :: HFunctor f => p -> CxtFun f (f :&: p) Source #
This function annotates each sub term of the given term with the given value (of type a).
liftA' :: HFunctor s => (s a :-> Cxt h s a) -> (s :&: p) a :-> Cxt h (s :&: p) 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.
stripA :: (RemA g f, HFunctor g) => CxtFun g f Source #
This function strips the annotations from a term over a functor with annotations.
project' :: (RemA f f', s :<: f') => Cxt h f a i -> Maybe (s (Cxt h f a) i) Source #
This function is similar to project
but applies to signatures
with an annotation which is then ignored.
caseCxt' :: forall cxt fs a e l t. All cxt fs => Proxy cxt -> (forall f. cxt f => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t Source #
caseCxt'' :: forall cxt fs a e l t. All cxt (DistAnn fs a) => Proxy cxt -> (forall f. cxt (f :&: a) => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t Source #