| Portability | non-portable |
|---|---|
| Stability | experimental |
| Maintainer | sjoerd@w3future.com |
Data.Category.NaturalTransformation
Description
- type :~> f g = (c ~ Dom f, c ~ Dom g, d ~ Cod f, d ~ Cod g) => Nat c d f g
- data Nat where
- type Component f g z = Cod f (f :% z) (g :% z)
- newtype Com f g z = Com {}
- o :: Category e => Nat d e j k -> Nat c d f g -> Nat c e (j :.: f) (k :.: g)
- (!) :: (Cod f ~ d, Cod g ~ d) => Nat ~> d f g -> Obj ~> a -> d (f :% a) (g :% a)
- data Precompose where
- Precompose :: (Functor f, Category d) => f -> Precompose f d
- data Postcompose where
- Postcompose :: (Functor f, Category c) => f -> Postcompose f c
- data YonedaEmbedding where
- YonedaEmbedding :: Category ~> => YonedaEmbedding ~>
Natural transformations
type :~> f g = (c ~ Dom f, c ~ Dom g, d ~ Cod f, d ~ Cod g) => Nat c d f gSource
f :~> g is a natural transformation from functor f to functor g.
Natural transformations are built up of components,
one for each object z in the domain category of f and g.
type Component f g z = Cod f (f :% z) (g :% z)Source
A component for an object z is an arrow from F z to G z.
A newtype wrapper for components, which can be useful for helper functions dealing with components.
o :: Category e => Nat d e j k -> Nat c d f g -> Nat c e (j :.: f) (k :.: g)Source
Horizontal composition of natural transformations.
(!) :: (Cod f ~ d, Cod g ~ d) => Nat ~> d f g -> Obj ~> a -> d (f :% a) (g :% a)Source
'n ! a' returns the component for the object a of a natural transformation n.
Related functors
data Precompose whereSource
Precompose f d is the functor such that Precompose f d :% g = g :.: f,
for functors g that compose with f and with codomain d.
Constructors
| Precompose :: (Functor f, Category d) => f -> Precompose f d |
Instances
| Functor (Precompose f d) |
data Postcompose whereSource
Postcompose f c is the functor such that Postcompose f c :% g = f :.: g,
for functors g that compose with f and with domain c.
Constructors
| Postcompose :: (Functor f, Category c) => f -> Postcompose f c |
Instances
| Functor (Postcompose f c) |
data YonedaEmbedding whereSource
The Yoneda embedding functor.
Constructors
| YonedaEmbedding :: Category ~> => YonedaEmbedding ~> |
Instances
| Functor (YonedaEmbedding ~>) |