<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I, for one, would greatly welcome someone rewriting much of the TcErrors module. (Almost all type errors are generated in that one module, rather conveniently.) Even better would be to have some written-out theory behind the design of the error-reporting mechanism. What we have now is incredibly ad-hoc and, as frequently reported, rather suboptimal.</div><div><br></div><div>Richard</div><br><div><div>On Mar 4, 2016, at 11:36 AM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-GB" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">indication that a more general type error improvement sweep would be welcome<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Absolutely yes.  But it depends on someone saying “I want to do that”; and of course on how hard or easy it turns out to be.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt 36pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">general UX improvements I would like to undertake.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Great!  Make Trac tickets proposing changes; debate them with others to form a consensus about what would be good; implement them… that would all be amazing.<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Simon<span style="font-family: Calibri, sans-serif; "><o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "> </span></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0cm 0cm 0cm 4pt; "><div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "><span class="Apple-converted-space"> </span>Christopher Allen [mailto:cma@<a href="http://bitemyapp.com">bitemyapp.com</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>04 March 2016 16:24<br><b>To:</b><span class="Apple-converted-space"> </span>Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>><br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: Specialized type hints<o:p></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">I was looking for an indication that a more general type error improvement sweep would be welcome. I could pinpoint a particular type error if you liked (such as the one that prompted this email), but there are general UX improvements I would like to undertake.<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></p><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">On Fri, Mar 4, 2016 at 4:25 AM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank" style="color: purple; text-decoration: underline; ">simonpj@microsoft.com</a>> wrote:<o:p></o:p></p><blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0cm 0cm 0cm 6pt; margin-left: 4.8pt; margin-right: 0cm; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; ">Christopher</span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "> </span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; ">Improving error message is an excellent goal, and one that I have spent more hours on than I care to tell you.</span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "> </span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; ">If you have a particular one in mind, could you open a Trac ticket with a particular reproducible test case, the error message you get, and the error message you’d like to get.</span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "><br>Thanks</span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "> </span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; ">Simon</span><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-family: Calibri, sans-serif; "> </span><o:p></o:p></div><div style="border-style: none none none solid; border-left-width: 1.5pt; border-left-color: blue; padding: 0cm 0cm 0cm 4pt; "><div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 11pt; font-family: Calibri, sans-serif; "><span class="Apple-converted-space"> </span>ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank" style="color: purple; text-decoration: underline; ">ghc-devs-bounces@haskell.org</a>]<span class="Apple-converted-space"> </span><b>On Behalf Of<span class="Apple-converted-space"> </span></b>Christopher Allen<br><b>Sent:</b><span class="Apple-converted-space"> </span>03 March 2016 07:55<br><b>To:</b><span class="Apple-converted-space"> </span><a href="mailto:ghc-devs@haskell.org" target="_blank" style="color: purple; text-decoration: underline; ">ghc-devs@haskell.org</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Specialized type hints</span><o:p></o:p></div></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">I'd like to see how warm people would be to catching GHC's type error quality up a bit.<o:p></o:p></p><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">I did a write-up on a confusion a reader of our book had:<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><a href="https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgist.github.com%2fbitemyapp%2fc27c721b92dab0248433&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c64d227da349847f85fe308d343391dbb%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=EtjujRikMvoUN%2fBq6RtOrotsPdXdvZggnMU3Cu2BypE%3d" target="_blank" style="color: purple; text-decoration: underline; ">https://gist.github.com/bitemyapp/c27c721b92dab0248433</a> <br clear="all"><o:p></o:p></p><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">This is not new. A lot of people complain about this particular type error in particular when they say GHC has bad type errors. I don't think GHC's type errors are bad, but I do think they could be improved and this particular issue has an unfortunate source to sink distance.<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">I would rather type error improvements not be buried behind a "silly beginners only" flag and that they just be part of improving the UX for everyone. With that proviso, how likely would specialized type error hints and some general error message fix ups be regarded?<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">By specialized I mean, "detect that they tried to find an instance of Num for (-> something something) and suggest that they did the wrong thing, with possible fixes: X Y Z". Ideally before the "hey do you want FlexibleContexts?!" thing fires.<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">I do not think I am capable of doing this, but being able to zoom in, clang style, to the expression where they are (probably accidentally) using a function like a Num or a Num like a function would be pretty valuable so they don't have to guess-n-check parenthesize their code.<o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; "> <o:p></o:p></p></div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">--<o:p></o:p></p><div><p class="MsoNormal" style="margin: 0cm 0cm 6pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Chris Allen<o:p></o:p></p></div></div></div></div></div></blockquote></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><br><br clear="all"><o:p></o:p></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">--<o:p></o:p></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; ">Chris Allen<o:p></o:p></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9.5pt; ">Currently working on </span><a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fhaskellbook.com&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c757f72d364664cd81b8508d344497063%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=EaRmV%2bS3%2f1vgr6klNmr0gM89ofO7CP2%2b7h12bJ%2bJwi8%3d" target="_blank" style="color: purple; text-decoration: underline; ">http://haskellbook.com</a><o:p></o:p></div></div></div></div></div></div>_______________________________________________<br>ghc-devs mailing list<br><a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</div></blockquote></div><br></body></html>