
#8057: Warn when supplying version number to package-qualified import -------------------------------------+------------------------------------- Reporter: Lemming | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * component: GHCi => Compiler Old description:
Imports with explicit package names and versions would be nice to have in GHCi, because you cannot use the -package and -hide-package options from within GHCi. This is what currently happens: {{{ $ ghci-7.6.3 -XPackageImports GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> import Control.Monad.Trans.List
<no location info>: Ambiguous module name `Control.Monad.Trans.List': it was found in multiple packages: transformers-0.3.0.0 List-0.5.1 Prelude> import "transformers-0.3.0.0" Control.Monad.Trans.List
<no location info>: Could not find module `Control.Monad.Trans.List' It is not a module in the current program, or in any known package. Prelude> :q Leaving GHCi. $ ghci-7.6.3 -hide-package List GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude> import Control.Monad.Trans.List Prelude Control.Monad.Trans.List> }}}
However, I now see that the import with explicit package name works, if I omit the package version. I think GHCi should at least warn that providing a version does not work.
See also #2362
New description: {{{ $ ghci -XPackageImports GHCi, version 7.8.3: ... Prelude> import "transformers-0.3.0.0" Control.Monad.Trans.List <no location info>: Could not find module ‘Control.Monad.Trans.List’ It is not a module in the current program, or in any known package. Prelude> import "transformers" Control.Monad.Trans.List Prelude Control.Monad.Trans.List> }}} The import with explicit package name works, if I omit the package version. I think GHC should at least warn that providing a version does not work. See also #2362. -- Comment: Changed the description, because it's not a GHCi only problem. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8057#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler