<div dir="auto"><div>What about introducing -fno-warn-pragma=XXX? People who use HLint will add -fno-warn-pragma=HLINT to their build configuration.<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 16, 2018, 20:51 Ben Gamari <<a href="mailto:ben@smart-cactus.org">ben@smart-cactus.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
<br>
Recently Neil Mitchell opened a pull request [1] proposing a single-line<br>
change: Adding `{-# HLINT ... #-}` to the list of pragmas ignored by the<br>
lexer. I'm a bit skeptical of this idea. Afterall, adding cases to the<br>
lexer for every tool that wants a pragma seems quite unsustainable.<br>
<br>
On the other hand, a reasonable counter-argument could be made on the<br>
basis of the Haskell Report, which specifically says that<br>
implementations should ignore unrecognized pragmas. If GHC did this<br>
(instead of warning, as it now does) then this wouldn't be a problem.<br>
<br>
Of course, silently ignoring mis-typed pragmas sounds terrible from a<br>
usability perspective. For this reason I proposed that the following<br>
happen:<br>
<br>
* The `{-# ... #-}` syntax be reserved in particular for compilers (it<br>
largely already is; the Report defines it as "compiler pragma"<br>
syntax). The next Report should also allow implementations to warn in<br>
the case of unrecognized pragmas.<br>
<br>
* We introduce a "tool pragma" convention (perhaps even standardized in<br>
the next Report). For this we can follow the model of Liquid Haskell:<br>
`{-@ $TOOL_NAME ... @-}`.<br>
<br>
Does this sound sensible?<br>
<br>
Cheers,<br>
<br>
- Ben<br>
<br>
<br>
[1] <a href="https://github.com/ghc/ghc/pull/204" rel="noreferrer noreferrer" target="_blank">https://github.com/ghc/ghc/pull/204</a><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank" rel="noreferrer">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div></div></div>