Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.TypeLits.Presburger.Compat
Synopsis
- data TyCon
- data Type
- data Unique
- data Subst = Subst InScopeSet IdSubstEnv TvSubstEnv CvSubstEnv
- data NoExtField = NoExtField
- data Plugin = Plugin {
- installCoreToDos :: CorePlugin
- tcPlugin :: TcPlugin
- defaultingPlugin :: DefaultingPlugin
- holeFitPlugin :: HoleFitPlugin
- driverPlugin :: [CommandLineOption] -> HscEnv -> IO HscEnv
- pluginRecompile :: [CommandLineOption] -> IO PluginRecompile
- parsedResultAction :: [CommandLineOption] -> ModSummary -> ParsedResult -> Hsc ParsedResult
- renamedResultAction :: [CommandLineOption] -> TcGblEnv -> HsGroup GhcRn -> TcM (TcGblEnv, HsGroup GhcRn)
- typeCheckResultAction :: [CommandLineOption] -> ModSummary -> TcGblEnv -> TcM TcGblEnv
- spliceRunAction :: [CommandLineOption] -> LHsExpr GhcTc -> TcM (LHsExpr GhcTc)
- interfaceLoadAction :: forall lcl. [CommandLineOption] -> ModIface -> IfM lcl ModIface
- data GenericUnitInfo srcpkgid srcpkgname uid modulename mod = GenericUnitInfo {
- unitId :: uid
- unitInstanceOf :: uid
- unitInstantiations :: [(modulename, mod)]
- unitPackageId :: srcpkgid
- unitPackageName :: srcpkgname
- unitPackageVersion :: Version
- unitComponentName :: Maybe srcpkgname
- unitAbiHash :: ShortText
- unitDepends :: [uid]
- unitAbiDepends :: [(uid, ShortText)]
- unitImportDirs :: [FilePathST]
- unitLibraries :: [ShortText]
- unitExtDepLibsSys :: [ShortText]
- unitExtDepLibsGhc :: [ShortText]
- unitLibraryDirs :: [FilePathST]
- unitLibraryDynDirs :: [FilePathST]
- unitExtDepFrameworks :: [ShortText]
- unitExtDepFrameworkDirs :: [FilePathST]
- unitLinkerOptions :: [ShortText]
- unitCcOptions :: [ShortText]
- unitIncludes :: [ShortText]
- unitIncludeDirs :: [FilePathST]
- unitHaddockInterfaces :: [FilePathST]
- unitHaddockHTMLs :: [FilePathST]
- unitExposedModules :: [(modulename, Maybe mod)]
- unitHiddenModules :: [modulename]
- unitIsIndefinite :: Bool
- unitIsExposed :: Bool
- unitIsTrusted :: Bool
- data FastString
- data Role
- data ModuleName
- data CtOrigin
- = GivenOrigin SkolemInfoAnon
- | GivenSCOrigin SkolemInfoAnon ScDepth Bool
- | OccurrenceOf Name
- | OccurrenceOfRecSel RdrName
- | AppOrigin
- | SpecPragOrigin UserTypeCtxt
- | TypeEqOrigin { }
- | KindEqOrigin TcType TcType CtOrigin (Maybe TypeOrKind)
- | IPOccOrigin HsIPName
- | OverLabelOrigin FastString
- | LiteralOrigin (HsOverLit GhcRn)
- | NegateOrigin
- | ArithSeqOrigin (ArithSeqInfo GhcRn)
- | AssocFamPatOrigin
- | SectionOrigin
- | HasFieldOrigin FastString
- | TupleOrigin
- | ExprSigOrigin
- | PatSigOrigin
- | PatOrigin
- | ProvCtxtOrigin (PatSynBind GhcRn GhcRn)
- | RecordUpdOrigin
- | ViewPatOrigin
- | ScOrigin ClsInstOrQC NakedScFlag
- | DerivClauseOrigin
- | DerivOriginDC DataCon Int Bool
- | DerivOriginCoerce Id Type Type Bool
- | StandAloneDerivOrigin
- | DefaultOrigin
- | DoOrigin
- | DoPatOrigin (LPat GhcRn)
- | MCompOrigin
- | MCompPatOrigin (LPat GhcRn)
- | ProcOrigin
- | ArrowCmdOrigin
- | AnnOrigin
- | FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan
- | FunDepOrigin2 PredType CtOrigin PredType SrcSpan
- | InjTFOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan
- | ExprHoleOrigin (Maybe RdrName)
- | TypeHoleOrigin OccName
- | PatCheckOrigin
- | ListOrigin
- | IfThenElseOrigin
- | BracketOrigin
- | StaticOrigin
- | Shouldn'tHappenOrigin String
- | GhcBug20076
- | InstProvidedOrigin Module ClsInst
- | NonLinearPatternOrigin
- | UsageEnvironmentOf Name
- | CycleBreakerOrigin CtOrigin
- | FRROrigin FixedRuntimeRepOrigin
- | WantedSuperclassOrigin PredType CtOrigin
- | InstanceSigOrigin Name Type Type
- | AmbiguityCheckOrigin UserTypeCtxt
- data IsBootInterface
- type TyVar = Var
- type TyConRepName = Name
- data TyLit = NumTyLit Integer
- data UnivCoProvenance
- type GhcPs = GhcPass 'Parsed
- data ImportDecl pass
- = ImportDecl {
- ideclExt :: XCImportDecl pass
- ideclName :: XRec pass ModuleName
- ideclPkgQual :: ImportDeclPkgQual pass
- ideclSource :: IsBootInterface
- ideclSafe :: Bool
- ideclQualified :: ImportDeclQualifiedStyle
- ideclAs :: Maybe (XRec pass ModuleName)
- ideclImportList :: Maybe (ImportListInterpretation, XRec pass [LIE pass])
- | XImportDecl !(XXImportDecl pass)
- = ImportDecl {
- data ImportDeclQualifiedStyle
- newtype PackageName = PackageName {}
- data Hsc a
- data BuiltInSynFamily = BuiltInSynFamily {
- sfMatchFam :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
- sfInteractTop :: [Type] -> Type -> [TypeEqn]
- sfInteractInert :: [Type] -> Type -> [Type] -> Type -> [TypeEqn]
- data TyConFlavour
- data ExpandSynResult tyco
- = NoExpansion
- | ExpandsSyn [(TyVar, tyco)] Type [tyco]
- data PrimElemRep
- data PrimRep
- data FamTyConFlav
- data Injectivity
- = NotInjective
- | Injective [Bool]
- data AlgTyConFlav
- data PromDataConInfo
- = NoPromInfo
- | RuntimeRep ([Type] -> [PrimRep])
- | VecCount Int
- | VecElem PrimElemRep
- | Levity Levity
- data AlgTyConRhs
- = AbstractTyCon
- | DataTyCon {
- data_cons :: [DataCon]
- data_cons_size :: Int
- is_enum :: Bool
- is_type_data :: Bool
- data_fixed_lev :: Bool
- | TupleTyCon { }
- | SumTyCon {
- data_cons :: [DataCon]
- data_cons_size :: Int
- | NewTyCon {
- data_con :: DataCon
- nt_rhs :: Type
- nt_etad_rhs :: ([TyVar], Type)
- nt_co :: CoAxiom Unbranched
- nt_fixed_rep :: Bool
- data TyConBndrVis
- type TyConPiTyBinder = VarBndr TyCoVar TyConBndrVis
- type TyConBinder = VarBndr TyVar TyConBndrVis
- type TvSubstEnv = TyVarEnv Type
- data EqRel
- data Pred
- data HsModule p
- = HsModule {
- hsmodExt :: XCModule p
- hsmodName :: Maybe (XRec p ModuleName)
- hsmodExports :: Maybe (XRec p [LIE p])
- hsmodImports :: [LImportDecl p]
- hsmodDecls :: [LHsDecl p]
- | XModule !(XXModule p)
- = HsModule {
- data FamInstMatch = FamInstMatch {}
- data InjectivityCheckResult
- data FamInstEnv
- type FamInstEnvs = (FamInstEnv, FamInstEnv)
- data FamFlavor
- data FamInst = FamInst {}
- data EvTerm
- data UnitDatabase unit = UnitDatabase {
- unitDatabasePath :: FilePath
- unitDatabaseUnits :: [GenUnitInfo unit]
- data HsParsedModule = HsParsedModule {
- hpm_module :: Located (HsModule GhcPs)
- hpm_src_files :: [FilePath]
- data CtLoc = CtLoc {}
- data CtEvidence
- data Ct
- data HscEnv
- data TcPluginSolveResult where
- TcPluginSolveResult {
- tcPluginInsolubleCts :: [Ct]
- tcPluginSolvedCts :: [(EvTerm, Ct)]
- tcPluginNewCts :: [Ct]
- pattern TcPluginOk :: [(EvTerm, Ct)] -> [Ct] -> TcPluginSolveResult
- pattern TcPluginContradiction :: [Ct] -> TcPluginSolveResult
- TcPluginSolveResult {
- data TcPlugin = TcPlugin {
- tcPluginInit :: TcPluginM s
- tcPluginSolve :: s -> TcPluginSolver
- tcPluginRewrite :: s -> UniqFM TyCon TcPluginRewriter
- tcPluginStop :: s -> TcPluginM ()
- data TcPluginM a
- type PredTree = Pred
- data TvSubst = TvSubst InScopeSet TvSubstEnv
- type TCvSubst = Subst
- newtype TypeEq = TypeEq {}
- type Substitution = [(TcTyVar, TcType)]
- type RawPackageName = FastString
- type ModuleUnit = Unit
- type HsModule' = HsModule
- text :: IsLine doc => String -> doc
- splitTyConApp :: Type -> (TyCon, [Type])
- mkTyConTy :: TyCon -> Type
- unpackFS :: FastString -> String
- fsLit :: String -> FastString
- noExtField :: NoExtField
- mkModuleName :: String -> ModuleName
- ppr :: Outputable a => a -> SDoc
- showSDocUnsafe :: SDoc -> String
- getUnique :: Uniquable a => a -> Unique
- getKey :: Unique -> Int
- mkPrelTyConRepName :: Name -> TyConRepName
- tyConRepName_maybe :: TyCon -> Maybe TyConRepName
- isUnboxedTupleTyCon :: TyCon -> Bool
- isTupleTyCon :: TyCon -> Bool
- mkUniqSet :: Uniquable a => [a] -> UniqSet a
- elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool
- mkModule :: u -> ModuleName -> GenModule u
- dataConWrapId :: DataCon -> Id
- cTupleDataCon :: Arity -> DataCon
- mkTcOcc :: String -> OccName
- emptyOccSet :: OccSet
- mkInstTyTcOcc :: String -> OccSet -> OccName
- tyConAppTyCon_maybe :: Type -> Maybe TyCon
- splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- typeKind :: HasDebugCallStack => Type -> Kind
- mkBaseModule :: FastString -> Module
- mkUnivCo :: UnivCoProvenance -> Role -> Type -> Type -> Coercion
- classTyCon :: Class -> TyCon
- className :: Class -> Name
- algTcFields :: TyConDetails -> FieldLabelEnv
- mkAnonTyConBinder :: TyVar -> TyConBinder
- mkAnonTyConBinders :: [TyVar] -> [TyConBinder]
- mkInvisAnonTyConBinder :: TyVar -> TyConBinder
- mkNamedTyConBinder :: ForAllTyFlag -> TyVar -> TyConBinder
- mkNamedTyConBinders :: ForAllTyFlag -> [TyVar] -> [TyConBinder]
- mkRequiredTyConBinder :: TyCoVarSet -> TyVar -> TyConBinder
- tyConBinderForAllTyFlag :: TyConBinder -> ForAllTyFlag
- tyConBndrVisForAllTyFlag :: TyConBndrVis -> ForAllTyFlag
- isNamedTyConBinder :: TyConBinder -> Bool
- isVisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
- isVisibleTcbVis :: TyConBndrVis -> Bool
- isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
- mkTyConKind :: [TyConBinder] -> Kind -> Kind
- tyConInvisTVBinders :: [TyConBinder] -> [InvisTVBinder]
- tyConVisibleTyVars :: TyCon -> [TyVar]
- mkLevPolyDataTyConRhs :: Bool -> Bool -> [DataCon] -> AlgTyConRhs
- mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
- visibleDataCons :: AlgTyConRhs -> [DataCon]
- isNoParent :: AlgTyConFlav -> Bool
- tyConRepModOcc :: Module -> OccName -> (Module, OccName)
- isVoidRep :: PrimRep -> Bool
- isGcPtrRep :: PrimRep -> Bool
- primRepCompatible :: Platform -> PrimRep -> PrimRep -> Bool
- primRepsCompatible :: Platform -> [PrimRep] -> [PrimRep] -> Bool
- primRepSizeB :: Platform -> PrimRep -> Int
- primElemRepSizeB :: Platform -> PrimElemRep -> Int
- primElemRepToPrimRep :: PrimElemRep -> PrimRep
- primRepIsFloat :: PrimRep -> Maybe Bool
- primRepIsWord :: PrimRep -> Bool
- primRepIsInt :: PrimRep -> Bool
- tyConFieldLabels :: TyCon -> [FieldLabel]
- lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel
- mkAlgTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Maybe CType -> [PredType] -> AlgTyConRhs -> AlgTyConFlav -> Bool -> TyCon
- mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon
- mkTupleTyCon :: Name -> [TyConBinder] -> Kind -> DataCon -> TupleSort -> AlgTyConFlav -> TyCon
- mkSumTyCon :: Name -> [TyConBinder] -> Kind -> [DataCon] -> AlgTyConFlav -> TyCon
- mkTcTyCon :: Name -> [TyConBinder] -> Kind -> [(Name, TcTyVar)] -> Bool -> TyConFlavour -> TyCon
- noTcTyConScopedTyVars :: [(Name, TcTyVar)]
- mkPrimTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
- mkSynonymTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Type -> Bool -> Bool -> Bool -> TyCon
- mkFamilyTyCon :: Name -> [TyConBinder] -> Kind -> Maybe Name -> FamTyConFlav -> Maybe Class -> Injectivity -> TyCon
- mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConPiTyBinder] -> Kind -> [Role] -> PromDataConInfo -> TyCon
- isAbstractTyCon :: TyCon -> Bool
- isPrimTyCon :: TyCon -> Bool
- isAlgTyCon :: TyCon -> Bool
- isVanillaAlgTyCon :: TyCon -> Bool
- isDataTyCon :: TyCon -> Bool
- isTypeDataTyCon :: TyCon -> Bool
- isInjectiveTyCon :: TyCon -> Role -> Bool
- isGenerativeTyCon :: TyCon -> Role -> Bool
- isGenInjAlgRhs :: AlgTyConRhs -> Bool
- isNewTyCon :: TyCon -> Bool
- unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)
- unwrapNewTyConEtad_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)
- isTypeSynonymTyCon :: TyCon -> Bool
- isTauTyCon :: TyCon -> Bool
- isFamFreeTyCon :: TyCon -> Bool
- isForgetfulSynTyCon :: TyCon -> Bool
- tyConMustBeSaturated :: TyCon -> Bool
- isGadtSyntaxTyCon :: TyCon -> Bool
- isEnumerationTyCon :: TyCon -> Bool
- isFamilyTyCon :: TyCon -> Bool
- isOpenFamilyTyCon :: TyCon -> Bool
- isTypeFamilyTyCon :: TyCon -> Bool
- isDataFamilyTyCon :: TyCon -> Bool
- isOpenTypeFamilyTyCon :: TyCon -> Bool
- isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched)
- isBuiltInSynFamTyCon_maybe :: TyCon -> Maybe BuiltInSynFamily
- tyConFamilyResVar_maybe :: TyCon -> Maybe Name
- tyConInjectivityInfo :: TyCon -> Injectivity
- isTyConAssoc :: TyCon -> Bool
- tyConAssoc_maybe :: TyCon -> Maybe TyCon
- tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon
- tyConTuple_maybe :: TyCon -> Maybe TupleSort
- isBoxedTupleTyCon :: TyCon -> Bool
- isUnboxedSumTyCon :: TyCon -> Bool
- isLiftedAlgTyCon :: TyCon -> Bool
- isPromotedDataCon_maybe :: TyCon -> Maybe DataCon
- isPromotedTupleTyCon :: TyCon -> Bool
- isPromotedDataCon :: TyCon -> Bool
- isDataKindsPromotedDataCon :: TyCon -> Bool
- isKindTyCon :: TyCon -> Bool
- isLiftedTypeKindTyConName :: Name -> Bool
- isImplicitTyCon :: TyCon -> Bool
- tyConCType_maybe :: TyCon -> Maybe CType
- tcHasFixedRuntimeRep :: TyCon -> Bool
- isConcreteTyCon :: TyCon -> Bool
- isTcTyCon :: TyCon -> Bool
- setTcTyConKind :: TyCon -> Kind -> TyCon
- isMonoTcTyCon :: TyCon -> Bool
- tcTyConScopedTyVars :: TyCon -> [(Name, TcTyVar)]
- expandSynTyCon_maybe :: TyCon -> [tyco] -> ExpandSynResult tyco
- isTyConWithSrcDataCons :: TyCon -> Bool
- tyConDataCons :: TyCon -> [DataCon]
- tyConDataCons_maybe :: TyCon -> Maybe [DataCon]
- tyConSingleDataCon_maybe :: TyCon -> Maybe DataCon
- tyConSingleDataCon :: TyCon -> DataCon
- tyConSingleAlgDataCon_maybe :: TyCon -> Maybe DataCon
- tyConAlgDataCons_maybe :: TyCon -> Maybe [DataCon]
- tyConFamilySize :: TyCon -> Int
- algTyConRhs :: TyCon -> AlgTyConRhs
- newTyConRhs :: TyCon -> ([TyVar], Type)
- newTyConEtadArity :: TyCon -> Int
- newTyConEtadRhs :: TyCon -> ([TyVar], Type)
- newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched)
- newTyConCo :: TyCon -> CoAxiom Unbranched
- newTyConDataCon_maybe :: TyCon -> Maybe DataCon
- tyConStupidTheta :: TyCon -> [PredType]
- synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type)
- synTyConRhs_maybe :: TyCon -> Maybe Type
- famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav
- isClassTyCon :: TyCon -> Bool
- tyConClass_maybe :: TyCon -> Maybe Class
- tyConATs :: TyCon -> [TyCon]
- isFamInstTyCon :: TyCon -> Bool
- tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched)
- tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type])
- tyConFamilyCoercion_maybe :: TyCon -> Maybe (CoAxiom Unbranched)
- tyConPromDataConInfo :: TyCon -> PromDataConInfo
- mkTyConTagMap :: TyCon -> NameEnv ConTag
- tyConFlavour :: TyCon -> TyConFlavour
- tcFlavourIsOpen :: TyConFlavour -> Bool
- pprPromotionQuote :: TyCon -> SDoc
- tyConSkolem :: TyCon -> Bool
- mkTyVarTy :: TyVar -> Type
- emptySubst :: Subst
- unionSubst :: Subst -> Subst -> Subst
- substTy :: TvSubst -> Type -> Type
- isNumLitTy :: Type -> Maybe Integer
- isStrLitTy :: Type -> Maybe FastString
- eqType :: Type -> Type -> Bool
- mkPrimEqPredRole :: Role -> Type -> Type -> PredType
- tcUnifyTy :: Type -> Type -> Maybe TvSubst
- classifyPredType :: Type -> PredTree
- isEqPred :: PredType -> Bool
- lookupTyCon :: MonadThings m => Name -> m TyCon
- eqTyConName :: Name
- cTupleTyCon :: Arity -> TyCon
- boolTyCon :: TyCon
- nilDataCon :: DataCon
- consDataCon :: DataCon
- promotedTrueDataCon :: TyCon
- promotedFalseDataCon :: TyCon
- promotedLTDataCon :: TyCon
- promotedEQDataCon :: TyCon
- promotedGTDataCon :: TyCon
- famInstAxiom :: FamInst -> CoAxiom Unbranched
- famInstRHS :: FamInst -> Type
- famInstTyCon :: FamInst -> TyCon
- famInstsRepTyCons :: [FamInst] -> [TyCon]
- famInstRepTyCon_maybe :: FamInst -> Maybe TyCon
- dataFamInstRepTyCon :: FamInst -> TyCon
- orphNamesOfFamInst :: FamInst -> NameSet
- pprFamInst :: FamInst -> SDoc
- pprFamInsts :: [FamInst] -> SDoc
- mkImportedFamInst :: Name -> [RoughMatchTc] -> CoAxiom Unbranched -> FamInst
- famInstEnvSize :: FamInstEnv -> Int
- emptyFamInstEnvs :: (FamInstEnv, FamInstEnv)
- emptyFamInstEnv :: FamInstEnv
- famInstEnvElts :: FamInstEnv -> [FamInst]
- familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst]
- familyNameInstances :: (FamInstEnv, FamInstEnv) -> Name -> [FamInst]
- unionFamInstEnv :: FamInstEnv -> FamInstEnv -> FamInstEnv
- extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv
- extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv
- compatibleBranches :: CoAxBranch -> CoAxBranch -> Bool
- injectiveBranches :: [Bool] -> CoAxBranch -> CoAxBranch -> InjectivityCheckResult
- mkCoAxBranch :: [TyVar] -> [TyVar] -> [CoVar] -> [Type] -> Type -> [Role] -> SrcSpan -> CoAxBranch
- mkBranchedCoAxiom :: Name -> TyCon -> [CoAxBranch] -> CoAxiom Branched
- mkUnbranchedCoAxiom :: Name -> TyCon -> CoAxBranch -> CoAxiom Unbranched
- mkSingleCoAxiom :: Role -> Name -> [TyVar] -> [TyVar] -> [CoVar] -> TyCon -> [Type] -> Type -> CoAxiom Unbranched
- mkNewTypeCoAxiom :: Name -> TyCon -> [TyVar] -> [Role] -> Type -> CoAxiom Unbranched
- lookupFamInstEnvByTyCon :: FamInstEnvs -> TyCon -> [FamInst]
- lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch]
- lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [FamInst]
- lookupFamInstEnvInjectivityConflicts :: [Bool] -> FamInstEnvs -> FamInst -> [CoAxBranch]
- isDominatedBy :: CoAxBranch -> [CoAxBranch] -> Bool
- reduceTyFamApp_maybe :: FamInstEnvs -> Role -> TyCon -> [Type] -> Maybe Reduction
- apartnessCheck :: [Type] -> CoAxBranch -> Bool
- topNormaliseType :: FamInstEnvs -> Type -> Type
- topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe Reduction
- topReduceTyFamApp_maybe :: FamInstEnvs -> TyCon -> [Type] -> Maybe HetReduction
- normaliseType :: FamInstEnvs -> Role -> Type -> Reduction
- normaliseTcApp :: FamInstEnvs -> Role -> TyCon -> [Type] -> Reduction
- tcTyFamInsts :: Type -> [(TyCon, [Type])]
- evCast :: EvExpr -> TcCoercion -> EvTerm
- classInstances :: InstEnvs -> Class -> [ClsInst]
- lookupPackageName :: UnitState -> PackageName -> Maybe UnitId
- ctEvidence :: Ct -> CtEvidence
- ctEvPred :: CtEvidence -> TcPredType
- isWanted :: CtEvidence -> Bool
- initialSubGoalDepth :: SubGoalDepth
- unsafeTcPluginTcM :: TcM a -> TcPluginM a
- purePlugin :: [CommandLineOption] -> IO PluginRecompile
- defaultPlugin :: Plugin
- lookupName :: Module -> OccName -> TcPluginM Name
- typeNatTyCons :: [TyCon]
- typeNatAddTyCon :: TyCon
- typeNatSubTyCon :: TyCon
- typeNatMulTyCon :: TyCon
- typeNatDivTyCon :: TyCon
- typeNatModTyCon :: TyCon
- typeNatExpTyCon :: TyCon
- typeNatLogTyCon :: TyCon
- typeNatCmpTyCon :: TyCon
- typeSymbolCmpTyCon :: TyCon
- typeSymbolAppendTyCon :: TyCon
- typeConsSymbolTyCon :: TyCon
- typeUnconsSymbolTyCon :: TyCon
- typeCharToNatTyCon :: TyCon
- typeNatToCharTyCon :: TyCon
- typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule
- typeCharCmpTyCon :: TyCon
- getTopEnv :: TcPluginM HscEnv
- getCtLocM :: CtOrigin -> Maybe TypeOrKind -> TcM CtLoc
- newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence
- newFlexiTyVar :: Kind -> TcPluginM TcTyVar
- lookupOrig :: Module -> OccName -> TcPluginM Name
- tcLookupClass :: Name -> TcPluginM Class
- tcLookupTyCon :: Name -> TcPluginM TyCon
- getInstEnvs :: TcPluginM InstEnvs
- matchFam :: TyCon -> [Type] -> TcPluginM (Maybe Reduction)
- tcPluginIO :: IO a -> TcPluginM a
- tcPluginTrace :: String -> SDoc -> TcPluginM ()
- lookupModule :: ModuleName -> FastString -> TcPluginM Module
- evByFiat :: String -> Type -> Type -> EvTerm
- tracePlugin :: String -> TcPlugin -> TcPlugin
- dATA_TYPE_EQUALITY :: Module
- unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- emptyTCvSubst :: Subst
- toTCv :: TvSubst -> TCvSubst
- emptyTvSubst :: TvSubst
- unionTvSubst :: TvSubst -> TvSubst -> TvSubst
- fromTCv :: TCvSubst -> TvSubst
- promotedBoolTyCon :: TyCon
- viewFunTy :: Type -> Maybe (Type, Type)
- getEqTyCon :: TcPluginM TyCon
- getEqWitnessTyCon :: TcPluginM TyCon
- getEqBoolTyCon :: TcPluginM TyCon
- decompFunTy :: Type -> [Type]
- isTrivial :: PredType -> Bool
- normaliseGivens :: [Ct] -> TcPluginM [Ct]
- subsCt :: Substitution -> Ct -> Ct
- subsType :: Substitution -> Type -> Type
- mkSubstitution :: [Ct] -> Substitution
- fsToUnitId :: FastString -> UnitId
- loadedPackageNames :: [UnitDatabase UnitId] -> UnitState -> [RawPackageName]
- preloadedUnitsM :: TcPluginM [RawPackageName]
- moduleUnit' :: Module -> ModuleUnit
- typeNatKind :: TcType
- mtypeNatLeqTyCon :: Maybe TyCon
- dATA_TYPE_ORD :: Module
- lookupTyNatPredLeq :: TcPluginM Name
- lookupTyNatBoolLeq :: TcPluginM TyCon
- lookupAssertTyCon :: TcPluginM (Maybe TyCon)
- lookupTyNatPredLt :: TcPluginM (Maybe TyCon)
- lookupTyNatBoolLt :: TcPluginM (Maybe TyCon)
- lookupTyNatPredGt :: TcPluginM (Maybe TyCon)
- lookupTyNatBoolGt :: TcPluginM (Maybe TyCon)
- lookupTyNatPredGeq :: TcPluginM (Maybe TyCon)
- lookupTyNatBoolGeq :: TcPluginM (Maybe TyCon)
- mOrdCondTyCon :: TcPluginM (Maybe TyCon)
- lookupTyGenericCompare :: TcPluginM (Maybe TyCon)
- lookupBool47 :: String -> TcPluginM (Maybe TyCon)
- lookupTyNot :: TcPluginM (Maybe TyCon)
- lookupTyIf :: TcPluginM (Maybe TyCon)
- lookupTyAnd :: TcPluginM (Maybe TyCon)
- lookupTyOr :: TcPluginM (Maybe TyCon)
- matchFam' :: TyCon -> [Type] -> TcPluginM (Maybe Type)
- getVoidTyCon :: TcPluginM TyCon
Documentation
TyCons represent type constructors. Type constructors are introduced by things such as:
1) Data declarations: data Foo = ...
creates the Foo
type constructor of
kind *
2) Type synonyms: type Foo = ...
creates the Foo
type constructor
3) Newtypes: newtype Foo a = MkFoo ...
creates the Foo
type constructor
of kind * -> *
4) Class declarations: class Foo where
creates the Foo
type constructor
of kind *
This data type also encodes a number of primitive, built in type constructors such as those for function and tuple types.
If you edit this type, you may need to update the GHC formalism See Note [GHC Formalism] in GHC.Core.Lint
Instances
Data TyCon | |
Defined in GHC.Core.TyCon Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyCon -> c TyCon # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyCon # dataTypeOf :: TyCon -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyCon) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyCon) # gmapT :: (forall b. Data b => b -> b) -> TyCon -> TyCon # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyCon -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyCon -> r # gmapQ :: (forall d. Data d => d -> u) -> TyCon -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyCon -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCon -> m TyCon # | |
NamedThing TyCon | |
Defined in GHC.Core.TyCon | |
Uniquable TyCon | |
Defined in GHC.Core.TyCon | |
Outputable TyCon | |
Defined in GHC.Core.TyCon | |
Eq TyCon | |
Constructors
TyVarTy Var | Vanilla type or kind variable (*never* a coercion variable) |
AppTy Type Type | Type application to something other than a 1) Function: must not be a 2) Argument type |
TyConApp TyCon [KindOrType] | Application of a 1) Type constructor being applied to. 2) Type arguments. Might not have enough type arguments here to saturate the constructor. Even type synonyms are not necessarily saturated; for example unsaturated type synonyms can appear as the right hand side of a type synonym. |
ForAllTy !ForAllTyBinder Type | A Π type. Note [When we quantify over a coercion variable] INVARIANT: If the binder is a coercion variable, it must be mentioned in the Type. See Note [Unused coercion variable in ForAllTy] |
FunTy | FUN m t1 t2 Very common, so an important special case See Note [Function types] |
LitTy TyLit | Type literals are similar to type constructors. |
CastTy Type KindCoercion | A kind cast. The coercion is always nominal. INVARIANT: The cast is never reflexive (EQ2) INVARIANT: The Type is not a CastTy (use TransCo instead) (EQ3) INVARIANT: The Type is not a ForAllTy over a tyvar (EQ4) See Note [Respecting definitional equality] |
CoercionTy Coercion | Injection of a Coercion into a type This should only ever be used in the RHS of an AppTy, in the list of a TyConApp, when applying a promoted GADT data constructor |
Instances
Data Type | |
Defined in GHC.Core.TyCo.Rep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type # dataTypeOf :: Type -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) # gmapT :: (forall b. Data b => b -> b) -> Type -> Type # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # | |
Outputable Type | |
Defined in GHC.Core.TyCo.Rep | |
Eq (DeBruijn Type) | |
Unique identifier.
The type of unique identifiers that are used in many places in GHC
for fast ordering and equality tests. You should generate these with
the functions from the UniqSupply
module
These are sometimes also referred to as "keys" in comments in GHC.
Instances
Show Unique | |
Uniquable Unique | |
Defined in GHC.Types.Unique | |
Outputable Unique | |
Defined in GHC.Types.Unique | |
Eq Unique | |
Type & coercion & id substitution
The Subst data type defined in this module contains substitution for tyvar, covar and id. However, operations on IdSubstEnv (mapping from Id to CoreExpr) that require the definition of the Expr data type are defined in GHC.Core.Subst to avoid circular module dependency.
Constructors
Subst InScopeSet IdSubstEnv TvSubstEnv CvSubstEnv |
Instances
Outputable Subst | |
Defined in GHC.Core.TyCo.Subst |
data NoExtField #
A placeholder type for TTG extension points that are not currently unused to represent any particular value.
This should not be confused with DataConCantHappen
, which are found in unused
extension constructors and therefore should never be inhabited. In
contrast, NoExtField
is used in extension points (e.g., as the field of
some constructor), so it must have an inhabitant to construct AST passes
that manipulate fields with that extension point as their type.
Constructors
NoExtField |
Instances
Data NoExtField | |
Defined in Language.Haskell.Syntax.Extension Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NoExtField -> c NoExtField # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c NoExtField # toConstr :: NoExtField -> Constr # dataTypeOf :: NoExtField -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c NoExtField) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c NoExtField) # gmapT :: (forall b. Data b => b -> b) -> NoExtField -> NoExtField # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NoExtField -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NoExtField -> r # gmapQ :: (forall d. Data d => d -> u) -> NoExtField -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NoExtField -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NoExtField -> m NoExtField # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NoExtField -> m NoExtField # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NoExtField -> m NoExtField # | |
Eq NoExtField | |
Defined in Language.Haskell.Syntax.Extension | |
Ord NoExtField | |
Defined in Language.Haskell.Syntax.Extension Methods compare :: NoExtField -> NoExtField -> Ordering # (<) :: NoExtField -> NoExtField -> Bool # (<=) :: NoExtField -> NoExtField -> Bool # (>) :: NoExtField -> NoExtField -> Bool # (>=) :: NoExtField -> NoExtField -> Bool # max :: NoExtField -> NoExtField -> NoExtField # min :: NoExtField -> NoExtField -> NoExtField # |
Plugin
is the compiler plugin data type. Try to avoid
constructing one of these directly, and just modify some fields of
defaultPlugin
instead: this is to try and preserve source-code
compatibility when we add fields to this.
Nonetheless, this API is preliminary and highly likely to change in the future.
Constructors
Plugin | |
Fields
|
data GenericUnitInfo srcpkgid srcpkgname uid modulename mod #
Information about an unit (a unit is an installed module library).
This is a subset of Cabal's InstalledPackageInfo
, with just the bits
that GHC is interested in.
Some types are left as parameters to be instantiated differently in ghc-pkg and in ghc itself.
Constructors
GenericUnitInfo | |
Fields
|
Instances
Binary DbUnitInfo | |
Defined in GHC.Unit.Database | |
(Show uid, Show modulename, Show mod, Show srcpkgid, Show srcpkgname) => Show (GenericUnitInfo srcpkgid srcpkgname uid modulename mod) | |
Defined in GHC.Unit.Database Methods showsPrec :: Int -> GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> ShowS # show :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> String # showList :: [GenericUnitInfo srcpkgid srcpkgname uid modulename mod] -> ShowS # | |
(Eq uid, Eq modulename, Eq mod, Eq srcpkgid, Eq srcpkgname) => Eq (GenericUnitInfo srcpkgid srcpkgname uid modulename mod) | |
Defined in GHC.Unit.Database Methods (==) :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> Bool # (/=) :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> Bool # |
data FastString #
A FastString
is a UTF-8 encoded string together with a unique ID. All
FastString
s are stored in a global hashtable to support fast O(1)
comparison.
It is also associated with a lazy reference to the Z-encoding of this string which is used by the compiler internally.
Instances
See Note [Roles] in GHC.Core.Coercion
Order of constructors matters: the Ord instance coincides with the *super*typing relation on roles.
Constructors
Nominal | |
Representational | |
Phantom |
Instances
Data Role | |
Defined in Language.Haskell.Syntax.Basic Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role # dataTypeOf :: Role -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) # gmapT :: (forall b. Data b => b -> b) -> Role -> Role # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # | |
Eq Role | |
Ord Role | |
type Anno (Maybe Role) | |
type Anno (Maybe Role) | |
data ModuleName #
A ModuleName is essentially a simple string, e.g. Data.List
.
Instances
Constructors
GivenOrigin SkolemInfoAnon | A given constraint from a user-written type signature. The
|
GivenSCOrigin |
|
Fields
| |
OccurrenceOf Name | |
OccurrenceOfRecSel RdrName | |
AppOrigin | |
SpecPragOrigin UserTypeCtxt | |
TypeEqOrigin | |
Fields
| |
KindEqOrigin TcType TcType CtOrigin (Maybe TypeOrKind) | |
IPOccOrigin HsIPName | |
OverLabelOrigin FastString | |
LiteralOrigin (HsOverLit GhcRn) | |
NegateOrigin | |
ArithSeqOrigin (ArithSeqInfo GhcRn) | |
AssocFamPatOrigin | |
SectionOrigin | |
HasFieldOrigin FastString | |
TupleOrigin | |
ExprSigOrigin | |
PatSigOrigin | |
PatOrigin | |
ProvCtxtOrigin (PatSynBind GhcRn GhcRn) | |
RecordUpdOrigin | |
ViewPatOrigin | |
ScOrigin ClsInstOrQC NakedScFlag |
|
DerivClauseOrigin | |
DerivOriginDC DataCon Int Bool | |
DerivOriginCoerce Id Type Type Bool | |
StandAloneDerivOrigin | |
DefaultOrigin | |
DoOrigin | |
DoPatOrigin (LPat GhcRn) | |
MCompOrigin | |
MCompPatOrigin (LPat GhcRn) | |
ProcOrigin | |
ArrowCmdOrigin | |
AnnOrigin | |
FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan | |
FunDepOrigin2 PredType CtOrigin PredType SrcSpan | |
InjTFOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan | |
ExprHoleOrigin (Maybe RdrName) | |
TypeHoleOrigin OccName | |
PatCheckOrigin | |
ListOrigin | |
IfThenElseOrigin | |
BracketOrigin | |
StaticOrigin | |
Shouldn'tHappenOrigin String | |
GhcBug20076 | |
InstProvidedOrigin | Testing whether the constraint associated with an instance declaration in a signature file is satisfied upon instantiation. Test cases: backpackshould_failbkpfail{11,43}.bkp |
NonLinearPatternOrigin | |
UsageEnvironmentOf Name | |
CycleBreakerOrigin CtOrigin | |
FRROrigin FixedRuntimeRepOrigin | |
WantedSuperclassOrigin PredType CtOrigin | |
InstanceSigOrigin Name Type Type | |
AmbiguityCheckOrigin UserTypeCtxt |
Instances
Outputable CtOrigin | |
Defined in GHC.Tc.Types.Origin |
data IsBootInterface #
Indicates whether a module name is referring to a boot interface (hs-boot file) or regular module (hs file). We need to treat boot modules specially when building compilation graphs, since they break cycles. Regular source files and signature files are treated equivalently.
Instances
type TyConRepName = Name #
Instances
Data TyLit | |
Defined in GHC.Core.TyCo.Rep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyLit -> c TyLit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyLit # dataTypeOf :: TyLit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyLit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyLit) # gmapT :: (forall b. Data b => b -> b) -> TyLit -> TyLit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyLit -> r # gmapQ :: (forall d. Data d => d -> u) -> TyLit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyLit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyLit -> m TyLit # | |
Outputable TyLit | |
Defined in GHC.Core.TyCo.Rep | |
Eq TyLit | |
data UnivCoProvenance #
For simplicity, we have just one UnivCo that represents a coercion from
some type to some other type, with (in general) no restrictions on the
type. The UnivCoProvenance specifies more exactly what the coercion really
is and why a program should (or shouldn't!) trust the coercion.
It is reasonable to consider each constructor of UnivCoProvenance
as a totally independent coercion form; their only commonality is
that they don't tell you what types they coercion between. (That info
is in the UnivCo
constructor of Coercion
.
Constructors
PhantomProv KindCoercion | See Note [Phantom coercions]. Only in Phantom roled coercions |
ProofIrrelProv KindCoercion | From the fact that any two coercions are considered equivalent. See Note [ProofIrrelProv]. Can be used in Nominal or Representational coercions |
PluginProv String | From a plugin, which asserts that this coercion is sound. The string is for the use of the plugin. |
CorePrepProv Bool |
Instances
Data UnivCoProvenance | |
Defined in GHC.Core.TyCo.Rep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnivCoProvenance -> c UnivCoProvenance # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnivCoProvenance # toConstr :: UnivCoProvenance -> Constr # dataTypeOf :: UnivCoProvenance -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnivCoProvenance) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnivCoProvenance) # gmapT :: (forall b. Data b => b -> b) -> UnivCoProvenance -> UnivCoProvenance # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r # gmapQ :: (forall d. Data d => d -> u) -> UnivCoProvenance -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnivCoProvenance -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance # | |
Outputable UnivCoProvenance | |
Defined in GHC.Core.TyCo.Rep Methods ppr :: UnivCoProvenance -> SDoc # |
data ImportDecl pass #
Import Declaration
A single Haskell import
declaration.
Constructors
ImportDecl | |
Fields
| |
XImportDecl !(XXImportDecl pass) |
Instances
type Anno (ImportDecl (GhcPass p)) | |
Defined in GHC.Hs.ImpExp |
data ImportDeclQualifiedStyle #
If/how an import is qualified
.
Constructors
QualifiedPre |
|
QualifiedPost |
|
NotQualified | Not qualified. |
Instances
newtype PackageName #
Constructors
PackageName | |
Fields |
Instances
Uniquable PackageName | |
Defined in GHC.Unit.Info Methods getUnique :: PackageName -> Unique # | |
Outputable PackageName | |
Defined in GHC.Unit.Info Methods ppr :: PackageName -> SDoc # | |
Eq PackageName | |
Defined in GHC.Unit.Info |
The Hsc monad: Passing an environment and diagnostic state
Instances
MonadIO Hsc | |
Defined in GHC.Driver.Env.Types | |
Applicative Hsc | |
Functor Hsc | |
Monad Hsc | |
HasDynFlags Hsc | |
Defined in GHC.Driver.Env.Types Methods getDynFlags :: Hsc DynFlags # | |
HasLogger Hsc | |
Defined in GHC.Driver.Env.Types |
data BuiltInSynFamily #
Constructors
BuiltInSynFamily | |
Fields
|
data TyConFlavour #
Paints a picture of what a TyCon
represents, in broad strokes.
This is used towards more informative error messages.
Constructors
Instances
Outputable TyConFlavour | |
Defined in GHC.Core.TyCon Methods ppr :: TyConFlavour -> SDoc # | |
Eq TyConFlavour | |
Defined in GHC.Core.TyCon |
data ExpandSynResult tyco #
Constructors
NoExpansion | |
ExpandsSyn [(TyVar, tyco)] Type [tyco] |
data PrimElemRep #
Constructors
Int8ElemRep | |
Int16ElemRep | |
Int32ElemRep | |
Int64ElemRep | |
Word8ElemRep | |
Word16ElemRep | |
Word32ElemRep | |
Word64ElemRep | |
FloatElemRep | |
DoubleElemRep |
Instances
A PrimRep
is an abstraction of a type. It contains information that
the code generator needs in order to pass arguments, return results,
and store values of this type. See also Note [RuntimeRep and PrimRep] in
GHC.Types.RepType and Note [VoidRep] in GHC.Types.RepType.
Constructors
VoidRep | |
LiftedRep | |
UnliftedRep | Unlifted pointer |
Int8Rep | Signed, 8-bit value |
Int16Rep | Signed, 16-bit value |
Int32Rep | Signed, 32-bit value |
Int64Rep | Signed, 64 bit value |
IntRep | Signed, word-sized value |
Word8Rep | Unsigned, 8 bit value |
Word16Rep | Unsigned, 16 bit value |
Word32Rep | Unsigned, 32 bit value |
Word64Rep | Unsigned, 64 bit value |
WordRep | Unsigned, word-sized value |
AddrRep | A pointer, but not to a Haskell value (use '(Un)liftedRep') |
FloatRep | |
DoubleRep | |
VecRep Int PrimElemRep | A vector |
Instances
Data PrimRep | |
Defined in GHC.Core.TyCon Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrimRep -> c PrimRep # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrimRep # toConstr :: PrimRep -> Constr # dataTypeOf :: PrimRep -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrimRep) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrimRep) # gmapT :: (forall b. Data b => b -> b) -> PrimRep -> PrimRep # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrimRep -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrimRep -> r # gmapQ :: (forall d. Data d => d -> u) -> PrimRep -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PrimRep -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrimRep -> m PrimRep # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimRep -> m PrimRep # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrimRep -> m PrimRep # | |
Show PrimRep | |
Binary PrimRep | |
Outputable PrimRep | |
Defined in GHC.Core.TyCon | |
Eq PrimRep | |
Ord PrimRep | |
data FamTyConFlav #
Information pertaining to the expansion of a type synonym (type
)
Constructors
DataFamilyTyCon TyConRepName | Represents an open type family without a fixed right hand side. Additional instances can appear at any time. These are introduced by either a top level declaration: data family T a :: * Or an associated data type declaration, within a class declaration: class C a b where data T b :: * |
OpenSynFamilyTyCon | An open type synonym family e.g. |
ClosedSynFamilyTyCon (Maybe (CoAxiom Branched)) | A closed type synonym family e.g.
|
AbstractClosedSynFamilyTyCon | A closed type synonym family declared in an hs-boot file with type family F a where .. |
BuiltInSynFamTyCon BuiltInSynFamily | Built-in type family used by the TypeNats solver |
Instances
Outputable FamTyConFlav | |
Defined in GHC.Core.TyCon Methods ppr :: FamTyConFlav -> SDoc # |
data Injectivity #
Constructors
NotInjective | |
Injective [Bool] |
Instances
Binary Injectivity | |
Defined in GHC.Core.TyCon Methods put_ :: BinHandle -> Injectivity -> IO () # put :: BinHandle -> Injectivity -> IO (Bin Injectivity) # get :: BinHandle -> IO Injectivity # | |
Eq Injectivity | |
Defined in GHC.Core.TyCon |
data AlgTyConFlav #
Describes the flavour of an algebraic type constructor. For
classes and data families, this flavour includes a reference to
the parent TyCon
.
Constructors
VanillaAlgTyCon TyConRepName | An ordinary algebraic type constructor. This includes unlifted and representation-polymorphic datatypes and newtypes and unboxed tuples, but NOT unboxed sums; see UnboxedSumTyCon. |
UnboxedSumTyCon | An unboxed sum type constructor. This is distinct from VanillaAlgTyCon because we currently don't allow unboxed sums to be Typeable since there are too many of them. See #13276. |
ClassTyCon Class TyConRepName | Type constructors representing a class dictionary. See Note [ATyCon for classes] in GHC.Core.TyCo.Rep |
DataFamInstTyCon (CoAxiom Unbranched) TyCon [Type] | Type constructors representing an *instance* of a *data* family. Parameters: 1) The type family in question 2) Instance types; free variables are the 3) A |
Instances
Outputable AlgTyConFlav | |
Defined in GHC.Core.TyCon Methods ppr :: AlgTyConFlav -> SDoc # |
data PromDataConInfo #
Some promoted datacons signify extra info relevant to GHC. For example,
the IntRep
constructor of RuntimeRep
corresponds to the IntRep
constructor of PrimRep
. This data structure allows us to store this
information right in the TyCon
. The other approach would be to look
up things like RuntimeRep
's PrimRep
by known-key every time.
See also Note [Getting from RuntimeRep to PrimRep] in GHC.Types.RepType
Constructors
NoPromInfo | an ordinary promoted data con |
RuntimeRep ([Type] -> [PrimRep]) | A constructor of |
VecCount Int | A constructor of |
VecElem PrimElemRep | A constructor of |
Levity Levity | A constructor of |
data AlgTyConRhs #
Represents right-hand-sides of TyCon
s for algebraic types
Constructors
AbstractTyCon | Says that we know nothing about this data type, except that it's represented by a pointer. Used when we export a data type abstractly into an .hi file. |
DataTyCon | Information about those |
Fields
| |
TupleTyCon | |
SumTyCon | An unboxed sum type. |
Fields
| |
NewTyCon | Information about those |
Fields
|
data TyConBndrVis #
Constructors
NamedTCB ForAllTyFlag | |
AnonTCB FunTyFlag |
Instances
Binary TyConBndrVis | |
Defined in GHC.Core.TyCon Methods put_ :: BinHandle -> TyConBndrVis -> IO () # put :: BinHandle -> TyConBndrVis -> IO (Bin TyConBndrVis) # get :: BinHandle -> IO TyConBndrVis # | |
Outputable TyConBndrVis | |
Defined in GHC.Core.TyCon Methods ppr :: TyConBndrVis -> SDoc # | |
OutputableBndr tv => Outputable (VarBndr tv TyConBndrVis) | |
Defined in GHC.Core.TyCon Methods ppr :: VarBndr tv TyConBndrVis -> SDoc # |
type TyConPiTyBinder = VarBndr TyCoVar TyConBndrVis #
type TyConBinder = VarBndr TyVar TyConBndrVis #
A choice of equality relation. This is separate from the type Role
because Phantom
does not define a (non-trivial) equality relation.
Instances
Outputable EqRel | |
Defined in GHC.Core.Predicate | |
Eq EqRel | |
Ord EqRel | |
A predicate in the solver. The solver tries to prove Wanted predicates from Given ones.
Haskell Module
All we actually declare here is the top-level structure for a module.
Constructors
HsModule | |
Fields
| |
XModule !(XXModule p) |
data FamInstMatch #
Constructors
FamInstMatch | |
Instances
Outputable FamInstMatch | |
Defined in GHC.Core.FamInstEnv Methods ppr :: FamInstMatch -> SDoc # |
data InjectivityCheckResult #
Result of testing two type family equations for injectiviy.
Constructors
InjectivityAccepted | Either RHSs are distinct or unification of RHSs leads to unification of LHSs |
InjectivityUnified CoAxBranch CoAxBranch | RHSs unify but LHSs don't unify under that substitution. Relevant for closed type families where equation after unification might be overlapped (in which case it is OK if they don't unify). Constructor stores axioms after unification. |
data FamInstEnv #
Instances
Outputable FamInstEnv | |
Defined in GHC.Core.FamInstEnv Methods ppr :: FamInstEnv -> SDoc # |
type FamInstEnvs = (FamInstEnv, FamInstEnv) #
Constructors
SynFamilyInst | |
DataFamilyInst TyCon |
Constructors
FamInst | |
Instances
NamedThing FamInst | |
Defined in GHC.Core.FamInstEnv | |
Outputable FamInst | |
Defined in GHC.Core.FamInstEnv |
Instances
Data EvTerm | |
Defined in GHC.Tc.Types.Evidence Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EvTerm -> c EvTerm # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EvTerm # toConstr :: EvTerm -> Constr # dataTypeOf :: EvTerm -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EvTerm) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EvTerm) # gmapT :: (forall b. Data b => b -> b) -> EvTerm -> EvTerm # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EvTerm -> r # gmapQ :: (forall d. Data d => d -> u) -> EvTerm -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> EvTerm -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EvTerm -> m EvTerm # | |
Outputable EvTerm | |
Defined in GHC.Tc.Types.Evidence |
data UnitDatabase unit #
Unit database
Constructors
UnitDatabase | |
Fields
|
Instances
Outputable u => Outputable (UnitDatabase u) | |
Defined in GHC.Unit.State Methods ppr :: UnitDatabase u -> SDoc # |
data HsParsedModule #
Constructors
HsParsedModule | |
Fields
|
Constructors
CtLoc | |
Fields
|
data CtEvidence #
Instances
Outputable CtEvidence | |
Defined in GHC.Tc.Types.Constraint Methods ppr :: CtEvidence -> SDoc # |
Instances
Outputable Ct | |
Defined in GHC.Tc.Types.Constraint |
HscEnv is like Session
, except that some of the fields are immutable.
An HscEnv is used to compile a single module from plain Haskell source
code (after preprocessing) to either C, assembly or C--. It's also used
to store the dynamic linker state to allow for multiple linkers in the
same address space.
Things like the module graph don't change during a single compilation.
Historical note: "hsc" used to be the name of the compiler binary, when there was a separate driver and compiler. To compile a single module, the driver would invoke hsc on the source code... so nowadays we think of hsc as the layer of the compiler that deals with compiling a single module.
Instances
ContainsDynFlags HscEnv | |
Defined in GHC.Driver.Env.Types Methods extractDynFlags :: HscEnv -> DynFlags # |
data TcPluginSolveResult #
Result of running a solver plugin.
Constructors
TcPluginSolveResult | |
Fields
|
Bundled Patterns
pattern TcPluginOk :: [(EvTerm, Ct)] -> [Ct] -> TcPluginSolveResult | The plugin has not found any contradictions, The first field is for constraints that were solved. The second field contains new work, that should be processed by the constraint solver. |
pattern TcPluginContradiction :: [Ct] -> TcPluginSolveResult | The plugin found a contradiction. The returned constraints are removed from the inert set, and recorded as insoluble. The returned list of constraints should never be empty. |
Constructors
TcPlugin | |
Fields
|
TcPluginM
is the monad in which type-checking plugins operate.
Instances
Constructors
TvSubst InScopeSet TvSubstEnv |
Instances
Outputable TvSubst Source # | |
Defined in GHC.TypeLits.Presburger.Compat |
type Substitution = [(TcTyVar, TcType)] Source #
type RawPackageName = FastString Source #
type ModuleUnit = Unit Source #
splitTyConApp :: Type -> (TyCon, [Type]) #
Attempts to tease a type apart into a type constructor and the application
of a number of arguments to that constructor. Panics if that is not possible.
See also splitTyConApp_maybe
(mkTyConTy tc) returns (TyConApp tc []) but arranges to share that TyConApp among all calls See Note [Sharing nullary TyConApps] So it's just an alias for tyConNullaryTy!
unpackFS :: FastString -> String #
Lazily unpacks and decodes the FastString
fsLit :: String -> FastString #
mkModuleName :: String -> ModuleName #
ppr :: Outputable a => a -> SDoc #
showSDocUnsafe :: SDoc -> String #
mkPrelTyConRepName :: Name -> TyConRepName #
Make a Name
for the Typeable
representation of the given wired-in type
isUnboxedTupleTyCon :: TyCon -> Bool #
Is this the TyCon
for an unboxed tuple?
isTupleTyCon :: TyCon -> Bool #
Does this TyCon
represent a tuple?
NB: when compiling Data.Tuple
, the tycons won't reply True
to
isTupleTyCon
, because they are built as AlgTyCons
. However they
get spat into the interface file as tuple tycons, so I don't think
it matters.
elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool #
mkModule :: u -> ModuleName -> GenModule u #
dataConWrapId :: DataCon -> Id #
Returns an Id which looks like the Haskell-source constructor by using
the wrapper if it exists (see dataConWrapId_maybe
) and failing over to
the worker (see dataConWorkId
)
cTupleDataCon :: Arity -> DataCon #
emptyOccSet :: OccSet #
Derive a name for the representation type constructor of a
data
/newtype
instance.
tyConAppTyCon_maybe :: Type -> Maybe TyCon #
The same as fst . splitTyConApp
We can short-cut the FunTy case
splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) #
Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor
typeKind :: HasDebugCallStack => Type -> Kind #
mkBaseModule :: FastString -> Module #
Arguments
:: UnivCoProvenance | |
-> Role | role of the built coercion, "r" |
-> Type | t1 :: k1 |
-> Type | t2 :: k2 |
-> Coercion | :: t1 ~r t2 |
Make a universal coercion between two arbitrary types.
classTyCon :: Class -> TyCon #
algTcFields :: TyConDetails -> FieldLabelEnv #
Maps a label to information about the field
mkAnonTyConBinder :: TyVar -> TyConBinder #
mkAnonTyConBinders :: [TyVar] -> [TyConBinder] #
mkNamedTyConBinder :: ForAllTyFlag -> TyVar -> TyConBinder #
mkNamedTyConBinders :: ForAllTyFlag -> [TyVar] -> [TyConBinder] #
mkRequiredTyConBinder :: TyCoVarSet -> TyVar -> TyConBinder #
Make a Required TyConBinder. It chooses between NamedTCB and AnonTCB based on whether the tv is mentioned in the dependent set
isNamedTyConBinder :: TyConBinder -> Bool #
isVisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool #
isVisibleTcbVis :: TyConBndrVis -> Bool #
isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool #
mkTyConKind :: [TyConBinder] -> Kind -> Kind #
tyConInvisTVBinders :: [TyConBinder] -> [InvisTVBinder] #
tyConVisibleTyVars :: TyCon -> [TyVar] #
Arguments
:: Bool | whether the |
-> Bool | True if this is a "type data" declaration See Note [Type data declarations] in GHC.Rename.Module |
-> [DataCon] | |
-> AlgTyConRhs |
Create an AlgTyConRhs
from the data constructors,
for a potentially levity-polymorphic datatype (with UnliftedDatatypes
).
mkDataTyConRhs :: [DataCon] -> AlgTyConRhs #
Create an AlgTyConRhs
from the data constructors.
Use mkLevPolyDataConRhs
if the datatype can be levity-polymorphic
or if it comes from a "data type" declaration
visibleDataCons :: AlgTyConRhs -> [DataCon] #
Extract those DataCon
s that we are able to learn about. Note
that visibility in this sense does not correspond to visibility in
the context of any particular user program!
isNoParent :: AlgTyConFlav -> Bool #
tyConRepModOcc :: Module -> OccName -> (Module, OccName) #
The name (and defining module) for the Typeable representation (TyCon) of a type constructor.
See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.
isGcPtrRep :: PrimRep -> Bool #
primRepSizeB :: Platform -> PrimRep -> Int #
The size of a PrimRep
in bytes.
This applies also when used in a constructor, where we allow packing the
fields. For instance, in data Foo = Foo Float# Float#
the two fields will
take only 8 bytes, which for 64-bit arch will be equal to 1 word.
See also mkVirtHeapOffsetsWithPadding for details of how data fields are
laid out.
primElemRepSizeB :: Platform -> PrimElemRep -> Int #
primRepIsFloat :: PrimRep -> Maybe Bool #
Return if Rep stands for floating type, returns Nothing for vector types.
primRepIsWord :: PrimRep -> Bool #
primRepIsInt :: PrimRep -> Bool #
tyConFieldLabels :: TyCon -> [FieldLabel] #
The labels for the fields of this particular TyCon
lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel #
Look up a field label belonging to this TyCon
Arguments
:: Name | |
-> [TyConBinder] | Binders of the |
-> Kind | Result kind |
-> [Role] | The roles for each TyVar |
-> Maybe CType | The C type this type corresponds to when using the CAPI FFI |
-> [PredType] | Stupid theta: see |
-> AlgTyConRhs | Information about data constructors |
-> AlgTyConFlav | What flavour is it? (e.g. vanilla, type family) |
-> Bool | Was the |
-> TyCon |
This is the making of an algebraic TyCon
.
mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon #
Simpler specialization of mkAlgTyCon
for classes
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | Result kind of the |
-> DataCon | |
-> TupleSort | Whether the tuple is boxed or unboxed |
-> AlgTyConFlav | |
-> TyCon |
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | Kind of the resulting |
-> [DataCon] | |
-> AlgTyConFlav | |
-> TyCon |
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind only |
-> [(Name, TcTyVar)] | Scoped type variables; see Note [How TcTyCons work] in GHC.Tc.TyCl |
-> Bool | Is this TcTyCon generalised already? |
-> TyConFlavour | What sort of |
-> TyCon |
Makes a tycon suitable for use during type-checking. It stores a variety of details about the definition of the TyCon, but no right-hand side. It lives only during the type-checking of a mutually-recursive group of tycons; it is then zonked to a proper TyCon in zonkTcTyCon. See also Note [Kind checking recursive type and class declarations] in GHC.Tc.TyCl.
noTcTyConScopedTyVars :: [(Name, TcTyVar)] #
No scoped type variables (to be used with mkTcTyCon).
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind
Must answer |
-> [Role] | |
-> TyCon |
Create an primitive TyCon
, such as Int#
, Type
or RealWorld#
Primitive TyCons are marshalable iff not lifted.
If you'd like to change this, modify marshalablePrimTyCon.
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind |
-> [Role] | |
-> Type | |
-> Bool | |
-> Bool | |
-> Bool | |
-> TyCon |
Create a type synonym TyCon
Arguments
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind |
-> Maybe Name | |
-> FamTyConFlav | |
-> Maybe Class | |
-> Injectivity | |
-> TyCon |
Create a type family TyCon
mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConPiTyBinder] -> Kind -> [Role] -> PromDataConInfo -> TyCon #
Create a promoted data constructor TyCon
Somewhat dodgily, we give it the same Name
as the data constructor itself; when we pretty-print
the TyCon we add a quote; see the Outputable TyCon instance
isAbstractTyCon :: TyCon -> Bool #
Test if the TyCon
is algebraic but abstract (invisible data constructors)
isPrimTyCon :: TyCon -> Bool #
Does this TyCon
represent something that cannot be defined in Haskell?
isAlgTyCon :: TyCon -> Bool #
Returns True
if the supplied TyCon
resulted from either a
data
or newtype
declaration
isVanillaAlgTyCon :: TyCon -> Bool #
Returns True
for vanilla AlgTyCons -- that is, those created
with a data
or newtype
declaration.
isDataTyCon :: TyCon -> Bool #
Returns True
for data types that are definitely represented by
heap-allocated constructors. These are scrutinised by Core-level
case
expressions, and they get info tables allocated for them.
Generally, the function will be true for all data
types and false
for newtype
s, unboxed tuples, unboxed sums and type family
TyCon
s. But it is not guaranteed to return True
in all cases
that it could.
NB: for a data type family, only the instance TyCon
s
get an info table. The family declaration TyCon
does not
isTypeDataTyCon :: TyCon -> Bool #
Was this TyCon
declared as "type data"?
See Note [Type data declarations] in GHC.Rename.Module.
isInjectiveTyCon :: TyCon -> Role -> Bool #
isInjectiveTyCon
is true of TyCon
s for which this property holds
(where r is the role passed in):
If (T a1 b1 c1) ~r (T a2 b2 c2), then (a1 ~r1 a2), (b1 ~r2 b2), and (c1 ~r3 c2)
(where r1, r2, and r3, are the roles given by tyConRolesX tc r)
See also Note [Decomposing TyConApp equalities] in GHC.Tc.Solver.Canonical
isGenerativeTyCon :: TyCon -> Role -> Bool #
isGenerativeTyCon
is true of TyCon
s for which this property holds
(where r is the role passed in):
If (T tys ~r t), then (t's head ~r T).
See also Note [Decomposing TyConApp equalities] in GHC.Tc.Solver.Canonical
isGenInjAlgRhs :: AlgTyConRhs -> Bool #
Is this an AlgTyConRhs
of a TyCon
that is generative and injective
with respect to representational equality?
isNewTyCon :: TyCon -> Bool #
Is this TyCon
that for a newtype
unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched) #
unwrapNewTyConEtad_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched) #
isTypeSynonymTyCon :: TyCon -> Bool #
Is this a TyCon
representing a regular H98 type synonym (type
)?
isTauTyCon :: TyCon -> Bool #
isFamFreeTyCon :: TyCon -> Bool #
Is this tycon neither a type family nor a synonym that expands to a type family?
isForgetfulSynTyCon :: TyCon -> Bool #
Is this a forgetful type synonym? If this is a type synonym whose RHS does not mention one (or more) of its bound variables, returns True. Thus, False means that all bound variables appear on the RHS; True may not mean anything, as the test to set this flag is conservative.
tyConMustBeSaturated :: TyCon -> Bool #
True iff we can decompose (T a b c) into ((T a b) c) I.e. is it injective and generative w.r.t nominal equality? That is, if (T a b) ~N d e f, is it always the case that (T ~N d), (a ~N e) and (b ~N f)? Specifically NOT true of synonyms (open and otherwise)
It'd be unusual to call tyConMustBeSaturated on a regular H98 type synonym, because you should probably have expanded it first But regardless, it's not decomposable
isGadtSyntaxTyCon :: TyCon -> Bool #
Is this an algebraic TyCon
declared with the GADT syntax?
isEnumerationTyCon :: TyCon -> Bool #
Is this an algebraic TyCon
which is just an enumeration of values?
isFamilyTyCon :: TyCon -> Bool #
Is this a TyCon
, synonym or otherwise, that defines a family?
isOpenFamilyTyCon :: TyCon -> Bool #
Is this a TyCon
, synonym or otherwise, that defines a family with
instances?
isTypeFamilyTyCon :: TyCon -> Bool #
Is this a synonym TyCon
that can have may have further instances appear?
isDataFamilyTyCon :: TyCon -> Bool #
Is this a synonym TyCon
that can have may have further instances appear?
isOpenTypeFamilyTyCon :: TyCon -> Bool #
Is this an open type family TyCon?
isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched) #
Is this a non-empty closed type family? Returns Nothing
for
abstract or empty closed families.
tyConFamilyResVar_maybe :: TyCon -> Maybe Name #
Extract type variable naming the result of injective type family
tyConInjectivityInfo :: TyCon -> Injectivity #
returns tyConInjectivityInfo
tc
if Injective
istc
is an
injective tycon (where is
states for which tyConBinders
tc
is
injective), or NotInjective
otherwise.
isTyConAssoc :: TyCon -> Bool #
Is this TyCon for an associated type?
tyConAssoc_maybe :: TyCon -> Maybe TyCon #
Get the enclosing class TyCon (if there is one) for the given TyCon.
tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon #
Get the enclosing class TyCon (if there is one) for the given TyConFlavour
tyConTuple_maybe :: TyCon -> Maybe TupleSort #
isBoxedTupleTyCon :: TyCon -> Bool #
Is this the TyCon
for a boxed tuple?
isUnboxedSumTyCon :: TyCon -> Bool #
Is this the TyCon
for an unboxed sum?
isLiftedAlgTyCon :: TyCon -> Bool #
isPromotedDataCon_maybe :: TyCon -> Maybe DataCon #
Retrieves the promoted DataCon if this is a PromotedDataCon;
isPromotedTupleTyCon :: TyCon -> Bool #
Is this the TyCon
for a promoted tuple?
isPromotedDataCon :: TyCon -> Bool #
Is this a PromotedDataCon?
isDataKindsPromotedDataCon :: TyCon -> Bool #
This function identifies PromotedDataCon's from data constructors in `data T = K1 | K2`, promoted by -XDataKinds. These type constructors are printed with a tick mark 'K1 and 'K2, and similarly have a tick mark added to their OccName's.
In contrast, constructors in `type data T = K1 | K2` are printed and represented with their original undecorated names. See Note [Type data declarations] in GHC.Rename.Module
isKindTyCon :: TyCon -> Bool #
Is this tycon really meant for use at the kind level? That is, should it be permitted without -XDataKinds?
isLiftedTypeKindTyConName :: Name -> Bool #
isImplicitTyCon :: TyCon -> Bool #
Identifies implicit tycons that, in particular, do not go into interface files (because they are implicitly reconstructed when the interface is read).
Note that:
- Associated families are implicit, as they are re-constructed from the class declaration in which they reside, and
- Family instances are not implicit as they represent the instance body
(similar to a
dfun
does that for a class instance). - Tuples are implicit iff they have a wired-in name (namely: boxed and unboxed tuples are wired-in and implicit, but constraint tuples are not)
tyConCType_maybe :: TyCon -> Maybe CType #
tcHasFixedRuntimeRep :: TyCon -> Bool #
Does this TyCon
have a syntactically fixed RuntimeRep when fully applied,
as per Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete?
False is safe. True means we're sure. Does only a quick check, based on the TyCon's category.
See Note [Representation-polymorphic TyCons]
isConcreteTyCon :: TyCon -> Bool #
Is this TyCon
concrete (i.e. not a synonym/type family)?
Used for representation polymorphism checks.
setTcTyConKind :: TyCon -> Kind -> TyCon #
isMonoTcTyCon :: TyCon -> Bool #
tcTyConScopedTyVars :: TyCon -> [(Name, TcTyVar)] #
Arguments
:: TyCon | |
-> [tyco] | Arguments to |
-> ExpandSynResult tyco | Returns a |
isTyConWithSrcDataCons :: TyCon -> Bool #
Check if the tycon actually refers to a proper `data` or `newtype` with user defined constructors rather than one from a class or other construction.
tyConDataCons :: TyCon -> [DataCon] #
As tyConDataCons_maybe
, but returns the empty list of constructors if no
constructors could be found
tyConDataCons_maybe :: TyCon -> Maybe [DataCon] #
tyConSingleDataCon :: TyCon -> DataCon #
Like tyConSingleDataCon_maybe
, but panics if Nothing
.
tyConSingleAlgDataCon_maybe :: TyCon -> Maybe DataCon #
Like tyConSingleDataCon_maybe
, but returns Nothing
for newtypes.
tyConAlgDataCons_maybe :: TyCon -> Maybe [DataCon] #
Returns Just dcs
if the given TyCon
is a data
type, a tuple type
or a sum type with data constructors dcs. If the TyCon
has more than one
constructor, or represents a primitive or function type constructor then
Nothing
is returned.
Like tyConDataCons_maybe
, but returns Nothing
for newtypes.
tyConFamilySize :: TyCon -> Int #
algTyConRhs :: TyCon -> AlgTyConRhs #
Extract an AlgTyConRhs
with information about data constructors from an
algebraic or tuple TyCon
. Panics for any other sort of TyCon
newTyConRhs :: TyCon -> ([TyVar], Type) #
newTyConEtadArity :: TyCon -> Int #
The number of type parameters that need to be passed to a newtype to resolve it. May be less than in the definition if it can be eta-contracted.
newTyConEtadRhs :: TyCon -> ([TyVar], Type) #
newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched) #
newTyConCo :: TyCon -> CoAxiom Unbranched #
newTyConDataCon_maybe :: TyCon -> Maybe DataCon #
tyConStupidTheta :: TyCon -> [PredType] #
Find the "stupid theta" of the TyCon
. A "stupid theta" is the context
to the left of an algebraic type declaration, e.g. Eq a
in the declaration
data Eq a => T a ...
. See Note [The stupid context]
in GHC.Core.DataCon.
synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type) #
Extract the TyVar
s bound by a vanilla type synonym
and the corresponding (unsubstituted) right hand side.
synTyConRhs_maybe :: TyCon -> Maybe Type #
Extract the information pertaining to the right hand side of a type synonym
(type
) declaration.
famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav #
Extract the flavour of a type family (with all the extra information that it carries)
isClassTyCon :: TyCon -> Bool #
Is this TyCon
that for a class instance?
tyConClass_maybe :: TyCon -> Maybe Class #
If this TyCon
is that for a class instance, return the class it is for.
Otherwise returns Nothing
isFamInstTyCon :: TyCon -> Bool #
Is this TyCon
that for a data family instance?
tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched) #
tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type]) #
If this TyCon
is that of a data family instance, return the family in question
and the instance types. Otherwise, return Nothing
tyConPromDataConInfo :: TyCon -> PromDataConInfo #
Extract any RuntimeRepInfo
from this TyCon
mkTyConTagMap :: TyCon -> NameEnv ConTag #
tyConFlavour :: TyCon -> TyConFlavour #
tcFlavourIsOpen :: TyConFlavour -> Bool #
Is this flavour of TyCon
an open type family or a data family?
pprPromotionQuote :: TyCon -> SDoc #
tyConSkolem :: TyCon -> Bool #
Returns whether or not this TyCon
is definite, or a hole
that may be filled in at some later point. See Note [Skolem abstract data]
emptySubst :: Subst #
unionSubst :: Subst -> Subst -> Subst #
isNumLitTy :: Type -> Maybe Integer #
Is this a numeric literal. We also look through type synonyms.
isStrLitTy :: Type -> Maybe FastString #
Is this a symbol literal. We also look through type synonyms.
eqType :: Type -> Type -> Bool #
Type equality on source types. Does not look through newtypes
,
PredType
s or type families, but it does look through type synonyms.
This first checks that the kinds of the types are equal and then
checks whether the types are equal, ignoring casts and coercions.
(The kind check is a recursive call, but since all kinds have type
Type
, there is no need to check the types of kinds.)
See also Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep.
mkPrimEqPredRole :: Role -> Type -> Type -> PredType #
Makes a lifted equality predicate at the given role
classifyPredType :: Type -> PredTree Source #
lookupTyCon :: MonadThings m => Name -> m TyCon #
eqTyConName :: Name #
cTupleTyCon :: Arity -> TyCon #
nilDataCon :: DataCon #
consDataCon :: DataCon #
famInstAxiom :: FamInst -> CoAxiom Unbranched #
famInstRHS :: FamInst -> Type #
famInstTyCon :: FamInst -> TyCon #
famInstsRepTyCons :: [FamInst] -> [TyCon] #
famInstRepTyCon_maybe :: FamInst -> Maybe TyCon #
dataFamInstRepTyCon :: FamInst -> TyCon #
orphNamesOfFamInst :: FamInst -> NameSet #
pprFamInst :: FamInst -> SDoc #
pprFamInsts :: [FamInst] -> SDoc #
mkImportedFamInst :: Name -> [RoughMatchTc] -> CoAxiom Unbranched -> FamInst #
famInstEnvSize :: FamInstEnv -> Int #
emptyFamInstEnvs :: (FamInstEnv, FamInstEnv) #
Create a FamInstEnv
from Name
indices.
INVARIANTS:
* The fs_tvs are distinct in each FamInst
of a range value of the map (so we can safely unify them)
famInstEnvElts :: FamInstEnv -> [FamInst] #
familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst] #
familyNameInstances :: (FamInstEnv, FamInstEnv) -> Name -> [FamInst] #
unionFamInstEnv :: FamInstEnv -> FamInstEnv -> FamInstEnv #
Makes no particular effort to detect conflicts.
extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv #
extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv #
compatibleBranches :: CoAxBranch -> CoAxBranch -> Bool #
injectiveBranches :: [Bool] -> CoAxBranch -> CoAxBranch -> InjectivityCheckResult #
Check whether two type family axioms don't violate injectivity annotation.
mkCoAxBranch :: [TyVar] -> [TyVar] -> [CoVar] -> [Type] -> Type -> [Role] -> SrcSpan -> CoAxBranch #
mkBranchedCoAxiom :: Name -> TyCon -> [CoAxBranch] -> CoAxiom Branched #
mkUnbranchedCoAxiom :: Name -> TyCon -> CoAxBranch -> CoAxiom Unbranched #
mkSingleCoAxiom :: Role -> Name -> [TyVar] -> [TyVar] -> [CoVar] -> TyCon -> [Type] -> Type -> CoAxiom Unbranched #
mkNewTypeCoAxiom :: Name -> TyCon -> [TyVar] -> [Role] -> Type -> CoAxiom Unbranched #
lookupFamInstEnvByTyCon :: FamInstEnvs -> TyCon -> [FamInst] #
lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch] #
lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [FamInst] #
lookupFamInstEnvInjectivityConflicts :: [Bool] -> FamInstEnvs -> FamInst -> [CoAxBranch] #
Check whether an open type family equation can be added to already existing instance environment without causing conflicts with supplied injectivity annotations. Returns list of conflicting axioms (type instance declarations).
isDominatedBy :: CoAxBranch -> [CoAxBranch] -> Bool #
reduceTyFamApp_maybe :: FamInstEnvs -> Role -> TyCon -> [Type] -> Maybe Reduction #
Arguments
:: [Type] | flattened target arguments. Make sure they're flattened! See Note [Flattening type-family applications when matching instances] in GHC.Core.Unify. |
-> CoAxBranch | the candidate equation we wish to use Precondition: this matches the target |
-> Bool | True = equation can fire |
Do an apartness check, as described in the "Closed Type Families" paper
(POPL '14). This should be used when determining if an equation
(CoAxBranch
) of a closed type family can be used to reduce a certain target
type family application.
topNormaliseType :: FamInstEnvs -> Type -> Type #
topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe Reduction #
Get rid of *outermost* (or toplevel) * type function redex * data family redex * newtypes returning an appropriate Representational coercion. Specifically, if topNormaliseType_maybe env ty = Just (co, ty') then (a) co :: ty ~R ty' (b) ty' is not a newtype, and is not a type-family or data-family redex
However, ty' can be something like (Maybe (F ty)), where (F ty) is a redex.
Always operates homogeneously: the returned type has the same kind as the original type, and the returned coercion is always homogeneous.
topReduceTyFamApp_maybe :: FamInstEnvs -> TyCon -> [Type] -> Maybe HetReduction #
Try to simplify a type-family application, by *one* step If topReduceTyFamApp_maybe env r F tys = Just (HetReduction (Reduction co rhs) res_co) then co :: F tys ~R# rhs res_co :: typeKind(F tys) ~ typeKind(rhs) Type families and data families; always Representational role
normaliseType :: FamInstEnvs -> Role -> Type -> Reduction #
normaliseTcApp :: FamInstEnvs -> Role -> TyCon -> [Type] -> Reduction #
tcTyFamInsts :: Type -> [(TyCon, [Type])] #
Finds outermost type-family applications occurring in a type, after expanding synonyms. In the list (F, tys) that is returned we guarantee that tys matches F's arity. For example, given type family F a :: * -> * (arity 1) calling tcTyFamInsts on (Maybe (F Int Bool) will return (F, [Int]), not (F, [Int,Bool])
This is important for its use in deciding termination of type instances (see #11581). E.g. type instance G [Int] = ...(F Int <big type>)... we don't need to take <big type> into account when asking if the calls on the RHS are smaller than the LHS
evCast :: EvExpr -> TcCoercion -> EvTerm #
d |> co
classInstances :: InstEnvs -> Class -> [ClsInst] #
lookupPackageName :: UnitState -> PackageName -> Maybe UnitId #
Find the unit we know about with the given package name (e.g. foo
), if any
(NB: there might be a locally defined unit name which overrides this)
This function is unsafe to use in general because it doesn't respect package
visibility.
ctEvidence :: Ct -> CtEvidence #
ctEvPred :: CtEvidence -> TcPredType #
isWanted :: CtEvidence -> Bool #
unsafeTcPluginTcM :: TcM a -> TcPluginM a #
purePlugin :: [CommandLineOption] -> IO PluginRecompile #
defaultPlugin :: Plugin #
Default plugin: does nothing at all, except for marking that safe
inference has failed unless -fplugin-trustworthy
is passed. For
compatibility reason you should base all your plugin definitions on this
default value.
typeNatTyCons :: [TyCon] #
newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence #
Create a new Wanted constraint with the given CtLoc
.
newFlexiTyVar :: Kind -> TcPluginM TcTyVar #
tcLookupClass :: Name -> TcPluginM Class #
tcLookupTyCon :: Name -> TcPluginM TyCon #
tcPluginIO :: IO a -> TcPluginM a #
Perform some IO, typically to interact with an external tool.
tcPluginTrace :: String -> SDoc -> TcPluginM () #
Output useful for debugging the compiler.
Arguments
:: ModuleName | Name of the module |
-> FastString | Name of the package containing the module. NOTE: This value is ignored on ghc>=8.0. |
-> TcPluginM Module |
Find a module
Arguments
:: String | Name the coercion should have |
-> Type | The LHS of the equivalence relation (~) |
-> Type | The RHS of the equivalence relation (~) |
-> EvTerm |
The EvTerm
equivalent for unsafeCoerce
tracePlugin :: String -> TcPlugin -> TcPlugin #
Print out extra information about the initialisation, stop, and every run
of the plugin when -ddump-tc-trace
is enabled.
decompFunTy :: Type -> [Type] Source #
mkSubstitution :: [Ct] -> Substitution Source #
fsToUnitId :: FastString -> UnitId Source #
loadedPackageNames :: [UnitDatabase UnitId] -> UnitState -> [RawPackageName] Source #
moduleUnit' :: Module -> ModuleUnit Source #
typeNatKind :: TcType Source #