[Haskell-cafe] Relating functors in Category Theory to Functor

ajb at spamcop.net ajb at spamcop.net
Tue Jun 29 20:01:56 EDT 2004

G'day all.

Quoting "Iavor S. Diatchki" <diatchki at cse.ogi.edu>:

> just a few silly remarks...

Not so silly...

> actually i think this is a good approximation.  not all polymorphic
> functions are natural
> transformations, but "simple" ones usually are.

I've found when studying category theory that expressing this stuff in
Haskell REALLY helps.  Haskell was a familiar notation, where category
theory notation was not.  Being able to freely translate between the
two helps.

In this case, recognising _which_ polymorphic functions are natural
transformations help you understand what a natural transformation
is.  A natural transformation in Haskell is a function of the

    tau :: f a -> g a

where f and g are specific Functors.

In the book by Saunders MacLane, there was one remark about natural
transformations which really helps.  He noted that a natural
transformation is one that's done

> it is not a good idea to have a _class_ for natural transformations as
> they have little to do with overloading.

Indeed.  If you actually want to get work done in Haskell, making a
class for this is a bad idea.  But then there are easier ways to do
this, too:


My point is that Haskell is a good and (for most people on this
mailing list) familiar notation for expressing these concepts.

Andrew Bromage

More information about the Haskell-Cafe mailing list