Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Plugin = Plugin {
- installCoreToDos :: CorePlugin
- tcPlugin :: TcPlugin
- holeFitPlugin :: HoleFitPlugin
- driverPlugin :: [CommandLineOption] -> HscEnv -> IO HscEnv
- pluginRecompile :: [CommandLineOption] -> IO PluginRecompile
- parsedResultAction :: [CommandLineOption] -> ModSummary -> HsParsedModule -> Hsc HsParsedModule
- 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
- tcPluginTrace :: String -> SDoc -> TcPluginM ()
- tcPluginIO :: IO a -> TcPluginM a
- tcLookupTyCon :: Name -> TcPluginM TyCon
- tcLookupClass :: Name -> TcPluginM Class
- newWanted :: CtLoc -> PredType -> TcPluginM CtEvidence
- newFlexiTyVar :: Kind -> TcPluginM TcTyVar
- matchFam :: TyCon -> [Type] -> TcPluginM (Maybe (TcCoercion, TcType))
- lookupOrig :: Module -> OccName -> TcPluginM Name
- getTopEnv :: TcPluginM HscEnv
- getInstEnvs :: TcPluginM InstEnvs
- purePlugin :: [CommandLineOption] -> IO PluginRecompile
- defaultPlugin :: Plugin
- getCtLocM :: CtOrigin -> Maybe TypeOrKind -> TcM CtLoc
- data TcPluginResult
- = TcPluginContradiction [Ct]
- | TcPluginOk [(EvTerm, Ct)] [Ct]
- data TcPluginM a
- data TcPlugin = TcPlugin {
- tcPluginInit :: TcPluginM s
- tcPluginSolve :: s -> TcPluginSolver
- tcPluginStop :: s -> TcPluginM ()
- unsafeTcPluginTcM :: TcM a -> TcPluginM a
- data HscEnv
- data Hsc a
- typeUnconsSymbolTyCon :: TyCon
- typeSymbolCmpTyCon :: TyCon
- typeSymbolAppendTyCon :: TyCon
- typeNatTyCons :: [TyCon]
- typeNatToCharTyCon :: TyCon
- typeNatSubTyCon :: TyCon
- typeNatMulTyCon :: TyCon
- typeNatModTyCon :: TyCon
- typeNatLogTyCon :: TyCon
- typeNatExpTyCon :: TyCon
- typeNatDivTyCon :: TyCon
- typeNatCoAxiomRules :: UniqFM FastString CoAxiomRule
- typeNatCmpTyCon :: TyCon
- typeNatAddTyCon :: TyCon
- typeConsSymbolTyCon :: TyCon
- typeCharToNatTyCon :: TyCon
- typeCharCmpTyCon :: TyCon
- data CtLoc = CtLoc {}
- data CtEvidence
- data Ct
- isWanted :: CtEvidence -> Bool
- initialSubGoalDepth :: SubGoalDepth
- ctEvidence :: Ct -> CtEvidence
- ctEvPred :: CtEvidence -> TcPredType
- data CtOrigin
- = GivenOrigin SkolemInfo
- | InstSCOrigin ScDepth TypeSize
- | OtherSCOrigin ScDepth SkolemInfo
- | OccurrenceOf Name
- | OccurrenceOfRecSel RdrName
- | AppOrigin
- | SpecPragOrigin UserTypeCtxt
- | TypeEqOrigin {
- uo_actual :: TcType
- uo_expected :: TcType
- uo_thing :: Maybe SDoc
- uo_visible :: Bool
- | 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 TypeSize
- | DerivClauseOrigin
- | DerivOriginDC DataCon Int Bool
- | DerivOriginCoerce Id Type Type Bool
- | StandAloneDerivOrigin
- | DefaultOrigin
- | DoOrigin
- | DoPatOrigin (LPat GhcRn)
- | MCompOrigin
- | MCompPatOrigin (LPat GhcRn)
- | IfOrigin
- | ProcOrigin
- | AnnOrigin
- | FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan
- | FunDepOrigin2 PredType CtOrigin PredType SrcSpan
- | ExprHoleOrigin (Maybe OccName)
- | TypeHoleOrigin OccName
- | PatCheckOrigin
- | ListOrigin
- | BracketOrigin
- | StaticOrigin
- | Shouldn'tHappenOrigin String
- | InstProvidedOrigin Module ClsInst
- | NonLinearPatternOrigin
- | UsageEnvironmentOf Name
- | CycleBreakerOrigin CtOrigin
- | InstanceSigOrigin Name Type Type
- | AmbiguityCheckOrigin UserTypeCtxt
- | GhcBug20076
- data HsParsedModule = HsParsedModule {}
- data HsModule = HsModule {}
- data ImportDeclQualifiedStyle
- data ImportDecl pass
- = ImportDecl {
- ideclExt :: XCImportDecl pass
- ideclSourceSrc :: SourceText
- ideclName :: XRec pass ModuleName
- ideclPkgQual :: Maybe StringLiteral
- ideclSource :: IsBootInterface
- ideclSafe :: Bool
- ideclQualified :: ImportDeclQualifiedStyle
- ideclImplicit :: Bool
- ideclAs :: Maybe (XRec pass ModuleName)
- ideclHiding :: Maybe (Bool, XRec pass [LIE pass])
- | XImportDecl !(XXImportDecl pass)
- = ImportDecl {
- type GhcPs = GhcPass 'Parsed
- data EvTerm
- classInstances :: InstEnvs -> Class -> [ClsInst]
- tcTyFamInsts :: Type -> [(TyCon, [Type])]
- promotedTrueDataCon :: TyCon
- promotedLTDataCon :: TyCon
- promotedGTDataCon :: TyCon
- promotedFalseDataCon :: TyCon
- promotedEQDataCon :: TyCon
- nilDataCon :: DataCon
- eqTyConName :: Name
- consDataCon :: DataCon
- boolTyCon :: TyCon
- lookupTyCon :: MonadThings m => Name -> m TyCon
- data NoExtField = NoExtField
- lookupPackageName :: UnitState -> PackageName -> Maybe IndefUnitId
- data InjectivityCheckResult
- data FamInstMatch = FamInstMatch {}
- type FamInstEnvs = (FamInstEnv, FamInstEnv)
- type FamInstEnv = UniqDFM TyCon FamilyInstEnv
- data FamInst = FamInst {}
- data FamFlavor
- topReduceTyFamApp_maybe :: FamInstEnvs -> TyCon -> [Type] -> Maybe (Coercion, Type, MCoercion)
- topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe (Coercion, Type)
- topNormaliseType :: FamInstEnvs -> Type -> Type
- reduceTyFamApp_maybe :: FamInstEnvs -> Role -> TyCon -> [Type] -> Maybe (Coercion, Type)
- pprFamInsts :: [FamInst] -> SDoc
- pprFamInst :: FamInst -> SDoc
- normaliseType :: FamInstEnvs -> Role -> Type -> (Coercion, Type)
- normaliseTcApp :: FamInstEnvs -> Role -> TyCon -> [Type] -> (Coercion, Type)
- 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
- mkImportedFamInst :: Name -> [RoughMatchTc] -> CoAxiom Unbranched -> FamInst
- mkCoAxBranch :: [TyVar] -> [TyVar] -> [CoVar] -> [Type] -> Type -> [Role] -> SrcSpan -> CoAxBranch
- mkBranchedCoAxiom :: Name -> TyCon -> [CoAxBranch] -> CoAxiom Branched
- lookupFamInstEnvInjectivityConflicts :: [Bool] -> FamInstEnvs -> FamInst -> [CoAxBranch]
- lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [FamInstMatch]
- lookupFamInstEnvByTyCon :: FamInstEnvs -> TyCon -> [FamInst]
- lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch]
- isDominatedBy :: CoAxBranch -> [CoAxBranch] -> Bool
- injectiveBranches :: [Bool] -> CoAxBranch -> CoAxBranch -> InjectivityCheckResult
- familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst]
- famInstsRepTyCons :: [FamInst] -> [TyCon]
- famInstTyCon :: FamInst -> TyCon
- famInstRepTyCon_maybe :: FamInst -> Maybe TyCon
- famInstRHS :: FamInst -> Type
- famInstEnvSize :: FamInstEnv -> Int
- famInstEnvElts :: FamInstEnv -> [FamInst]
- famInstAxiom :: FamInst -> CoAxiom Unbranched
- extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv
- extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv
- emptyFamInstEnvs :: (FamInstEnv, FamInstEnv)
- emptyFamInstEnv :: FamInstEnv
- dataFamInstRepTyCon :: FamInst -> TyCon
- apartnessCheck :: [Type] -> CoAxBranch -> Bool
- data Pred
- data EqRel
- isEqPred :: PredType -> Bool
- mkPrimEqPredRole :: Role -> Type -> Type -> PredType
- typeKind :: HasDebugCallStack => Type -> Kind
- splitTyConApp :: Type -> (TyCon, [Type])
- isStrLitTy :: Type -> Maybe FastString
- isNumLitTy :: Type -> Maybe Integer
- eqType :: Type -> Type -> Bool
- type TvSubstEnv = TyVarEnv Type
- data TCvSubst = TCvSubst InScopeSet TvSubstEnv CvSubstEnv
- unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- emptyTCvSubst :: TCvSubst
- mkTyVarTy :: TyVar -> Type
- type TyConTyCoBinder = VarBndr TyCoVar TyConBndrVis
- data TyConFlavour
- data TyConBndrVis
- type TyConBinder = VarBndr TyVar TyConBndrVis
- data RuntimeRepInfo
- = NoRRI
- | RuntimeRep ([Type] -> [PrimRep])
- | VecCount Int
- | VecElem PrimElemRep
- | LiftedInfo
- | UnliftedInfo
- data PrimRep
- data PrimElemRep
- data Injectivity
- = NotInjective
- | Injective [Bool]
- data FamTyConFlav
- data AlgTyConRhs
- = AbstractTyCon
- | DataTyCon { }
- | 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_lev_poly :: Bool
- data AlgTyConFlav
- visibleDataCons :: AlgTyConRhs -> [DataCon]
- unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)
- unwrapNewTyConEtad_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched)
- tyConVisibleTyVars :: TyCon -> [TyVar]
- tyConTuple_maybe :: TyCon -> Maybe TupleSort
- tyConStupidTheta :: TyCon -> [PredType]
- tyConSkolem :: TyCon -> Bool
- tyConSingleDataCon_maybe :: TyCon -> Maybe DataCon
- tyConSingleDataCon :: TyCon -> DataCon
- tyConSingleAlgDataCon_maybe :: TyCon -> Maybe DataCon
- tyConRuntimeRepInfo :: TyCon -> RuntimeRepInfo
- tyConRoles :: TyCon -> [Role]
- tyConRepModOcc :: Module -> OccName -> (Module, OccName)
- tyConInvisTVBinders :: [TyConBinder] -> [InvisTVBinder]
- tyConInjectivityInfo :: TyCon -> Injectivity
- tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon
- tyConFlavour :: TyCon -> TyConFlavour
- tyConFieldLabels :: TyCon -> [FieldLabel]
- tyConFamilySize :: TyCon -> Int
- tyConFamilyResVar_maybe :: TyCon -> Maybe Name
- tyConFamilyCoercion_maybe :: TyCon -> Maybe (CoAxiom Unbranched)
- tyConFamInst_maybe :: TyCon -> Maybe (TyCon, [Type])
- tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched)
- tyConDataCons_maybe :: TyCon -> Maybe [DataCon]
- tyConDataCons :: TyCon -> [DataCon]
- tyConClass_maybe :: TyCon -> Maybe Class
- tyConCType_maybe :: TyCon -> Maybe CType
- tyConBndrVisArgFlag :: TyConBndrVis -> ArgFlag
- tyConBinderArgFlag :: TyConBinder -> ArgFlag
- tyConAssoc_maybe :: TyCon -> Maybe TyCon
- tyConAlgDataCons_maybe :: TyCon -> Maybe [DataCon]
- tyConATs :: TyCon -> [TyCon]
- tcFlavourIsOpen :: TyConFlavour -> Bool
- synTyConRhs_maybe :: TyCon -> Maybe Type
- synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type)
- setTcTyConKind :: TyCon -> Kind -> TyCon
- primRepsCompatible :: Platform -> [PrimRep] -> [PrimRep] -> Bool
- primRepSizeB :: Platform -> PrimRep -> Int
- primRepIsFloat :: PrimRep -> Maybe Bool
- primRepCompatible :: Platform -> PrimRep -> PrimRep -> Bool
- primElemRepSizeB :: PrimElemRep -> Int
- pprPromotionQuote :: TyCon -> SDoc
- noTcTyConScopedTyVars :: [(Name, TcTyVar)]
- newTyConRhs :: TyCon -> ([TyVar], Type)
- newTyConEtadRhs :: TyCon -> ([TyVar], Type)
- newTyConEtadArity :: TyCon -> Int
- newTyConDataCon_maybe :: TyCon -> Maybe DataCon
- newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched)
- newTyConCo :: TyCon -> CoAxiom Unbranched
- mustBeSaturated :: TyCon -> Bool
- mkTyConTagMap :: TyCon -> NameEnv ConTag
- mkTyConKind :: [TyConBinder] -> Kind -> Kind
- mkTupleTyCon :: Name -> [TyConBinder] -> Kind -> Arity -> DataCon -> TupleSort -> AlgTyConFlav -> TyCon
- mkTcTyCon :: Name -> [TyConBinder] -> Kind -> [(Name, TcTyVar)] -> Bool -> TyConFlavour -> TyCon
- mkSynonymTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Type -> Bool -> Bool -> Bool -> TyCon
- mkSumTyCon :: Name -> [TyConBinder] -> Kind -> Arity -> [TyVar] -> [DataCon] -> AlgTyConFlav -> TyCon
- mkRequiredTyConBinder :: TyCoVarSet -> TyVar -> TyConBinder
- mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConTyCoBinder] -> Kind -> [Role] -> RuntimeRepInfo -> TyCon
- mkPrimTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
- mkNamedTyConBinders :: ArgFlag -> [TyVar] -> [TyConBinder]
- mkNamedTyConBinder :: ArgFlag -> TyVar -> TyConBinder
- mkLiftedPrimTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> TyCon
- mkKindTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Name -> TyCon
- mkFunTyCon :: Name -> [TyConBinder] -> Name -> TyCon
- mkFamilyTyCon :: Name -> [TyConBinder] -> Kind -> Maybe Name -> FamTyConFlav -> Maybe Class -> Injectivity -> TyCon
- mkDataTyConRhs :: [DataCon] -> AlgTyConRhs
- mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon
- mkAnonTyConBinders :: AnonArgFlag -> [TyVar] -> [TyConBinder]
- mkAnonTyConBinder :: AnonArgFlag -> TyVar -> TyConBinder
- mkAlgTyCon :: Name -> [TyConBinder] -> Kind -> [Role] -> Maybe CType -> [PredType] -> AlgTyConRhs -> AlgTyConFlav -> Bool -> TyCon
- lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel
- isVoidRep :: PrimRep -> Bool
- isVisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
- isVanillaAlgTyCon :: TyCon -> Bool
- isUnliftedTyCon :: TyCon -> Bool
- isUnboxedSumTyCon :: TyCon -> Bool
- isTypeSynonymTyCon :: TyCon -> Bool
- isTypeFamilyTyCon :: TyCon -> Bool
- isTyConWithSrcDataCons :: TyCon -> Bool
- isTyConAssoc :: TyCon -> Bool
- isTcTyCon :: TyCon -> Bool
- isTcLevPoly :: TyCon -> Bool
- isTauTyCon :: TyCon -> Bool
- isPromotedTupleTyCon :: TyCon -> Bool
- isPromotedDataCon_maybe :: TyCon -> Maybe DataCon
- isPromotedDataCon :: TyCon -> Bool
- isPrimTyCon :: TyCon -> Bool
- isOpenTypeFamilyTyCon :: TyCon -> Bool
- isOpenFamilyTyCon :: TyCon -> Bool
- isNoParent :: AlgTyConFlav -> Bool
- isNewTyCon :: TyCon -> Bool
- isNamedTyConBinder :: TyConBinder -> Bool
- isLiftedTypeKindTyConName :: Name -> Bool
- isLiftedAlgTyCon :: TyCon -> Bool
- isKindTyCon :: TyCon -> Bool
- isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
- isInjectiveTyCon :: TyCon -> Role -> Bool
- isImplicitTyCon :: TyCon -> Bool
- isGenerativeTyCon :: TyCon -> Role -> Bool
- isGenInjAlgRhs :: AlgTyConRhs -> Bool
- isGcPtrRep :: PrimRep -> Bool
- isGadtSyntaxTyCon :: TyCon -> Bool
- isForgetfulSynTyCon :: TyCon -> Bool
- isFamilyTyCon :: TyCon -> Bool
- isFamInstTyCon :: TyCon -> Bool
- isFamFreeTyCon :: TyCon -> Bool
- isEnumerationTyCon :: TyCon -> Bool
- isDataTyCon :: TyCon -> Bool
- isDataFamilyTyCon :: TyCon -> Bool
- isConstraintKindCon :: TyCon -> Bool
- isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched)
- isClassTyCon :: TyCon -> Bool
- isBuiltInSynFamTyCon_maybe :: TyCon -> Maybe BuiltInSynFamily
- isBoxedTupleTyCon :: TyCon -> Bool
- isAlgTyCon :: TyCon -> Bool
- isAbstractTyCon :: TyCon -> Bool
- famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav
- expandSynTyCon_maybe :: TyCon -> [tyco] -> Maybe ([(TyVar, tyco)], Type, [tyco])
- algTyConRhs :: TyCon -> AlgTyConRhs
- gHC_TYPENATS :: Module
- dATA_TYPE_EQUALITY :: Module
- className :: Class -> Name
- classTyCon :: Class -> TyCon
- data Role
- data BuiltInSynFamily = BuiltInSynFamily {
- sfMatchFam :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
- sfInteractTop :: [Type] -> Type -> [TypeEqn]
- sfInteractInert :: [Type] -> Type -> [Type] -> Type -> [TypeEqn]
- mkTcOcc :: String -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- emptyOccSet :: OccSet
- tyConAppTyCon_maybe :: Type -> Maybe TyCon
- splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- mkTyConTy :: TyCon -> Type
- data Type
- data TyLit = NumTyLit Integer
- type TyConRepName = Name
- data TyCon
- tyConRepName_maybe :: TyCon -> Maybe TyConRepName
- mkPrelTyConRepName :: Name -> TyConRepName
- isUnboxedTupleTyCon :: TyCon -> Bool
- isTupleTyCon :: TyCon -> Bool
- isFunTyCon :: TyCon -> Bool
- newtype PackageName = PackageName {}
- type TyVar = Var
- data IsBootInterface
- mkModule :: u -> ModuleName -> GenModule u
- mkModuleName :: String -> ModuleName
- mkUniqSet :: Uniquable a => [a] -> UniqSet a
- elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool
- getUnique :: Uniquable a => a -> Unique
- getKey :: Unique -> Int
- ppr :: Outputable a => a -> SDoc
- showSDocUnsafe :: SDoc -> String
- data FastString
- unpackFS :: FastString -> String
- fsLit :: String -> FastString
- data UnitDatabase unit = UnitDatabase {
- unitDatabasePath :: FilePath
- unitDatabaseUnits :: [GenUnitInfo unit]
- text :: String -> SDoc
- data ModuleName
- data GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod = GenericUnitInfo {
- unitId :: uid
- unitInstanceOf :: compid
- 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
- tracePlugin :: String -> TcPlugin -> TcPlugin
- lookupName :: Module -> OccName -> TcPluginM Name
- lookupModule :: ModuleName -> FastString -> TcPluginM Module
- evByFiat :: String -> Type -> Type -> EvTerm
- type HsModule' = HsModule
- type ModuleUnit = Unit
- type RawPackageName = FastString
- type Substitution = [(TcTyVar, TcType)]
- newtype TypeEq = TypeEq {}
- data TvSubst = TvSubst InScopeSet TvSubstEnv
- type PredTree = Pred
- type TcPluginSolveResult = TcPluginResult
- emptyTvSubst :: TvSubst
- toTCv :: TvSubst -> TCvSubst
- substTy :: TvSubst -> Type -> Type
- unionTvSubst :: TvSubst -> TvSubst -> TvSubst
- fromTCv :: TCvSubst -> TvSubst
- promotedBoolTyCon :: TyCon
- viewFunTy :: Type -> Maybe (Type, Type)
- tcUnifyTy :: Type -> Type -> Maybe TvSubst
- getEqTyCon :: TcPluginM TyCon
- getEqWitnessTyCon :: TcPluginM TyCon
- decompFunTy :: Type -> [Type]
- isTrivial :: PredType -> Bool
- normaliseGivens :: [Ct] -> TcPluginM [Ct]
- subsCt :: Substitution -> Ct -> Ct
- subsType :: Substitution -> Type -> Type
- mkSubstitution :: [Ct] -> Substitution
- classifyPredType :: Type -> PredTree
- fsToUnitId :: FastString -> UnitId
- loadedPackageNames :: [UnitDatabase UnitId] -> UnitState -> [RawPackageName]
- preloadedUnitsM :: TcPluginM [RawPackageName]
- moduleUnit' :: Module -> ModuleUnit
- noExtField :: NoExtField
- typeNatKind :: TcType
- mtypeNatLeqTyCon :: Maybe TyCon
- 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)
Documentation
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.
Plugin | |
|
tcPluginTrace :: String -> SDoc -> TcPluginM () #
Output useful for debugging the compiler.
tcPluginIO :: IO a -> TcPluginM a #
Perform some IO, typically to interact with an external tool.
tcLookupTyCon :: Name -> TcPluginM TyCon #
tcLookupClass :: Name -> TcPluginM Class #
newFlexiTyVar :: Kind -> TcPluginM TcTyVar #
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.
data TcPluginResult #
TcPluginContradiction [Ct] | The plugin found a contradiction. The returned constraints are removed from the inert set, and recorded as insoluble. |
TcPluginOk [(EvTerm, Ct)] [Ct] | The first field is for constraints that were solved. These are removed from the inert set, and the evidence for them is recorded. The second field contains new work, that should be processed by the constraint solver. |
Instances
TcPlugin | |
|
unsafeTcPluginTcM :: TcM a -> TcPluginM a #
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.
The Hsc monad: Passing an environment and warning state
Instances
MonadIO Hsc | |
Defined in GHC.Driver.Env.Types | |
Applicative Hsc | |
Functor Hsc | |
Monad Hsc | |
HasDynFlags Hsc | |
Defined in GHC.Driver.Env.Types getDynFlags :: Hsc DynFlags # | |
HasLogger Hsc | |
Defined in GHC.Driver.Env.Types |
typeNatTyCons :: [TyCon] #
CtLoc | |
|
data CtEvidence #
Instances
Outputable CtEvidence | |
Defined in GHC.Tc.Types.Constraint ppr :: CtEvidence -> SDoc # |
Instances
Outputable Ct | |
Defined in GHC.Tc.Types.Constraint |
isWanted :: CtEvidence -> Bool #
ctEvidence :: Ct -> CtEvidence #
ctEvPred :: CtEvidence -> TcPredType #
GivenOrigin SkolemInfo | A given constraint from a user-written type signature. The
|
InstSCOrigin |
|
| |
OtherSCOrigin |
|
| |
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 TypeSize |
|
DerivClauseOrigin | |
DerivOriginDC DataCon Int Bool | |
DerivOriginCoerce Id Type Type Bool | |
StandAloneDerivOrigin | |
DefaultOrigin | |
DoOrigin | |
DoPatOrigin (LPat GhcRn) | |
MCompOrigin | |
MCompPatOrigin (LPat GhcRn) | |
IfOrigin | |
ProcOrigin | |
AnnOrigin | |
FunDepOrigin1 PredType CtOrigin RealSrcSpan PredType CtOrigin RealSrcSpan | |
FunDepOrigin2 PredType CtOrigin PredType SrcSpan | |
ExprHoleOrigin (Maybe OccName) | |
TypeHoleOrigin OccName | |
PatCheckOrigin | |
ListOrigin | |
BracketOrigin | |
StaticOrigin | |
Shouldn'tHappenOrigin String | |
InstProvidedOrigin Module ClsInst | |
NonLinearPatternOrigin | |
UsageEnvironmentOf Name | |
CycleBreakerOrigin CtOrigin | |
InstanceSigOrigin Name Type Type | |
AmbiguityCheckOrigin UserTypeCtxt | |
GhcBug20076 |
Instances
Outputable CtOrigin | |
Defined in GHC.Tc.Types.Origin |
data HsParsedModule #
Haskell Module
All we actually declare here is the top-level structure for a module.
HsModule | |
|
Instances
Data HsModule | |
Defined in GHC.Hs gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HsModule -> c HsModule # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c HsModule # toConstr :: HsModule -> Constr # dataTypeOf :: HsModule -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c HsModule) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c HsModule) # gmapT :: (forall b. Data b => b -> b) -> HsModule -> HsModule # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HsModule -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HsModule -> r # gmapQ :: (forall d. Data d => d -> u) -> HsModule -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HsModule -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> HsModule -> m HsModule # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> HsModule -> m HsModule # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> HsModule -> m HsModule # | |
Outputable HsModule | |
data ImportDeclQualifiedStyle #
If/how an import is qualified
.
QualifiedPre |
|
QualifiedPost |
|
NotQualified | Not qualified. |
Instances
data ImportDecl pass #
Import Declaration
A single Haskell import
declaration.
ImportDecl | |
| |
XImportDecl !(XXImportDecl pass) |
Instances
(OutputableBndrId p, Outputable (Anno (IE (GhcPass p)))) => Outputable (ImportDecl (GhcPass p)) | |
Defined in GHC.Hs.ImpExp ppr :: ImportDecl (GhcPass p) -> SDoc # | |
type Anno (ImportDecl (GhcPass p)) | |
Defined in GHC.Hs.ImpExp |
Instances
Data EvTerm | |
Defined in GHC.Tc.Types.Evidence 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 |
classInstances :: InstEnvs -> Class -> [ClsInst] #
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
nilDataCon :: DataCon #
eqTyConName :: Name #
consDataCon :: DataCon #
lookupTyCon :: MonadThings m => Name -> m TyCon #
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 NoExtCon
, 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.
Instances
lookupPackageName :: UnitState -> PackageName -> Maybe IndefUnitId #
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)
data InjectivityCheckResult #
Result of testing two type family equations for injectiviy.
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 overlpapped (in which case it is OK if they don't unify). Constructor stores axioms after unification. |
data FamInstMatch #
Instances
Outputable FamInstMatch | |
Defined in GHC.Core.FamInstEnv ppr :: FamInstMatch -> SDoc # |
type FamInstEnvs = (FamInstEnv, FamInstEnv) #
type FamInstEnv = UniqDFM TyCon FamilyInstEnv #
Instances
NamedThing FamInst | |
Defined in GHC.Core.FamInstEnv | |
Outputable FamInst | |
Defined in GHC.Core.FamInstEnv |
topReduceTyFamApp_maybe :: FamInstEnvs -> TyCon -> [Type] -> Maybe (Coercion, Type, MCoercion) #
Try to simplify a type-family application, by *one* step If topReduceTyFamApp_maybe env r F tys = Just (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
topNormaliseType_maybe :: FamInstEnvs -> Type -> Maybe (Coercion, Type) #
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.
topNormaliseType :: FamInstEnvs -> Type -> Type #
reduceTyFamApp_maybe :: FamInstEnvs -> Role -> TyCon -> [Type] -> Maybe (Coercion, Type) #
pprFamInsts :: [FamInst] -> SDoc #
pprFamInst :: FamInst -> SDoc #
normaliseType :: FamInstEnvs -> Role -> Type -> (Coercion, Type) #
normaliseTcApp :: FamInstEnvs -> Role -> TyCon -> [Type] -> (Coercion, Type) #
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 #
mkImportedFamInst :: Name -> [RoughMatchTc] -> CoAxiom Unbranched -> FamInst #
mkCoAxBranch :: [TyVar] -> [TyVar] -> [CoVar] -> [Type] -> Type -> [Role] -> SrcSpan -> CoAxBranch #
mkBranchedCoAxiom :: Name -> TyCon -> [CoAxBranch] -> CoAxiom Branched #
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).
lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [FamInstMatch] #
lookupFamInstEnvByTyCon :: FamInstEnvs -> TyCon -> [FamInst] #
lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch] #
isDominatedBy :: CoAxBranch -> [CoAxBranch] -> Bool #
injectiveBranches :: [Bool] -> CoAxBranch -> CoAxBranch -> InjectivityCheckResult #
Check whether two type family axioms don't violate injectivity annotation.
familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst] #
famInstsRepTyCons :: [FamInst] -> [TyCon] #
famInstTyCon :: FamInst -> TyCon #
famInstRepTyCon_maybe :: FamInst -> Maybe TyCon #
famInstRHS :: FamInst -> Type #
famInstEnvSize :: FamInstEnv -> Int #
famInstEnvElts :: FamInstEnv -> [FamInst] #
famInstAxiom :: FamInst -> CoAxiom Unbranched #
extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv #
extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv #
dataFamInstRepTyCon :: FamInst -> TyCon #
:: [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.
A predicate in the solver. The solver tries to prove Wanted predicates from Given ones.
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 | |
mkPrimEqPredRole :: Role -> Type -> Type -> PredType #
Makes a lifted equality predicate at the given role
typeKind :: HasDebugCallStack => Type -> Kind #
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
isStrLitTy :: Type -> Maybe FastString #
Is this a symbol literal. We also look through type synonyms.
isNumLitTy :: Type -> Maybe Integer #
Is this a numeric literal. We also look through type synonyms.
eqType :: Type -> Type -> Bool #
Type equality on source types. Does not look through newtypes
or
PredType
s, 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.
Type & coercion substitution
The following invariants must hold of a TCvSubst
:
- The in-scope set is needed only to guide the generation of fresh uniques
- In particular, the kind of the type variables in the in-scope set is not relevant
- The substitution is only applied ONCE! This is because in general such application will not reach a fixed point.
Instances
Outputable TCvSubst | |
Defined in GHC.Core.TyCo.Subst |
unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst #
type TyConTyCoBinder = VarBndr TyCoVar TyConBndrVis #
data TyConFlavour #
Paints a picture of what a TyCon
represents, in broad strokes.
This is used towards more informative error messages.
Instances
Outputable TyConFlavour | |
Defined in GHC.Core.TyCon ppr :: TyConFlavour -> SDoc # | |
Eq TyConFlavour | |
Defined in GHC.Core.TyCon (==) :: TyConFlavour -> TyConFlavour -> Bool # (/=) :: TyConFlavour -> TyConFlavour -> Bool # |
data TyConBndrVis #
Instances
Binary TyConBndrVis | |
Defined in GHC.Core.TyCon put_ :: BinHandle -> TyConBndrVis -> IO () # put :: BinHandle -> TyConBndrVis -> IO (Bin TyConBndrVis) # get :: BinHandle -> IO TyConBndrVis # | |
Outputable TyConBndrVis | |
Defined in GHC.Core.TyCon ppr :: TyConBndrVis -> SDoc # | |
OutputableBndr tv => Outputable (VarBndr tv TyConBndrVis) | |
Defined in GHC.Core.TyCon ppr :: VarBndr tv TyConBndrVis -> SDoc # |
type TyConBinder = VarBndr TyVar TyConBndrVis #
data RuntimeRepInfo #
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
NoRRI | an ordinary promoted data con |
RuntimeRep ([Type] -> [PrimRep]) | A constructor of |
VecCount Int | A constructor of |
VecElem PrimElemRep | A constructor of |
LiftedInfo | A constructor of |
UnliftedInfo | A constructor of |
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.
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
Show PrimRep | |
Outputable PrimRep | |
Defined in GHC.Core.TyCon | |
Eq PrimRep | |
data PrimElemRep #
Int8ElemRep | |
Int16ElemRep | |
Int32ElemRep | |
Int64ElemRep | |
Word8ElemRep | |
Word16ElemRep | |
Word32ElemRep | |
Word64ElemRep | |
FloatElemRep | |
DoubleElemRep |
Instances
Show PrimElemRep | |
Defined in GHC.Core.TyCon showsPrec :: Int -> PrimElemRep -> ShowS # show :: PrimElemRep -> String # showList :: [PrimElemRep] -> ShowS # | |
Outputable PrimElemRep | |
Defined in GHC.Core.TyCon ppr :: PrimElemRep -> SDoc # | |
Eq PrimElemRep | |
Defined in GHC.Core.TyCon (==) :: PrimElemRep -> PrimElemRep -> Bool # (/=) :: PrimElemRep -> PrimElemRep -> Bool # |
data Injectivity #
Instances
Binary Injectivity | |
Defined in GHC.Core.TyCon put_ :: BinHandle -> Injectivity -> IO () # put :: BinHandle -> Injectivity -> IO (Bin Injectivity) # get :: BinHandle -> IO Injectivity # | |
Eq Injectivity | |
Defined in GHC.Core.TyCon (==) :: Injectivity -> Injectivity -> Bool # (/=) :: Injectivity -> Injectivity -> Bool # |
data FamTyConFlav #
Information pertaining to the expansion of a type synonym (type
)
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 ppr :: FamTyConFlav -> SDoc # |
data AlgTyConRhs #
Represents right-hand-sides of TyCon
s for algebraic types
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 |
| |
TupleTyCon | |
SumTyCon | An unboxed sum type. |
| |
NewTyCon | Information about those |
|
data AlgTyConFlav #
VanillaAlgTyCon TyConRepName | An ordinary type constructor has no parent. |
UnboxedAlgTyCon (Maybe TyConRepName) | An unboxed type constructor. The TyConRepName is a Maybe since 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 ppr :: AlgTyConFlav -> SDoc # |
visibleDataCons :: AlgTyConRhs -> [DataCon] #
Both type classes as well as family instances imply implicit type constructors. These implicit type constructors refer to their parent structure (ie, the class or family from which they derive) using a type of the following form.
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!
unwrapNewTyCon_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched) #
unwrapNewTyConEtad_maybe :: TyCon -> Maybe ([TyVar], Type, CoAxiom Unbranched) #
tyConVisibleTyVars :: TyCon -> [TyVar] #
tyConTuple_maybe :: TyCon -> Maybe TupleSort #
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 ...
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]
tyConSingleDataCon :: TyCon -> DataCon #
Like tyConSingleDataCon_maybe
, but panics if Nothing
.
tyConSingleAlgDataCon_maybe :: TyCon -> Maybe DataCon #
Like tyConSingleDataCon_maybe
, but returns Nothing
for newtypes.
tyConRuntimeRepInfo :: TyCon -> RuntimeRepInfo #
Extract any RuntimeRepInfo
from this TyCon
tyConRoles :: TyCon -> [Role] #
Get the list of roles for the type parameters of a TyCon
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.
tyConInvisTVBinders :: [TyConBinder] -> [InvisTVBinder] #
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.
tyConFlavourAssoc_maybe :: TyConFlavour -> Maybe TyCon #
Get the enclosing class TyCon (if there is one) for the given TyConFlavour
tyConFlavour :: TyCon -> TyConFlavour #
tyConFieldLabels :: TyCon -> [FieldLabel] #
The labels for the fields of this particular TyCon
tyConFamilySize :: TyCon -> Int #
tyConFamilyResVar_maybe :: TyCon -> Maybe Name #
Extract type variable naming the result of injective type family
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
tyConFamInstSig_maybe :: TyCon -> Maybe (TyCon, [Type], CoAxiom Unbranched) #
tyConDataCons_maybe :: TyCon -> Maybe [DataCon] #
tyConDataCons :: TyCon -> [DataCon] #
As tyConDataCons_maybe
, but returns the empty list of constructors if no
constructors could be found
tyConClass_maybe :: TyCon -> Maybe Class #
If this TyCon
is that for a class instance, return the class it is for.
Otherwise returns Nothing
tyConCType_maybe :: TyCon -> Maybe CType #
tyConAssoc_maybe :: TyCon -> Maybe TyCon #
Get the enclosing class TyCon (if there is one) for the given TyCon.
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.
tcFlavourIsOpen :: TyConFlavour -> Bool #
Is this flavour of TyCon
an open type family or a data family?
synTyConRhs_maybe :: TyCon -> Maybe Type #
Extract the information pertaining to the right hand side of a type synonym
(type
) declaration.
synTyConDefn_maybe :: TyCon -> Maybe ([TyVar], Type) #
Extract the TyVar
s bound by a vanilla type synonym
and the corresponding (unsubstituted) right hand side.
setTcTyConKind :: TyCon -> Kind -> TyCon #
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.
primRepIsFloat :: PrimRep -> Maybe Bool #
Return if Rep stands for floating type, returns Nothing for vector types.
primElemRepSizeB :: PrimElemRep -> Int #
pprPromotionQuote :: TyCon -> SDoc #
noTcTyConScopedTyVars :: [(Name, TcTyVar)] #
No scoped type variables (to be used with mkTcTyCon).
newTyConRhs :: TyCon -> ([TyVar], Type) #
newTyConEtadRhs :: 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.
newTyConDataCon_maybe :: TyCon -> Maybe DataCon #
newTyConCo_maybe :: TyCon -> Maybe (CoAxiom Unbranched) #
newTyConCo :: TyCon -> CoAxiom Unbranched #
mustBeSaturated :: 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 mustBeSaturated on a regular H98 type synonym, because you should probably have expanded it first But regardless, it's not decomposable
mkTyConTagMap :: TyCon -> NameEnv ConTag #
mkTyConKind :: [TyConBinder] -> Kind -> Kind #
:: Name | |
-> [TyConBinder] | |
-> Kind | Result kind of the |
-> Arity | Arity of the tuple |
-> DataCon | |
-> TupleSort | Whether the tuple is boxed or unboxed |
-> AlgTyConFlav | |
-> TyCon |
:: 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.
Create a type synonym TyCon
:: Name | |
-> [TyConBinder] | |
-> Kind | Kind of the resulting |
-> Arity | Arity of the sum |
-> [TyVar] |
|
-> [DataCon] | |
-> AlgTyConFlav | |
-> TyCon |
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
mkPromotedDataCon :: DataCon -> Name -> TyConRepName -> [TyConTyCoBinder] -> Kind -> [Role] -> RuntimeRepInfo -> 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
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind, never levity-polymorphic |
-> [Role] | |
-> TyCon |
Create an unlifted primitive TyCon
, such as Int#
.
mkNamedTyConBinders :: ArgFlag -> [TyVar] -> [TyConBinder] #
mkNamedTyConBinder :: ArgFlag -> TyVar -> TyConBinder #
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind |
-> [Role] | |
-> TyCon |
Create a lifted primitive TyCon
such as RealWorld
Kind constructors
mkFunTyCon :: Name -> [TyConBinder] -> Name -> TyCon #
:: Name | |
-> [TyConBinder] | |
-> Kind | result kind |
-> Maybe Name | |
-> FamTyConFlav | |
-> Maybe Class | |
-> Injectivity | |
-> TyCon |
Create a type family TyCon
mkDataTyConRhs :: [DataCon] -> AlgTyConRhs #
mkClassTyCon :: Name -> [TyConBinder] -> [Role] -> AlgTyConRhs -> Class -> Name -> TyCon #
Simpler specialization of mkAlgTyCon
for classes
mkAnonTyConBinders :: AnonArgFlag -> [TyVar] -> [TyConBinder] #
mkAnonTyConBinder :: AnonArgFlag -> TyVar -> TyConBinder #
:: 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
.
lookupTyConFieldLabel :: FieldLabelString -> TyCon -> Maybe FieldLabel #
Look up a field label belonging to this TyCon
isVisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool #
isVanillaAlgTyCon :: TyCon -> Bool #
Returns True
for vanilla AlgTyCons -- that is, those created
with a data
or newtype
declaration.
isUnliftedTyCon :: TyCon -> Bool #
isUnboxedSumTyCon :: TyCon -> Bool #
Is this the TyCon
for an unboxed sum?
isTypeSynonymTyCon :: TyCon -> Bool #
Is this a TyCon
representing a regular H98 type synonym (type
)?
isTypeFamilyTyCon :: TyCon -> Bool #
Is this a synonym TyCon
that can have may have further instances appear?
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.
isTyConAssoc :: TyCon -> Bool #
Is this TyCon for an associated type?
isTcLevPoly :: TyCon -> Bool #
Could this TyCon ever be levity-polymorphic when fully applied? True is safe. False means we're sure. Does only a quick check based on the TyCon's category. Precondition: The fully-applied TyCon has kind (TYPE blah)
isTauTyCon :: TyCon -> Bool #
isPromotedTupleTyCon :: TyCon -> Bool #
Is this the TyCon
for a promoted tuple?
isPromotedDataCon_maybe :: TyCon -> Maybe DataCon #
Retrieves the promoted DataCon if this is a PromotedDataCon;
isPromotedDataCon :: TyCon -> Bool #
Is this a PromotedDataCon?
isPrimTyCon :: TyCon -> Bool #
Does this TyCon
represent something that cannot be defined in Haskell?
isOpenTypeFamilyTyCon :: TyCon -> Bool #
Is this an open type family TyCon?
isOpenFamilyTyCon :: TyCon -> Bool #
Is this a TyCon
, synonym or otherwise, that defines a family with
instances?
isNoParent :: AlgTyConFlav -> Bool #
isNewTyCon :: TyCon -> Bool #
Is this TyCon
that for a newtype
isNamedTyConBinder :: TyConBinder -> Bool #
isLiftedTypeKindTyConName :: Name -> Bool #
isLiftedAlgTyCon :: TyCon -> Bool #
isKindTyCon :: TyCon -> Bool #
Is this tycon really meant for use at the kind level? That is, should it be permitted without -XDataKinds?
isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool #
isInjectiveTyCon :: TyCon -> Role -> Bool #
isInjectiveTyCon
is true of TyCon
s for which this property holds
(where X is the role passed in):
If (T a1 b1 c1) ~X (T a2 b2 c2), then (a1 ~X1 a2), (b1 ~X2 b2), and (c1 ~X3 c2)
(where X1, X2, and X3, are the roles given by tyConRolesX tc X)
See also Note [Decomposing equality] in GHC.Tc.Solver.Canonical
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)
isGenerativeTyCon :: TyCon -> Role -> Bool #
isGenerativeTyCon
is true of TyCon
s for which this property holds
(where X is the role passed in):
If (T tys ~X t), then (t's head ~X T).
See also Note [Decomposing equality] 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?
isGcPtrRep :: PrimRep -> Bool #
isGadtSyntaxTyCon :: TyCon -> Bool #
Is this an algebraic TyCon
declared with the GADT syntax?
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.
isFamilyTyCon :: TyCon -> Bool #
Is this a TyCon
, synonym or otherwise, that defines a family?
isFamInstTyCon :: TyCon -> Bool #
Is this TyCon
that for a data family instance?
isFamFreeTyCon :: TyCon -> Bool #
Is this tycon neither a type family nor a synonym that expands to a type family?
isEnumerationTyCon :: TyCon -> Bool #
Is this an algebraic TyCon
which is just an enumeration of values?
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
isDataFamilyTyCon :: TyCon -> Bool #
Is this a synonym TyCon
that can have may have further instances appear?
isConstraintKindCon :: TyCon -> Bool #
Returns True
for the TyCon
of the Constraint
kind.
isClosedSynFamilyTyConWithAxiom_maybe :: TyCon -> Maybe (CoAxiom Branched) #
Is this a non-empty closed type family? Returns Nothing
for
abstract or empty closed families.
isClassTyCon :: TyCon -> Bool #
Is this TyCon
that for a class instance?
isBoxedTupleTyCon :: TyCon -> Bool #
Is this the TyCon
for a boxed tuple?
isAlgTyCon :: TyCon -> Bool #
Returns True
if the supplied TyCon
resulted from either a
data
or newtype
declaration
isAbstractTyCon :: TyCon -> Bool #
Test if the TyCon
is algebraic but abstract (invisible data constructors)
famTyConFlav_maybe :: TyCon -> Maybe FamTyConFlav #
Extract the flavour of a type family (with all the extra information that it carries)
:: TyCon | |
-> [tyco] | Arguments to |
-> Maybe ([(TyVar, tyco)], Type, [tyco]) | Returns a |
algTyConRhs :: TyCon -> AlgTyConRhs #
Extract an AlgTyConRhs
with information about data constructors from an
algebraic or tuple TyCon
. Panics for any other sort of TyCon
gHC_TYPENATS :: Module #
classTyCon :: Class -> TyCon #
Instances
Data Role | |
Defined in GHC.Core.Coercion.Axiom 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 # | |
Binary Role | |
Outputable Role | |
Defined in GHC.Core.Coercion.Axiom | |
Eq Role | |
Ord Role | |
type Anno (Maybe Role) | |
Defined in GHC.Hs.Decls | |
type Anno (Maybe Role) | |
Defined in GHC.Hs.Decls |
data BuiltInSynFamily #
BuiltInSynFamily | |
|
Derive a name for the representation type constructor of a
data
/newtype
instance.
emptyOccSet :: OccSet #
tyConAppTyCon_maybe :: Type -> Maybe TyCon #
The same as fst . splitTyConApp
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
Create the plain type constructor type which has been applied to no type arguments at all.
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 !TyCoVarBinder Type | A Π type. 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 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) | |
Instances
Data TyLit | |
Defined in GHC.Core.TyCo.Rep 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 | |
type TyConRepName = Name #
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.
Instances
Data TyCon | |
Defined in GHC.Core.TyCon 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 | |
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.
isFunTyCon :: TyCon -> Bool #
newtype PackageName #
Instances
Uniquable PackageName | |
Defined in GHC.Unit.Info getUnique :: PackageName -> Unique # | |
Outputable PackageName | |
Defined in GHC.Unit.Info ppr :: PackageName -> SDoc # | |
Eq PackageName | |
Defined in GHC.Unit.Info (==) :: PackageName -> PackageName -> Bool # (/=) :: PackageName -> PackageName -> Bool # |
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
mkModule :: u -> ModuleName -> GenModule u #
mkModuleName :: String -> ModuleName #
elementOfUniqSet :: Uniquable a => a -> UniqSet a -> Bool #
ppr :: Outputable a => a -> SDoc #
showSDocUnsafe :: SDoc -> String #
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
unpackFS :: FastString -> String #
Unpacks and decodes the FastString
fsLit :: String -> FastString #
data UnitDatabase unit #
Unit database
UnitDatabase | |
|
data ModuleName #
A ModuleName is essentially a simple string, e.g. Data.List
.
Instances
data GenericUnitInfo compid 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.
GenericUnitInfo | |
|
Instances
Binary DbUnitInfo | |
Defined in GHC.Unit.Database | |
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid, Show srcpkgname) => Show (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod) | |
Defined in GHC.Unit.Database showsPrec :: Int -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> ShowS # show :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> String # showList :: [GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod] -> ShowS # | |
(Eq uid, Eq compid, Eq modulename, Eq mod, Eq srcpkgid, Eq srcpkgname) => Eq (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod) | |
Defined in GHC.Unit.Database (==) :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> Bool # (/=) :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod -> Bool # |
tracePlugin :: String -> TcPlugin -> TcPlugin #
Print out extra information about the initialisation, stop, and every run
of the plugin when -ddump-tc-trace
is enabled.
:: 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
:: 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
type ModuleUnit = Unit Source #
type RawPackageName = FastString Source #
type Substitution = [(TcTyVar, TcType)] Source #
Instances
Outputable TvSubst Source # | |
Defined in GHC.TypeLits.Presburger.Compat |
type TcPluginSolveResult = TcPluginResult Source #
decompFunTy :: Type -> [Type] Source #
mkSubstitution :: [Ct] -> Substitution Source #
classifyPredType :: Type -> PredTree Source #
fsToUnitId :: FastString -> UnitId Source #
loadedPackageNames :: [UnitDatabase UnitId] -> UnitState -> [RawPackageName] Source #
moduleUnit' :: Module -> ModuleUnit Source #
typeNatKind :: TcType Source #