Skip to content

Commit

Permalink
v0.14.0.0: mkEqPredRole renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
sheaf committed Nov 28, 2024
1 parent 5b6b34f commit 8a2cb9c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
10 changes: 8 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Version 0.13.0.0 (2024-30-10)

# Version 0.14.0.0 (2024-11-28)

- Rename `mkPrimEqPredRole` to `mkEqPredRole`. This is a re-exported function
from GHC, and the renaming adapts to the renaming in GHC-9.13.

# Version 0.13.0.0 (2024-10-30)

- Update to changes in the type of GHC's `mkUnivCo`
in order to (properly) add support for GHC 9.12.
Expand All @@ -14,7 +20,7 @@

- Re-export `ctEvCoercion`, and stop re-exporting `ctEvId`.

# Version 0.12.0.0 (2024-22-10)
# Version 0.12.0.0 (2024-10-22)

- Add preliminary support for GHC 9.12.

Expand Down
2 changes: 1 addition & 1 deletion ghc-tcplugin-api.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: ghc-tcplugin-api
version: 0.13.0.0
version: 0.14.0.0
synopsis: An API for type-checker plugins.
license: BSD-3-Clause
build-type: Simple
Expand Down
26 changes: 19 additions & 7 deletions src/GHC/TcPlugin/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ module GHC.TcPlugin.API

-- | The following functions allow plugins to create constraints
-- for typeclasses and type equalities.
, mkClassPred, mkPrimEqPredRole
, mkClassPred, mkEqPredRole

-- | === Deriveds

Expand Down Expand Up @@ -516,7 +516,7 @@ import GHC.Core.Class
import GHC.Core.Coercion
( mkReflCo, mkSymCo, mkTransCo
, mkUnivCo
#if MIN_VERSION_ghc(8,10,0)
#if !MIN_VERSION_ghc(9,13,0) && MIN_VERSION_ghc(8,10,0)
, mkPrimEqPredRole
#endif
)
Expand All @@ -536,6 +536,9 @@ import GHC.Core.Make
#endif
import GHC.Core.Predicate
( EqRel(..)
#if MIN_VERSION_ghc(9,13,0)
, mkEqPredRole
#endif
#if MIN_VERSION_ghc(8,10,0)
, Pred(..)
#else
Expand Down Expand Up @@ -1111,12 +1114,21 @@ mkVisFunTysMany = mkFunTys
mkPiTy :: TyCoBinder -> Type -> Type
mkPiTy bndr ty = mkPiTys [bndr] ty

-- | Makes a lifted equality predicate at the given role
mkPrimEqPredRole :: Role -> Type -> Type -> PredType
mkPrimEqPredRole Nominal = mkPrimEqPred
mkPrimEqPredRole Representational = mkReprPrimEqPred
mkPrimEqPredRole Phantom = panic "mkPrimEqPredRole phantom"
#endif
#endif

--------------------------------------------------------------------------------

#if !MIN_VERSION_ghc(9,13,0)
-- | Makes an unlifted equality predicate at the given role
-- (either 'Nominal' or 'Representational').
mkEqPredRole :: Role -> Type -> Type -> PredType
#if MIN_VERSION_ghc(8,10,0)
mkEqPredRole = mkPrimEqPredRole
#else
mkEqPredRole Nominal = mkPrimEqPred
mkEqPredRole Representational = mkReprPrimEqPred
mkEqPredRole Phantom = panic "mkPrimEqPredRole phantom"
#endif
#endif

Expand Down

0 comments on commit 8a2cb9c

Please sign in to comment.