[ghc-steering-committee] Modifiers (Was: #512: NoFieldSelectors as datatype annotation)

Joachim Breitner mail at joachim-breitner.de
Thu Dec 15 09:43:12 UTC 2022


Hi Richard,

thanks, comparing Modifiers to the annotations and attributes in other
languages indeed puts this into a perspective that makes more sense to
me. It seems I have assumed a broader scope for modifiers (maybe
because “modify” sounds much stronger than “annotate” or
“attribut…ize”). So I conclude the goal is not to necessarily to remove
_all_ kind of  pragmas, but only maybe those that fit the pattern (e.g.
don’t affect parsing and renaming). Is that right?

So my straw man “could qualified imports be modifiers” is simply out of
scope (heh).

Especially the potential use case for plugins (which do benefit from an
extensible, namespaced scheme that does not require changes to parsing)
– essentially a variant of the ANN pragma – is convincing.

Turning back to NoFieldSelectors, however, I notice that
NoFieldSelectors _does_ affect renaming already, because it affects
whether a symbol with the field’s name is in scope (which, in
particular, has further effects with implicit binders etc…), doesn't
it? So would modifiers, if we had them, even work here?


Cheers,
Joachim
-- 
Joachim Breitner
  mail at joachim-breitner.de
  http://www.joachim-breitner.de/



More information about the ghc-steering-committee mailing list