Not all GHC flags called dynamic are really dynamic
Not all GHC flags called
dynamic are really dynamic!
GHC currently has 2 kinds of flags:
Mode: A mode may be used on the command line only. You can pass only one mode flag.
Dynamic: A dynamic flag may be used on the command line, in a
OPTIONS_GHCpragma in a source file, or in a
:setcommand in GHCi.
However, GHC has some dynamic flags that are not so dynamic:
- They can only be set at startup.
- They can be combined with other mode or dynamic flags.
- But they can't change after GHC(i) has started..
Ticket #19299 (closed) shows two examples,
We need a third category of GHC(i) flags, called
static. A static flag
- can only be set before startup from the command line.
- can't be set per module with a
- can't be changed with a GHCi
:setcommand during a GHCi session.
- There can be several of static flags on the command line.
Currently if you (re)set such a static option in GHCi or in a
OPTIONS_GHC pragma, you either get an error message, or the setting is silently ignored.
GHC(i) should reject these
static flags in a GHCi
:set command or in a
PS: This ticket is a replacement for #19299 (closed)