On Thu, Jun 4, 2015 at 10:30 PM, Edward Z. Yang <[email protected]> wrote:

> Excerpts from Brandon Allbery's message of 2015-06-04 13:06:52 -0700:
> > Looks to me like it's confused about whether a ~ is part of an equality
> > constraint or is a laziness annotation. The former would be illegal at
> that
> > point, though, I'd think? Somewhere it believes a constraint might be
> > possible there, via btype.
> >
> > As ezyang says in the message I see just came in, you'll need extra
> > production rules to distinguish that top level. Although I'd wonder why
> it
> > believes an equality constraint is acceptable there in the first place;
> is
> > that a lurking bug in the parser?
>
> In general, the parser is more liberal than is actually required; we
> can give better error messages this way.
>
> Second, here is where it's ambiguous:
>
>     T a ~b
>
> where T is a TyCon.  Does this parse as
>
>     T a (~b)
>
> or
>
>     T a ~ b
>
> Parser doesn't currently distinguish these cases.
>

I guess we should parse it as T a (~b), just as we have unary minus bind
"tighter" with the following token.


>
> Edward
> _______________________________________________
> ghc-devs mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
_______________________________________________
ghc-devs mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to