cubix-compdata-1.0.1: Compositional Data Types for Cubix
Copyright(c) 2011 Patrick Bahr
LicenseBSD3
MaintainerPatrick Bahr <paba@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell98

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 = HFix (Sum fs :&: a) Source #

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

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

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

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 #

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 #

(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 #

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

Defined in Data.Comp.Multi.Ops

Methods

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

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 :: (* -> *) -> * -> *) s' | s -> s' where Source #

Methods

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

propAnn :: HFunctor g => Hom f g -> Hom (f :&: p) (g :&: p) Source #

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.

isNode' :: (HFunctor g, RemA g g', f :<: g') => Proxy f -> Cxt h g a l -> Bool Source #

inj' :: f :<: g => (f :&: p) e l -> (g :&: p) e l Source #

inject' :: f :<: g => (f :&: p) (Cxt h (g :&: p) a) :-> Cxt h (g :&: p) a Source #

injectOpt :: f :<: g => f (AnnHFix (Maybe p) g) l -> AnnHFix (Maybe p) g l Source #

caseH' :: forall fs a e l t. Alts (DistAnn fs a) e l t -> (Sum fs :&: a) e l -> t Source #

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 #

type family DistAnn (fs :: [(* -> *) -> * -> *]) (a :: *) :: [(* -> *) -> * -> *] where ... Source #

Equations

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

type AnnCxt p h f a = Cxt h (f :&: p) a Source #

type AnnCxtS p h fs a = AnnCxt p h (Sum fs) a Source #