Hi, I&#39;m looking from an example of MonadError usage for exception handling.<div><br></div><div>After reading this <a href="http://mvanier.livejournal.com/5343.html">http://mvanier.livejournal.com/5343.html</a> I&#39;d like to see an example with two different error types handled in the same function.</div>
<div><br></div><div>I mean I have</div><div>  f :: a -&gt; Either e1 b </div><div>  g :: b -&gt; Either e2 c</div><div>and I want to write a new function </div><div>   z :: a -&gt; Either e3 c</div><div>using f and g.</div>
<div>(with Either e1, Either e2 and Either e3 all instances of MonadError) </div><div>e3 could provide constructors like E1Occurred e1 and E2Occurred e2 (to mimic inner exceptions)</div><div><br></div><div><br></div><div>
I&#39;d like to see how readable would be z.</div><div>Can you point me to a snippet or even a real codebase showing such thing?</div><div><br></div><div><br></div><div>Giacomo</div><div><br></div><div><br></div>