[Haskell-cafe] Category Theory and Haskell

AUGER Cédric sedrikov at gmail.com
Fri Nov 30 09:49:55 CET 2012

Le Sun, 25 Nov 2012 21:41:47 +0000,
Gytis Žilinskas <gytis.zilinskas at gmail.com> a écrit :

> Greetings,
> I'm only taking my very first steps learning Haskell, but I believe
> that this mailing list might be appropriate for my question.
> How difficult would it be to study category theory and simultaneously
> come up with Haskell examples of various results that it presents?
> I believe some background is in order. I am a second year maths
> student (well actually I'm in-between 2nd and 3rd, but let's not delve
> into details). I have also done some 2nd year CS courses so I have
> some background in that too. My general interests seem to lie
> somewhere between maths and compsci (I guess theoretical cs is the
> word for it), but it doesn't look like there is a good way to study
> the subject at an undergrad level. Most CompSci undergrad courses seem
> to concentrate too much on the trade of being a programmer and only
> present the basics of the theoretical results. While maths departments
> seem to be reluctant to make room in the undergrad curriculum for a
> huge subject that, after all, is maths.
> Recently, whenever I try reading up on something that looks like an
> exciting topic to me, I hit my head against category theory. That
> seems to suggest, that I should check it out, as it might be a fun
> subject to study, or at least provide valuable insights elsewhere.
> I've tried looking for some resources online. Most of them are
> outright scary and clearly have prerequisites that I lack. Some a
> little bit more accessible. Overall, various similar questions on
> different stackexchanges and even some old discussions on this mailing
> list, imply that to study category theory one has to know many
> examples from other advanced fields, in order to see the patterns that
> category theory describes. Now I obviously lack that. Some basic group
> theory, linear algebra, real/complex analysis and metric spaces is
> pretty much all I've got. Moreover, most sources say that without the
> knowledge of examples - category theory is an extremely dry subject to
> study. Therefore, my preliminary plan is the following:
> Read:
> * Barry Mazur - When is one thing equal to some other thing?
> * Conceptual mathematics : a first introduction to categories / F.
> William Lawvere, Stephen H. Schanuel. (People say that it is rather
> lightweight, but at this point my goal is to see the general idea of
> category theory and get some taste of it)
> Then, in the 2nd semester, I have an option of taking a self-study
> module, and if I don't get bored by cats by that time - it would be
> great to invest some more time in it (or rather, I'll do anything to
> avoid applied maths *shudder*). However, I'll need to present my case
> before the department staff and this, basically, is why I'm here.
> Right now, it looks like the main argument against me, would be that I
> can't appreciate the subject since I lack the fundamentals in other
> areas of maths. So I was hoping, I could convince them that everything
> I lack example wise - I'll find in Haskell. Okay, "everything" might
> be too strong of a statement, but I don't really know what I'm talking
> about so it's a bit difficult to calibrate. Could you comment whether
> Haskell would serve me well for this purpose?
> I've also seen these lecture notes:
> http://www.haskell.org/haskellwiki/User:Michiexile/MATH198. But I'm
> not sure if they won't be deemed too comp sci targeted. Therefore, I'm
> putting more hope into "The Joy of Cats" which, at least according to
> the first few pages, doesn't assume any prior knowledge that I don't
> have.
> So that's that, I would appreciate any advice you could give.
> Gytis
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

 I would suggest reading Saunders MacLane book (Categories for the
working mathematician). I am happy to have bought this one. But do not
be impressed by the given exercises, they have no correction, and some
are not understandable for a new comer. (The first exercise of the book
talks about Lie groups and algebra, that is hard to start with). So for
the examples, only read the ones involving the "Set", "Ab", "Rng"
categories if you are not used to the other ones.
 The terminology is also annoying, as the formalization was done rather
lately, and some concepts merged, so for instance the concept of limit.
In the terminology, you have "limit"="inverse limit" and
"colimit"="direct limit" which is quite confusing (but MacLane is not
at fault for that).

Some other resource is the categories channel on IRC (Freenode), the
nLab wiki (and Wikipedia of course).

You may also be interested in Agda, which would help in using the laws
of each category (not ensured by raw Haskell). I learned Coq rather
than Agda, so you can also try it too.

More information about the Haskell-Cafe mailing list