Department of Mathematics

Massachusetts Institute of Technology

**Office:** 2-180

**Email:** {bfo,dspivak} -- mit/edu

# 18.S097: Programming with Categories

## IAP 2020

### General information

Room: | 4-163 |

Dates: | Jan 7—31 (MTWRF) |

Time: | 2—3pm |

Prerequisites: | None |

Credit: | 3 units (1-0-2) (P/D/F) |

**Summary**: In this course we explain how category theory—a branch of mathematics known for its ability to organize the key abstractions that structure much of the mathematical universe—has become useful for writing elegant and maintainable code. In particular, we'll use examples from the Haskell programming language to motivate category-theoretic constructs, and then explain these constructs from a more abstract and inclusive viewpoint. Hands-on programming exercises will be used to demonstrate categorical ideas like "the universal property of products" in working Haskell code. A rough list of topics includes:
- Sets, types, categories, functors, natural transformations
- Universal constructions and associated data types
- Adjunctions and cartesian closed categories
- Algebras, catamorphisms, anamorphisms
- Monads, comonads, Kleisli arrows
- Monoids, monoidal categories, lax monoidal functors, applicatives
- Profunctors, (co)ends, optics

**We will assume no background knowledge on behalf of the student**, starting from scratch on both the programming and mathematics.
(Flyer)

Students are very welcome to audit.

### Course details

Course notes will be published here in advance of each class.

Feedback about the notes is welcome
here or via email to the instructors.

The instructors will lead problem discussion and be available for questions each
day from 3 to 4pm, in the course classroom, 4-163.

Students taking the course for credit will be required complete three problem
sets. There will be no exam.

There will be no class on Monday 1/20 (MLK Day).

### Other resources

### Join the mailing list

Join the mailing list to get updates.

This
work by Brendan Fong, Bartosz Milewski, and David Spivak is licensed
under a
Creative Commons
Attribution-Share Alike 3.0 Unported License.