@@ -76,7 +76,6 @@ import System.FilePath
7676import System.Directory
7777
7878-- The following imports are needed only for JSON instances
79- import Data.Version (Version (.. ))
8079import Distribution.Simple.Compiler (PackageDB (.. ))
8180import Distribution.License (License (.. ))
8281import Distribution.ModuleName (ModuleName )
@@ -107,21 +106,21 @@ getInstalledPackages _proxy dbspec = do
107106 (mbDb :: Maybe db )
108107
109108-- | Try to retrieve an 'InstalledPackageInfo' for each of
110- -- 'InstalledPackageId 's from a specified set of 'PackageDB's.
109+ -- 'UnitId 's from a specified set of 'PackageDB's.
111110--
112111-- May throw a 'PkgInfoNotFound' exception.
113112--
114113-- If a database doesn't exist, the behaviour is determined by
115114-- 'maybeInitDB'.
116115readPackagesInfo
117116 :: IsPackageDB db
118- => Proxy db -> [PackageDB ] -> [InstalledPackageId ] -> IO Packages
117+ => Proxy db -> [PackageDB ] -> [UnitId ] -> IO Packages
119118readPackagesInfo proxyDb dbs pkgIds = do
120119 allPkgInfos <- concat <$> mapM (getInstalledPackages proxyDb) dbs
121120 let
122121 pkgMap =
123122 Map. fromList
124- [ (Info. installedPackageId pkgInfo, pkgInfo)
123+ [ (Info. installedUnitId pkgInfo, pkgInfo)
125124 | pkgInfo <- allPkgInfos
126125 ]
127126 forM pkgIds $ \ pkgId ->
@@ -290,7 +289,7 @@ errPrefix = "haskell-suite package manager"
290289data PkgDBError
291290 = BadPkgDB FilePath -- ^ package database could not be parsed or contains errors
292291 | PkgDBReadError FilePath IOException -- ^ package db file could not be read
293- | PkgExists InstalledPackageId -- ^ attempt to register an already present package id
292+ | PkgExists UnitId -- ^ attempt to register an already present package id
294293 | RegisterNullDB -- ^ attempt to register in the global db when it's not present
295294 deriving (Typeable )
296295instance Show PkgDBError where
@@ -306,7 +305,7 @@ instance Show PkgDBError where
306305instance Exception PkgDBError
307306
308307data PkgInfoError
309- = PkgInfoNotFound InstalledPackageId
308+ = PkgInfoNotFound UnitId
310309 -- ^ requested package id could not be found in any of the package databases
311310 deriving Typeable
312311instance Exception PkgInfoError
@@ -328,11 +327,6 @@ instance ToJSON License where
328327instance FromJSON License where
329328 parseJSON = stdFromJSON
330329
331- instance ToJSON Version where
332- toJSON = stdToJSON
333- instance FromJSON Version where
334- parseJSON = stdFromJSON
335-
336330instance ToJSON ModuleName where
337331 toJSON = stdToJSON
338332instance FromJSON ModuleName where
@@ -348,16 +342,16 @@ instance ToJSON PackageIdentifier where
348342instance FromJSON PackageIdentifier where
349343 parseJSON = stdFromJSON
350344
351- instance ToJSON InstalledPackageId where
345+ instance ToJSON UnitId where
352346 toJSON = stdToJSON
353- instance FromJSON InstalledPackageId where
347+ instance FromJSON UnitId where
354348 parseJSON = stdFromJSON
355349
356- instance ToJSON PackageKey where
350+ instance ToJSON AbiHash where
357351 toJSON = stdToJSON
358- instance FromJSON PackageKey where
352+ instance FromJSON AbiHash where
359353 parseJSON = stdFromJSON
360354
361355deriveJSON defaultOptions ''Info. OriginalModule
362356deriveJSON defaultOptions ''Info. ExposedModule
363- deriveJSON defaultOptions ''Info. InstalledPackageInfo_
357+ deriveJSON defaultOptions ''Info. InstalledPackageInfo
0 commit comments