title: How to lift function to transformed monad in haskell?
body: <p>I know with the data constructor and the run*** function, </p>
  
  <p>I can lift any function to a specific MonadTrans instance.</p>
  
  <p>Like this,</p>
  
  <pre><code>import Control.Monad.Trans
  import Control.Monad.Trans.Maybe
  import Control.Monad
  
  liftF :: (Monad m) =&gt; (a -&gt; b) -&gt; MaybeT m a -&gt; MaybeT m b
  liftF f x = MaybeT $ do
         inner &lt;- runMaybeT x
         return $ liftM f inner
  </code></pre>
  
  <p>But how can I generalize this liftF to</p>
  
  <pre><code>liftF :: (MonadTrans t, Monad m) =&gt; (a -&gt; b) -&gt; t m a -&gt; t m b
  </code></pre>