Use liftIO for that; that's what MonadIO is for. I expected you were needing to go the other way, because if you have MonadIO then you have IO via liftIO.


The type signature for catch is -- 

catch :: Exception e => IO a -> (e -> IO a) -> IO a

This is Spock's monad: https://hackage.haskell.org/package/Spock-core-0.11.0.0/docs/Web-Spock-Action.html#t:ActionCtxT (it has MonadTrans, MonadIO, Monad, Functor, Applicative, Alternative instances).

How do I catch an exception coming out of an action in the ActionCtxT monad?

-- Saurabh.