I've been doing functional programming, primarily in OCaml, for a couple years now, and have recently ventured into the land of monads. I'm able to work them now, and understand how to use them, but I'm interested in understanding more about their mathematical foundations. These foundations are usually presented as coming from category theory. So we get explanations such as the following:



> 
> A monad is a monoid in the category of endofunctors.
> 
> 
> 


Now, my goal (partially) is to understand what that means. Can anyone suggest a gentle introduction to category theory, particularly one aimed at programmers already familiar with a functional language such as ML or Haskell, with references for further reading? Resources not necessarily aimed at programmers but accessible to readers with a background in discrete math and first-order logic would be quite acceptable as well.



Resources for learning practical category theory
Online resources:


* [The Catsters channel](http://www.youtube.com/user/TheCatsters)
* [MATH198 course notes](http://haskell.org/haskellwiki/User:Michiexile/MATH198) - examples in Haskell
* [Rydehard, Burstall: Computional Category Theory](http://www.cs.man.ac.uk/%7Edavid/categories/book/) - examples in ML (free reprint of a book)
* [MAGIC course](http://www.cs.manchester.ac.uk/%7Ehsimmons/MAGIC-CATS/magic-cats.html)
* [Barr, Wells: Category theory for computing science](http://www.tac.mta.ca/tac/reprints/articles/22/tr22.pdf) (TAC TR22 is a free reprint of the book)
* [Jaap van Oosten: basic category theory](http://www.itu.dk/%7Ebirkedal/teaching/category-theory-Fall-2001/basiccat.ps.gz)
* [Tom Leinster](http://www.maths.gla.ac.uk/%7Etl/ct/)
* [Eugenia Cheng](http://cheng.staff.shef.ac.uk/catnotes/categorynotes-cheng.pdf)
* [Steve Awodey](http://www.andrew.cmu.edu/course/80-413-713/notes/) - very similar to the book mentioned by Quadrescence
* [Daniele Turi](http://www.dcs.ed.ac.uk/home/dt/CT/)
* [Thomas Streicher](http://www.mathematik.tu-darmstadt.de/%7Estreicher/CTCL.pdf)
* [Abstract and concrete categories: the joy of cats](http://katmat.math.uni-bremen.de/acc/) - might be considered too verbose, but it's full of examples; slightly newer (?) version as [TAC TR17](http://tac.mta.ca/tac/reprints/articles/17/tr17.pdf)
* [Spivak: Category Theory for Scientists](http://ocw.mit.edu/courses/mathematics/18-s996-category-theory-for-scientists-spring-2013/textbook/MIT18_S996S13_textbook.pdf) - free textbook of a 2013 MIT OpenCourseWare; an updated (and non-free) version was published by MIT Press in 2014.
* [Emily Riehl: Category Theory in Context](https://math.jhu.edu/%7Eeriehl/context.pdf)


Books (not free):


* Benjamin Pierce: Basic category theory for computer scientists, MIT Press 1991; a slight expansion/update of the earlier (and free) [CMU-CS-88-203 report](http://repository.cmu.edu/cgi/viewcontent.cgi?article=2846&context=compsci)
* MacLane - solid mathematical foundations, but hardly any references to computing
* [Martin Brandenburg](https://mathoverflow.net/users/2841/martin-brandenburg) - Einführung in die Kategorientheorie (in german)


Category theory in Haskell:


* [Wikibooks introductory text](http://en.wikibooks.org/wiki/Haskell/Category_theory)
* [sigfpe's blog](http://blog.sigfpe.com) has a lot of category theory articles - (di)natural transformations, monads, Yoneda lemma...
* [Comonad.Reader](http://comonad.com/reader/)
* [The Monad.Reader](http://www.haskell.org/sitewiki/images/8/85/TMR-Issue13.pdf) - check "Calculating monads with category theory"
* [Bartosz Milewski - Category Theory for Programmers](https://www.goodreads.com/book/show/33618151-category-theory-for-programmers)


[Another list](http://www.cs.le.ac.uk/people/akurz/books.html)


