Copyright | (c) 2011 Patrick Bahr, Tom Hvitved |
---|---|
License | BSD3 |
Maintainer | Tom Hvitved <hvitved@diku.dk> |
Stability | experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
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.
Documentation
class HDifunctor f where Source
This class represents higher-order difunctors.
HDifunctor f => HDifunctor ((:&:) f p) | |
(HDifunctor f, HDifunctor g) => HDifunctor ((:+:) f g) |
class HFunctor h where
This class represents higher-order functors (Johann, Ghani, POPL '08) which are endofunctors on the category of endofunctors.
hfmap :: (:->) f g -> (:->) (h f) (h g)
A higher-order functor f
also maps a natural transformation
g :-> h
to a natural transformation f g :-> f h
HDifunctor f => HFunctor (f a) | A higher-order difunctor gives rise to a higher-order functor when restricted to a particular contravariant argument. |
Functor f => HFunctor (Compose f) |
newtype K a i :: * -> * -> *
The parametrised constant functor.
type (:->) f g = forall i. f i -> g i infixr 0
This type represents natural transformations.
type NatM m f g = forall i. f i -> m (g i)