packages feed

ghc-tcplugins-extra 0.4.1 → 0.4.2

raw patch · 4 files changed

+43/−11 lines, 4 filesdep ~ghcPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ghc

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,6 @@+## 0.4.2 *June 17th 2021*+* Support for GHC-9.2.0.20210422+ ## 0.4.1 *January 1st 2021* * Support for GHC-9.0.1-rc1 
README.md view
@@ -1,6 +1,6 @@ # ghc-tcplugins-extra Utilities for writing GHC type-checker plugins -[![Build Status](https://secure.travis-ci.org/clash-lang/ghc-tcplugins-extra.svg?branch=master)](http://travis-ci.org/clash-lang/ghc-tcplugins-extra)+[![Build Status](https://github.com/clash-lang/ghc-tcplugins-extra/actions/workflows/haskell-ci.yml/badge.svg?branch=master)](https://github.com/clash-lang/ghc-tcplugins-extra/actions) [![Hackage](https://img.shields.io/hackage/v/ghc-tcplugins-extra.svg)](https://hackage.haskell.org/package/ghc-tcplugins-extra) [![Hackage Dependencies](https://img.shields.io/hackage-deps/v/ghc-tcplugins-extra.svg?style=flat)](http://packdeps.haskellers.com/feed?needle=exact%3Aghc-tcplugins-extra)
ghc-tcplugins-extra.cabal view
@@ -1,5 +1,5 @@ name:                ghc-tcplugins-extra-version:             0.4.1+version:             0.4.2 synopsis:            Utilities for writing GHC type-checker plugins description:         Utilities for writing GHC type-checker plugins, such as                      creating constraints, with a stable API covering multiple@@ -18,7 +18,8 @@                      CHANGELOG.md cabal-version:       >=1.10 tested-with:         GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4,-                     GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.3, GHC == 9.0.1+                     GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.4, GHC == 9.0.1,+                     GHC == 9.2.1  source-repository head   type: git@@ -33,7 +34,7 @@ library   exposed-modules:     GHC.TcPluginM.Extra   build-depends:       base >=4.8  && <5,-                       ghc  >=7.10 && <9.2+                       ghc  >=7.10 && <9.4   hs-source-dirs:      src   default-language:    Haskell2010   other-extensions:    CPP
src/GHC/TcPluginM/Extra.hs view
@@ -45,20 +45,25 @@ import Data.List     (groupBy, partition, sortOn)  -- GHC API+#if MIN_VERSION_ghc(9,2,0)+import qualified GHC.Unit.Finder as Finder+import GHC.Tc.Types.Constraint (CanEqLHS (..))+#elif MIN_VERSION_ghc(9,0,0)+import qualified GHC.Driver.Finder as Finder+#endif #if MIN_VERSION_ghc(9,0,0) import GHC.Core (Expr (..)) import GHC.Core.Coercion (Role (..), mkPrimEqPred, mkUnivCo) import GHC.Core.Type  (PredType) import GHC.Core.TyCo.Rep (Type (..), UnivCoProvenance (..)) import GHC.Data.FastString (FastString, fsLit)-import qualified GHC.Driver.Finder as Finder import GHC.Unit.Module (Module, ModuleName) import GHC.Tc.Plugin (FindResult (..), TcPluginM, lookupOrig, tcPluginTrace) import qualified GHC.Tc.Plugin as TcPluginM import GHC.Tc.Utils.TcType (TcTyVar, TcType) import GHC.Tc.Types (TcPlugin (..), TcPluginResult (..)) import GHC.Tc.Types.Constraint-  (Ct (..), CtLoc, CtEvidence (..), ctEvId, ctLoc, mkNonCanonical)+  (Ct (..), CtLoc, CtEvidence (..), QCInst (..), ctEvId, ctLoc, mkNonCanonical) import GHC.Tc.Types.Evidence (EvTerm (..)) import GHC.Types.Name (Name) import GHC.Types.Name.Occurrence (OccName)@@ -112,10 +117,14 @@ import Var        (varType) #endif #if __GLASGOW_HASKELL__ < 809-import TcRnTypes     (Ct (..), ctLoc, ctEvId, mkNonCanonical)+import TcRnTypes     (Ct (..), ctLoc, ctEvId, mkNonCanonical+#if __GLASGOW_HASKELL__ >= 806+                     ,QCInst(..)+#endif+                    ) #else import Constraint-  (Ct (..), CtEvidence (..), CtLoc, ctLoc, ctEvId, mkNonCanonical)+  (Ct (..), CtEvidence (..), CtLoc, QCInst(..), ctLoc, ctEvId, mkNonCanonical) #endif import TcType        (TcTyVar, TcType) #if __GLASGOW_HASKELL__ < 809@@ -376,8 +385,14 @@ mkSubst   :: Ct   -> Maybe ((TcTyVar, TcType),Ct)+#if MIN_VERSION_ghc(9,2,0)+mkSubst ct@(CEqCan {..})+  | TyVarLHS tyvar <- cc_lhs+  = Just ((tyvar,cc_rhs),ct)+#else mkSubst ct@(CTyEqCan {..})  = Just ((cc_tyvar,cc_rhs),ct) mkSubst ct@(CFunEqCan {..}) = Just ((cc_fsk,TyConApp cc_fun cc_tyargs),ct)+#endif mkSubst _                   = Nothing  -- | Apply substitution in the evidence of Cts@@ -385,9 +400,22 @@   :: [(TcTyVar, TcType)]   -> Ct   -> Ct-substCt subst ct =-  ct { cc_ev = (cc_ev ct) {ctev_pred = substType subst (ctev_pred (cc_ev ct))}-     }+substCt subst = overEvidencePredType (substType subst)++-- | Modify the predicate type of the evidence term of a constraint+overEvidencePredType :: (TcType -> TcType) -> Ct -> Ct+#if MIN_VERSION_ghc(8,6,0)+overEvidencePredType f (CQuantCan qci) =+  let+    ev :: CtEvidence+    ev = qci_ev qci+  in CQuantCan ( qci { qci_ev = ev { ctev_pred = f (ctev_pred ev) } } )+#endif+overEvidencePredType f ct =+  let+    ev :: CtEvidence+    ev = cc_ev ct+  in ct { cc_ev = ev { ctev_pred = f (ctev_pred ev) } }  -- | Apply substitutions in Types --