 <p>Another answer thanks to mpickering on freenode: </p> <pre><code>sourcesGetOne = EitherT $ maybeNotFound &lt;$&gt; sourcesFind </code></pre> <blockquote> <p>So the question is how to write a function.. <code>IO (Maybe a) -&gt; EitherT (Int, String) IO a</code> Given a function <code>f :: Maybe a -&gt; Either (Int, String) a</code>, then one way is..</p> <p><code>myFunc action = EitherT (f &lt;$&gt; action)</code></p> <p>If you look at the docs for EitherT -- <a href="https://hackage.haskell.org/package/either-4.3.3.2/docs/Control-Monad-Trans-Either.html" rel="nofollow">https://hackage.haskell.org/package/either-4.3.3.2/docs/Control-Monad-Trans-Either.html</a>. Then you'll see that <code>EitherT (Int, String) IO a</code>, is actually just a wrapped up <code>IO (Either (Int, String) a)</code></p> </blockquote>