PROPOSAL: Add displayException to Exception typeclass
michael at snoyman.com
Mon Nov 10 14:01:26 UTC 2014
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
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
This change will, on its own, cause no breakage 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,
or something else, please propose it separately.
Discussion period: two weeks.
 Besides introducing a new, possibly clashing identifier name.
 That one actually seems like a very good idea to me.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries