aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/GhcUtils.hs
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-07-19 17:11:01 +0100
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-07-21 08:14:19 -0700
commit8ac42d3327473939c013551750425cac191ff0fd (patch)
tree2bae383f059f5d22194307fa83b7717a7983dbe6 /src/Haddock/GhcUtils.hs
parentcb96b4f1ed0462b4a394b9fda6612c3bea9886bd (diff)
Track GHC PackageId to PackageKey renaming.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Conflicts: src/Haddock/Interface/Create.hs
Diffstat (limited to 'src/Haddock/GhcUtils.hs')
-rw-r--r--src/Haddock/GhcUtils.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs
index 8ea5485b..33d92131 100644
--- a/src/Haddock/GhcUtils.hs
+++ b/src/Haddock/GhcUtils.hs
@@ -44,23 +44,23 @@ moduleString = moduleNameString . moduleName
-- return the (name,version) of the package
modulePackageInfo :: Module -> (String, [Char])
-modulePackageInfo modu = case unpackPackageId pkg of
- Nothing -> (packageIdString pkg, "")
+modulePackageInfo modu = case unpackPackageKey pkg of
+ Nothing -> (packageKeyString pkg, "")
Just x -> (display $ pkgName x, showVersion (pkgVersion x))
- where pkg = modulePackageId modu
+ where pkg = modulePackageKey modu
-- This was removed from GHC 6.11
-- XXX we shouldn't be using it, probably
--- | Try and interpret a GHC 'PackageId' as a cabal 'PackageIdentifer'. Returns @Nothing@ if
+-- | Try and interpret a GHC 'PackageKey' as a cabal 'PackageIdentifer'. Returns @Nothing@ if
-- we could not parse it as such an object.
-unpackPackageId :: PackageId -> Maybe PackageIdentifier
-unpackPackageId p
+unpackPackageKey :: PackageKey -> Maybe PackageIdentifier
+unpackPackageKey p
= case [ pid | (pid,"") <- readP_to_S parse str ] of
[] -> Nothing
(pid:_) -> Just pid
- where str = packageIdString p
+ where str = packageKeyString p
lookupLoadedHomeModuleGRE :: GhcMonad m => ModuleName -> m (Maybe GlobalRdrEnv)