compdata-0.5.2: Compositional Data Types

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

Data.Comp.Multi.HFunctor

Description

This module defines higher-order functors (Johann, Ghani, POPL '08), i.e. endofunctors on the category of endofunctors.

Synopsis

Documentation

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) 

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

This type represents natural transformations.

type :=> f a = forall i. f i -> aSource

This type represents co-cones from f to a. f :=> a is isomorphic to f :-> K a

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

newtype I a Source

The identity Functor.

Constructors

I 

Fields

unI :: a
 

newtype K a i Source

The parametrised constant functor.

Constructors

K 

Fields

unK :: a
 

Instances

Functor (K a) 
KShow (K String) 
Eq a => KEq (K a) 
Ord a => KOrd (K a) 
Eq a => PEq (K a) 
Ord a => POrd (K a) 
Eq a => Eq (K a i) 
Ord a => Ord (K a i) 

data A f Source

Constructors

forall i . A 

Fields

unA :: f i
 

Instances

KEq a => Eq (A a) 

data (f :.: g) e t Source

This data type denotes the composition of two functor families.

Constructors

Comp f (g e) t