<div dir="ltr">I understand the error below, but I'm not really sure what an instance of liftIO would look like for the Identity functor. I guess I'm not all to clear on what an identity functor is.<br><br>I'm a little fuzzy on what an identity monad is. I understand that id gives the identity of something back pretty well though. Can anyone help?<br><br>If anyone could help me fix the code below as well as explain the questions I have above it would be a great help.<br><br>import Control.Monad.Trans.State<br>import Control.Monad.IO.Class<br><br>type MyState = State Int<br><br>modAndPrintState :: Int -> MyState ()<br>modAndPrintState x = do<br>  get >>= \i -> do<br>    liftIO . print $ i<br>    if even x then put (x + i) else put (i * (x + 1) - x)<br><br>main = undefined<br><br><br>-- Prelude Control.Monad.Trans.State> :r<br>-- [1 of 1] Compiling Main             ( blah2.hs, interpreted )<br><br>-- blah2.hs:9:5:<br>--     No instance for (MonadIO Data.Functor.Identity.Identity)<br>--       arising from a use of `liftIO'<br>--     Possible fix:<br>--       add an instance declaration for<br>--       (MonadIO Data.Functor.Identity.Identity)<br>--     In the first argument of `(.)', namely `liftIO'<br>--     In the expression: liftIO . print<br>--     In a stmt of a 'do' block: liftIO . print $ i<br>-- Failed, modules loaded: none.<br><br><br>Thanks!<br></div>