Skip to content

Commit

Permalink
Add support for GHC 9.11.20240522
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaanb committed May 22, 2024
1 parent 2e57de3 commit a3ea193
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ghc-typelits-knownnat.cabal
Original file line number Diff line number Diff line change
@@ -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@
Expand Down
11 changes: 11 additions & 0 deletions src-ghc-9.4/GHC/TypeLits/KnownNat/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a3ea193

Please sign in to comment.