[ghc-steering-committee] #541: WARNING pragma with category, Recommendation: accept

Joachim Breitner mail at joachim-breitner.de
Tue Nov 29 16:14:18 UTC 2022


Hi,

Am Dienstag, dem 29.11.2022 um 10:14 +0000 schrieb Simon Marlow:
> I'd like to see the pragma be `{-# WARNING [partial] head #-}`
> without the `x-` prefix, because 
> 1. I'm not in favour of compulsory (and therefore redundant) extra
> syntax
> 2. I don't think there would be much confusion about which flag to
> use, because the flag is literally included in the warning/error
> message from the compiler. 

looks like we are generally in favor of this proposal, while this
particular shed’s wall color causes discussion.

Arnaud suggested to use the namespace’d name of the category in both
the flags and the pragma  (i.e. [x-partial], [deprecations], to match
-Werror=x-partial, -Werror=deprecations), which resonated with Adam,
Richard and me.

Simon PS was, however, baffled by this and Simon M voices a preference
to only allow custom categories, without the the prefix, in pragmas
([partial]) to reduce noise and redundancy.

Happy to hear more voices and accept with whatever the majority of
voices said they’d prefer (without formal votes, doesn’t seem to be
worth it), assuming nobody thinks either way is a showstopper.


Minor point: Note that it’s not compulsory: The proposal (as it stands)
does allow {-# WARNING [deprecations] -#}, which corresponds to, say, 
-Werror=deprecations, _not_ -Werror=x-deprecations. 

If we’d do away with the explicit x- prefix in pragmas and add it
implicitly, we should probably change Point 3 of the proposed change
specification to not say that a pragma without category is treated like
{-# WARNING [deprecations] #-}, but simply state that it’s then
controlled by the (built-in, non x-’ed) “deprecations” category, even
if the same effect cannot be achieved syntactically with an explicit
category.


Cheers,
Joachim

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



More information about the ghc-steering-committee mailing list