Monad (category theory)

We had some time to talk, and during the course of it I realized I’d become less scared of certain topics involving monads.

Monads seem to bother a lot of people. There’s even a YouTube video called The Monads Hurt My Head! ... Shortly thereafter, the woman speaking exclaims:

What the heck?! How do you even explain what a monad is?

John Baez, [1]

In category theory, a branch of mathematics, a monad is a triple consisting of a functor T from a category to itself and two natural transformations that satisfy the conditions like associativity. For example, if are functors adjoint to each other, then together with determined by the adjoint relation is a monad.

In concise terms, a monad is a monoid in the category of endofunctors of some fixed category (an endofunctor is a functor mapping a category to itself). According to John Baez, a monad can be considered at least in two ways: [1]

  1. A monad as a generalized monoid; this is clear since a monad is a monoid in a certain category,
  2. A monad as a tool for studying algebraic gadgets; for example, a group can be described by a certain monad.

Monads are used in the theory of pairs of adjoint functors, and they generalize closure operators on partially ordered sets to arbitrary categories. Monads are also useful in the theory of datatypes, the denotational semantics of imperative programming languages, and in functional programming languages, allowing languages without mutable state to do things such as simulate for-loops; see Monad (functional programming).

A monad is also called, especially in old literature, a triple, triad, standard construction and fundamental construction.[2]

  1. ^ a b https://golem.ph.utexas.edu/category/2009/07/the_monads_hurt_my_head_but_no.html
  2. ^ Barr, Michael; Wells, Charles (1985), "Toposes, Triples and Theories" (PDF), Grundlehren der mathematischen Wissenschaften, vol. 278, Springer-Verlag, pp. 82 and 120, ISBN 0-387-96115-1.