Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 625
    • Merge requests 625
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2452
Closed
Open
Issue created Jul 18, 2008 by Daniel Gorín@jcpetruzzaReporter

Add a flag to disable the implicit qualified import of every available module in interactive mode

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")'
Trac metadata
Trac field Value
Version 6.9
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking