Hey all,
ChickenProp has been working on implementing the modifiers proposal (#
370), and has fixed some mistakes and omissions (
https://github.com/ghc-proposals/ghc-proposals/pull/681)
I had some initial concerns and requested clarification, which has now been addressed.
My recommendation is that we
accept.
Here's a summary provided by ChickenProp:
* ';' is now allowed in between modifiers attached to decls, and required before the decl. So
%One %Two ; data F -- previously allowed, still allowed
%One %Two data F -- previously allowed
, now forbidden
%One ; %Two ; data F -- previously forbidden, now allowed
%One ; %Two data F -- previously forbidden, still forbidden
Initially, I made the one before the decl required for parsing reasons. I couldn't figure out how to have all of: optional pre-decl semicolon; modifiers attached to expressions; expressions can appear at the top level. (I was getting shift/reduce or reduce/reduce conflicts in the parser.) Since there are no longer modifiers attached to expressions, it could be optional again. But in case we want modifiers on expressions in future, we might want to keep our options open.
* No modifiers attached to types or expressions.
* `-Wunrecognized-modifiers`, not `-Wunknown-modifiers`. Specify that it's enabled by default.
* `-XLinearTypes -XNoModifiers` introduces backwards compatible behavior.
* Add non-normative discussion of RN versus TC modifiers.
* In the linear-types proposal, update the examples of modifiers attached to lambda-bound variables. I think the examples now match the BNF given. Also, the line "the `lpat` must be a bare variable" was contradicted by syntax elsewhere in the proposal, so remove that.