compdata-0.13.0: Compositional Data Types
Copyright(c) 2010-2013 Patrick Bahr
LicenseBSD3
MaintainerPatrick Bahr <paba@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Comp.Annotation

Description

This module defines annotations on signatures.

Synopsis

Documentation

data (f :&: a) e infixr 7 Source #

This data type adds a constant product (annotation) to a signature.

Constructors

(f e) :&: a infixr 7 

Instances

Instances details
DistAnn (f :: k -> TYPE LiftedRep) p (f :&: p :: k -> Type) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

injectA :: forall (a :: k0). p -> f a -> (f :&: p) a Source #

projectA :: forall (a :: k0). (f :&: p) a -> (f a, p) Source #

RemA (f :&: p :: k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

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

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

Defined in Data.Comp.Ops

Methods

injectA :: forall (a :: k0). p -> (f :+: s) a -> ((f :&: p) :+: s') a Source #

projectA :: forall (a :: k0). ((f :&: p) :+: s') a -> ((f :+: s) a, p) Source #

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

Defined in Data.Comp.Ops

Methods

remA :: forall (a :: k0). ((f :&: p) :+: s) a -> (f :+: s') a Source #

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

Defined in Data.Comp.Ops

Methods

fold :: Monoid m => (f :&: a) m -> m #

foldMap :: Monoid m => (a0 -> m) -> (f :&: a) a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> (f :&: a) a0 -> m #

foldr :: (a0 -> b -> b) -> b -> (f :&: a) a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> (f :&: a) a0 -> b #

foldl :: (b -> a0 -> b) -> b -> (f :&: a) a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> (f :&: a) a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> (f :&: a) a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> (f :&: a) a0 -> a0 #

toList :: (f :&: a) a0 -> [a0] #

null :: (f :&: a) a0 -> Bool #

length :: (f :&: a) a0 -> Int #

elem :: Eq a0 => a0 -> (f :&: a) a0 -> Bool #

maximum :: Ord a0 => (f :&: a) a0 -> a0 #

minimum :: Ord a0 => (f :&: a) a0 -> a0 #

sum :: Num a0 => (f :&: a) a0 -> a0 #

product :: Num a0 => (f :&: a) a0 -> a0 #

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

Defined in Data.Comp.Ops

Methods

traverse :: Applicative f0 => (a0 -> f0 b) -> (f :&: a) a0 -> f0 ((f :&: a) b) #

sequenceA :: Applicative f0 => (f :&: a) (f0 a0) -> f0 ((f :&: a) a0) #

mapM :: Monad m => (a0 -> m b) -> (f :&: a) a0 -> m ((f :&: a) b) #

sequence :: Monad m => (f :&: a) (m a0) -> m ((f :&: a) a0) #

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

Defined in Data.Comp.Ops

Methods

fmap :: (a0 -> b) -> (f :&: a) a0 -> (f :&: a) b #

(<$) :: a0 -> (f :&: a) b -> (f :&: a) a0 #

(ArbitraryF f, Arbitrary p) => ArbitraryF (f :&: p) Source # 
Instance details

Defined in Data.Comp.Arbitrary

Methods

arbitraryF' :: Arbitrary v => [(Int, Gen ((f :&: p) v))] Source #

arbitraryF :: Arbitrary v => Gen ((f :&: p) v) Source #

shrinkF :: Arbitrary v => (f :&: p) v -> [(f :&: p) v] Source #

(NFDataF f, NFData a) => NFDataF (f :&: a) Source # 
Instance details

Defined in Data.Comp.DeepSeq

Methods

rnfF :: NFData a0 => (f :&: a) a0 -> () Source #

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

Defined in Data.Comp.Show

Methods

showConstr :: (f :&: p) a -> String Source #

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

Defined in Data.Comp.Show

Methods

showF :: (f :&: p) String -> String Source #

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

Defined in Data.Comp.Variables

Methods

isVar :: (f :&: a) a0 -> Maybe v Source #

bindsVars :: Mapping m a0 => (f :&: a) a0 -> m (Set v) Source #

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

Formal product of signatures (functors).

Constructors

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

Instances

Instances details
(Foldable f, Foldable g) => Foldable (f :*: g) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

fold :: Monoid m => (f :*: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Traversable f, Traversable g) => Traversable (f :*: g) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) #

mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) #

sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #

(Functor f, Functor g) => Functor (f :*: g) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #

(<$) :: a -> (f :*: g) b -> (f :*: g) a #

class DistAnn s p s' | s' -> s, s' -> p where Source #

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

Methods

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

Inject an annotation over a signature.

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

Project an annotation from a signature.

Instances

Instances details
DistAnn (f :: k -> TYPE LiftedRep) p (f :&: p :: k -> Type) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

injectA :: forall (a :: k0). p -> f a -> (f :&: p) a Source #

projectA :: forall (a :: k0). (f :&: p) a -> (f a, p) Source #

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

Defined in Data.Comp.Ops

Methods

injectA :: forall (a :: k0). p -> (f :+: s) a -> ((f :&: p) :+: s') a Source #

projectA :: forall (a :: k0). ((f :&: p) :+: s') a -> ((f :+: s) a, p) Source #

class RemA s s' | s -> s' where Source #

Methods

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

Remove annotations from a signature.

Instances

Instances details
RemA (f :&: p :: k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.Comp.Ops

Methods

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

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

Defined in Data.Comp.Ops

Methods

remA :: forall (a :: k0). ((f :&: p) :+: s) a -> (f :+: s') a Source #

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

Transform 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.

liftA' :: (DistAnn s' p s, Functor s') => (s' a -> Cxt h s' a) -> s a -> Cxt h s a Source #

Transform 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, Functor g) => CxtFun g f Source #

Strip the annotations from a term over a functor with annotations.

propAnn :: (DistAnn f p f', DistAnn g p g', Functor 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', Functor 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, Functor 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 -> Maybe (s (Cxt h f a)) Source #

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