compdata-0.1: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerPatrick Bahr <paba@diku.dk>

Data.Comp.Multi.Ops

Description

This module provides operators on higher-order functors. All definitions are generalised versions of those in Data.Comp.Ops.

Synopsis

Documentation

data (f :++: g) h e Source

Data type defining coproducts.

Constructors

HInl (f h e) 
HInr (g h e) 

Instances

f :<<: g => f :<<: (:++: h g) 
f :<<: (:++: f g) 
(HFunctor f, HFunctor g) => HFunctor (:++: f g) 
(HExpFunctor f, HExpFunctor g) => HExpFunctor (:++: f g) 
(HFoldable f, HFoldable g) => HFoldable (:++: f g) 
(HTraversable f, HTraversable g) => HTraversable (:++: f g) 
(HEqF f, HEqF g) => HEqF (:++: f g)

EqF is propagated through sums.

(HShowF f, HShowF g) => HShowF (:++: f g) 
(HasVars f v, HasVars g v) => HasVars (:++: f g) v 
HDistProd s p s' => HDistProd (:++: f s) p (:++: (:&&: f p) s') 
HRemoveP s s' => HRemoveP (:++: (:&&: f p) s) (:++: f s') 

class sub :<<: sup whereSource

The subsumption relation.

Methods

hinj :: sub a :-> sup aSource

hproj :: NatM Maybe (sup a) (sub a)Source

Instances

f :<<: f 
f :<<: g => f :<<: (:++: h g) 
f :<<: (:++: f g) 

data (f :**: g) a Source

Constructors

(f a) :**: (g a) 

hfst :: (f :**: g) a -> f aSource

hsnd :: (f :**: g) a -> g aSource

data (f :&&: a) g e 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 productHTermHom.

Constructors

(f g e) :&&: a 

Instances

HDistProd f p (:&&: f p) 
HFunctor f => HFunctor (:&&: f a) 
HFoldable f => HFoldable (:&&: f a) 
HTraversable f => HTraversable (:&&: f a) 
(HShowF f, Show p) => HShowF (:&&: f p) 
HRemoveP (:&&: f p) f 
HDistProd s p s' => HDistProd (:++: f s) p (:++: (:&&: f p) s') 
HRemoveP s s' => HRemoveP (:++: (:&&: f p) s) (:++: f s') 

class HDistProd s p s' | s' -> s, s' -> p whereSource

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

Methods

hinjectP :: p -> s a :-> s' aSource

This function injects a product a value over a signature.

hprojectP :: s' a :-> (s a :&: p)Source

Instances

HDistProd f p (:&&: f p) 
HDistProd s p s' => HDistProd (:++: f s) p (:++: (:&&: f p) s') 

class HRemoveP s s' | s -> s' whereSource

Methods

hremoveP :: s a :-> s' aSource

Instances

HRemoveP (:&&: f p) f 
HRemoveP s s' => HRemoveP (:++: (:&&: f p) s) (:++: f s')