#2640: Treat -X flags consistently in GHCi
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                  
        Type:  feature request   |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  6.8.3           
    Severity:  normal            |    Keywords:                  
  Difficulty:  Unknown           |    Testcase:                  
Architecture:  Unknown/Multiple  |          Os:  Unknown/Multiple
---------------------------------+------------------------------------------
 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 `:set` command.

 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
 `-XExtendedDefaultRules` is set for GHCi.
  * Command-line flags are applied to both flag-sets.
  * The `:set` command affects both flag-sets
  * Add a new `:set-local` command 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.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2640>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to