On Wed, Jul 18, 2012 at 7:05 AM, Ertugrul Söylemez <span dir="ltr">&lt;<a href="mailto:es@ertes.de" target="_blank">es@ertes.de</a>&gt;</span> wrote:<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

exception handling should be done on a per-context basis, where the<br>
developer establishes the notion of context.  Most of the time this<br>
boils down to releasing resources:<br>
<br>
    forkIO (doStuffWith h `finally` hClose h)<br></blockquote><div><br></div><div>Hello Ertugrul,</div><div><br></div><div>Agreed, although sometimes I just want to be lazy and catch any exception and see what it is in the top-level context :-)</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In more complicated scenarios, where you actually need to /handle/ the<br>
exception you should probably wrap some control concept around it.<br>
There are many options.  You could just catch and handle the exception.<br>
Other options include a resumable monad (like monad-coroutine) that<br>
brings everything back into a consistent state.<br><br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Finally for both efficiency and safety make use of a stream processing<br>
abstraction like conduit, enumerator or pipes.<br></blockquote><div><br></div><div>Thank you for these interesting pointers, I&#39;ll look into them later. </div><div><br></div><div> </div></div>