| Copyright | (c) 2011 Patrick Bahr |
|---|---|
| License | BSD3 |
| Maintainer | Patrick Bahr <paba@diku.dk> |
| Stability | experimental |
| Portability | non-portable (GHC Extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
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 :: Signature) = HFix (Sum fs :&: a)
- type AnnHFix a (f :: Node) = HFix (f :&: a)
- data ((f :: Node) :&: a) (g :: Family) e = (f g e) :&: a
- class RemA (s :: Node) (s' :: Family -> Type -> Type) | s -> s' where
- liftA :: forall (s :: Node) (s' :: Family -> Type -> Type) (a :: Family) (t :: Type -> Type). RemA s s' => (s' a :-> t) -> s a :-> t
- ann :: forall (f :: (Type -> Type) -> Type -> Type) p. HFunctor f => p -> CxtFun f (f :&: p)
- liftA' :: forall (s :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) h p. HFunctor s => (s a :-> Cxt h s a) -> (s :&: p) a :-> Cxt h (s :&: p) a
- stripA :: forall (g :: Node) (f :: Family -> Type -> Type). (RemA g f, HFunctor g) => CxtFun g f
- propAnn :: forall (g :: (Type -> Type) -> Type -> Type) (f :: Fragment) p. HFunctor g => Hom f g -> Hom (f :&: p) (g :&: p)
- project' :: forall (f :: Node) (f' :: Family -> Type -> Type) s h (a :: Type -> Type) i. (RemA f f', s :<: f') => Cxt h f a i -> Maybe (s (Cxt h f a) i)
- pattern (::&::) :: forall g (fs :: Signature) h x a l. g :-<: fs => g (Cxt h (Sum fs :&: x) a) l -> x -> Cxt h (Sum fs :&: x) a l
- isNode' :: forall (f :: Fragment) (g :: (Type -> Type) -> Type -> Type) (g' :: Family -> Type -> Type) h (a :: Type -> Type) l. (HFunctor g, RemA g g', f :<: g') => Cxt h g a l -> Bool
- inj' :: forall (f :: Fragment) (g :: Fragment) p (e :: Family) l. f :<: g => (f :&: p) e l -> (g :&: p) e l
- inject' :: forall (f :: Fragment) (g :: Fragment) p h (a :: Type -> Type). f :<: g => (f :&: p) (Cxt h (g :&: p) a) :-> Cxt h (g :&: p) a
- injectOpt :: forall f (g :: Fragment) p l. f :<: g => f (AnnHFix (Maybe p) g) l -> AnnHFix (Maybe p) g l
- caseH' :: forall (fs :: Signature) a (e :: Type -> Type) l t. Alts (DistAnn fs a) e l t -> (Sum fs :&: a) e l -> t
- caseCxt' :: forall cxt (fs :: [Fragment]) a (e :: Family) l t. All cxt fs => (forall (f :: Fragment). cxt f => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t
- caseCxt'' :: forall cxt (fs :: Signature) a (e :: Family) l t. All cxt (DistAnn fs a) => (forall (f :: Node). cxt (f :&: a) => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t
- type family DistAnn (fs :: Signature) a :: Signature where ...
- type AnnCxt p h (f :: Node) (a :: Type -> Type) = Cxt h (f :&: p) a
- type AnnCxtS p h (fs :: Signature) (a :: Type -> Type) = AnnCxt p h (Sum fs) a
Documentation
data ((f :: Node) :&: a) (g :: Family) e infixr 7 Source #
This data type adds a constant product to a signature. Alternatively, this could have also been defined as
data ((f :: Node) :&: 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
| (f :<: Sum fs, Default a) => f :<: (Sum fs :&: a) Source # | |
| (ShowHF f, Show p) => ShowHF (f :&: p) 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 # | |
| HFunctor f => HFunctor (f :&: a) 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 # | |
| RemA (f :&: p) f Source # | |
| f :<: Sum fs => (f :&: a) :<: (Sum fs :&: a) Source # | |
| Generic (f e l) => Generic ((f :&: p) e l) Source # | |
| type Rep ((f :&: p) e l) Source # | |
class RemA (s :: Node) (s' :: Family -> Type -> Type) | s -> s' where Source #
liftA :: forall (s :: Node) (s' :: Family -> Type -> Type) (a :: Family) (t :: Type -> Type). 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 :: forall (f :: (Type -> Type) -> Type -> Type) p. 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' :: forall (s :: (Type -> Type) -> Type -> Type) (a :: Type -> Type) h p. 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 :: forall (g :: Node) (f :: Family -> Type -> Type). (RemA g f, HFunctor g) => CxtFun g f Source #
This function strips the annotations from a term over a functor with annotations.
propAnn :: forall (g :: (Type -> Type) -> Type -> Type) (f :: Fragment) p. HFunctor g => Hom f g -> Hom (f :&: p) (g :&: p) Source #
project' :: forall (f :: Node) (f' :: Family -> Type -> Type) s h (a :: Type -> Type) i. (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.
pattern (::&::) :: forall g (fs :: Signature) h x a l. g :-<: fs => g (Cxt h (Sum fs :&: x) a) l -> x -> Cxt h (Sum fs :&: x) a l Source #
isNode' :: forall (f :: Fragment) (g :: (Type -> Type) -> Type -> Type) (g' :: Family -> Type -> Type) h (a :: Type -> Type) l. (HFunctor g, RemA g g', f :<: g') => Cxt h g a l -> Bool Source #
inj' :: forall (f :: Fragment) (g :: Fragment) p (e :: Family) l. f :<: g => (f :&: p) e l -> (g :&: p) e l Source #
inject' :: forall (f :: Fragment) (g :: Fragment) p h (a :: Type -> Type). f :<: g => (f :&: p) (Cxt h (g :&: p) a) :-> Cxt h (g :&: p) a Source #
injectOpt :: forall f (g :: Fragment) p l. f :<: g => f (AnnHFix (Maybe p) g) l -> AnnHFix (Maybe p) g l Source #
caseH' :: forall (fs :: Signature) a (e :: Type -> Type) l t. Alts (DistAnn fs a) e l t -> (Sum fs :&: a) e l -> t Source #
caseCxt' :: forall cxt (fs :: [Fragment]) a (e :: Family) l t. All cxt fs => (forall (f :: Fragment). cxt f => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t Source #
caseCxt'' :: forall cxt (fs :: Signature) a (e :: Family) l t. All cxt (DistAnn fs a) => (forall (f :: Node). cxt (f :&: a) => (f :&: a) e l -> t) -> (Sum fs :&: a) e l -> t Source #