<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 10:39 AM, Herbert Valerio Riedel <span dir="ltr"><<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Michael,<br>
<span class=""><br>
On 2014-10-29 at 00:43:55 +0100, Michael Snoyman wrote:<br>
> I don't want to make a format proposal yet, just open up discussion on an<br>
> issue, and see how others feel about it.<br>
><br>
> As I recently commented on this list[1], the Show typeclass is overloaded<br>
> with multiple meanings (serialization, debug info, and user-friendly data<br>
> display). The general consensus seems to be that the official semantics for<br>
> Show should be for serialization (as paired up with Read).<br>
<br>
</span>[...]<br>
<span class=""><br>
> I have a possible solution that I'd like to propose as a strawman: add a<br>
> new method to the Exception typeclass:<br>
><br>
>     displayException :: e -> String<br>
>     displayException = show<br>
<br>
</span>As we're having the general problem of 'Show' being abused for<br>
pretty-printing, why not rather standardise on a pretty-show/printing<br>
typeclass that would not be limited to Exceptions? What am I missing?<br>
<br></blockquote><div><br></div><div>The downside to that is that it introduces a breaking change, whereas this proposal does not. If we *do* want to standardize on a pretty-printing typeclass, I think the right way forward (though somewhat painful) is:<br><br></div><div>Release X: Introduce the pretty-printing typeclass, add displayException with default implementation of Show, do not otherwise change Exception.<br>Release X+1: Add new typeclass as a superclass of Exception.<br></div><div>Release X+2: Switch default implementation of displayException to the pretty-show.<br>Release X+3: Remove Show as a superclass.<br><br>Maybe some of those steps can be combined, I'm not certain.<br><br></div><div>Michael <br></div></div></div></div>