<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.Code, li.Code, div.Code
        {mso-style-name:Code;
        mso-style-link:"Code Char";
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Courier New";
        color:#1F497D;}
span.CodeChar
        {mso-style-name:"Code Char";
        mso-style-link:Code;
        font-family:"Courier New";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
.MsoPapDefault
        {mso-style-type:export-only;
        margin-top:6.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">On this thread, a representative collection of *<b>reproducible</b>
<b>examples</b>* with the actual error message and the desired one, would be tremendously helpful.  Lacking that, it’s hard to know where to begin.   (Creating the examples takes a bit of work, I know.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Start a wiki page!  Stuff in email threads gets lost<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ghc-devs [mailto:ghc-devs-bounces@haskell.org]
<b>On Behalf Of </b>Christopher Allen<br>
<b>Sent:</b> 19 June 2015 04:27<br>
<b>To:</b> Ömer Sinan Ağacan<br>
<b>Cc:</b> ghc-devs<br>
<b>Subject:</b> Re: expanding type synonyms in error messages<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Just to add my own +1, having this when working with streaming libraries (I've needed it less with lens, oddly) would be a tremendous help for people learning them I think. I think I've run into the same thing as Kostiantyn in the past.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On Thu, Jun 18, 2015 at 9:42 PM, Ömer Sinan Ağacan <<a href="mailto:omeragacan@gmail.com" target="_blank">omeragacan@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
It's good to see that I'm not the only one who wants this. I'm doing<br>
some GHC hacking nowadays and I'll give it a try.<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
2015-06-18 4:41 GMT-04:00 Kostiantyn Rybnikov <<a href="mailto:k-bx@k-bx.com">k-bx@k-bx.com</a>>:<br>
> I wanted to add that synonym expansion would be especially helpful in<br>
> error-messages like:<br>
><br>
> Expected type: <non-expanded, small type, like "Producer a m ()"><br>
> Actual type: <your type, like "Proxy a a' b b' m v"><br>
><br>
> I would be glad if we could have an expansions enabling flag in GHC, and<br>
> could consider turning it on by default if it will look good for that.<br>
><br>
> 16 черв. 2015 22:44 "Richard Eisenberg" <<a href="mailto:eir@cis.upenn.edu">eir@cis.upenn.edu</a>> пише:<br>
><br>
>> GHC tries hard to preserve type synonyms where possible, but of course, it<br>
>> can't preserve all of them. The general rule it tries to follow is: preserve<br>
>> vanilla type synonyms; expand type families. This is true both in expected<br>
>> types and actual types.<br>
>> If you have a case where you believe that GHC could preserve a type<br>
>> synonym in an expected type, submit a bug report. (Note that constraint<br>
>> synonyms are particularly hard to preserve!)<br>
>><br>
>> It would be very easy to report both the synonym-preserving form and the<br>
>> expanded form in an error report, at the cost of making error reports even<br>
>> more verbose. You're welcome to submit a feature request, and this would<br>
>> likely make a good first patch to GHC if you want to get your hands dirty.<br>
>> I'd personally prefer the feature to be protected behind a flag (to avoid<br>
>> seeing that `String` expands to `[Char]` everywhere, for example), but<br>
>> others may feel differently here.<br>
>><br>
>> Richard<br>
>><br>
>> On Jun 16, 2015, at 11:20 AM, Ömer Sinan Ağacan <<a href="mailto:omeragacan@gmail.com">omeragacan@gmail.com</a>><br>
>> wrote:<br>
>><br>
>> > Hi all,<br>
>> ><br>
>> > While working with complex types with lots of arguments etc. errors are<br>
>> > becoming annoying very fast. For example, GHC prints errors in this way:<br>
>> ><br>
>> >    Expected type: <type without any synonyms><br>
>> >      Actual type: <type with synonyms><br>
>> ><br>
>> > Now I have to expand that synonym in my head to understand the error.<br>
>> ><br>
>> > I was wondering if implementing something like this is possible:<br>
>> ><br>
>> > In type error messages, GHC also prints types that are cleaned from type<br>
>> > synonyms. Maybe something like this:<br>
>> ><br>
>> >         Expected type: <type1><br>
>> >    (without synonyms): <type1, synonyms are expanded><br>
>> >           Actual type: <type2><br>
>> >    (without synonyms): <type2, synonyms are expanded><br>
>> ><br>
>> > If this is not always desirable for some reason, we can hide this<br>
>> > behavior<br>
>> > behind a flag.<br>
>> ><br>
>> > What do GHC devs think about this? Is this, in theory, possible to do?<br>
>> > How hard<br>
>> > would it be to implement this?<br>
>> ><br>
>> > Thanks.<br>
>> > _______________________________________________<br>
>> > ghc-devs mailing list<br>
>> > <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
>> > <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
>><br>
>> _______________________________________________<br>
>> ghc-devs mailing list<br>
>> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<o:p> </o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Chris Allen<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<span style="font-size:9.5pt">Currently working on </span><a href="http://haskellbook.com" target="_blank">http://haskellbook.com</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>