This module is inspired by the paper
/Functional Programming with Overloading and
Higher-Order Polymorphism/,
Mark P Jones (http://web.cecs.pdx.edu/~mpj/)
Advanced School of Functional Programming, 1995.

Map a stateful computation from one (return value, state) pair to
another. For instance, to convert numberTree from a function that
returns a tree to a function that returns the sum of the numbered
tree (see the Examples section for numberTree and sumTree) you may
write: