From 3249cf1216fbe12963e117e77cf1879983ee72d4 Mon Sep 17 00:00:00 2001
From: Sylvain Henry <sylvain@haskus.fr>
Date: Tue, 30 May 2023 13:45:26 +0200
Subject: [PATCH] Don't use getKey

---
 compiler/GHC/Builtin/Names.hs   | 6 +++---
 compiler/GHC/Driver/Main.hs     | 3 +--
 compiler/GHC/Runtime/Context.hs | 2 +-
 compiler/GHC/StgToJS/Rts/Rts.hs | 1 -
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/compiler/GHC/Builtin/Names.hs b/compiler/GHC/Builtin/Names.hs
index d72e911541de..5909cf26f5be 100644
--- a/compiler/GHC/Builtin/Names.hs
+++ b/compiler/GHC/Builtin/Names.hs
@@ -659,9 +659,9 @@ gHC_RECORDS = mkBaseModule (fsLit "GHC.Records")
 rOOT_MAIN :: Module
 rOOT_MAIN       = mkMainModule (fsLit ":Main") -- Root module for initialisation
 
-mkInteractiveModule :: Int -> Module
--- (mkInteractiveMoudule 9) makes module 'interactive:Ghci9'
-mkInteractiveModule n = mkModule interactiveUnit (mkModuleName ("Ghci" ++ show n))
+mkInteractiveModule :: String -> Module
+-- (mkInteractiveMoudule "9") makes module 'interactive:Ghci9'
+mkInteractiveModule n = mkModule interactiveUnit (mkModuleName ("Ghci" ++ n))
 
 pRELUDE_NAME, mAIN_NAME :: ModuleName
 pRELUDE_NAME   = mkModuleNameFS (fsLit "Prelude")
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index fd02fbdb0cd7..ba176b6ce568 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -248,7 +248,6 @@ import GHC.Types.Name.Set (NonCaffySet)
 import GHC.Types.TyThing
 import GHC.Types.HpcInfo
 import GHC.Types.Unique.Supply (uniqFromMask)
-import GHC.Types.Unique (getKey)
 
 import GHC.Utils.Fingerprint ( Fingerprint )
 import GHC.Utils.Panic
@@ -2588,7 +2587,7 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr = do
   -- guaranteed.
   --
   -- We reuse the unique we obtained for the binding, but any unique would do.
-  let this_mod = mkInteractiveModule (getKey u)
+  let this_mod = mkInteractiveModule (show u)
   let for_bytecode = True
 
   (stg_binds, _prov_map, _collected_ccs, _stg_cg_infos) <-
diff --git a/compiler/GHC/Runtime/Context.hs b/compiler/GHC/Runtime/Context.hs
index caa61755d75f..49cb0f678411 100644
--- a/compiler/GHC/Runtime/Context.hs
+++ b/compiler/GHC/Runtime/Context.hs
@@ -330,7 +330,7 @@ icReaderEnv = igre_env . ic_gre_cache
 
 icInteractiveModule :: InteractiveContext -> Module
 icInteractiveModule (InteractiveContext { ic_mod_index = index })
-  = mkInteractiveModule index
+  = mkInteractiveModule (show index)
 
 -- | This function returns the list of visible TyThings (useful for
 -- e.g. showBindings).
diff --git a/compiler/GHC/StgToJS/Rts/Rts.hs b/compiler/GHC/StgToJS/Rts/Rts.hs
index 707f6a64f45f..8dd0272ae9df 100644
--- a/compiler/GHC/StgToJS/Rts/Rts.hs
+++ b/compiler/GHC/StgToJS/Rts/Rts.hs
@@ -52,7 +52,6 @@ import Data.Array
 import Data.Monoid
 import Data.Char (toLower, toUpper)
 import qualified Data.Bits          as Bits
-import qualified Data.ByteString.Lazy.Char8 as BLC
 
 -- | The garbageCollector resets registers and result variables.
 garbageCollector :: JStat
-- 
GitLab