summaryrefslogtreecommitdiff
path: root/compiler/main/Packages.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/Packages.hs')
-rw-r--r--compiler/main/Packages.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs
index 4f8afb5e91..70476a16bd 100644
--- a/compiler/main/Packages.hs
+++ b/compiler/main/Packages.hs
@@ -1354,12 +1354,10 @@ missingDependencyMsg (Just parent)
-- -----------------------------------------------------------------------------
-packageKeyPackageIdString :: DynFlags -> PackageKey -> String
+packageKeyPackageIdString :: DynFlags -> PackageKey -> Maybe String
packageKeyPackageIdString dflags pkg_key
- | pkg_key == mainPackageKey = "main"
- | otherwise = maybe "(unknown)"
- sourcePackageIdString
- (lookupPackage dflags pkg_key)
+ | pkg_key == mainPackageKey = Just "main"
+ | otherwise = fmap sourcePackageIdString (lookupPackage dflags pkg_key)
-- | Will the 'Name' come from a dynamically linked library?
isDllName :: DynFlags -> PackageKey -> Module -> Name -> Bool