[Haskell-beginners] Category Theory

Matt Andrew mjsaand at gmail.com
Thu Jun 24 06:33:01 EDT 2010

Hi all,

I have spend some time over the last couple of days trying to get my head around category theory, in order to understand concepts like monads a little better, in order to understand Haskell a little better =) I have grasped, at least to a degree, the basic concepts of 'category,' 'functor' and 'natural transformation' but I am still fuzzy on a few specifics and had a couple of questions. I'm doing this for self-study and have no one to ask these questions of and so thought I'd ask them here.

My first question is this: where are functors understood to 'live,' or exist? They operate on categories, are they therefore understood to exist outside of the categories they operate on? (I understand that functors can form a category themselves, but I'm asking this question in relation to the categories they operate on. Are they inside or outside of them?) In other words when I define a functor in Haskell, are the pair of functions 'fmap,' and whatever unary type constructor is defined along with it, then part of the morphisms of the Haskell category? Or are they outside of the Haskell category (where the Haskell category I've seen defined in the articles I've read is one where its objects are types and its morphisms functions on those types)?

This leads me to my next question. It seems that all functors in Haskell (or at least all members of the functor typeclass) are covalent endofunctors. Does this mean that whenever a new functor is defined in Haskell, that the Haskell category (H) grows to accomodate the effects of that functor? In other words, for any covalent endofunctor F : H -> H, do H's morphisms then grow to include F(f) and objects to include F(a), where a is any object in H and f is any morphism in H?

I have been working off the assumption that the answer to my last question is 'yes.' The reason for this is natural transformations. Where functors seem to be able to be 'outside' of the categories they operate on (whether they are in fact 'outside' or not is my first question), natural transformations appear to have to be 'inside.' My understanding of the theory is that a natural transformation is a collection of morphisms in the target category of two parallel functors (where such morphisms operate on the functors and meet some specific properties). Surely the only way such a collection of morphisms would make sense would be if the objects they map to/from (i.e. the structures imposed by the two functors) were part of that category also?

I hope these questions make sense. I really appreciate anyone who takes to time to read this!


More information about the Beginners mailing list