<div dir="ltr">Hello,<br><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 8, 2013 at 1:39 AM, Simon Peyton-Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div><div class="im">
<p class="MsoNormal">What I would like to see is something like:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New"">HsApp (HsApp (HsApp (HsVar "foldl'") (HsVar "+")) (HsLit 0)) (HsVar "xs")</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d">We could derive ‘Show’ on everything but that would generate a LOT of new code, that would seldom be used. Also ‘Show’ doesn’t pretty-print so the result would
be illegible. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d"><u></u> </span></p></div></div></blockquote><div style>I have a package called "pretty-show", which can convert standard `Show` instances into human-readable form, and it can also produce HTML renditions of `Show`-ed data structures. It is very useful for debugging or learning a new code base.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d"><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Verdana","sans-serif";color:#1f497d">I’m a bit dubious. Maybe a better thing might be to improve the existing pretty-printer so it gave you the cues you are looking for?<br>
<br></span></p></div></div></blockquote><div style>Agreed that this is probably a better solution, although having derived `Show` instances would allow one to see exactly what data-structure was produced at some point, which can be helpful when figuring out how some part of GHC works.</div>
<div><br></div><div style>-Iavor</div><div><br></div></div></div></div>