A monad is a mathematical structure which is heavily used in (pure) functional programming, basically Haskell. However, there are many other mathematical structures available, l
I suspect that the disproportionately large attention given to this one particular type class (Monad
) over the many others is mainly a historical fluke. People often associate IO
with Monad
, although the two are independently useful ideas (as are list reversal and bananas). Because IO
is magical (having an implementation but no denotation) and Monad
is often associated with IO
, it's easy to fall into magical thinking about Monad
.
(Aside: it's questionable whether IO
even is a monad. Do the monad laws hold? What do the laws even mean for IO
, i.e., what does equality mean? Note the problematic association with the state monad.)