From 10f6831272cf17c2ad5171cba1cc0b065018e1bb Mon Sep 17 00:00:00 2001
From: Junji Hashimoto <junji.hashimoto@gmail.com>
Date: Wed, 20 Apr 2022 05:09:54 +0900
Subject: [PATCH 1/4] Upper limit relaxation of ghc

---
 typelevel-rewrite-rules.cabal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typelevel-rewrite-rules.cabal b/typelevel-rewrite-rules.cabal
index bd2c839..09a23b8 100644
--- a/typelevel-rewrite-rules.cabal
+++ b/typelevel-rewrite-rules.cabal
@@ -48,7 +48,7 @@ library
   build-depends:
       base >=4.12 && <5
     , containers >=0.6.2.1
-    , ghc >=8.10.2 && <9.1
+    , ghc >=8.10.2 && <9.4
     , ghc-prim >=0.5.3
     , term-rewriting >=0.3.0.1
     , transformers >=0.5.6.2

From 1a1e489c31ab21c0f1a9796cb4961e098d4dfe71 Mon Sep 17 00:00:00 2001
From: Junji Hashimoto <junji.hashimoto@gmail.com>
Date: Mon, 16 May 2022 13:10:59 +0900
Subject: [PATCH 2/4] Fix a test for ghc9.2

---
 src/TypeLevel/Rewrite/Internal/Lookup.hs        | 13 ++++++++++++-
 test/should-compile/InstanceConstraints/Test.hs |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/TypeLevel/Rewrite/Internal/Lookup.hs b/src/TypeLevel/Rewrite/Internal/Lookup.hs
index 62a1d32..e5708ea 100644
--- a/src/TypeLevel/Rewrite/Internal/Lookup.hs
+++ b/src/TypeLevel/Rewrite/Internal/Lookup.hs
@@ -6,8 +6,13 @@ import Data.Tuple (swap)
 
 -- GHC API
 import GHC (DataCon, TyCon, dataConTyCon)
-#if MIN_VERSION_ghc(9,0,0)
+#if MIN_VERSION_ghc(9,2,0)
+import GHC.Iface.Load (cannotFindModule)
+import GHC.Tc.Plugin (getTopEnv)
+#elif MIN_VERSION_ghc(9,0,0)
 import GHC.Driver.Finder (cannotFindModule)
+#endif
+#if MIN_VERSION_ghc(9,0,0)
 import GHC (Module, ModuleName, mkModuleName)
 import GHC.Plugins (mkDataOcc, mkTcOcc)
 import GHC.Utils.Panic (panicDoc)
@@ -35,9 +40,15 @@ lookupModule moduleNameStr = do
     Found _ module_ -> do
       pure module_
     findResult -> do
+#if MIN_VERSION_ghc(9,2,0)
+      hscEnv <- getTopEnv
+      panicDoc ("TypeLevel.Lookup.lookupModule " ++ show moduleNameStr)
+             $ cannotFindModule hscEnv moduleName findResult
+#else
       dynFlags <- unsafeTcPluginTcM getDynFlags
       panicDoc ("TypeLevel.Lookup.lookupModule " ++ show moduleNameStr)
              $ cannotFindModule dynFlags moduleName findResult
+#endif
 
 -- 'TcPluginM.lookupM' unfortunately fails with a very unhelpful error message
 -- when we look up a name which doesn't exist:
diff --git a/test/should-compile/InstanceConstraints/Test.hs b/test/should-compile/InstanceConstraints/Test.hs
index 57053f7..1f9e3c4 100644
--- a/test/should-compile/InstanceConstraints/Test.hs
+++ b/test/should-compile/InstanceConstraints/Test.hs
@@ -42,7 +42,7 @@ f5 :: forall a b x y
 f5 = foo @(F a x)
 
 f6 :: forall a b x y
-    . ( F a b ~ G x y
+    . ( b ~ G x y
       , y ~ x
       , x ~ y
       , Foo (F a b)

From 4176e10d4de2d1310506c0fcf6a74956d81d59b6 Mon Sep 17 00:00:00 2001
From: Junji Hashimoto <junji.hashimoto@gmail.com>
Date: Sat, 22 Oct 2022 03:06:59 +0900
Subject: [PATCH 3/4] Update package.yml

---
 package.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.yaml b/package.yaml
index 1450ec8..197930f 100644
--- a/package.yaml
+++ b/package.yaml
@@ -25,7 +25,7 @@ dependencies:
 library:
   source-dirs:      src
   dependencies:
-    - ghc >= 8.10.2 && <9.1
+    - ghc >= 8.10.2 && <9.4
     - containers >= 0.6.2.1
     - term-rewriting >= 0.3.0.1
     - transformers >= 0.5.6.2

From e5d98e7f35e8a769956c4f8a3117cae25631bbb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Samuel=20G=C3=A9lineau?= <gelisam+github@gmail.com>
Date: Tue, 14 Mar 2023 23:03:04 -0400
Subject: [PATCH 4/4] rename CI config file

According to my experiments in #36, renaming the CI config file
mysteriously allows CI to start running again!
---
 .github/workflows/{ci.yml => haskell.yml} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename .github/workflows/{ci.yml => haskell.yml} (100%)

diff --git a/.github/workflows/ci.yml b/.github/workflows/haskell.yml
similarity index 100%
rename from .github/workflows/ci.yml
rename to .github/workflows/haskell.yml