diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-10-06 00:17:15 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-10-08 01:37:33 -0700 |
commit | 4e8a0607140b23561248a41aeaf837224aa6315b (patch) | |
tree | 8e03945afe5c40c13b41667e0175f14db15d0780 /libraries/ghc-boot | |
parent | 00b530d5402aaa37e4085ecdcae0ae54454736c1 (diff) | |
download | haskell-4e8a0607140b23561248a41aeaf837224aa6315b.tar.gz |
Distinguish between UnitId and InstalledUnitId.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'libraries/ghc-boot')
-rw-r--r-- | libraries/ghc-boot/GHC/PackageDb.hs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index 2e51af0dcb..eda1a696ca 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -92,6 +92,7 @@ data InstalledPackageInfo compid srcpkgid srcpkgname instunitid unitid modulenam haddockHTMLs :: [FilePath], exposedModules :: [(modulename, Maybe mod)], hiddenModules :: [modulename], + indefinite :: Bool, exposed :: Bool, trusted :: Bool } @@ -139,7 +140,7 @@ data DbUnitId compid unitid modulename mod dbUnitIdComponentId :: compid, dbUnitIdInsts :: [(modulename, mod)] } - | DbHashedUnitId { + | DbInstalledUnitId { dbUnitIdComponentId :: compid, dbUnitIdHash :: Maybe BS.ByteString } @@ -175,6 +176,7 @@ emptyInstalledPackageInfo = haddockHTMLs = [], exposedModules = [], hiddenModules = [], + indefinite = False, exposed = False, trusted = False } @@ -313,7 +315,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => includes includeDirs haddockInterfaces haddockHTMLs exposedModules hiddenModules - exposed trusted) = do + indefinite exposed trusted) = do put (toStringRep sourcePackageId) put (toStringRep packageName) put packageVersion @@ -338,6 +340,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => put (map (\(mod_name, mb_mod) -> (toStringRep mod_name, fmap toDbModule mb_mod)) exposedModules) put (map toStringRep hiddenModules) + put indefinite put exposed put trusted @@ -364,6 +367,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => haddockHTMLs <- get exposedModules <- get hiddenModules <- get + indefinite <- get exposed <- get trusted <- get return (InstalledPackageInfo @@ -384,7 +388,7 @@ instance (RepInstalledPackageInfo a b c d e f g) => (fromStringRep mod_name, fmap fromDbModule mb_mod)) exposedModules) (map fromStringRep hiddenModules) - exposed trusted) + indefinite exposed trusted) instance (BinaryStringRep modulename, BinaryStringRep compid, DbUnitIdModuleRep compid unitid modulename mod) => @@ -409,7 +413,7 @@ instance (BinaryStringRep modulename, BinaryStringRep compid, instance (BinaryStringRep modulename, BinaryStringRep compid, DbUnitIdModuleRep compid unitid modulename mod) => Binary (DbUnitId compid unitid modulename mod) where - put (DbHashedUnitId cid hash) = do + put (DbInstalledUnitId cid hash) = do putWord8 0 put (toStringRep cid) put hash @@ -423,7 +427,7 @@ instance (BinaryStringRep modulename, BinaryStringRep compid, 0 -> do cid <- get hash <- get - return (DbHashedUnitId (fromStringRep cid) hash) + return (DbInstalledUnitId (fromStringRep cid) hash) _ -> do dbUnitIdComponentId <- get dbUnitIdInsts <- get |