compdata-0.10.1: Compositional Data Types

Copyright(c) 2011 Patrick Bahr
LicenseBSD3
MaintainerPatrick Bahr <paba@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell98

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 where Source

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 g Source

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

Instances

type (:->) f g = forall i. f i -> g i infixr 0 Source

This type represents natural transformations.

type (:=>) f a = forall i. f i -> a infixr 0 Source

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) Source 
Foldable (K a) Source 
Traversable (K a) Source 
Eq a => KEq (K a) Source 
Ord a => KOrd (K a) Source 
Eq a => Eq (K a i) Source 
Ord a => Ord (K a i) Source 

data A f Source

Constructors

A 

Fields

unA :: forall i. f i
 

data E f Source

Constructors

forall i . E 

Fields

unE :: f i
 

runE :: (f :=> b) -> E f -> b Source

data (f :.: g) e t infixl 5 Source

This data type denotes the composition of two functor families.

Constructors

Comp (f (g e) t)