lift embeds an action from an underlying monad into a monad-transformer context. For example, ReaderT can lift actions from its underlying monad, while liftIO specifically lifts IO actions. section 15.1.1
Lifting an IO action in ReaderT
With type App a = ReaderT Config IO a, an App action can read its Config environment and use liftIO to print a path mapping. Running runReaderT example cfg produces src -> dst. section 15.1.1
ghci> import Control.Monad.Trans.Class
ghci> :i MonadTrans
type MonadTrans :: ((* -> *) -> * -> *) -> Constraint
class MonadTrans t where
lift :: Monad m => m a -> t m a
{-# MINIMAL lift #-}
The MonadTrans definition gives lift its general type: Monad m => m a -> t m a. section 15.1.1
