It is also possible to refer to a package explicitly durring import with the PackageImports language pragma.  You can read about it in the ghc manual[1].

Patrick

[1] http://www.haskell.org/ghc/docs/7.2.1/html/users_guide/syntax-extns.html#package-imports

On Fri, Apr 26, 2013 at 10:10 PM, Hong Yang <hyangfji@gmail.com> wrote:
Thanks.


On Fri, Apr 26, 2013 at 8:33 AM, Brandon Allbery <allbery.b@gmail.com> wrote:
On Thu, Apr 25, 2013 at 11:12 PM, Hong Yang <hyangfji@gmail.com> wrote:
There are two modules called the same name: System.IO.Strict, documented respectively at
    http://hackage.haskell.org/packages/archive/strict-io/0.2.1/doc/html/System-IO-Strict.html
    http://hackage.haskell.org/package/strict-0.3.2
 
My questions are:

1)    Will these two modules coexist in the same version of GHC? Or put it another way, both modules' .tar.gz files have System/IO/Strict.hs inside, will they overlap in physical disk? From where can I tell which locations they will be installed to?

Each module gets its own directory tree under /usr/lib/ghc or ~/.ghc.
 
2)    If yes, which module will "import System.IO.Strict" actually use?

This is a bit harder; it will try to pick one, but I don't know the rules. Ultimately it's best to use -package parameters to tell it which package to take it from.

This is where building with cabal-install helps, as you specify the package to use in the manifest and only the packages listed in the manifest will be visible to ghc.
 
--
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners



_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners




--
Patrick Wheeler
Patrick.John.Wheeler@gmail.com
Patrick.J.Wheeler@rice.edu
Patrick.Wheeler@colorado.edu