From 47ab4b8e5a61e0545d71cd384d424ef1c7f80d33 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Sat, 11 Apr 2020 12:03:52 +0200 Subject: UnitId has been renamed into Unit --- haddock-api/src/Haddock/Interface/Create.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'haddock-api/src/Haddock/Interface') diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 7e05e669..53fcc358 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -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]: ------------ -- cgit v1.2.3 From a61dbdb0a7420e15e978bce6c09de1ce99290f44 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Sat, 11 Apr 2020 22:00:48 +0200 Subject: Fix for GHC.Unit.* modules --- haddock-api/src/Haddock.hs | 3 +-- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 2 +- haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | 2 +- haddock-api/src/Haddock/GhcUtils.hs | 3 +-- haddock-api/src/Haddock/Interface.hs | 2 +- haddock-api/src/Haddock/Interface/AttachInstances.hs | 2 +- haddock-api/src/Haddock/Interface/Create.hs | 4 ++-- haddock-api/src/Haddock/Interface/Json.hs | 2 +- haddock-api/src/Haddock/ModuleTree.hs | 4 ++-- haddock-api/src/Haddock/Options.hs | 2 +- 11 files changed, 13 insertions(+), 15 deletions(-) (limited to 'haddock-api/src/Haddock/Interface') diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 7fc6edd0..85ccde3d 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -68,9 +68,8 @@ import GHC hiding (verbosity) import Config import GHC.Driver.Session hiding (projectVersion, verbosity) import GHC.Utils.Error -import GHC.Driver.Packages +import GHC.Unit import GHC.Utils.Panic (handleGhcException) -import GHC.Types.Module import GHC.Data.FastString import qualified GHC.Runtime.Loader diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index fb238995..7b66c566 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -22,7 +22,7 @@ import GHC.Iface.Ext.Types ( HieFile(..), HieASTs(..) ) import GHC.Iface.Ext.Binary ( readHieFile, hie_file_result) import Data.Map as M import GHC.Data.FastString ( mkFastString ) -import GHC.Types.Module ( Module, moduleName ) +import GHC.Unit.Module ( Module, moduleName ) import GHC.Types.Name.Cache ( initNameCache ) import GHC.Types.Unique.Supply ( mkSplitUniqSupply ) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index a6134cd2..e01d7114 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -13,7 +13,7 @@ import Haddock.Backends.Hyperlinker.Utils import qualified Data.ByteString as BS import GHC.Iface.Ext.Types -import GHC.Types.Module ( ModuleName, moduleNameString ) +import GHC.Unit.Module ( ModuleName, moduleNameString ) import GHC.Types.Name ( getOccString, isInternalName, Name, nameModule, nameUnique ) import GHC.Types.SrcLoc import GHC.Types.Unique ( getKey ) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs index 56fb63fa..f5f64f51 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs @@ -39,7 +39,7 @@ import Text.XHtml hiding ( name, title, p, quote ) import qualified Text.XHtml as XHtml import GHC ( SrcSpan(..), srcSpanStartLine, Name ) -import GHC.Types.Module ( Module, ModuleName, moduleName, moduleNameString ) +import GHC.Unit.Module ( Module, ModuleName, moduleName, moduleNameString ) import GHC.Types.Name ( getOccString, nameOccName, isValOcc ) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 8341faf5..f8f6f838 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -28,7 +28,7 @@ import GHC.Utils.FV as FV import GHC.Utils.Outputable ( Outputable, panic, showPpr ) import GHC.Types.Name import GHC.Types.Name.Set -import GHC.Types.Module +import GHC.Unit.Module import GHC.Driver.Types import GHC import GHC.Core.Class @@ -41,7 +41,6 @@ import GHC.Types.Var.Env ( TyVarEnv, extendVarEnv, elemVarEnv, emptyVarEnv ) import GHC.Core.TyCo.Rep ( Type(..) ) import GHC.Core.Type ( isRuntimeRepVar ) import GHC.Builtin.Types( liftedRepDataConTyCon ) -import GHC.Hs.Utils (CollectPass(..)) import GHC.Data.StringBuffer ( StringBuffer ) import qualified GHC.Data.StringBuffer as S diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index 80ce2b55..fa0f648f 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -50,7 +50,7 @@ import qualified Data.Set as Set import Distribution.Verbosity import Text.Printf -import GHC.Types.Module (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet) +import GHC.Unit.Module.Env (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet) import GHC.Data.Graph.Directed import GHC.Driver.Session hiding (verbosity) import GHC hiding (verbosity) 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 53fcc358..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 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 diff --git a/haddock-api/src/Haddock/ModuleTree.hs b/haddock-api/src/Haddock/ModuleTree.hs index 3d47e4db..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, moduleUnit, unitString ) +import GHC.Unit.Module ( Module, moduleNameString, moduleName, moduleUnit, unitString ) import GHC.Driver.Session ( DynFlags ) -import GHC.Driver.Packages ( lookupUnit, unitPackageIdString ) +import GHC.Unit.State ( lookupUnit, unitPackageIdString ) import qualified Control.Applicative as A diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index e8a7a61b..011a361d 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -48,7 +48,7 @@ import GHC.Data.FastString import GHC ( DynFlags, Module, moduleUnit ) import Haddock.Types import Haddock.Utils -import GHC.Driver.Packages +import GHC.Unit.State import System.Console.GetOpt import qualified Text.ParserCombinators.ReadP as RP -- cgit v1.2.3