Treatment of unknown pragmas

Boespflug, Mathieu m at tweag.io
Tue Oct 16 20:25:57 UTC 2018


> >  I'm a bit skeptical of this idea. Afterall, adding cases to the
> > lexer for every tool that wants a pragma seems quite unsustainable.
>
> I don't find this argument that convincing. Given the list already
> includes CATCH and DERIVE, the bar can't have been _that_ high to
> entry. And yet, the list remains pretty short. My guess is the demand
> is pretty low - we're just whitelisting a handful of additional words
> that aren't misspellings.

I agree. GHC presumably gives warnings for most names because most
possible pragma names really are misspellings of what the user
intended to say. Some select few pragma names are likely *not*
misspellings (like CATCH, DERIVE, HLINT, etc), so there the policy is
reversed. Common usage is what tells us is likely a misspelling vs
not. Simply tracking the common usage is the pragmatic choice.


More information about the ghc-devs mailing list