[commit: ghc] master: Clarify some comments in Packages.hs [skip-ci] (6e77d45)

git at git.haskell.org git at git.haskell.org
Tue Mar 3 21:03:10 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6e77d45b2b4dcf189b71621009e80b96a3c5155a/ghc

>---------------------------------------------------------------

commit 6e77d45b2b4dcf189b71621009e80b96a3c5155a
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Tue Mar 3 13:05:03 2015 -0800

    Clarify some comments in Packages.hs [skip-ci]
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


>---------------------------------------------------------------

6e77d45b2b4dcf189b71621009e80b96a3c5155a
 compiler/main/Packages.hs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index db48d99..42aa0a1 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -233,9 +233,10 @@ type ModuleToPkgConfAll =
 
 data PackageState = PackageState {
   -- | A mapping of 'PackageKey' to 'PackageConfig'.  This list is adjusted
-  -- so that only valid packages are here.  Currently, we also flip the
-  -- exposed/trusted bits based on package flags; however, the hope is to
-  -- stop doing that.
+  -- so that only valid packages are here.  'PackageConfig' reflects
+  -- what was stored *on disk*, except for the 'trusted' flag, which
+  -- is adjusted at runtime.  (In particular, some packages in this map
+  -- may have the 'exposed' flag be 'False'.)
   pkgIdMap              :: PackageConfigMap,
 
   -- | The packages we're going to link in eagerly.  This list
@@ -287,7 +288,9 @@ getPackageDetails dflags pid =
     expectJust "getPackageDetails" (lookupPackage dflags pid)
 
 -- | Get a list of entries from the package database.  NB: be careful with
--- this function, it may not do what you expect it to.
+-- this function, although all packages in this map are "visible", this
+-- does not imply that the exposed-modules of the package are available
+-- (they may have been thinned or renamed).
 listPackageConfigMap :: DynFlags -> [PackageConfig]
 listPackageConfigMap dflags = eltsUFM (pkgIdMap (pkgState dflags))
 



More information about the ghc-commits mailing list