Copyright | (c) 2011 Patrick Bahr |
---|---|
License | BSD3 |
Maintainer | Patrick Bahr <paba@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
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 = forall i . E {
- unE :: f i
- runE :: (f :=> b) -> E f -> b
- data (f :.: g) e t = Comp f (g e) t
Documentation
This class represents higher-order functors (Johann, Ghani, POPL '08) which are endofunctors on the category of endofunctors.
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 parametrised constant functor.