title: Catch SomeException with ExceptT
body: <p>I'm trying to use the <code>ExceptT</code> monad transformer to catch any exception thrown by a function, like so:</p>
  
  <pre><code>import Control.Exception
  import Control.Monad.Trans.Except
  
  badFunction :: ExceptT SomeException IO ()
  badFunction = throw DivideByZero
  
  main :: IO ()
  main = do
      r &lt;- runExceptT badFunction
      case r of Left _ -&gt; putStrLn "caught error"
                Right _ -&gt; putStrLn "nope, didn't catch no error" 
  </code></pre>
  
  <p>... but the exception happily flies by.  What am I doing wrong?</p>
  
  <p><strong>Edit</strong>: to clarify, the aim is to catch <em>any</em> exception thrown by a function, regardless of how the exception was thrown.  If it makes any difference, the real function call is at the bottom of a fairly deep monad transformer stack. I don't mind missing things like thrown strings (bad programmer!). </p>