I've been building my way up through some category theory in Haskell on my way to creating more general Monads.
Before I can move onto the next step I am going to need to be able to work with natural transformations.
Now natural transformations on regular Functors are easy enough they are just functions
trans :: forall a . F a -> G a
(where F and G are Functors) with the additional restriction that
fmap f . trans = trans . fmap f
equivalent to the commutative diagram:
However when I move on to more categorical functors
class
( Category cat1
, Category cat2
)
=> Functor cat1 cat2 f
where
map :: cat1 a b -> cat2 (f a) (f b)
I am not sure how I can augment the definition of natural transformation to keep up.
The diagram implies that
trans :: forall a . cat2 (F a) (G a)
where
Functor cat1 cat2 F
Functor cat1' cat2 G
However it is not clear to me that it must be the case that cat1 ~ cat1'. Or what the relationship between the transformation and the precategories of both functors are.
What does a natural tranformation look like in the broader context of Haskell Functors over more general categories?
