<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 4, 2015 at 10:30 PM, Edward Z. Yang <span dir="ltr"><<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Excerpts from Brandon Allbery's message of 2015-06-04 13:06:52 -0700:<br>
<span class="">> Looks to me like it's confused about whether a ~ is part of an equality<br>
> constraint or is a laziness annotation. The former would be illegal at that<br>
> point, though, I'd think? Somewhere it believes a constraint might be<br>
> possible there, via btype.<br>
><br>
> As ezyang says in the message I see just came in, you'll need extra<br>
> production rules to distinguish that top level. Although I'd wonder why it<br>
> believes an equality constraint is acceptable there in the first place; is<br>
> that a lurking bug in the parser?<br>
<br>
</span>In general, the parser is more liberal than is actually required; we<br>
can give better error messages this way.<br>
<br>
Second, here is where it's ambiguous:<br>
<br>
    T a ~b<br>
<br>
where T is a TyCon.  Does this parse as<br>
<br>
    T a (~b)<br>
<br>
or<br>
<br>
    T a ~ b<br>
<br>
Parser doesn't currently distinguish these cases.<br></blockquote><div><br></div><div>I guess we should parse it as T a (~b), just as we have unary minus bind "tighter" with the following token.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div><br></div></div>