GHCi ignores cmd line flags XMonomorphismRestr.. XNoExtendedDef..#10857
GHCi maintains two sets of options:
- The
loading options
apply when loading modules - The
interactive options
apply when evaluating expressions and commands typed at the GHCi prompt.
The loading options are mostly created in ghc/Main.hs:main'
from the command line flags and from config files.
In the function ghc/GHCi/UI.hs:interactiveUI
the loading options are copied to the interactive options.
These interactive options (but not the loading options!) are supplemented unconditionally by setting ExtendedDefaultRules ON and MonomorphismRestriction OFF. The unconditional setting of these options eventually overwrite settings already specified at the command line.
Therefore instead of unconditionally setting ExtendedDefaultRules and MonomorphismRestriction for the interactive options, we first check, whether they were not already set before.
Note this is a copy of Phab:D5554.