ghc-tcplugins-extra 0.4 → 0.4.1
raw patch · 3 files changed
+34/−10 lines, 3 filesdep ~ghcPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghc
API changes (from Hackage documentation)
Files
- CHANGELOG.md +3/−0
- ghc-tcplugins-extra.cabal +3/−3
- src/GHC/TcPluginM/Extra.hs +28/−7
CHANGELOG.md view
@@ -1,3 +1,6 @@+## 0.4.1 *January 1st 2021*+* Support for GHC-9.0.1-rc1+ ## 0.4 *January 31st 2020* * Expose functions for flattening constraints in GHC 8.2 and earlier
ghc-tcplugins-extra.cabal view
@@ -1,5 +1,5 @@ name: ghc-tcplugins-extra-version: 0.4+version: 0.4.1 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,7 @@ 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.2, GHC == 8.10.1+ GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.3, GHC == 9.0.1 source-repository head type: git@@ -33,7 +33,7 @@ library exposed-modules: GHC.TcPluginM.Extra build-depends: base >=4.8 && <5,- ghc >=7.10 && <8.12+ ghc >=7.10 && <9.2 hs-source-dirs: src default-language: Haskell2010 other-extensions: CPP
src/GHC/TcPluginM/Extra.hs view
@@ -39,11 +39,32 @@ where -- External-#if __GLASGOW_HASKELL__ < 711 import Data.Maybe (mapMaybe)-#endif+import Control.Arrow (first, second)+import Data.Function (on)+import Data.List (groupBy, partition, sortOn) -- GHC API+#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)+import GHC.Tc.Types.Evidence (EvTerm (..))+import GHC.Types.Name (Name)+import GHC.Types.Name.Occurrence (OccName)+import GHC.Utils.Outputable ((<+>), ($$), empty, ppr, text)+import GHC.Utils.Panic (panicDoc)+#else #if __GLASGOW_HASKELL__ < 711 import BasicTypes (TopLevelFlag (..)) #endif@@ -90,9 +111,6 @@ import Type (EqRel (..), PredTree (..), PredType, Type, classifyPredType) import Var (varType) #endif-import Control.Arrow (first, second)-import Data.Function (on)-import Data.List (groupBy, partition, sortOn) #if __GLASGOW_HASKELL__ < 809 import TcRnTypes (Ct (..), ctLoc, ctEvId, mkNonCanonical) #else@@ -109,9 +127,9 @@ import TcRnTypes (ctEvTerm) import TypeRep (Type (..)) #else-import Data.Maybe (mapMaybe) import TyCoRep (Type (..)) #endif+#endif -- workaround for https://ghc.haskell.org/trac/ghc/ticket/10301 #if __GLASGOW_HASKELL__ < 802@@ -389,7 +407,10 @@ -- TODO: Is it safe to do "dumb" substitution under binders? -- ForAllTy tv (substType subst ty) t-#if __GLASGOW_HASKELL__ >= 809+#if __GLASGOW_HASKELL__ >= 900+substType subst (FunTy k1 k2 t1 t2) =+ FunTy k1 k2 (substType subst t1) (substType subst t2)+#elif __GLASGOW_HASKELL__ >= 809 substType subst (FunTy af t1 t2) = FunTy af (substType subst t1) (substType subst t2) #elif __GLASGOW_HASKELL__ >= 802