compdata-param-0.9.2: Parametric Compositional Data Types

Copyright(c) 2010-2011 Patrick Bahr Tom Hvitved
LicenseBSD3
MaintainerTom Hvitved <hvitved@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell98

Data.Comp.Param.Multi.Annotation

Description

This module defines annotations on signatures.

Synopsis

Documentation

data (f :&: p) (a :: * -> *) (b :: * -> *) i infixr 7 Source #

This data type adds a constant product to a signature.

Constructors

(f a b i) :&: p infixr 7 
Instances
DistAnn f p (f :&: p) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

injectA :: p -> f a b :-> (f :&: p) a b Source #

projectA :: (f :&: p) a b i -> (f a b :&: p) i Source #

HDifunctor f => HDifunctor (f :&: p) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

hdimap :: (a :-> b) -> (c :-> d) -> (f :&: p) b c :-> (f :&: p) a d Source #

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

Defined in Data.Comp.Param.Multi.Show

Methods

showHD :: (f :&: p) Name (K (FreshM String)) i -> FreshM String Source #

HDitraversable f => HDitraversable (f :&: p) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

hdimapM :: Monad m => NatM m b c -> NatM m ((f :&: p) a b) ((f :&: p) a c) Source #

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

Defined in Data.Comp.Param.Multi.Ops

Methods

remA :: (f :&: p) a b i -> f a b i Source #

DistAnn s p s' => DistAnn (f :+: s) p ((f :&: p) :+: s') Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

injectA :: p -> (f :+: s) a b :-> ((f :&: p) :+: s') a b Source #

projectA :: ((f :&: p) :+: s') a b i -> ((f :+: s) a b :&: p) i Source #

RemA s s' => RemA ((f :&: p) :+: s) (f :+: s') Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

remA :: ((f :&: p) :+: s) a b i -> (f :+: s') a b i Source #

data (f :*: g) a b i infixr 8 Source #

Formal product of signatures (higher-order difunctors).

Constructors

(f a b i) :*: (g a b i) infixr 8 

class DistAnn (s :: (* -> *) -> (* -> *) -> * -> *) p s' | s' -> s, s' -> p where Source #

This class defines how to distribute an annotation over a sum of signatures.

Minimal complete definition

injectA, projectA

Methods

injectA :: p -> s a b :-> s' a b Source #

Inject an annotation over a signature.

projectA :: s' a b :-> (s a b :&: p) Source #

Project an annotation from a signature.

Instances
DistAnn f p (f :&: p) Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

injectA :: p -> f a b :-> (f :&: p) a b Source #

projectA :: (f :&: p) a b i -> (f a b :&: p) i Source #

DistAnn s p s' => DistAnn (f :+: s) p ((f :&: p) :+: s') Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

injectA :: p -> (f :+: s) a b :-> ((f :&: p) :+: s') a b Source #

projectA :: ((f :&: p) :+: s') a b i -> ((f :+: s) a b :&: p) i Source #

class RemA (s :: (* -> *) -> (* -> *) -> * -> *) s' | s -> s' where Source #

Minimal complete definition

remA

Methods

remA :: s a b :-> s' a b Source #

Remove annotations from a signature.

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

Defined in Data.Comp.Param.Multi.Ops

Methods

remA :: (f :&: p) a b i -> f a b i Source #

RemA s s' => RemA ((f :&: p) :+: s) (f :+: s') Source # 
Instance details

Defined in Data.Comp.Param.Multi.Ops

Methods

remA :: ((f :&: p) :+: s) a b i -> (f :+: s') a b i Source #

liftA :: RemA s s' => (s' a b :-> t) -> s a b :-> t Source #

Transform a function with a domain constructed from a higher-order difunctor to a function with a domain constructed with the same higher-order difunctor, but with an additional annotation.

liftA' :: (DistAnn s' p s, HDifunctor s') => (s' a b :-> Cxt h s' c d) -> s a b :-> Cxt h s c d Source #

Transform a function with a domain constructed from a higher-order difunctor to a function with a domain constructed with the same higher-order difunctor, but with an additional annotation.

stripA :: (RemA g f, HDifunctor g) => CxtFun g f Source #

Strip the annotations from a term over a higher-order difunctor with annotations.

propAnn :: (DistAnn f p f', DistAnn g p g', HDifunctor g) => Hom f g -> Hom f' g' Source #

Lift a term homomorphism over signatures f and g to a term homomorphism over the same signatures, but extended with annotations.

propAnnM :: (DistAnn f p f', DistAnn g p g', HDifunctor g, Monad m) => HomM m f g -> HomM m f' g' Source #

Lift a monadic term homomorphism over signatures f and g to a monadic term homomorphism over the same signatures, but extended with annotations.

ann :: (DistAnn f p g, HDifunctor f) => p -> CxtFun f g Source #

Annotate each node of a term with a constant value.

project' :: (RemA f f', s :<: f') => Cxt h f a b i -> Maybe (s a (Cxt h f a b) i) Source #

This function is similar to project but applies to signatures with an annotation which is then ignored.