title: bind a monadic value (m2 a) inside some other monad m1
body: <p>Working in a Coding Dojo today I tried the following</p>
  
  <pre><code>example :: IO ()
  example = do input &lt;- getLine
               parsed &lt;- parseOnly parser input
               ...
  </code></pre>
  
  <p>where <code>parseOnly :: Parser a -&gt; Either String a</code> (from <code>attoparsec</code>) of course the compiler complained that <code>Either ..</code> is not <code>IO ..</code> essentially telling me I am mixing monads.</p>
  
  <p>Of course this can be solved by</p>
  
  <pre><code>             case parseOnly parser input of .. -&gt; ..
  </code></pre>
  
  <p>which is kind of unelegant, I think. Also my guess is that somebody else had this problem earlier and the solution I think is related to monad transformers, but the last bits I cannot piece together.</p>
  
  <p>It also reminded me of <code>liftIO</code> - but this is the other way around I think which solves the problem of lifting an IO action happening inside some surrounding monad (more precisely <code>MonadIO</code> - say for example inside <code>Snap</code> when one wants to print something to <code>stdout</code> while getting some http).</p>
  
  <p>More general this problem seems to be for a <code>Monad m1</code> and a (different) <code>Monad m2</code> how can I do something like</p>
  
  <pre><code>example = do a &lt;- m1Action
               b &lt;- m2Action
               ..
  </code></pre>