From a3ea1930fe8c0185af69905ff1126a2292fe26b6 Mon Sep 17 00:00:00 2001 From: Christiaan Baaij Date: Wed, 22 May 2024 22:21:06 +0200 Subject: [PATCH] Add support for GHC 9.11.20240522 --- CHANGELOG.md | 3 +++ ghc-typelits-knownnat.cabal | 2 +- src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0e9afb..d03f767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog for the [`ghc-typelits-knownnat`](http://hackage.haskell.org/package/ghc-typelits-knownnat) package +## 0.7.13 +* Support for GHC 9.11.20220522 + ## 0.7.12 *May 22nd, 2024* * Support for GHC 9.10.1 diff --git a/ghc-typelits-knownnat.cabal b/ghc-typelits-knownnat.cabal index c5c99d1..0f4833d 100644 --- a/ghc-typelits-knownnat.cabal +++ b/ghc-typelits-knownnat.cabal @@ -1,5 +1,5 @@ name: ghc-typelits-knownnat -version: 0.7.12 +version: 0.7.13 synopsis: Derive KnownNat constraints from other KnownNat constraints description: A type checker plugin for GHC that can derive \"complex\" @KnownNat@ diff --git a/src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs b/src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs index f31a21c..f51523c 100644 --- a/src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs +++ b/src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs @@ -154,6 +154,9 @@ import GHC.Tc.Types.Evidence (EvTerm (..), EvExpr, EvBindsVar, evDFunApp, mkEvCast, mkTcSymCo, mkTcTransCo, evTermCoercion_maybe) #endif +#if MIN_VERSION_ghc(9,11,0) +import GHC.Plugins (emptyDVarSet) +#endif import GHC.Types.Id (idType) import GHC.Types.Name (nameModule_maybe, nameOccName, Name) import GHC.Types.Name.Occurrence (occNameString) @@ -676,7 +679,11 @@ makeOpDict (opCls,dfid) knCls tyArgsC tyArgsI z evArgs sM Nothing -> op_to_kn Just (_,rw) -> let kn_co_rw = mkTyConAppCo Representational (classTyCon knCls) [rw] +#if MIN_VERSION_ghc(9,11,0) + kn_co_co = mkUnivCo (PluginProv "ghc-typelits-knownnat" emptyDVarSet) +#else kn_co_co = mkUnivCo (PluginProv "ghc-typelits-knownnat") +#endif Representational (coercionRKind kn_co_rw) (mkTyConApp (classTyCon knCls) [z]) @@ -792,7 +799,11 @@ makeOpDictByFiat (opCls,dfid) knCls tyArgsC tyArgsI z evArgs $ dropForAlls -- KnownBool b => SBool b $ idType kn_meth -- forall b. KnownBool b => SBool b -- SBool b R~ Bool (The "Lie") +#if MIN_VERSION_ghc(9,11,0) + , let kn_co_rep = mkUnivCo (PluginProv "ghc-typelits-knownnat" emptyDVarSet) +#else , let kn_co_rep = mkUnivCo (PluginProv "ghc-typelits-knownnat") +#endif Representational (mkTyConApp kn_tcRep [z]) boolTy -- KnownBoolNat2 f a b ~ SBool f