compdata-0.3: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerTom Hvitved <hvitved@diku.dk>

Data.Comp.MultiParam.HDifunctor

Description

This module defines higher-order difunctors, a hybrid between higher-order functors (Johann, Ghani, POPL '08), and difunctors (Meijer, Hutton, FPCA '95). Higher-order difunctors are used to define signatures for compositional parametric generalised data types.

Synopsis

Documentation

class HDifunctor f whereSource

This class represents higher-order difunctors.

Methods

hdimap :: (a :-> b) -> (c :-> d) -> f b c :-> f a dSource

Instances

class HFunctor h whereSource

This class represents higher-order functors (Johann, Ghani, POPL '08) which are endofunctors on the category of endofunctors.

Methods

hfmap :: (f :-> g) -> h f :-> h gSource

A higher-order functor f also maps a natural transformation g :-> h to a natural transformation f g :-> f h

Instances

HDifunctor f => HFunctor (f a)

A higher-order difunctor gives rise to a higher-order functor when restricted to a particular contravariant argument.

HFunctor f => HFunctor (Cxt h f) 
HFunctor f => HFunctor (:&: f a) 
(HFunctor f, HFunctor g) => HFunctor (:+: f g) 

data I a Source

The identity functor.

Constructors

I 

Fields

unI :: a
 

Instances

data K a i Source

The parametrised constant functor.

Constructors

K 

Fields

unK :: a
 

Instances

Functor (K a) 
Show a => PShow (K a) 
Eq a => PEq (K a) 
Ord a => POrd (K a) 
Eq a => Eq (K a i) 
(HDifunctor f, EqHD f) => Eq (Term f i)

Equality on terms.

Ord a => Ord (K a i) 
(HDifunctor f, OrdHD f) => Ord (Term f i)

Ordering of terms.

(HDifunctor f, ShowHD f) => Show (Term f i)

Printing of terms.

data A f Source

Constructors

forall i . A 

Fields

unA :: f i
 

type :-> f g = forall i. f i -> g iSource

This type represents natural transformations.

type NatM m f g = forall i. f i -> m (g i)Source

This type represents monadic natural transformations.