X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fpackages.xml;h=621747f33d0cd42fffe7ce236a8dbb43cfc5ce9b;hb=23c11847ac06735217d778e4e78d527ca0d55649;hp=7c934a2f45f77eaa93976f7a59efa83ac8a78fbd;hpb=6dcff14bc5a7b394cf77f98b369d6f93c030cb36;p=ghc-hetmet.git diff --git a/docs/users_guide/packages.xml b/docs/users_guide/packages.xml index 7c934a2..621747f 100644 --- a/docs/users_guide/packages.xml +++ b/docs/users_guide/packages.xml @@ -5,9 +5,12 @@ Packages packages - A package is a library of Haskell modules known to the compiler. GHC - comes with several packages: see the accompanying - library documentation. + A package is a library of Haskell modules known to the + compiler. GHC comes with several packages: see the accompanying + library + documentation. More packages to install can be obtained + from HackageDB. Using a package couldn't be simpler: if you're using or GHCi, then most of the installed packages will be @@ -30,15 +33,41 @@ Packages packages using - GHC only knows about packages that are installed. + GHC only knows about packages that are + installed. To see which packages are installed, use + the ghc-pkg command: + + +$ ghc-pkg list +/usr/lib/ghc-6.4/package.conf: + base-1.0, haskell98-1.0, template-haskell-1.0, mtl-1.0, unix-1.0, + Cabal-1.0, haskell-src-1.0, parsec-1.0, network-1.0, + QuickCheck-1.0, HUnit-1.1, fgl-1.0, X11-1.1, HGL-3.1, OpenGL-2.0, + GLUT-2.0, stm-1.0, readline-1.0, (lang-1.0), (concurrent-1.0), + (posix-1.0), (util-1.0), (data-1.0), (text-1.0), (net-1.0), + (hssource-1.0), rts-1.0 + An installed package is either exposed or hidden - by default. Command-line flags, described below, allow you to expose a hidden package + by default. Packages hidden by default are listed in + parentheses (eg. (lang-1.0)) in the output above. Command-line flags, described below, allow you to expose a hidden package or hide an exposed one. Only modules from exposed packages may be imported by your Haskell code; if you try to import a module from a hidden package, GHC will emit an error message. + To see which modules are provided by a package use the + ghc-pkg command (see ): + + +$ ghc-pkg field network exposed-modules +exposed-modules: Network.BSD, + Network.CGI, + Network.Socket, + Network.URI, + Network + + The GHC command line options that control packages are: @@ -163,47 +192,6 @@ Packages - - - To see which packages are installed, use the - ghc-pkg command: - - -$ ghc-pkg list -/usr/lib/ghc-6.4/package.conf: - base-1.0, haskell98-1.0, template-haskell-1.0, mtl-1.0, unix-1.0, - Cabal-1.0, haskell-src-1.0, parsec-1.0, network-1.0, - QuickCheck-1.0, HUnit-1.1, fgl-1.0, X11-1.1, HGL-3.1, OpenGL-2.0, - GLUT-2.0, stm-1.0, readline-1.0, (lang-1.0), (concurrent-1.0), - (posix-1.0), (util-1.0), (data-1.0), (text-1.0), (net-1.0), - (hssource-1.0), rts-1.0 - - - Packages hidden by default are listed in - parentheses (eg. (lang-1.0)) in the output above. - To expose a package which is hidden by - default, use the - flag (see above). - - When a package is exposed, it makes available for import the exposed modules - of the package. To see which modules are exposed by a package use the - ghc-pkg command (see ): - - -$ ghc-pkg field network exposed-modules -exposed-modules: Network.BSD, - Network.CGI, - Network.Socket, - Network.URI, - Network - - - In general, packages containing hierarchical modules are usually - exposed by default. However, it is possible for two packages to contain - the same module: in this case, only one of the packages should be - exposed. It is an error to import a module that belongs to more than one - exposed package. -