MonadTrans is a Haskell type class for monad transformers. Its lift function moves a computation from an underlying monad into the transformer context, allowing both effects to participate in one action. section 15.1.1
Lifting an IO action into ReaderT
With type App a = ReaderT Config IO a, an App action cannot use putStrLn directly because putStrLn belongs to IO. Writing liftIO $ putStrLn (...) lifts that IO action into App. MonadTrans generalizes this idea with lift for underlying monads beyond IO. 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 class signature makes the abstraction concrete: lift accepts a Monad action and returns the corresponding action in transformer t. section 15.1.1
