[core libraries] Re: PROPOSAL: Add displayException to Exception typeclass
Edward Kmett
ekmett at gmail.com
Fri Nov 21 16:48:21 UTC 2014
Sounds good to me.
The first half of the proposal has effectively unanimous support.
-Edward
On Fri, Nov 21, 2014 at 5:32 AM, Michael Snoyman <michael at snoyman.com>
wrote:
> I realize it's a few days shy of the 2 week mark, but discussion has
> stopped, and there seems to be no objection to the first half of this
> proposal. Given that freeze is fast approaching for 7.10, I'd like to move
> ahead with implementation of this (which is admittedly an incredibly
> trivial patch).
>
> I've created a Trac ticket for this:
>
> https://ghc.haskell.org/trac/ghc/ticket/9822
>
> Thanks all for the discussion.
>
>
> On Mon Nov 10 2014 at 4:01:34 PM Michael Snoyman <michael at snoyman.com>
> wrote:
>
>> I started a discussion a few weeks back on some theoretical changes to
>> how exceptions are displayed. That discussion covered a lot of different
>> ground. I'd now like to formally propose the original change I mentioned in
>> that thread:
>>
>> 1. Add a new method to the Exception typeclass:
>>
>> -- | Render this exception value in a human-friendly manner. Default
>> implementation: @show at .
>> displayException :: e -> String
>> displayException = show
>>
>> 2. Modify GHC's default exception handler to use `displayException`
>> instead of `show`.
>>
>> This change will, on its own, cause no breakage[1] and, without further
>> action, will have no change in program behavior. It does, however, allow
>> users to begin distinguishing between how their exceptions should be
>> `show`n versus how they should be displayed to an end user.
>>
>> Note that I am *not* proposing at this time any other changes discussed
>> in the previous thread. If someone wants to propose removing Show
>> superclasses, adding a Read superclass, providing a typeRepStack method[2],
>> or something else, please propose it separately.
>>
>> Discussion period: two weeks.
>>
>> Michael
>>
>> [1] Besides introducing a new, possibly clashing identifier name.
>> [2] That one actually seems like a very good idea to me.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "haskell-core-libraries" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to haskell-core-libraries+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141121/1d9f74da/attachment.html>
More information about the Libraries
mailing list