aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Interface
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-29 12:36:37 -0400
committerGitHub <noreply@github.com>2020-04-29 12:36:37 -0400
commit66faa532d4e3d93e87c5b042bef82d631dc74eb5 (patch)
tree971e9594725d0c6c798161aaee22054b9c696356 /haddock-api/src/Haddock/Interface
parent7c34f89d801bafba3162bc091dd486cbb9e9fd5b (diff)
parenta61dbdb0a7420e15e978bce6c09de1ce99290f44 (diff)
Merge pull request #1183 from hsyl20/wip/hsyl20/unitid
Refactoring of Unit code
Diffstat (limited to 'haddock-api/src/Haddock/Interface')
-rw-r--r--haddock-api/src/Haddock/Interface/AttachInstances.hs2
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs16
-rw-r--r--haddock-api/src/Haddock/Interface/Json.hs2
3 files changed, 10 insertions, 10 deletions
diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs
index 7dba9d03..ec61fb37 100644
--- a/haddock-api/src/Haddock/Interface/AttachInstances.hs
+++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs
@@ -34,7 +34,7 @@ import GHC.Utils.Error
import GHC.Core.FamInstEnv
import GHC
import GHC.Core.InstEnv
-import GHC.Types.Module ( ModuleSet, moduleSetElts )
+import GHC.Unit.Module.Env ( ModuleSet, moduleSetElts )
import GHC.Utils.Monad (liftIO)
import GHC.Types.Name
import GHC.Types.Name.Env
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index 7e05e669..786779c6 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -40,7 +40,7 @@ import Data.Traversable
import GHC.Types.Avail hiding (avail)
import qualified GHC.Types.Avail as Avail
-import qualified GHC.Types.Module as Module
+import qualified GHC.Unit.Module as Module
import qualified GHC.Types.SrcLoc as SrcLoc
import GHC.Core.ConLike (ConLike(..))
import GHC
@@ -48,7 +48,7 @@ import GHC.Driver.Types
import GHC.Types.Name
import GHC.Types.Name.Set
import GHC.Types.Name.Env
-import GHC.Driver.Packages ( lookupModuleInAllPackages, PackageName(..) )
+import GHC.Unit.State ( lookupModuleInAllPackages, PackageName(..) )
import GHC.Data.Bag
import GHC.Types.Name.Reader
import GHC.Tc.Types
@@ -221,7 +221,7 @@ mkAliasMap dflags mRenamedSource =
-- them to the user. We should reuse that information;
-- or at least reuse the renamed imports, which know what
-- they import!
- (fmap Module.fsToUnitId $
+ (fmap Module.fsToUnit $
fmap sl_fs $ ideclPkgQual impDecl)
(case ideclName impDecl of SrcLoc.L _ name -> name),
alias))
@@ -265,7 +265,7 @@ unrestrictedModuleImports idecls =
-- Similar to GHC.lookupModule
-- ezyang: Not really...
lookupModuleDyn ::
- DynFlags -> Maybe UnitId -> ModuleName -> Module
+ DynFlags -> Maybe Unit -> ModuleName -> Module
lookupModuleDyn _ (Just pkgId) mdlName =
Module.mkModule pkgId mdlName
lookupModuleDyn dflags Nothing mdlName =
@@ -839,7 +839,7 @@ availExportItem is_sig modMap thisMod semMod warnings exportedNames
Just decl -> return ([decl], (noDocForDecl, availNoDocs avail))
| otherwise ->
return ([], (noDocForDecl, availNoDocs avail))
- | Just iface <- M.lookup (semToIdMod (moduleUnitId thisMod) m) modMap
+ | Just iface <- M.lookup (semToIdMod (moduleUnit thisMod) m) modMap
, Just ds <- M.lookup n (ifaceDeclMap iface) =
return (ds, lookupDocs avail warnings
(ifaceDocMap iface)
@@ -885,10 +885,10 @@ availNoDocs avail =
-- | Given a 'Module' from a 'Name', convert it into a 'Module' that
-- we can actually find in the 'IfaceMap'.
-semToIdMod :: UnitId -> Module -> Module
+semToIdMod :: Unit -> Module -> Module
semToIdMod this_uid m
| Module.isHoleModule m = mkModule this_uid (moduleName m)
- | otherwise = m
+ | otherwise = m
hiDecl :: DynFlags -> Name -> ErrMsgGhc (Maybe (LHsDecl GhcRn))
hiDecl dflags t = do
@@ -967,7 +967,7 @@ moduleExport thisMod dflags ifaceMap instIfaceMap expMod =
return []
where
m = mkModule unitId expMod -- Identity module!
- unitId = moduleUnitId thisMod
+ unitId = moduleUnit thisMod
-- Note [1]:
------------
diff --git a/haddock-api/src/Haddock/Interface/Json.hs b/haddock-api/src/Haddock/Interface/Json.hs
index 701c68bf..043a1530 100644
--- a/haddock-api/src/Haddock/Interface/Json.hs
+++ b/haddock-api/src/Haddock/Interface/Json.hs
@@ -7,7 +7,7 @@ module Haddock.Interface.Json (
import GHC.Types.Basic
import GHC.Utils.Json
-import GHC.Types.Module
+import GHC.Unit.Module
import GHC.Types.Name
import GHC.Utils.Outputable