samskivert: Typeclassopedia – Yorgey

27 December 2010

As the structure of the title suggests, this is a small encyclopedic exposition of the main Haskell type classes. It focuses on those type classes with category-theoretic foundations. It introduces them incrementally, each building on the type classes before it. Yorgey takes some pedagogical liberties and describes classes that don’t exist, but would if Haskell’s standard libraries were redesigned from scratch today (indeed, Scalaz follows his idealized presentation nearly exactly). The classes covered in detail are: Functor, Pointed, Applicative, Monad, Monoid, Foldable, Traversable, Category, Arrow, and Comonad.

This came at a very opportune time during my own slowly growing understanding of category theory and its applications to computer science. I had made ad hoc inroads on many of these concepts, and was ready for the Typeclassopedia’s organized presentation. My meager ability to read Haskell code was also helpful, because the definitions are presented as Haskell source. I even ended up writing some Haskell to verify my solutions to some of the numerous exercises left to the reader.


©1999–2015 Michael Bayne