Proposal: Continue the displayException program

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal: Continue the displayException program

David Feuer
Several years ago, Michael Snoyman proposed [*] that we add a displayException method to the Exception class, and that we make GHC use it in the default handler. The first part of that proposal was accepted and implemented, but the second part was not, for reasons that are not very clear to me. I would like to re-propose that we change the default exception handler to use displayException instead of Show. This seems like a much better default, and anyone who wants to do it the old way can still change the top-level handler.


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Continue the displayException program

Eric Mertens
It looks like the original objection is that using displayException makes it harder for the programmer to determine how to handle the exception and that uncaught exceptions were expected to be mostly seen by the developer. This kind of problem certainly comes up when we have to consult the GHC sources to map IOError error message text back to the correct predicate function to use to test for an exception.

Part of the original discussion on this topic included some ideas for ways to make it easier to install an uncaught exception handler that would use displayException instead of the default show. Maybe it would be a good time to entertain some progress on those?

On May 9, 2018, at 6:11 PM, David Feuer <[hidden email]> wrote:

Several years ago, Michael Snoyman proposed [*] that we add a displayException method to the Exception class, and that we make GHC use it in the default handler. The first part of that proposal was accepted and implemented, but the second part was not, for reasons that are not very clear to me. I would like to re-propose that we change the default exception handler to use displayException instead of Show. This seems like a much better default, and anyone who wants to do it the old way can still change the top-level handler.

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Proposal: Continue the displayException program

Michael Snoyman
In reply to this post by David Feuer
As I'm guessing you'd expect, I'm +1 on this.

On Thu, May 10, 2018, 4:12 AM David Feuer <[hidden email]> wrote:
Several years ago, Michael Snoyman proposed [*] that we add a displayException method to the Exception class, and that we make GHC use it in the default handler. The first part of that proposal was accepted and implemented, but the second part was not, for reasons that are not very clear to me. I would like to re-propose that we change the default exception handler to use displayException instead of Show. This seems like a much better default, and anyone who wants to do it the old way can still change the top-level handler.

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries