<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 18 May 2018 at 16:13, 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 link="blue" vlink="purple" lang="EN-GB">
<div class="m_5727447764977688943WordSection1"><span></span>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>We can’t make the result type depend on DynFlags! (Yet)(</span></p>
<p class="m_5727447764977688943Code" style="margin-left:0cm"><b><span>    parser :: DynFlags -> String
</span></b></p>
<p class="m_5727447764977688943Code"><b><span>  -> HsSyn (GhcPass (Parsed (if …
</span></b></p>
<p class="m_5727447764977688943Code"><b><span>                            <wbr>then WithApiAnnotations</span></b></p>
<p class="m_5727447764977688943Code"><b><span>                            else WihoutsApiAnnotations)</span></b></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span></span></p></div></div></blockquote><div><br></div>We could conceptually have</div><div class="gmail_quote"><br></div><div class="gmail_quote">  parser :: DynFlags -> String -> Either (HsSyn (Parsed WithApiAnnotations)) (HsSyn (Parsed NoApiAnnotations))</div><div class="gmail_quote"><br></div><div class="gmail_quote">The main point is that the next phase can make use of either of the variants.</div><div class="gmail_quote"><br></div><div class="gmail_quote">And it may be simplest to just always use the annotations, the ParsedSource is normally discarded after renaming anyway.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Alan<br></div></div></div>