.. title: Monads: just a monoid in the category of endofunctors!
.. slug: monads-just-a-monoid-in-the-category-of-endofunctors
.. date: 2023-07-01 18:15:11 UTC+02:00
.. tags: 
.. category: 
.. link: 
.. description: 
.. type: text
.. has_math: true

In computer science, and especially in functional programming, monads appear **a
lot**! When one wants to understand them, however, it seems all explanations are
either a fully categorical definition that is way too abstract or a hand-wavy
intuition of 'boxes' and pipes and whatnot. In this post, I attempt to reconcile
the two into a rigorous, but intuitive explanation.

Intuition
#########

Monads are to seen, intuitively, as a way to nicely (functorially) extend
objects in a certain universe (category) into other objects of that universe in
a monoidal way, that is, there is a unit: a natural way to 'plainly' extend an
object :math:`A` into :math:`T A` and there is a multiplication: there is a
natural and unique way to combine higher level extensions :math:`T \cdots T A`
into a single layer :math:`T A`. The vagueness of the terms involved reflects
the generality of applications of category theory. A monad is a purely
categorical construct and therefore, so many categories reflecting so many
different 'universes' of things could make use of monads, and the concrete
intuition for each case can be quite different.

.. TEASER_END

:math:`\LaTeX` 
