On Wed, Jul 18, 2012 at 7:05 AM, Ertugrul Söylemez <es@ertes.de> wrote:
exception handling should be done on a per-context basis, where the
developer establishes the notion of context. Most of the time this
boils down to releasing resources:
forkIO (doStuffWith h `finally` hClose h)
In more complicated scenarios, where you actually need to /handle/ the
exception you should probably wrap some control concept around it.
There are many options. You could just catch and handle the exception.
Other options include a resumable monad (like monad-coroutine) that
brings everything back into a consistent state.
Finally for both efficiency and safety make use of a stream processing
abstraction like conduit, enumerator or pipes.