ghc-tcplugin-api 0.19.0.0 → 0.20.0.0
raw patch · 5 files changed
+211/−55 lines, 5 filesdep ~ghcdep ~template-haskellPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghc, template-haskell
API changes (from Hackage documentation)
- GHC.TcPlugin.API: class Monad m => MonadThings (m :: Type -> Type)
- GHC.TcPlugin.API: lookupDataCon :: MonadThings m => Name -> m DataCon
- GHC.TcPlugin.API: lookupId :: MonadThings m => Name -> m Id
- GHC.TcPlugin.API: lookupThing :: MonadThings m => Name -> m TyThing
- GHC.TcPlugin.API: lookupTyCon :: MonadThings m => Name -> m TyCon
- GHC.TcPlugin.API.Internal: class Monad m => MonadThings (m :: Type -> Type)
- GHC.TcPlugin.API.Internal: instance (GHC.Base.Monad (GHC.TcPlugin.API.Internal.TcPluginM s), GHC.TcPlugin.API.Internal.MonadTcPlugin (GHC.TcPlugin.API.Internal.TcPluginM s)) => GHC.Types.TyThing.MonadThings (GHC.TcPlugin.API.Internal.TcPluginM s)
- GHC.TcPlugin.API.Internal: lookupDataCon :: MonadThings m => Name -> m DataCon
- GHC.TcPlugin.API.Internal: lookupId :: MonadThings m => Name -> m Id
- GHC.TcPlugin.API.Internal: lookupThing :: MonadThings m => Name -> m TyThing
- GHC.TcPlugin.API.Internal: lookupTyCon :: MonadThings m => Name -> m TyCon
+ GHC.Builtins: anyTy :: Type
+ GHC.Builtins: anyTyCon :: TyCon
+ GHC.Builtins: anyTypeOfKind :: Kind -> Type
+ GHC.Builtins: boolTy :: Type
+ GHC.Builtins: boolTyCon :: TyCon
+ GHC.Builtins: boxedRepDataConTyCon :: TyCon
+ GHC.Builtins: cONSTRAINTKind :: Type
+ GHC.Builtins: cONSTRAINTTyCon :: TyCon
+ GHC.Builtins: cTupleDataCon :: Arity -> DataCon
+ GHC.Builtins: cTupleTyCon :: Arity -> TyCon
+ GHC.Builtins: charDataCon :: DataCon
+ GHC.Builtins: charPrimTy :: Type
+ GHC.Builtins: charTy :: Type
+ GHC.Builtins: charTyCon :: TyCon
+ GHC.Builtins: coercibleClass :: Class
+ GHC.Builtins: coercibleDataCon :: DataCon
+ GHC.Builtins: coercibleTyCon :: TyCon
+ GHC.Builtins: coercibleTyConKey :: Unique
+ GHC.Builtins: consDataCon :: DataCon
+ GHC.Builtins: constraintKind :: Kind
+ GHC.Builtins: constraintKindTyCon :: TyCon
+ GHC.Builtins: doublePrimTy :: Type
+ GHC.Builtins: doubleTy :: Type
+ GHC.Builtins: doubleTyCon :: TyCon
+ GHC.Builtins: eqClass :: Class
+ GHC.Builtins: eqDataCon :: DataCon
+ GHC.Builtins: eqPhantPrimTyCon :: TyCon
+ GHC.Builtins: eqPhantPrimTyConKey :: Unique
+ GHC.Builtins: eqPrimTyCon :: TyCon
+ GHC.Builtins: eqPrimTyConKey :: Unique
+ GHC.Builtins: eqReprPrimTyCon :: TyCon
+ GHC.Builtins: eqReprPrimTyConKey :: Unique
+ GHC.Builtins: eqTyCon :: TyCon
+ GHC.Builtins: eqTyConKey :: Unique
+ GHC.Builtins: equalityTyCon :: Role -> TyCon
+ GHC.Builtins: errorMessageTypeErrorFamName :: Name
+ GHC.Builtins: fUNTyCon :: TyCon
+ GHC.Builtins: falseDataCon :: DataCon
+ GHC.Builtins: floatPrimTy :: Type
+ GHC.Builtins: floatTy :: Type
+ GHC.Builtins: floatTyCon :: TyCon
+ GHC.Builtins: hasKey :: Uniquable a => a -> Unique -> Bool
+ GHC.Builtins: heqClass :: Class
+ GHC.Builtins: heqDataCon :: DataCon
+ GHC.Builtins: heqTyCon :: TyCon
+ GHC.Builtins: heqTyConKey :: Unique
+ GHC.Builtins: intDataCon :: DataCon
+ GHC.Builtins: intPrimTy :: Type
+ GHC.Builtins: intTy :: Type
+ GHC.Builtins: intTyCon :: TyCon
+ GHC.Builtins: integerTy :: Type
+ GHC.Builtins: integerTyCon :: TyCon
+ GHC.Builtins: justDataCon :: DataCon
+ GHC.Builtins: levityTy :: Type
+ GHC.Builtins: levityTyCon :: TyCon
+ GHC.Builtins: liftedDataConTy :: Type
+ GHC.Builtins: liftedDataConTyCon :: TyCon
+ GHC.Builtins: liftedRepTy :: RuntimeRepType
+ GHC.Builtins: liftedTypeKind :: Type
+ GHC.Builtins: liftedTypeKindTyCon :: TyCon
+ GHC.Builtins: listTyCon :: TyCon
+ GHC.Builtins: manyDataCon :: DataCon
+ GHC.Builtins: manyDataConTy :: Type
+ GHC.Builtins: maybeTyCon :: TyCon
+ GHC.Builtins: mkBoxedTupleTy :: [Type] -> Type
+ GHC.Builtins: mkConstraintTupleTy :: [Type] -> Type
+ GHC.Builtins: mkListTy :: Type -> Type
+ GHC.Builtins: mkMaybeTy :: Type -> Kind
+ GHC.Builtins: mkPromotedListTy :: Kind -> [Type] -> Type
+ GHC.Builtins: mkPromotedMaybeTy :: Kind -> Maybe Type -> Type
+ GHC.Builtins: mkPromotedPairTy :: Kind -> Kind -> Type -> Type -> Type
+ GHC.Builtins: mkProxyPrimTy :: Type -> Type -> Type
+ GHC.Builtins: mkStatePrimTy :: Type -> Type
+ GHC.Builtins: mkSumTy :: [Type] -> Type
+ GHC.Builtins: mkTupleTy :: Boxity -> [Type] -> Type
+ GHC.Builtins: mkTupleTy1 :: Boxity -> [Type] -> Type
+ GHC.Builtins: multiplicityTy :: Type
+ GHC.Builtins: multiplicityTyCon :: TyCon
+ GHC.Builtins: naturalTy :: Type
+ GHC.Builtins: naturalTyCon :: TyCon
+ GHC.Builtins: nilDataCon :: DataCon
+ GHC.Builtins: nothingDataCon :: DataCon
+ GHC.Builtins: oneDataCon :: DataCon
+ GHC.Builtins: oneDataConTy :: Type
+ GHC.Builtins: orderingTyCon :: TyCon
+ GHC.Builtins: promotedConsDataCon :: TyCon
+ GHC.Builtins: promotedEQDataCon :: TyCon
+ GHC.Builtins: promotedFalseDataCon :: TyCon
+ GHC.Builtins: promotedGTDataCon :: TyCon
+ GHC.Builtins: promotedJustDataCon :: TyCon
+ GHC.Builtins: promotedLTDataCon :: TyCon
+ GHC.Builtins: promotedNilDataCon :: TyCon
+ GHC.Builtins: promotedNothingDataCon :: TyCon
+ GHC.Builtins: promotedTrueDataCon :: TyCon
+ GHC.Builtins: promotedTupleDataCon :: Boxity -> Arity -> TyCon
+ GHC.Builtins: proxyPrimTyCon :: TyCon
+ GHC.Builtins: realWorldStatePrimTy :: Type
+ GHC.Builtins: realWorldTy :: Type
+ GHC.Builtins: realWorldTyCon :: TyCon
+ GHC.Builtins: runtimeRepTy :: Type
+ GHC.Builtins: runtimeRepTyCon :: TyCon
+ GHC.Builtins: stringTy :: Type
+ GHC.Builtins: sumDataCon :: ConTag -> Arity -> DataCon
+ GHC.Builtins: sumTyCon :: Arity -> TyCon
+ GHC.Builtins: tYPEKind :: Type
+ GHC.Builtins: tYPETyCon :: TyCon
+ GHC.Builtins: trueDataCon :: DataCon
+ GHC.Builtins: tupleDataCon :: Boxity -> Arity -> DataCon
+ GHC.Builtins: tupleTyCon :: Boxity -> Arity -> TyCon
+ GHC.Builtins: typeCharCmpTyCon :: TyCon
+ GHC.Builtins: typeCharToNatTyCon :: TyCon
+ GHC.Builtins: typeConsSymbolTyCon :: TyCon
+ GHC.Builtins: typeErrorAppendDataConName :: Name
+ GHC.Builtins: typeErrorShowTypeDataConName :: Name
+ GHC.Builtins: typeErrorTextDataConName :: Name
+ GHC.Builtins: typeErrorVAppendDataConName :: Name
+ GHC.Builtins: typeNatAddTyCon :: TyCon
+ GHC.Builtins: typeNatCmpTyCon :: TyCon
+ GHC.Builtins: typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule
+ GHC.Builtins: typeNatDivTyCon :: TyCon
+ GHC.Builtins: typeNatExpTyCon :: TyCon
+ GHC.Builtins: typeNatLogTyCon :: TyCon
+ GHC.Builtins: typeNatModTyCon :: TyCon
+ GHC.Builtins: typeNatMulTyCon :: TyCon
+ GHC.Builtins: typeNatSubTyCon :: TyCon
+ GHC.Builtins: typeNatToCharTyCon :: TyCon
+ GHC.Builtins: typeNatTyCons :: [TyCon]
+ GHC.Builtins: typeSymbolAppendTyCon :: TyCon
+ GHC.Builtins: typeSymbolCmpTyCon :: TyCon
+ GHC.Builtins: typeSymbolKind :: Kind
+ GHC.Builtins: typeSymbolKindCon :: TyCon
+ GHC.Builtins: typeToTypeKind :: Type
+ GHC.Builtins: typeUnconsSymbolTyCon :: TyCon
+ GHC.Builtins: unboxedSumKind :: [Type] -> Kind
+ GHC.Builtins: unboxedTupleKind :: [Type] -> Kind
+ GHC.Builtins: unitDataCon :: DataCon
+ GHC.Builtins: unitDataConId :: Id
+ GHC.Builtins: unitTy :: Type
+ GHC.Builtins: unitTyCon :: TyCon
+ GHC.Builtins: unliftedDataConTy :: Type
+ GHC.Builtins: unliftedDataConTyCon :: TyCon
+ GHC.Builtins: unliftedRepTy :: RuntimeRepType
+ GHC.Builtins: unliftedTypeKind :: Type
+ GHC.Builtins: wordDataCon :: DataCon
+ GHC.Builtins: wordPrimTy :: Type
+ GHC.Builtins: wordTy :: Type
+ GHC.Builtins: wordTyCon :: TyCon
+ GHC.Builtins: zeroBitRepTy :: RuntimeRepType
+ GHC.Builtins: zeroBitTypeKind :: Type
Files
- changelog.md +15/−0
- ghc-tcplugin-api.cabal +8/−8
- src/GHC/Builtins.hs +129/−0
- src/GHC/TcPlugin/API.hs +14/−20
- src/GHC/TcPlugin/API/Internal.hs +45/−27
changelog.md view
@@ -1,3 +1,18 @@+# Version 0.20.0.0 (2026-09-01) + +- Preliminary support for GHC 10.2 (with the known-entities refactor). + +- The re-exports of `GHC.Builtin.Names`, `GHC.Builtin.Types` and + `GHC.Builtin.Types.Prim` have been replaced by a single umbrella helper + module, `GHC.Builtins`. Remarks: + + - GHC 10.2 no longer defines static `Name`s for known-key entities. Instead, + these need to be resolved at runtime. Accordingly, `GHC.Builtins` + exports `KnownKey` uniques such as `errorMessageTypeErrorFamKey` on + GHC >= 10.2, instead of `Name`s such as `errorMessageTypeErrorFamName`. + + - The `MonadThings` class has been removed. Use `tcLookupTyCon`, + `tcLookupDataCon` etc instead. # Version 0.19.0.0 (2026-05-12)
ghc-tcplugin-api.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ghc-tcplugin-api -version: 0.19.0.0 +version: 0.20.0.0 synopsis: An API for type-checker plugins. license: BSD-3-Clause build-type: Simple @@ -39,11 +39,11 @@ containers >= 0.6 && < 0.9, ghc - >= 8.8 && < 10.1, + >= 8.8 && < 10.3, transformers >= 0.5 && < 0.7, template-haskell - >= 2.15 && < 2.26, + >= 2.15 && < 3, default-language: Haskell2010 @@ -64,13 +64,12 @@ GHC.TcPlugin.API.Names, GHC.TcPlugin.API.TyConSubst, - GHC.TcPlugin.API.Internal + GHC.TcPlugin.API.Internal, + GHC.Builtins + reexported-modules: - GHC.Builtin.Names - , GHC.Builtin.Types - , GHC.Builtin.Types.Prim - , GHC.Core.Make + GHC.Core.Make , GHC.Plugins , GHC.Types.Unique.DFM , GHC.Types.Unique.FM @@ -100,6 +99,7 @@ , PrelNames as GHC.Builtin.Names , TysWiredIn as GHC.Builtin.Types + , TcTypeNats as GHC.Builtin.Types.Literals , TysPrim as GHC.Builtin.Types.Prim , CoreSyn as GHC.Core
+ src/GHC/Builtins.hs view
@@ -0,0 +1,129 @@+{-# LANGUAGE CPP #-} + +-- | Helper umbrella re-exports of various known entities to GHC: known-key +-- uniques, wired-in types. +module GHC.Builtins + ( -- * Known-key uniques + hasKey + , eqTyConKey, heqTyConKey, coercibleTyConKey + , eqPrimTyConKey, eqReprPrimTyConKey, eqPhantPrimTyConKey + + -- * Custom type errors (prefer using 'GHC.TcPlugin.API.mkTcPluginErrorTy') +#if MIN_VERSION_ghc(10,1,0) + , errorMessageTypeErrorFamKey + , typeErrorTextDataConKey, typeErrorShowTypeDataConKey + , typeErrorAppendDataConKey, typeErrorVAppendDataConKey +#else + , errorMessageTypeErrorFamName + , typeErrorTextDataConName, typeErrorShowTypeDataConName + , typeErrorAppendDataConName, typeErrorVAppendDataConName +#endif + + -- * Equality and coercions + , eqTyCon, heqTyCon, coercibleTyCon + , eqPrimTyCon, eqReprPrimTyCon, eqPhantPrimTyCon + , eqClass, heqClass, coercibleClass + , eqDataCon, heqDataCon, coercibleDataCon +#if MIN_VERSION_ghc(8,10,0) + , equalityTyCon +#endif + + -- * Kinds + , liftedTypeKind, constraintKind, typeSymbolKind + , unboxedTupleKind, unboxedSumKind + , liftedTypeKindTyCon, constraintKindTyCon, tYPETyCon + , anyTy, anyTyCon, anyTypeOfKind +#if MIN_VERSION_ghc(8,10,0) + , typeToTypeKind +#endif +#if MIN_VERSION_ghc(9,1,0) + , unliftedTypeKind +#endif +#if MIN_VERSION_ghc(9,3,0) + , zeroBitTypeKind +#endif +#if MIN_VERSION_ghc(9,5,0) + , tYPEKind, cONSTRAINTKind, cONSTRAINTTyCon, fUNTyCon +#endif + + -- * Runtime representations, levities and multiplicities + , runtimeRepTy, runtimeRepTyCon, liftedRepTy +#if MIN_VERSION_ghc(9,0,0) + , multiplicityTy, multiplicityTyCon + , manyDataCon, oneDataCon, manyDataConTy, oneDataConTy +#endif +#if MIN_VERSION_ghc(9,1,0) + , unliftedRepTy, boxedRepDataConTyCon, levityTyCon + , liftedDataConTy, unliftedDataConTy + , liftedDataConTyCon, unliftedDataConTyCon +#endif +#if MIN_VERSION_ghc(9,3,0) + , levityTy, zeroBitRepTy +#endif + + -- * Wired-in types + , unitTy, unitTyCon, unitDataCon, unitDataConId + , boolTy, boolTyCon, trueDataCon, falseDataCon + , promotedTrueDataCon, promotedFalseDataCon + , orderingTyCon, promotedLTDataCon, promotedEQDataCon, promotedGTDataCon + , charTy, charTyCon, charDataCon + , intTy, intTyCon, intDataCon + , wordTy, wordTyCon, wordDataCon + , floatTy, floatTyCon, doubleTy, doubleTyCon + , stringTy + , listTyCon, nilDataCon, consDataCon + , promotedNilDataCon, promotedConsDataCon + , maybeTyCon, justDataCon, nothingDataCon + , promotedJustDataCon, promotedNothingDataCon +#if MIN_VERSION_ghc(9,0,0) + , integerTy, integerTyCon, naturalTy, naturalTyCon +#endif +#if !MIN_VERSION_ghc(9,1,0) + , typeNatKind +#endif + + -- * Tuples and sums + , tupleTyCon, tupleDataCon, promotedTupleDataCon + , sumTyCon, sumDataCon + , mkTupleTy, mkBoxedTupleTy, mkSumTy + , mkListTy, mkPromotedListTy +#if MIN_VERSION_ghc(8,10,0) + , mkTupleTy1 +#endif +#if MIN_VERSION_ghc(9,1,0) + , cTupleTyCon, cTupleDataCon + , mkMaybeTy, mkPromotedMaybeTy, mkPromotedPairTy +#endif +#if MIN_VERSION_ghc(9,5,0) + , mkConstraintTupleTy +#endif + + -- * Type-level literals + , typeNatTyCons, typeNatCoAxiomRules + , typeNatAddTyCon, typeNatSubTyCon, typeNatMulTyCon, typeNatExpTyCon + , typeNatDivTyCon, typeNatModTyCon, typeNatLogTyCon, typeNatCmpTyCon + , typeSymbolCmpTyCon, typeSymbolAppendTyCon, typeSymbolKindCon +#if MIN_VERSION_ghc(9,1,0) + , typeConsSymbolTyCon, typeUnconsSymbolTyCon + , typeCharCmpTyCon, typeCharToNatTyCon, typeNatToCharTyCon +#endif + + -- * Primitive types + , intPrimTy, wordPrimTy, charPrimTy, floatPrimTy, doublePrimTy + , realWorldTy, realWorldTyCon, realWorldStatePrimTy + , mkStatePrimTy, mkProxyPrimTy, proxyPrimTyCon + ) + where + +-- ghc +#if MIN_VERSION_ghc(10,1,0) +import GHC.Builtin.KnownKeys +import GHC.Builtin.WiredIn.Prim +import GHC.Builtin.WiredIn.TypeLits +import GHC.Builtin.WiredIn.Types +#else +import GHC.Builtin.Names +import GHC.Builtin.Types +import GHC.Builtin.Types.Literals +import GHC.Builtin.Types.Prim +#endif
src/GHC/TcPlugin/API.hs view
@@ -511,7 +511,6 @@ -- | == Names , Name, OccName, TyThing, TcTyThing - , MonadThings(..) , Class(classTyCon), DataCon, TyCon, Id , FastString @@ -559,25 +558,6 @@ -- ghc import GHC ( TyThing(..) ) -import GHC.Builtin.Names - ( hasKey - , eqPrimTyConKey, eqReprPrimTyConKey - , heqTyConKey, eqTyConKey, coercibleTyConKey - ) -import GHC.Builtin.Types - ( typeSymbolKind, charTy -#if MIN_VERSION_ghc(9,1,0) - , naturalTy -#else - , typeNatKind -#endif - ) -#if !MIN_VERSION_ghc(9,0,0) -import GHC.Builtin.Types - ( intDataCon ) -import GHC.Builtin.Types.Prim - ( intPrimTy ) -#endif import GHC.Core ( CoreBndr, CoreExpr, Expr(..), mkTyApps, mkApps ) import GHC.Core.Class @@ -885,6 +865,20 @@ ( filterOut ) -- ghc-tcplugin-api +import GHC.Builtins + ( hasKey + , eqPrimTyConKey, eqReprPrimTyConKey + , heqTyConKey, eqTyConKey, coercibleTyConKey + , typeSymbolKind, charTy +#if MIN_VERSION_ghc(9,1,0) + , naturalTy +#else + , typeNatKind +#endif +#if !MIN_VERSION_ghc(9,0,0) + , intDataCon, intPrimTy +#endif + ) import GHC.TcPlugin.API.Internal #ifndef HAS_REWRITING import GHC.TcPlugin.API.Internal.Shim
src/GHC/TcPlugin/API/Internal.hs view
@@ -51,7 +51,6 @@ , TcPluginM(..) , TcPluginErrorMessage(..) , TcPluginRewriter - , MonadThings(..) , askRewriteEnv , askDeriveds , askEvBinds @@ -75,17 +74,6 @@ ( ReaderT(..) ) -- ghc -import qualified GHC.Builtin.Names - as GHC.TypeLits - ( errorMessageTypeErrorFamName - , typeErrorTextDataConName - , typeErrorAppendDataConName - , typeErrorVAppendDataConName - , typeErrorShowTypeDataConName - ) -import qualified GHC.Builtin.Types - as GHC - ( constraintKind ) import qualified GHC.Core.DataCon as GHC ( promoteDataCon ) @@ -104,6 +92,11 @@ import qualified GHC.Tc.Plugin as GHC ( tcLookupDataCon, tcLookupTyCon ) +#if MIN_VERSION_ghc(10,1,0) +import qualified GHC.Tc.Utils.Env + as GHC + ( rnLookupKnownKeyName ) +#endif import qualified GHC.Tc.Types as GHC ( TcM, TcPlugin(..), TcPluginM @@ -134,12 +127,7 @@ import qualified GHC.Types.Unique.FM as GHC ( UniqFM ) -#if MIN_VERSION_ghc(9,1,0) -import GHC.Types.TyThing - ( MonadThings(..) ) -#else -import GHC.Driver.Types - ( MonadThings(..) ) +#if !MIN_VERSION_ghc(9,1,0) import GHC.Tc.Types.Constraint ( ctEvidence, ctEvId, isDerived ) import GHC.Types.Var.Env @@ -150,6 +138,26 @@ #endif -- ghc-tcplugin-api +import qualified GHC.Builtins + as GHC + ( constraintKind ) +import qualified GHC.Builtins + as GHC.TypeError +#if MIN_VERSION_ghc(10,1,0) + ( errorMessageTypeErrorFamKey + , typeErrorTextDataConKey + , typeErrorAppendDataConKey + , typeErrorVAppendDataConKey + , typeErrorShowTypeDataConKey + ) +#else + ( errorMessageTypeErrorFamName + , typeErrorTextDataConName + , typeErrorAppendDataConName + , typeErrorVAppendDataConName + , typeErrorShowTypeDataConName + ) +#endif #ifndef HAS_REWRITING import GHC.TcPlugin.API.Internal.Shim ( TcPluginSolveResult, TcPluginRewriteResult(..) @@ -622,10 +630,6 @@ errorMsgTy = interpretErrorMessage builtinDefs msg pure $ GHC.mkTyConApp typeErrorTyCon [ GHC.constraintKind, errorMsgTy ] -instance ( Monad ( TcPluginM s ), MonadTcPlugin ( TcPluginM s ) ) - => MonadThings ( TcPluginM s ) where - lookupThing = unsafeLiftTcM . lookupThing - -------------------------------------------------------------------------------- -- Private types and functions. -- Not exposed at all, even from the internal module. @@ -647,11 +651,25 @@ initBuiltinDefs :: GHC.TcPluginM BuiltinDefs initBuiltinDefs = do - typeErrorTyCon <- GHC.tcLookupTyCon GHC.TypeLits.errorMessageTypeErrorFamName - textTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon GHC.TypeLits.typeErrorTextDataConName - showTypeTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon GHC.TypeLits.typeErrorShowTypeDataConName - concatTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon GHC.TypeLits.typeErrorAppendDataConName - vcatTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon GHC.TypeLits.typeErrorVAppendDataConName +#if MIN_VERSION_ghc(10,1,0) + let lookupBuiltin = GHC.unsafeTcPluginTcM . GHC.rnLookupKnownKeyName + typeErrorName <- lookupBuiltin GHC.TypeError.errorMessageTypeErrorFamKey + textName <- lookupBuiltin GHC.TypeError.typeErrorTextDataConKey + showTypeName <- lookupBuiltin GHC.TypeError.typeErrorShowTypeDataConKey + concatName <- lookupBuiltin GHC.TypeError.typeErrorAppendDataConKey + vcatName <- lookupBuiltin GHC.TypeError.typeErrorVAppendDataConKey +#else + let typeErrorName = GHC.TypeError.errorMessageTypeErrorFamName + textName = GHC.TypeError.typeErrorTextDataConName + showTypeName = GHC.TypeError.typeErrorShowTypeDataConName + concatName = GHC.TypeError.typeErrorAppendDataConName + vcatName = GHC.TypeError.typeErrorVAppendDataConName +#endif + typeErrorTyCon <- GHC.tcLookupTyCon typeErrorName + textTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon textName + showTypeTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon showTypeName + concatTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon concatName + vcatTyCon <- GHC.promoteDataCon <$> GHC.tcLookupDataCon vcatName pure ( BuiltinDefs { .. } ) interpretErrorMessage :: BuiltinDefs -> TcPluginErrorMessage -> GHC.PredType