StateT package:adjunctions

A state transformer monad parameterized by:
  • g - A representable functor used to memoize results for a state Rep g
  • m - The inner monad.
The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.
Evaluate a state computation with the given initial state and return the final value, discarding the final state.
Evaluate a state computation with the given initial state and return the final state, discarding the final value.