Menu
  • HOME
  • TAGS

Perform simple IO in Haskeline, inside InputT monad, without having to resort to unsafePerformIO

haskell,monad-transformers,haskeline

Since InputT IO is a MonadIO, you can use liftIO with this type: liftIO :: IO a -> InputT IO a So, do ... x <- liftIO $ runExceptT $ foo input case x of Left err -> ... Right res -> ... Alternatively, use Control.Monad.Trans.lift instead....