StrictData and the parser

Johan Tibell johan.tibell at gmail.com
Thu Jun 4 23:52:30 UTC 2015


On Thu, Jun 4, 2015 at 10:30 PM, Edward Z. Yang <ezyang at mit.edu> 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
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150605/e2cf4e88/attachment.html>


More information about the ghc-devs mailing list