title: @djinn MonadError e m => m ()
body: <p>Is it possible to give an expression of type</p>
  
  <pre><code>MonadError e m =&gt; m ()
  </code></pre>
  
  <p>that raises an error, that can be handled with <code>catchError</code>? Note the absence of an <code>Error e</code> requirement.</p>
  
  <p>Under what circumstances can an error created with <code>fail</code> be handled with <code>catchError</code>? What can lead to a <code>fail</code> not being caught by <code>catchError</code>? In what way did these circumstances change with respect to GHC releases? (There is a <a href="http://blog.ezyang.com/2011/08/8-ways-to-report-errors-in-haskell-revisited/" rel="nofollow">mention</a> that the behaviour changed in base 4.3.)</p>
  
  <p>The background of this question is a larger piece of code (<a href="http://www.cogsys.wiai.uni-bamberg.de/effalip/" rel="nofollow">Igor2</a> function <code>nomatch</code>) where an error created with <code>fail "some message"</code> passes by <code>catchError</code> and terminates the program, but replacing the <code>fail</code> invocation with <code>throwError undefined</code> results in the error being caught as expected. Of course <code>throwError undefined</code> is an ugly hack and this question aims to understand the background and correct solution.</p>