The familiar State monad lets us represent computations with a state that can be queried and
updated. The state must have the same type during the entire computation however. One sometimes
wants to express a computation where not only the value but also the type of the state can be
updated -- while maintaining static typing. We wish for a parameterized monad that indexes each
monadic type by an initial (type)state and a final (type)state. The effect of an effectful
computation thus becomes apparent in the type of the computation, and so can be statically
reasoned about.