On Tue, Jan 20, 2015 at 12:09 PM, Cody Goodman <codygman.consulting@gmail.com> wrote:
type MyState = State Int

modAndPrintState :: Int -> MyState ()
modAndPrintState x = do
  get >>= \i -> do
    liftIO . print $ i
    if even x then put (x + i) else put (i * (x + 1) - x)

This code works in the State monad and the only effect there is what it says on the tin: state, not IO. So the code gets use of put and get, but not print.

Others will soon chime in on StateT solutions, but from the looks of it, you merely want to display the trace of the state. In which case look to Debug.Trace.

-- Kim-Ee