Proposal: Add exception info

Michael Sloan mgsloan at gmail.com
Tue Apr 21 21:32:55 UTC 2015


On Tue, Apr 21, 2015 at 7:56 AM, Yitzchak Gale <gale at sefer.org> wrote:

> Michael Snoyman wrote:
> > Can you give an example of a concrete problem you're
> > expecting to run into?
>
> Package foo uploads a new version with a critical bug fix.
> As is often the case, this new version also supports updated
> dependencies, including exceptions. The new exceptions
> breaks the old SomeException type, so foo is forced to
> specify a lower bound that excludes the old exceptions.
>

This only happens when a package depends on receiving or adding extra
exception info.  I don't think this will be necessary for most packages.
The primary use-case I'm seeing for this extra exception info is being able
to display it to the user.  Since this will be done by 'displayException' /
'show' / the default exception handler, there's no need for user code to do
anything special to get it.

In the cases where we do have code that cares about this extra exception
info, we would indeed be doing something that wasn't possible before, and
so have issues with backwards compatibility.

For example, when an exception is thrown while 'bracket' is handling an
exception, it would be quite handy to be able to catch the original
exception.  This is simply not possible today, and so it is not possible to
offer this in a way which works on earlier versions of base.

I'd be quite concerned if this didn't offer some additional power that
wasn't available before.  Isn't that the point of changing things / adding
such features?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150421/8b7854db/attachment.html>


More information about the Libraries mailing list