cubix-compdata
Copyright(c) 2011 Patrick Bahr
LicenseBSD3
MaintainerPatrick Bahr <paba@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Comp.Multi.Annotation

Description

This module defines annotations on signatures. All definitions are generalised versions of those in Data.Comp.Annotation.

Synopsis

Documentation

type AnnTerm a (fs :: Signature) = HFix (Sum fs :&: a) Source #

type AnnHFix a (f :: Node) = HFix (f :&: a) Source #

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

Instances details
(f :<: Sum fs, Default a) => f :<: (Sum fs :&: a) Source # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

inj :: forall (a0 :: Family). f a0 :-> (Sum fs :&: a) a0 Source #

proj :: forall (a0 :: Family). NatM Maybe ((Sum fs :&: a) a0) (f a0) Source #

(ShowHF f, Show p) => ShowHF (f :&: p) Source # 
Instance details

Defined in Data.Comp.Multi.Show

Methods

showHF :: Alg (f :&: p) (K String) Source #

showHF' :: (f :&: p) (K String) :=> String Source #

HFoldable f => HFoldable (f :&: a) Source # 
Instance details

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 # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

hfmap :: forall (f0 :: Type -> Type) (g :: Type -> Type). (f0 :-> g) -> (f :&: a) f0 :-> (f :&: a) g Source #

HTraversable f => HTraversable (f :&: a) Source # 
Instance details

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 # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

remA :: forall (a :: Family). (f :&: p) a :-> f a Source #

f :<: Sum fs => (f :&: a) :<: (Sum fs :&: a) Source # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

inj :: forall (a0 :: Family). (f :&: a) a0 :-> (Sum fs :&: a) a0 Source #

proj :: forall (a0 :: Family). NatM Maybe ((Sum fs :&: a) a0) ((f :&: a) a0) Source #

Generic (f e l) => Generic ((f :&: p) e l) Source # 
Instance details

Defined in Data.Comp.Multi.Derive.Generic

Associated Types

type Rep ((f :&: p) e l) 
Instance details

Defined in Data.Comp.Multi.Derive.Generic

type Rep ((f :&: p) e l) = Rep (f e l) :*: Rec0 p

Methods

from :: (f :&: p) e l -> Rep ((f :&: p) e l) x #

to :: Rep ((f :&: p) e l) x -> (f :&: p) e l #

type Rep ((f :&: p) e l) Source # 
Instance details

Defined in Data.Comp.Multi.Derive.Generic

type Rep ((f :&: p) e l) = Rep (f e l) :*: Rec0 p

class RemA (s :: Node) (s' :: Family -> Type -> Type) | s -> s' where Source #

Methods

remA :: forall (a :: Family). s a :-> s' a Source #

Instances

Instances details
(RemA f g, RemA (Sum fs) (Sum gs)) => RemA (Sum (f ': fs)) (Sum (g ': gs)) Source # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

remA :: forall (a :: Family). Sum (f ': fs) a :-> Sum (g ': gs) a Source #

RemA (f :&: p) f Source # 
Instance details

Defined in Data.Comp.Multi.Ops

Methods

remA :: forall (a :: Family). (f :&: p) a :-> f a 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 #

type family DistAnn (fs :: Signature) a :: Signature where ... Source #

Equations

DistAnn (f ': fs) a = (f :&: a) ': DistAnn fs a 
DistAnn ('[] :: [Fragment]) _1 = '[] :: [Fragment] 

type AnnCxt p h (f :: Node) (a :: Type -> Type) = Cxt h (f :&: p) a Source #

type AnnCxtS p h (fs :: Signature) (a :: Type -> Type) = AnnCxt p h (Sum fs) a Source #