Tutorial

Monad morphisms solve the common problem of fixing monadic code after the
fact without modifying the original source code or type signatures. The
following sections illustrate various examples of transparently modifying
existing functions.

Monad morphisms

Notice that generalize is a monad morphism, and the following two proofs
show how generalize satisfies the monad morphism laws. You can refer to
these proofs as an example for how to prove a function obeys the monad
morphism laws: