Proposal: Extensible exceptions

Henning Thielemann lemming at
Mon Jul 7 10:00:12 EDT 2008

On Mon, 7 Jul 2008, Yitzchak Gale wrote:

> Henning Thielemann wrote:
>> I don't see the problem. Current 'bracket' would be used for bracketing
>> current IO code, new 'bracket' would be used to bracket new ErrorT based IO
>> code.
> bracket is a GHC primitive. It works only directly with IO, not with
> other monads. I don't think there is any way to write "new bracket"
> right now.

We could catch GHC primitive exceptions and return pure ExceptionalResult 
(aka Either) in the basic IO routines like 'readFile'.

Btw. new IO modules would also give us the opportunity to get rid of hPut, 
hGetLine and friends, and convert them to H.put, H.getLine etc.

More information about the Libraries mailing list