Ticket #567 (new enhancement)

Opened 4 years ago

Last modified 4 years ago

Allow negation of language extension names by adding/removing "No" in front

Reported by: SamB Owned by:
Priority: normal Milestone:
Component: Cabal library Version: 1.6.0.1
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: Platform:

Description

GHC supports this, and it could be useful when features are added or removed from the baseline Haskell -- say, record syntax?

Change History

Changed 4 years ago by duncan

Specifically how about:

data Extension =
  ...
  {- all the existing extensions -}
  ...
  Negated Extension

and add a function:

negateExtension :: Extension -> Extension
negateExtension (Negated e) = e
negateExtension          e  = Negated e

and extend the parser and pretty printer. Specifically, all extensions are to be negated syntactically by adding a 'No' prefix, or if it already begins with 'No' then removing the prefix.

This is also related to the proposal to remove the 'NoMonoPatBinds?' extension and add an extension 'MonoPatBinds?'. It's not immediately clear if it affects it positively or negatively.

Note: See TracTickets for help on using tickets.