| Copyright | (c) 2011 Patrick Bahr | 
|---|---|
| License | BSD3 | 
| Maintainer | Patrick Bahr <paba@diku.dk> | 
| Stability | experimental | 
| Portability | non-portable (GHC Extensions) | 
| Safe Haskell | Safe | 
| Language | Haskell98 | 
Data.Comp.Multi.HFunctor
Description
This module defines higher-order functors (Johann, Ghani, POPL '08), i.e. endofunctors on the category of endofunctors.
- class HFunctor h where
 - type (:->) f g = forall i. f i -> g i
 - type (:=>) f a = forall i. f i -> a
 - type NatM m f g = forall i. f i -> m (g i)
 - newtype I a = I {
- unI :: a
 
 - newtype K a i = K {
- unK :: a
 
 - data A f = A {
- unA :: forall i. f i
 
 - data E f = E {
- unE :: f i
 
 - runE :: (f :=> b) -> E f -> b
 - data (f :.: g) e t = Comp (f (g e) t)
 
Documentation
class HFunctor h where Source #
This class represents higher-order functors (Johann, Ghani, POPL '08) which are endofunctors on the category of endofunctors.
Minimal complete definition
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
The identity Functor.
The parametrised constant functor.