A monad on a category is an endofunctor equipped with two natural transformations satisfying associativity and the unit laws . The two transformations are a unit and a multiplication . Equivalently a monad is a monoid in the endofunctor category , which is the organising slogan for compositional effects. The weaker applicative-functor sits between a plain functor and a monad, whereas a relative-monad relaxes the endofunctor to a functor . Its algebras are maps compatible with , and these form the Eilenberg–Moore category, whereas the free algebras form the Kleisli category. Every adjunction induces a monad , and every monad arises this way. The prototype is the distribution monad, also called the Giry monad, whose Kleisli maps are the channels of a markov-category. Other standard examples are powerset for nondeterminism, for partiality, list, and state, each choosing what “impure” means.

References

  • Saunders Mac Lane, Categories for the Working Mathematician (1971), ch. VI (monads, Eilenberg-Moore, Kleisli)
  • Michèle Giry, “A categorical approach to probability theory”, in Categorical Aspects of Topology and Analysis, LNM 915 (1982)