#2452: Add a flag to disable the implicit qualified import of every available
module in interactive mode
--------------------------------+-------------------------------------------
    Reporter:  jcpetruzza       |       Owner:                         
        Type:  feature request  |      Status:  new                    
    Priority:  normal           |   Component:  Compiler (Type checker)
     Version:  6.9              |    Severity:  minor                  
    Keywords:                   |    Testcase:                         
Architecture:  Unknown          |          Os:  Unknown                
--------------------------------+-------------------------------------------
 In interactive mode every available module is implicitly imported
 qualified. While this is very convenient when working with GHCi, it can be
 a little annoying in other contexts.

 For instance, in a lambdabot-like application, one would like to rely on
 the type of a given expression to decide if it is side-effect free and,
 thus, safe to execute. However, because every module in the `base` package
 is imported qualified one has to do a manual check to filter out cases
 like:

 {{{
 ghc -e 'System.IO.Unsafe.unsafePerformIO (evilStuff >> return "i'm an
 innocent string")'
 }}}

 Another example would be a GHC-API based refactoring tool that wants to
 check if a refactored expression typechecks before modifying the code. If
 every module is imported qualified, the tool might get many false
 positives.

 The proposal is to keep the current behaviour as the default but to add a
 `-fno-implicit-import-qualified` flag to disable it when needed. The
 following should fail to execute:

 {{{
 ghc -fno-implicit-import-qualified -e 'System.IO.Unsafe.unsafePerformIO
 (evilStuff >> return "i'm an innocent string")'
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2452>
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