Control.Monad.MonadStateIO
Description
general usefull state monad for a local state and IO
This module is used for threading a state and io actions through a computation. Here the monad is constructed by hand. It could easily be refactored with the use of the monad transformer library.
Documentation
trcState :: (state -> String) -> StateIO state ()Source
state inspection command: a "show"-like function is applied to the state and the result is written to stderr.
changeState :: (state -> state) -> StateIO state stateSource
change the state with a given function and return the new state