
seeing aexp -> qvar (variable) | gcon (general constructor) ... | qcon { fbind1 … fbindn } (labeled construction) | aexp { fbind1 … fbindn } (labelled update) and https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-220003 I realise that the update requires at least one field binding whereas for a construction "C {}" (n = 0) could be used. ("C {}" makes sense for patterns!) And due to the meta-rule a labelled update is not possible for a lambda abstraction, let expression, or conditional (as aexp), but it is for case (and do if the record type happens to be a monad). So a further less obvious example is: case e of p -> r { f = v } that will be parsed as: (case e of p -> r) { f = v } (I'm sure the grammar could be fully disambiguated, but this would not improve readability. Preferring shift over reduce is common and fine for such cases.) Cheers Christian Am 12.07.2016 um 10:36 schrieb Simon Peyton Jones via Glasgow-haskell-users:
I've added record construction and update to the syntax, which makes it clearer how the other constructs are analogous to them.
Simon
| -----Original Message----- | From: Glasgow-haskell-users [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Akio Takano | Sent: 11 July 2016 03:24 | To: glasgow-haskell-users@haskell.org | Subject: ArgumentDo proposal updated | | Hi glasgow-haskell-users, | | Thank you for all the feedback to the ArgumentDo proposal. Following | the discussion, I made changes to the proposal and updated the wiki | page [0]. | | Now the proposed grammar is greatly simplified: it doesn't add a new | non-terminal anymore, indeed it removes one instead. The proposed set | of accepted programs remains unchanged. | | I hope the this update addresses one major concern that was raised in | the previous discussion. | | Any feedback is appreciated. | | Regards, | Takano Akio | | [0]: https://ghc.haskell.org/trac/ghc/wiki/ArgumentDo | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h | askell.org%2fcgi-bin%2fmailman%2flistinfo%2fglasgow-haskell- | users&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c4ef11cd0d5d041 | 3ac28108d3a9327fd1%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=flpo46 | T9CWuGH8ndJY3roC44iubY7U8xeYWkJ2J8Img%3d _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users