| Copyright | (C) 2015 The University of Kansas |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Andy Gill |
| Stability | Experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Control.Natural
Description
A data type and class for natural transformations.
Newtype for a Natural Transformation
newtype f :~> g infixr 0 Source #
A natural transformation suitable for storing in a container.
Type Synonym for a Natural Transformation
Conversion functions between the newtype and the synonym
unwrapNT :: Transformation f g t => t -> forall a. f a -> g a Source #
Class for Natural Transformations
class Transformation f g t | t -> f g where Source #
A (natural) transformation is inside t, and contains f and g
(typically Functors).
The order of arguments allows the use of GeneralizedNewtypeDeriving to wrap
a :~>, but maintain the Transformation constraint. Thus, # can be used
on abstract data types.
Methods
(#) :: t -> forall a. f a -> g a infix 0 Source #
The invocation method for a natural transformation.
Instances
| Transformation (f :: Type -> Type) IO (Object f) Source # | |
| Transformation (f :: k -> Type) (g :: k -> Type) (f :~> g) Source # | |
Defined in Control.Natural | |