<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.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle20
        {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">Let me urge you, once again, to consult users.  I really do not want to implement a feature that (thus far) lacks a single enthusiastic
 user.  Please.<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""> Alan & Kim Zimmerman [mailto:alan.zimm@gmail.com]
<br>
<b>Sent:</b> 01 October 2014 16:13<br>
<b>To:</b> Simon Peyton Jones<br>
<b>Cc:</b> Richard Eisenberg; Edward Z. Yang; ghc-devs@haskell.org<br>
<b>Subject:</b> Re: Feedback request for #9628 AST Annotations<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><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:12.0pt;margin-left:0cm">
I have put up a new diff at <a href="https://phabricator.haskell.org/D297">https://phabricator.haskell.org/D297</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
It is just a proof of concept at this point, to check if the approach is acceptable.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
This is much less intrusive, and only affects the lexer/parser, in what should be a transparent way.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
The new module ApiAnnotation was introduced because it needs to be imported by Lexer.x, and I was worried about another circular import cycle. It does also allow the annotations to be defined in a self-contained way,  which can then easily be used by other
 external projects such as ghc-parser.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
If there is consensus that this will not break anything else, I would like to go ahead and add the rest of the annotations.<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">
Regards<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">
  Alan<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 Tue, Sep 30, 2014 at 11:19 AM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.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">
I'm anxious about it being too big a change too.<br>
<br>
I'd be up for it if we had several "customers" all saying "yes, this is precisely what we need to make our usage of the GHC API far far easier".  With enough detail so we can understand their use-case.<br>
<br>
Otherwise I worry that we might go to a lot of effort to solve the wrong problem; or to build a solution that does not, in the end, work for the actual use-case.<br>
<br>
Another way to tackle this would be to ensure that syntax tree nodes have a "node-key" (a bit like their source location) that clients could use in a finite map, to map node-key to values of their choice.<br>
<br>
I have not reviewed your patch in detail, but it's uncomfortable that the 'l' parameter gets into IfGblEnv and DsM.  That doesn't smell right.<br>
<br>
Ditto DynFlags/HscEnv, though I think here that you are right that the "hooks" interface is very crucial.  After all, the WHOLE POINT is too make the client interface more flexible. I would consult Luite and Edsko, who were instrumental in designing the new
 hooks interface<br>
        <a href="https://ghc.haskell.org/trac/ghc/wiki/Ghc/Hooks" target="_blank">
https://ghc.haskell.org/trac/ghc/wiki/Ghc/Hooks</a><br>
(I'm not sure if that page is up to date, but I hope so)<br>
<br>
A good way to proceed might be to identify some of the big users of the GHC API (I'm sure I don't know them all), discuss with them what would help them, and share the results on a wiki page.<br>
<span style="color:#888888"><br>
<span class="hoenzb">Simon</span></span><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>
|  -----Original Message-----<br>
|  From: ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org">ghc-devs-bounces@haskell.org</a>] On Behalf Of<br>
|  Richard Eisenberg<br>
|  Sent: 30 September 2014 03:04<br>
|  To: Edward Z. Yang<br>
|  Cc: <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
|  Subject: Re: Feedback request for #9628 AST Annotations<br>
|<br>
|  I'm only speaking up because Alan is specifically requesting feedback:<br>
|  I'm really ambivalent about this. I agree with Edward that this is a<br>
|  big change and adds permanent noise in a lot of places. But, I also<br>
|  really respect the goal here -- better tool support. Is it worthwhile<br>
|  to do this using a dynamically typed bit (using Typeable and such),<br>
|  which would avoid the noise? Maybe.<br>
|<br>
|  What do other languages do? Do we know what, say, Agda does to get<br>
|  such tight coupling with an editor? Does, say, Eclipse have such a<br>
|  chummy relationship with a Java compiler to do its refactoring, or is<br>
|  that separately implemented? Haskell/GHC is not the first project to<br>
|  have this problem, and there's plenty of solutions out there. And,<br>
|  unlike most other times, I don't think Haskell is exceptional in this<br>
|  regard (there's nothing very special about Haskell's AST, maybe beyond<br>
|  indentation-awareness), so we can probably adopt other solutions<br>
|  nicely.<br>
|<br>
|  Richard<br>
|<br>
|  On Sep 29, 2014, at 8:58 PM, "Edward Z. Yang" <<a href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>> wrote:<br>
|<br>
|  > Excerpts from Alan & Kim Zimmerman's message of 2014-09-29 13:38:45<br>
|  -0700:<br>
|  >> 1. Is this change too big, should I scale it back to just update<br>
|  the<br>
|  >>   HsSyn structures and then lock it down to Located SrcSpan for all<br>
|  >>   the rest?<br>
|  ><br>
|  > I don't claim to speak for the rest of the GHC developers, but I<br>
|  think<br>
|  > this change is too big.  I am almost tempted to say that we<br>
|  shouldn't<br>
|  > add the type parameter at all, and do something else (maybe Backpack<br>
|  > can let us extend SrcSpan in a modular way, or even use a<br>
|  dynamically<br>
|  > typed map for annotations.)<br>
|  ><br>
|  > Edward<br>
|  > _______________________________________________<br>
|  > ghc-devs mailing list<br>
|  > <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
|  > <a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/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://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/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://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/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">
<o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>