Treat -X flags consistently in GHCi
Currently GHCi treats -X language extension flags as follows: the -X extension applies to both code typed to the GHCi prompt, and to modules loaded by GHCi. This happens whether the -X flag is given on the command line when invoking GHCi, or in a
But there is one exception! The
-XExtendedDefaultRules flag applies only to modules loaded by GHCi. For code typed at the GHCi prompt, the
-XExtendedDefaultRules flag is always on, and cannot be switched off. This is (a) inconsistent and (b) awkward if you want to switch it off.
Talking to Simon, the Right Thing seems to be to this:
- GHCi should maintain two sets of flag settings: one for the GHCi prompt, and one for loaded modules
- The two flat-sets are initialised identical, except that
-XExtendedDefaultRulesis set for GHCi.
- Command-line flags are applied to both flag-sets.
:setcommand affects both flag-sets
- Add a new
:set-localcommand to affect the GHCi prompt flag-set only.
- (It's probably not worth a command that affects only the loaded modules.)
It's not clear how urgent this is. Add yourself to cc list if you care, and add a comment.