diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-29 12:36:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 12:36:37 -0400 |
commit | 66faa532d4e3d93e87c5b042bef82d631dc74eb5 (patch) | |
tree | 971e9594725d0c6c798161aaee22054b9c696356 /haddock-api/src/Haddock/ModuleTree.hs | |
parent | 7c34f89d801bafba3162bc091dd486cbb9e9fd5b (diff) | |
parent | a61dbdb0a7420e15e978bce6c09de1ce99290f44 (diff) |
Merge pull request #1183 from hsyl20/wip/hsyl20/unitid
Refactoring of Unit code
Diffstat (limited to 'haddock-api/src/Haddock/ModuleTree.hs')
-rw-r--r-- | haddock-api/src/Haddock/ModuleTree.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/haddock-api/src/Haddock/ModuleTree.hs b/haddock-api/src/Haddock/ModuleTree.hs index 598e3f9a..688e3e71 100644 --- a/haddock-api/src/Haddock/ModuleTree.hs +++ b/haddock-api/src/Haddock/ModuleTree.hs @@ -15,9 +15,9 @@ module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where import Haddock.Types ( MDoc ) import GHC ( Name ) -import GHC.Types.Module ( Module, moduleNameString, moduleName, moduleUnitId, unitIdString ) +import GHC.Unit.Module ( Module, moduleNameString, moduleName, moduleUnit, unitString ) import GHC.Driver.Session ( DynFlags ) -import GHC.Driver.Packages ( lookupUnit, sourcePackageIdString ) +import GHC.Unit.State ( lookupUnit, unitPackageIdString ) import qualified Control.Applicative as A @@ -29,10 +29,10 @@ mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree mkModuleTree dflags showPkgs mods = foldr fn [] [ (mdl, splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ] where - modPkg mod_ | showPkgs = Just (unitIdString (moduleUnitId mod_)) + modPkg mod_ | showPkgs = Just (unitString (moduleUnit mod_)) | otherwise = Nothing - modSrcPkg mod_ | showPkgs = fmap sourcePackageIdString - (lookupUnit dflags (moduleUnitId mod_)) + modSrcPkg mod_ | showPkgs = fmap unitPackageIdString + (lookupUnit dflags (moduleUnit mod_)) | otherwise = Nothing fn (m,mod_,pkg,srcPkg,short) = addToTrees mod_ m pkg srcPkg short |