import Control.Monad.Trans.Identity (IdentityT,runIdentityT) import Control.Monad.Trans.State (State, get, runState) import Control.Monad.Trans.Class (lift) withoutIdentityT :: State () () withoutIdentityT = do x <- get return x withIdentityT :: IdentityT (State ()) () withIdentityT = do x <- lift get return x withIdentityT2 :: IdentityT (IdentityT (State ())) () withIdentityT2 = do x <- lift $ lift get return x main = do let x = runState withoutIdentityT () let y = runState (runIdentityT withIdentityT ) () let z = runState (runIdentityT (runIdentityT withIdentityT2 )) () print x print y print z