Proposal: Add exception info
Michael Sloan
mgsloan at gmail.com
Tue Apr 21 20:55:28 UTC 2015
On Tue, Apr 21, 2015 at 8:23 AM, Greg Weber <greg at gregweber.info> wrote:
>
> On Tue, Apr 14, 2015 at 11:38 AM, Michael Sloan <mgsloan at gmail.com> wrote:
>
>> data SomeException = forall e . Exception e =>
>> SomeExceptionWithInfo e [SomeExceptionInfo]
>>
>> data SomeExceptionInfo = forall a . ExceptionInfo a =>
>> SomeExceptionInfo a
>
>
> Is it necessary for SomeExceptionWithInfo to have a list of a forall data
> type?
> Are Exceptions really that mysterious, or can we more concretely describe
> the information that should be attached to an exception?
>
> SomeExceptionWithInfo e IsAsync CallStack ImplicitStack
>
I did consider this option, but I think as soon as a fixed set is selected,
someone's going to put something else in it. Usually we wouldn't want to
use such a 'dynamic' mechanism in Haskell, but it's appropriate for
something so global as the type used to throw exceptions.
> I am still open to the idea of adding a forall data scratchpad, but can we
> at least try to specify some standard fields?
>
> SomeExceptionWithInfo e IsAsync CallStack ImplicitStack
> [SomeExceptionInfo]
>
This is an interesting idea. I particularly see value in having 'IsAsync'
be a part of the Exception. This is because `throwIO` / `throw` would need
to set this to False when rethrowing async exceptions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150421/2628fd1d/attachment.html>
More information about the Libraries
mailing list