From 806e49ae36a058dbe4494055a6b936dd153c6194 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Wed, 22 Sep 2021 18:28:35 +0200 Subject: Refactor package imports Use an (Raw)PkgQual datatype instead of `Maybe FastString` to represent package imports. Factorize the code that renames RawPkgQual into PkgQual in function `rnPkgQual`. Renaming consists in checking if the FastString is the magic "this" keyword, the home-unit unit-id or something else. Bump haddock submodule --- compiler/GHC/Iface/Load.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/GHC/Iface/Load.hs') diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index 13fd3c1a3e..61ef61c8c4 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -98,6 +98,7 @@ import GHC.Types.Unique.FM import GHC.Types.Unique.DSet import GHC.Types.SrcLoc import GHC.Types.TyThing +import GHC.Types.PkgQual import GHC.Unit.External import GHC.Unit.Module @@ -111,7 +112,6 @@ import GHC.Unit.Finder import GHC.Unit.Env ( ue_hpt ) import GHC.Data.Maybe -import GHC.Data.FastString import Control.Monad import Data.Map ( toList ) @@ -295,7 +295,7 @@ needWiredInHomeIface _ = False loadSrcInterface :: SDoc -> ModuleName -> IsBootInterface -- {-# SOURCE #-} ? - -> Maybe FastString -- "package", if any + -> PkgQual -- "package", if any -> RnM ModIface loadSrcInterface doc mod want_boot maybe_pkg @@ -308,7 +308,7 @@ loadSrcInterface doc mod want_boot maybe_pkg loadSrcInterface_maybe :: SDoc -> ModuleName -> IsBootInterface -- {-# SOURCE #-} ? - -> Maybe FastString -- "package", if any + -> PkgQual -- "package", if any -> RnM (MaybeErr SDoc ModIface) loadSrcInterface_maybe doc mod want_boot maybe_pkg -- cgit v1.2.1