The state monad

December 13, 2012