Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module is not used by GHC itself. Rather, it exports all of the functions and types you are likely to need when writing a plugin for GHC. So authors of plugins can probably get away simply with saying "import GhcPlugins".
Particularly interesting modules for plugin writers include CoreSyn and CoreMonad.
Synopsis
- module Plugins
- module RdrName
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- emptyTidyOccEnv :: TidyOccEnv
- mkMethodOcc :: OccName -> OccName
- mkDataCOcc :: OccName -> OccSet -> OccName
- mkDataTOcc :: OccName -> OccSet -> OccName
- mkDFunOcc :: String -> Bool -> OccSet -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- mkLocalOcc :: Unique -> OccName -> OccName
- mkSuperDictSelOcc :: Int -> OccName -> OccName
- mkSuperDictAuxOcc :: Int -> OccName -> OccName
- mkDataConWorkerOcc :: OccName -> OccName
- mkRecFldSelOcc :: String -> OccName
- mkGen1R :: OccName -> OccName
- mkGenR :: OccName -> OccName
- mkTyConRepOcc :: OccName -> OccName
- mkMaxTagOcc :: OccName -> OccName
- mkTag2ConOcc :: OccName -> OccName
- mkCon2TagOcc :: OccName -> OccName
- mkEqPredCoOcc :: OccName -> OccName
- mkInstTyCoOcc :: OccName -> OccName
- mkNewTyCoOcc :: OccName -> OccName
- mkClassDataConOcc :: OccName -> OccName
- mkRepEqOcc :: OccName -> OccName
- mkForeignExportOcc :: OccName -> OccName
- mkSpecOcc :: OccName -> OccName
- mkIPOcc :: OccName -> OccName
- mkDictOcc :: OccName -> OccName
- mkClassOpAuxOcc :: OccName -> OccName
- mkDefaultMethodOcc :: OccName -> OccName
- mkBuilderOcc :: OccName -> OccName
- mkMatcherOcc :: OccName -> OccName
- mkWorkerOcc :: OccName -> OccName
- mkDataConWrapperOcc :: OccName -> OccName
- isTypeableBindOcc :: OccName -> Bool
- isDefaultMethodOcc :: OccName -> Bool
- isDerivedOccName :: OccName -> Bool
- startsWithUnderscore :: OccName -> Bool
- parenSymOcc :: OccName -> SDoc -> SDoc
- isSymOcc :: OccName -> Bool
- isDataSymOcc :: OccName -> Bool
- isDataOcc :: OccName -> Bool
- isValOcc :: OccName -> Bool
- isTcOcc :: OccName -> Bool
- isTvOcc :: OccName -> Bool
- isVarOcc :: OccName -> Bool
- setOccNameSpace :: NameSpace -> OccName -> OccName
- occNameString :: OccName -> String
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- intersectsOccSet :: OccSet -> OccSet -> Bool
- intersectOccSet :: OccSet -> OccSet -> OccSet
- isEmptyOccSet :: OccSet -> Bool
- elemOccSet :: OccName -> OccSet -> Bool
- minusOccSet :: OccSet -> OccSet -> OccSet
- unionManyOccSets :: [OccSet] -> OccSet
- unionOccSets :: OccSet -> OccSet -> OccSet
- extendOccSetList :: OccSet -> [OccName] -> OccSet
- extendOccSet :: OccSet -> OccName -> OccSet
- mkOccSet :: [OccName] -> OccSet
- unitOccSet :: OccName -> OccSet
- emptyOccSet :: OccSet
- pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
- alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
- filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
- delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
- delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
- mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
- mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
- extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
- extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
- plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
- plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
- occEnvElts :: OccEnv a -> [a]
- foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- elemOccEnv :: OccName -> OccEnv a -> Bool
- mkOccEnv :: [(OccName, a)] -> OccEnv a
- lookupOccEnv :: OccEnv a -> OccName -> Maybe a
- extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
- extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
- unitOccEnv :: OccName -> a -> OccEnv a
- emptyOccEnv :: OccEnv a
- nameSpacesRelated :: NameSpace -> NameSpace -> Bool
- demoteOccName :: OccName -> Maybe OccName
- mkClsOccFS :: FastString -> OccName
- mkClsOcc :: String -> OccName
- mkTcOccFS :: FastString -> OccName
- mkTcOcc :: String -> OccName
- mkTyVarOccFS :: FastString -> OccName
- mkTyVarOcc :: String -> OccName
- mkDataOccFS :: FastString -> OccName
- mkDataOcc :: String -> OccName
- mkVarOccFS :: FastString -> OccName
- mkVarOcc :: String -> OccName
- mkOccNameFS :: NameSpace -> FastString -> OccName
- mkOccName :: NameSpace -> String -> OccName
- pprOccName :: OccName -> SDoc
- pprNameSpaceBrief :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpace :: NameSpace -> SDoc
- isValNameSpace :: NameSpace -> Bool
- isVarNameSpace :: NameSpace -> Bool
- isTvNameSpace :: NameSpace -> Bool
- isTcClsNameSpace :: NameSpace -> Bool
- isDataConNameSpace :: NameSpace -> Bool
- tvName :: NameSpace
- srcDataName :: NameSpace
- dataName :: NameSpace
- tcClsName :: NameSpace
- clsName :: NameSpace
- tcName :: NameSpace
- data NameSpace
- class HasOccName name where
- data OccEnv a
- type OccSet = UniqSet OccName
- type TidyOccEnv = UniqFM Int
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- emptyFsEnv :: FastStringEnv a
- type FastStringEnv a = UniqFM a
- data OccName
- pprPrefixName :: NamedThing a => a -> SDoc
- pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc
- getOccFS :: NamedThing a => a -> FastString
- getOccString :: NamedThing a => a -> String
- getSrcSpan :: NamedThing a => a -> SrcSpan
- getSrcLoc :: NamedThing a => a -> SrcLoc
- nameStableString :: Name -> String
- pprNameDefnLoc :: Name -> SDoc
- pprDefinedAt :: Name -> SDoc
- pprModulePrefix :: PprStyle -> Module -> OccName -> SDoc
- pprNameUnqualified :: Name -> SDoc
- stableNameCmp :: Name -> Name -> Ordering
- localiseName :: Name -> Name
- tidyNameOcc :: Name -> OccName -> Name
- setNameLoc :: Name -> SrcSpan -> Name
- setNameUnique :: Name -> Unique -> Name
- mkFCallName :: Unique -> String -> Name
- mkSysTvName :: Unique -> FastString -> Name
- mkSystemVarName :: Unique -> FastString -> Name
- mkSystemNameAt :: Unique -> OccName -> SrcSpan -> Name
- mkSystemName :: Unique -> OccName -> Name
- mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
- mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name
- mkDerivedInternalName :: (OccName -> OccName) -> Unique -> Name -> Name
- mkClonedInternalName :: Unique -> Name -> Name
- mkInternalName :: Unique -> OccName -> SrcSpan -> Name
- isSystemName :: Name -> Bool
- isVarName :: Name -> Bool
- isValName :: Name -> Bool
- isDataConName :: Name -> Bool
- isTyConName :: Name -> Bool
- isTyVarName :: Name -> Bool
- nameIsFromExternalPackage :: UnitId -> Name -> Bool
- nameIsHomePackageImport :: Module -> Name -> Bool
- nameIsHomePackage :: Module -> Name -> Bool
- nameIsLocalOrFrom :: Module -> Name -> Bool
- nameModule_maybe :: Name -> Maybe Module
- nameModule :: HasDebugCallStack => Name -> Module
- isHoleName :: Name -> Bool
- isInternalName :: Name -> Bool
- isExternalName :: Name -> Bool
- isBuiltInSyntax :: Name -> Bool
- wiredInNameTyThing_maybe :: Name -> Maybe TyThing
- isWiredInName :: Name -> Bool
- nameSrcSpan :: Name -> SrcSpan
- nameSrcLoc :: Name -> SrcLoc
- nameNameSpace :: Name -> NameSpace
- nameOccName :: Name -> OccName
- nameUnique :: Name -> Unique
- data BuiltInSyntax
- class NamedThing a where
- getOccName :: a -> OccName
- getName :: a -> Name
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- emptyTidyOccEnv :: TidyOccEnv
- mkMethodOcc :: OccName -> OccName
- mkDataCOcc :: OccName -> OccSet -> OccName
- mkDataTOcc :: OccName -> OccSet -> OccName
- mkDFunOcc :: String -> Bool -> OccSet -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- mkLocalOcc :: Unique -> OccName -> OccName
- mkSuperDictSelOcc :: Int -> OccName -> OccName
- mkSuperDictAuxOcc :: Int -> OccName -> OccName
- mkDataConWorkerOcc :: OccName -> OccName
- mkRecFldSelOcc :: String -> OccName
- mkGen1R :: OccName -> OccName
- mkGenR :: OccName -> OccName
- mkTyConRepOcc :: OccName -> OccName
- mkMaxTagOcc :: OccName -> OccName
- mkTag2ConOcc :: OccName -> OccName
- mkCon2TagOcc :: OccName -> OccName
- mkEqPredCoOcc :: OccName -> OccName
- mkInstTyCoOcc :: OccName -> OccName
- mkNewTyCoOcc :: OccName -> OccName
- mkClassDataConOcc :: OccName -> OccName
- mkRepEqOcc :: OccName -> OccName
- mkForeignExportOcc :: OccName -> OccName
- mkSpecOcc :: OccName -> OccName
- mkIPOcc :: OccName -> OccName
- mkDictOcc :: OccName -> OccName
- mkClassOpAuxOcc :: OccName -> OccName
- mkDefaultMethodOcc :: OccName -> OccName
- mkBuilderOcc :: OccName -> OccName
- mkMatcherOcc :: OccName -> OccName
- mkWorkerOcc :: OccName -> OccName
- mkDataConWrapperOcc :: OccName -> OccName
- isTypeableBindOcc :: OccName -> Bool
- isDefaultMethodOcc :: OccName -> Bool
- isDerivedOccName :: OccName -> Bool
- startsWithUnderscore :: OccName -> Bool
- parenSymOcc :: OccName -> SDoc -> SDoc
- isSymOcc :: OccName -> Bool
- isDataSymOcc :: OccName -> Bool
- isDataOcc :: OccName -> Bool
- isValOcc :: OccName -> Bool
- isTcOcc :: OccName -> Bool
- isTvOcc :: OccName -> Bool
- isVarOcc :: OccName -> Bool
- setOccNameSpace :: NameSpace -> OccName -> OccName
- occNameString :: OccName -> String
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- intersectsOccSet :: OccSet -> OccSet -> Bool
- intersectOccSet :: OccSet -> OccSet -> OccSet
- isEmptyOccSet :: OccSet -> Bool
- elemOccSet :: OccName -> OccSet -> Bool
- minusOccSet :: OccSet -> OccSet -> OccSet
- unionManyOccSets :: [OccSet] -> OccSet
- unionOccSets :: OccSet -> OccSet -> OccSet
- extendOccSetList :: OccSet -> [OccName] -> OccSet
- extendOccSet :: OccSet -> OccName -> OccSet
- mkOccSet :: [OccName] -> OccSet
- unitOccSet :: OccName -> OccSet
- emptyOccSet :: OccSet
- pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
- alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
- filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
- delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
- delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
- mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
- mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
- extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
- extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
- plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
- plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
- occEnvElts :: OccEnv a -> [a]
- foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- elemOccEnv :: OccName -> OccEnv a -> Bool
- mkOccEnv :: [(OccName, a)] -> OccEnv a
- lookupOccEnv :: OccEnv a -> OccName -> Maybe a
- extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
- extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
- unitOccEnv :: OccName -> a -> OccEnv a
- emptyOccEnv :: OccEnv a
- nameSpacesRelated :: NameSpace -> NameSpace -> Bool
- demoteOccName :: OccName -> Maybe OccName
- mkClsOccFS :: FastString -> OccName
- mkClsOcc :: String -> OccName
- mkTcOccFS :: FastString -> OccName
- mkTcOcc :: String -> OccName
- mkTyVarOccFS :: FastString -> OccName
- mkTyVarOcc :: String -> OccName
- mkDataOccFS :: FastString -> OccName
- mkDataOcc :: String -> OccName
- mkVarOccFS :: FastString -> OccName
- mkVarOcc :: String -> OccName
- mkOccNameFS :: NameSpace -> FastString -> OccName
- mkOccName :: NameSpace -> String -> OccName
- pprOccName :: OccName -> SDoc
- pprNameSpaceBrief :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpace :: NameSpace -> SDoc
- isValNameSpace :: NameSpace -> Bool
- isVarNameSpace :: NameSpace -> Bool
- isTvNameSpace :: NameSpace -> Bool
- isTcClsNameSpace :: NameSpace -> Bool
- isDataConNameSpace :: NameSpace -> Bool
- tvName :: NameSpace
- srcDataName :: NameSpace
- dataName :: NameSpace
- tcClsName :: NameSpace
- clsName :: NameSpace
- tcName :: NameSpace
- data NameSpace
- class HasOccName name where
- data OccEnv a
- type OccSet = UniqSet OccName
- type TidyOccEnv = UniqFM Int
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- emptyFsEnv :: FastStringEnv a
- type FastStringEnv a = UniqFM a
- data OccName
- data Name
- module Var
- isNeverLevPolyId :: Id -> Bool
- transferPolyIdInfo :: Id -> [Var] -> Id -> Id
- zapStableUnfolding :: Id -> Id
- zapIdTailCallInfo :: Id -> Id
- zapIdUsedOnceInfo :: Id -> Id
- zapIdUsageEnvInfo :: Id -> Id
- zapIdUsageInfo :: Id -> Id
- zapIdDemandInfo :: Id -> Id
- zapFragileIdInfo :: Id -> Id
- zapLamIdInfo :: Id -> Id
- updOneShotInfo :: Id -> OneShotInfo -> Id
- setIdOneShotInfo :: Id -> OneShotInfo -> Id
- clearOneShotLambda :: Id -> Id
- setOneShotLambda :: Id -> Id
- isProbablyOneShotLambda :: Id -> Bool
- isStateHackType :: Type -> Bool
- typeOneShot :: Type -> OneShotInfo
- stateHackOneShot :: OneShotInfo
- isOneShotBndr :: Var -> Bool
- idStateHackOneShotInfo :: Id -> OneShotInfo
- idOneShotInfo :: Id -> OneShotInfo
- isConLikeId :: Id -> Bool
- idRuleMatchInfo :: Id -> RuleMatchInfo
- setInlineActivation :: Id -> Activation -> Id
- idInlineActivation :: Id -> Activation
- modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id
- setInlinePragma :: Id -> InlinePragma -> Id
- idInlinePragma :: Id -> InlinePragma
- zapIdOccInfo :: Id -> Id
- setIdOccInfo :: Id -> OccInfo -> Id
- idOccInfo :: Id -> OccInfo
- setIdCafInfo :: Id -> CafInfo -> Id
- idCafInfo :: Id -> CafInfo
- setIdSpecialisation :: Id -> RuleInfo -> Id
- idHasRules :: Id -> Bool
- idCoreRules :: Id -> [CoreRule]
- idSpecialisation :: Id -> RuleInfo
- setCaseBndrEvald :: StrictnessMark -> Id -> Id
- setIdDemandInfo :: Id -> Demand -> Id
- idDemandInfo :: Id -> Demand
- setIdUnfolding :: Id -> Unfolding -> Id
- realIdUnfolding :: Id -> Unfolding
- idUnfolding :: Id -> Unfolding
- isStrictId :: Id -> Bool
- zapIdStrictness :: Id -> Id
- setIdStrictness :: Id -> StrictSig -> Id
- idStrictness :: Id -> StrictSig
- isBottomingId :: Var -> Bool
- idFunRepArity :: Id -> RepArity
- setIdCallArity :: Id -> Arity -> Id
- idCallArity :: Id -> Arity
- setIdArity :: Id -> Arity -> Id
- idArity :: Id -> Arity
- asJoinId_maybe :: Id -> Maybe JoinArity -> Id
- zapJoinId :: Id -> Id
- asJoinId :: Id -> JoinArity -> JoinId
- idJoinArity :: JoinId -> JoinArity
- isDeadBinder :: Id -> Bool
- idIsFrom :: Module -> Id -> Bool
- isImplicitId :: Id -> Bool
- hasNoBinding :: Id -> Bool
- idDataCon :: Id -> DataCon
- isJoinId_maybe :: Var -> Maybe JoinArity
- isJoinId :: Var -> Bool
- isDataConId_maybe :: Id -> Maybe DataCon
- isDataConWrapId_maybe :: Id -> Maybe DataCon
- isDataConWrapId :: Id -> Bool
- isDataConWorkId_maybe :: Id -> Maybe DataCon
- isDataConWorkId :: Id -> Bool
- isFCallId_maybe :: Id -> Maybe ForeignCall
- isFCallId :: Id -> Bool
- isPrimOpId_maybe :: Id -> Maybe PrimOp
- isDFunId :: Id -> Bool
- isPrimOpId :: Id -> Bool
- isClassOpId_maybe :: Id -> Maybe Class
- isNaughtyRecordSelector :: Id -> Bool
- isPatSynRecordSelector :: Id -> Bool
- isDataConRecordSelector :: Id -> Bool
- isRecordSelector :: Id -> Bool
- recordSelectorTyCon :: Id -> RecSelParent
- mkTemplateLocalsNum :: Int -> [Type] -> [Id]
- mkTemplateLocals :: [Type] -> [Id]
- mkTemplateLocal :: Int -> Type -> Id
- mkWorkerId :: Unique -> Id -> Type -> Id
- mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id
- mkUserLocal :: OccName -> Unique -> Type -> SrcSpan -> Id
- mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id
- mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id
- mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id
- mkSysLocal :: FastString -> Unique -> Type -> Id
- mkExportedVanillaId :: Name -> Type -> Id
- mkExportedLocalId :: IdDetails -> Name -> Type -> Id
- mkLocalIdWithInfo :: Name -> Type -> IdInfo -> Id
- mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id
- mkLocalIdOrCoVar :: Name -> Type -> Id
- mkLocalCoVar :: Name -> Type -> CoVar
- mkLocalId :: Name -> Type -> Id
- mkVanillaGlobalWithInfo :: Name -> Type -> IdInfo -> Id
- mkVanillaGlobal :: Name -> Type -> Id
- mkGlobalId :: IdDetails -> Name -> Type -> IdInfo -> Id
- maybeModifyIdInfo :: Maybe IdInfo -> Id -> Id
- modifyIdInfo :: HasDebugCallStack => (IdInfo -> IdInfo) -> Id -> Id
- setIdInfo :: Id -> IdInfo -> Id
- localiseId :: Id -> Id
- setIdType :: Id -> Type -> Id
- setIdUnique :: Id -> Unique -> Id
- setIdName :: Id -> Name -> Id
- idType :: Id -> Kind
- idUnique :: Id -> Unique
- idName :: Id -> Name
- isExportedId :: Var -> Bool
- isGlobalId :: Var -> Bool
- isLocalId :: Var -> Bool
- isId :: Var -> Bool
- globaliseId :: Id -> Id
- idDetails :: Id -> IdDetails
- idInfo :: HasDebugCallStack => Id -> IdInfo
- type Id = Var
- type JoinId = Id
- type InVar = Var
- type InId = Id
- type OutVar = Var
- type OutId = Id
- data Var
- module IdInfo
- module CoreMonad
- module CoreSyn
- module Literal
- module DataCon
- module CoreUtils
- module MkCore
- module CoreFVs
- substTickish :: Subst -> Tickish Id -> Tickish Id
- substDVarSet :: Subst -> DVarSet -> DVarSet
- substRulesForImportedIds :: Subst -> [CoreRule] -> [CoreRule]
- substSpec :: Subst -> Id -> RuleInfo -> RuleInfo
- substIdOcc :: Subst -> Id -> Id
- substUnfolding :: Subst -> Unfolding -> Unfolding
- substUnfoldingSC :: Subst -> Unfolding -> Unfolding
- substIdInfo :: Subst -> Id -> IdInfo -> Maybe IdInfo
- substIdType :: Subst -> Id -> Id
- substCo :: HasCallStack => Subst -> Coercion -> Coercion
- getTCvSubst :: Subst -> TCvSubst
- substTy :: Subst -> Type -> Type
- cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id])
- cloneBndr :: Subst -> Unique -> Var -> (Subst, Var)
- cloneBndrs :: Subst -> UniqSupply -> [Var] -> (Subst, [Var])
- cloneIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id])
- cloneIdBndr :: Subst -> UniqSupply -> Id -> (Subst, Id)
- substRecBndrs :: Subst -> [Id] -> (Subst, [Id])
- substBndrs :: Subst -> [Var] -> (Subst, [Var])
- substBndr :: Subst -> Var -> (Subst, Var)
- deShadowBinds :: CoreProgram -> CoreProgram
- substBind :: Subst -> CoreBind -> (Subst, CoreBind)
- substBindSC :: Subst -> CoreBind -> (Subst, CoreBind)
- substExpr :: SDoc -> Subst -> CoreExpr -> CoreExpr
- substExprSC :: SDoc -> Subst -> CoreExpr -> CoreExpr
- setInScope :: Subst -> InScopeSet -> Subst
- extendInScopeIds :: Subst -> [Id] -> Subst
- extendInScopeList :: Subst -> [Var] -> Subst
- extendInScope :: Subst -> Var -> Subst
- addInScopeSet :: Subst -> VarSet -> Subst
- isInScope :: Var -> Subst -> Bool
- mkOpenSubst :: InScopeSet -> [(Var, CoreArg)] -> Subst
- delBndrs :: Subst -> [Var] -> Subst
- delBndr :: Subst -> Var -> Subst
- lookupTCvSubst :: Subst -> TyVar -> Type
- lookupIdSubst :: SDoc -> Subst -> Id -> CoreExpr
- extendSubstList :: Subst -> [(Var, CoreArg)] -> Subst
- extendSubstWithVar :: Subst -> Var -> Var -> Subst
- extendSubst :: Subst -> Var -> CoreArg -> Subst
- extendTvSubstList :: Subst -> [(TyVar, Type)] -> Subst
- extendTvSubst :: Subst -> TyVar -> Type -> Subst
- extendIdSubstList :: Subst -> [(Id, CoreExpr)] -> Subst
- extendIdSubst :: Subst -> Id -> CoreExpr -> Subst
- zapSubstEnv :: Subst -> Subst
- substInScope :: Subst -> InScopeSet
- mkSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> IdSubstEnv -> Subst
- mkEmptySubst :: InScopeSet -> Subst
- emptySubst :: Subst
- isEmptySubst :: Subst -> Bool
- data Subst = Subst InScopeSet IdSubstEnv TvSubstEnv CvSubstEnv
- type IdSubstEnv = IdEnv CoreExpr
- extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
- type TvSubstEnv = TyVarEnv Type
- data InScopeSet
- module Rules
- module Annotations
- module DynFlags
- module Packages
- module Module
- tyConAppNeedsKindSig :: Bool -> TyCon -> Int -> Bool
- classifiesTypeWithValues :: Kind -> Bool
- isKindLevPoly :: Kind -> Bool
- isConstraintKindCon :: TyCon -> Bool
- setJoinResTy :: Int -> Type -> Type -> Type
- modifyJoinResTy :: Int -> (Type -> Type) -> Type -> Type
- splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet
- splitVisVarsOfType :: Type -> Pair TyCoVarSet
- synTyConResKind :: TyCon -> Kind
- tyConsOfType :: Type -> UniqSet TyCon
- occCheckExpand :: [Var] -> Type -> Maybe Type
- resultIsLevPoly :: Type -> Bool
- isTypeLevPoly :: Type -> Bool
- tcReturnsConstraintKind :: Kind -> Bool
- tcIsRuntimeTypeKind :: Kind -> Bool
- tcIsLiftedTypeKind :: Kind -> Bool
- tcIsConstraintKind :: Kind -> Bool
- tcTypeKind :: HasDebugCallStack => Type -> Kind
- typeKind :: HasDebugCallStack => Type -> Kind
- nonDetCmpTc :: TyCon -> TyCon -> Ordering
- nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering
- nonDetCmpTypeX :: RnEnv2 -> Type -> Type -> Ordering
- nonDetCmpTypes :: [Type] -> [Type] -> Ordering
- nonDetCmpType :: Type -> Type -> Ordering
- eqVarBndrs :: RnEnv2 -> [Var] -> [Var] -> Maybe RnEnv2
- eqTypes :: [Type] -> [Type] -> Bool
- eqTypeX :: RnEnv2 -> Type -> Type -> Bool
- seqTypes :: [Type] -> ()
- seqType :: Type -> ()
- isValidJoinPointType :: JoinArity -> Type -> Bool
- isPrimitiveType :: Type -> Bool
- isStrictType :: HasDebugCallStack => Type -> Bool
- isDataFamilyAppType :: Type -> Bool
- isAlgType :: Type -> Bool
- isUnboxedSumType :: Type -> Bool
- isUnboxedTupleType :: Type -> Bool
- getRuntimeRep :: HasDebugCallStack => Type -> Type
- getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type
- dropRuntimeRepArgs :: [Type] -> [Type]
- isRuntimeRepKindedTy :: Type -> Bool
- mightBeUnliftedType :: Type -> Bool
- isUnliftedType :: HasDebugCallStack => Type -> Bool
- isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool
- isCoVarType :: Type -> Bool
- isFamFreeTy :: Type -> Bool
- coAxNthLHS :: forall (br :: BranchFlag). CoAxiom br -> Int -> Type
- mkFamilyTyConApp :: TyCon -> [Type] -> Type
- closeOverKindsDSet :: DTyVarSet -> DTyVarSet
- closeOverKindsList :: [TyVar] -> [TyVar]
- closeOverKindsFV :: [TyVar] -> FV
- closeOverKinds :: TyVarSet -> TyVarSet
- binderRelevantType_maybe :: TyCoBinder -> Maybe Type
- tyBinderType :: TyBinder -> Type
- tyCoBinderType :: TyCoBinder -> Type
- tyCoBinderVar_maybe :: TyCoBinder -> Maybe TyCoVar
- isAnonTyCoBinder :: TyCoBinder -> Bool
- mkAnonBinder :: AnonArgFlag -> Type -> TyCoBinder
- isTauTy :: Type -> Bool
- appTyArgFlags :: Type -> [Type] -> [ArgFlag]
- tyConArgFlags :: TyCon -> [Type] -> [ArgFlag]
- partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a])
- filterOutInferredTypes :: TyCon -> [Type] -> [Type]
- filterOutInvisibleTypes :: TyCon -> [Type] -> [Type]
- splitPiTysInvisibleN :: Int -> Type -> ([TyCoBinder], Type)
- splitPiTysInvisible :: Type -> ([TyCoBinder], Type)
- invisibleTyBndrCount :: Type -> Int
- splitForAllVarBndrs :: Type -> ([TyCoVarBinder], Type)
- splitPiTys :: Type -> ([TyCoBinder], Type)
- splitPiTy :: Type -> (TyCoBinder, Type)
- splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type)
- splitForAllTy_co_maybe :: Type -> Maybe (TyCoVar, Type)
- splitForAllTy_ty_maybe :: Type -> Maybe (TyCoVar, Type)
- splitForAllTy_maybe :: Type -> Maybe (TyCoVar, Type)
- dropForAlls :: Type -> Type
- splitForAllTy :: Type -> (TyCoVar, Type)
- isFunTy :: Type -> Bool
- isPiTy :: Type -> Bool
- isForAllTy_co :: Type -> Bool
- isForAllTy_ty :: Type -> Bool
- isForAllTy :: Type -> Bool
- splitForAllTysSameVis :: ArgFlag -> Type -> ([TyCoVar], Type)
- splitForAllTys :: Type -> ([TyCoVar], Type)
- mkTyConBindersPreferAnon :: [TyVar] -> TyCoVarSet -> [TyConBinder]
- mkLamTypes :: [Var] -> Type -> Type
- mkLamType :: Var -> Type -> Type
- mkVisForAllTys :: [TyVar] -> Type -> Type
- mkSpecForAllTys :: [TyVar] -> Type -> Type
- mkSpecForAllTy :: TyVar -> Type -> Type
- mkInvForAllTys :: [TyVar] -> Type -> Type
- mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type
- mkInvForAllTy :: TyVar -> Type -> Type
- mkTyCoInvForAllTy :: TyCoVar -> Type -> Type
- stripCoercionTy :: Type -> Coercion
- isCoercionTy_maybe :: Type -> Maybe Coercion
- mkCoercionTy :: Coercion -> Type
- discardCast :: Type -> Type
- tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder]
- splitCastTy_maybe :: Type -> Maybe (Type, Coercion)
- newTyConInstRhs :: TyCon -> [Type] -> Type
- nextRole :: Type -> Role
- splitListTyConApp_maybe :: Type -> Maybe Type
- repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])
- splitTyConApp :: Type -> (TyCon, [Type])
- tyConAppArgN :: Int -> Type -> Type
- tyConAppArgs :: Type -> [Type]
- tyConAppArgs_maybe :: Type -> Maybe [Type]
- tyConAppTyCon :: Type -> TyCon
- tyConAppTyCon_maybe :: Type -> Maybe TyCon
- tyConAppTyConPicky_maybe :: Type -> Maybe TyCon
- mkTyConApp :: TyCon -> [Type] -> Type
- applyTysX :: [TyVar] -> Type -> [Type] -> Type
- piResultTys :: HasDebugCallStack => Type -> [Type] -> Type
- funArgTy :: Type -> Type
- funResultTy :: Type -> Type
- splitFunTys :: Type -> ([Type], Type)
- splitFunTy_maybe :: Type -> Maybe (Type, Type)
- splitFunTy :: Type -> (Type, Type)
- pprUserTypeErrorTy :: Type -> SDoc
- userTypeError_maybe :: Type -> Maybe Type
- isLitTy :: Type -> Maybe TyLit
- isStrLitTy :: Type -> Maybe FastString
- mkStrLitTy :: FastString -> Type
- isNumLitTy :: Type -> Maybe Integer
- mkNumLitTy :: Integer -> Type
- repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type])
- splitAppTys :: Type -> (Type, [Type])
- splitAppTy :: Type -> (Type, Type)
- tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type)
- repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type)
- splitAppTy_maybe :: Type -> Maybe (Type, Type)
- mkAppTys :: Type -> [Type] -> Type
- repGetTyVar_maybe :: Type -> Maybe TyVar
- getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN)
- getTyVar_maybe :: Type -> Maybe TyVar
- isTyVarTy :: Type -> Bool
- getTyVar :: String -> Type -> TyVar
- mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion
- mapType :: Monad m => TyCoMapper env m -> env -> Type -> m Type
- isRuntimeRepVar :: TyVar -> Bool
- isUnliftedRuntimeRep :: Type -> Bool
- isUnliftedTypeKind :: Kind -> Bool
- isLiftedRuntimeRep :: Type -> Bool
- kindRep_maybe :: HasDebugCallStack => Kind -> Maybe Type
- kindRep :: HasDebugCallStack => Kind -> Type
- expandTypeSynonyms :: Type -> Type
- data TyCoMapper env (m :: Type -> Type) = TyCoMapper {}
- cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar])
- cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar)
- substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar])
- substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar)
- substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar])
- substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar)
- substCoUnchecked :: TCvSubst -> Coercion -> Coercion
- lookupTyVar :: TCvSubst -> TyVar -> Maybe Type
- substTyVars :: TCvSubst -> [TyVar] -> [Type]
- substTyVar :: TCvSubst -> TyVar -> Type
- substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType
- substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType
- substTysUnchecked :: TCvSubst -> [Type] -> [Type]
- substTys :: HasCallStack => TCvSubst -> [Type] -> [Type]
- substTyUnchecked :: TCvSubst -> Type -> Type
- substTyAddInScope :: TCvSubst -> Type -> Type
- substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type]
- substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion
- substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type
- substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type
- zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv
- zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv
- mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst
- zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst
- zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst
- unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- extendTCvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
- extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
- extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
- extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
- extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst
- extendTCvSubstWithClone :: TCvSubst -> TyCoVar -> TyCoVar -> TCvSubst
- extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
- extendTCvInScopeSet :: TCvSubst -> VarSet -> TCvSubst
- extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst
- extendTCvInScope :: TCvSubst -> Var -> TCvSubst
- zapTCvSubst :: TCvSubst -> TCvSubst
- setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst
- notElemTCvSubst :: Var -> TCvSubst -> Bool
- getTCvSubstRangeFVs :: TCvSubst -> VarSet
- getTCvInScope :: TCvSubst -> InScopeSet
- getTvSubstEnv :: TCvSubst -> TvSubstEnv
- mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst
- isEmptyTCvSubst :: TCvSubst -> Bool
- mkEmptyTCvSubst :: InScopeSet -> TCvSubst
- emptyTCvSubst :: TCvSubst
- composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv)
- emptyTvSubstEnv :: TvSubstEnv
- data TCvSubst = TCvSubst InScopeSet TvSubstEnv CvSubstEnv
- type TvSubstEnv = TyVarEnv Type
- tidyKind :: TidyEnv -> Kind -> Kind
- tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)
- tidyTopType :: Type -> Type
- tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)
- tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type])
- tidyType :: TidyEnv -> Type -> Type
- tidyTypes :: TidyEnv -> [Type] -> [Type]
- tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar
- tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
- tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])
- tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)
- tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar]
- tyCoVarsOfTypeWellScoped :: Type -> [TyVar]
- scopedSort :: [TyCoVar] -> [TyCoVar]
- noFreeVarsOfType :: Type -> Bool
- coVarsOfTypes :: [Type] -> TyCoVarSet
- coVarsOfType :: Type -> CoVarSet
- tyCoFVsVarBndr :: Var -> FV -> FV
- tyCoFVsVarBndrs :: [Var] -> FV -> FV
- tyCoFVsBndr :: TyCoVarBinder -> FV -> FV
- tyCoFVsOfType :: Type -> FV
- tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet
- tyCoVarsOfTypes :: [Type] -> TyCoVarSet
- tyCoVarsOfType :: Type -> TyCoVarSet
- funTyCon :: TyCon
- typeSize :: Type -> Int
- mkTyConTy :: TyCon -> Type
- mkPiTys :: [TyCoBinder] -> Type -> Type
- mkPiTy :: TyCoBinder -> Type -> Type
- mkForAllTys :: [TyCoVarBinder] -> Type -> Type
- mkInvisFunTys :: [Type] -> Type -> Type
- mkVisFunTys :: [Type] -> Type -> Type
- mkInvisFunTy :: Type -> Type -> Type
- mkVisFunTy :: Type -> Type -> Type
- mkTyVarTys :: [TyVar] -> [Type]
- mkTyVarTy :: TyVar -> Type
- isNamedBinder :: TyCoBinder -> Bool
- isVisibleBinder :: TyCoBinder -> Bool
- isInvisibleBinder :: TyCoBinder -> Bool
- type KindOrType = Type
- type KnotTied ty = ty
- isTyVar :: Var -> Bool
- tyVarKind :: TyVar -> Kind
- mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder]
- mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder]
- mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder
- binderType :: VarBndr TyCoVar argf -> Type
- binderArgFlag :: VarBndr tv argf -> argf
- binderVars :: [VarBndr tv argf] -> [tv]
- binderVar :: VarBndr tv argf -> tv
- sameVis :: ArgFlag -> ArgFlag -> Bool
- isInvisibleArgFlag :: ArgFlag -> Bool
- isVisibleArgFlag :: ArgFlag -> Bool
- type TyVar = Var
- type TyCoVar = Id
- data ForallVisFlag
- type TyCoVarBinder = VarBndr TyCoVar ArgFlag
- type TyVarBinder = VarBndr TyVar ArgFlag
- liftedTypeKind :: Kind
- isPredTy :: HasDebugCallStack => Type -> Bool
- isCoercionTy :: Type -> Bool
- mkAppTy :: Type -> Type -> Type
- mkCastTy :: Type -> Coercion -> Type
- piResultTy :: HasDebugCallStack => Type -> Type -> Type
- eqType :: Type -> Type -> Bool
- coreView :: Type -> Maybe Type
- tcView :: Type -> Maybe Type
- isRuntimeRepTy :: Type -> Bool
- isLiftedTypeKind :: Kind -> Bool
- splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- partitionInvisibleTypes :: TyCon -> [Type] -> ([Type], [Type])
- mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type
- data Type
- data TyThing
- data TyCoBinder
- type PredType = Type
- type Kind = Type
- type ThetaType = [PredType]
- data ArgFlag
- data AnonArgFlag
- data Var
- module TyCon
- simplifyArgsWorker :: [TyCoBinder] -> Kind -> TyCoVarSet -> [Role] -> [(Type, Coercion)] -> ([Type], [Coercion], CoercionN)
- buildCoercion :: Type -> Type -> CoercionN
- mkReprPrimEqPred :: Type -> Type -> Type
- mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- mkPrimEqPredRole :: Role -> Type -> Type -> PredType
- mkPrimEqPred :: Type -> Type -> Type
- mkHeteroCoercionType :: Role -> Kind -> Kind -> Type -> Type -> Type
- coercionRole :: Coercion -> Role
- coercionKindRole :: Coercion -> (Pair Type, Role)
- coercionKinds :: [Coercion] -> Pair [Type]
- lcInScopeSet :: LiftingContext -> InScopeSet
- lcTCvSubst :: LiftingContext -> TCvSubst
- liftEnvSubstRight :: TCvSubst -> LiftCoEnv -> TCvSubst
- liftEnvSubstLeft :: TCvSubst -> LiftCoEnv -> TCvSubst
- lcSubstRight :: LiftingContext -> TCvSubst
- lcSubstLeft :: LiftingContext -> TCvSubst
- swapLiftCoEnv :: LiftCoEnv -> LiftCoEnv
- substRightCo :: LiftingContext -> Coercion -> Coercion
- substLeftCo :: LiftingContext -> Coercion -> Coercion
- isMappedByLC :: TyCoVar -> LiftingContext -> Bool
- liftCoSubstVarBndrUsing :: (LiftingContext -> Type -> (CoercionN, a)) -> LiftingContext -> TyCoVar -> (LiftingContext, TyCoVar, CoercionN, a)
- liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion
- substForAllCoBndrUsingLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyCoVar -> Coercion -> (LiftingContext, TyCoVar, Coercion)
- zapLiftingContext :: LiftingContext -> LiftingContext
- extendLiftingContextAndInScope :: LiftingContext -> TyCoVar -> Coercion -> LiftingContext
- extendLiftingContext :: LiftingContext -> TyCoVar -> Coercion -> LiftingContext
- mkSubstLiftingContext :: TCvSubst -> LiftingContext
- emptyLiftingContext :: InScopeSet -> LiftingContext
- liftCoSubstWith :: Role -> [TyCoVar] -> [Coercion] -> Type -> Coercion
- liftCoSubstWithEx :: Role -> [TyVar] -> [Coercion] -> [TyCoVar] -> [Type] -> (Type -> Coercion, [Type])
- eqCoercionX :: RnEnv2 -> Coercion -> Coercion -> Bool
- eqCoercion :: Coercion -> Coercion -> Bool
- topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type)
- topNormaliseTypeX :: NormaliseStepper ev -> (ev -> ev -> ev) -> Type -> Maybe (ev, Type)
- unwrapNewTypeStepper :: NormaliseStepper Coercion
- composeSteppers :: NormaliseStepper ev -> NormaliseStepper ev -> NormaliseStepper ev
- mapStepResult :: (ev1 -> ev2) -> NormaliseStepResult ev1 -> NormaliseStepResult ev2
- instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion)
- mkCoCast :: Coercion -> CoercionR -> Coercion
- mkPiCo :: Role -> Var -> Coercion -> Coercion
- mkPiCos :: Role -> [Var] -> Coercion -> Coercion
- castCoercionKindI :: Coercion -> CoercionN -> CoercionN -> Coercion
- castCoercionKind :: Coercion -> Role -> Type -> Type -> CoercionN -> CoercionN -> Coercion
- promoteCoercion :: Coercion -> CoercionN
- ltRole :: Role -> Role -> Bool
- nthRole :: Role -> TyCon -> Int -> Role
- tyConRolesRepresentational :: TyCon -> [Role]
- tyConRolesX :: Role -> TyCon -> [Role]
- setNominalRole_maybe :: Role -> Coercion -> Maybe Coercion
- downgradeRole :: Role -> Role -> Coercion -> Coercion
- mkCoherenceRightCo :: Role -> Type -> CoercionN -> Coercion -> Coercion
- mkCoherenceLeftCo :: Role -> Type -> CoercionN -> Coercion -> Coercion
- mkGReflLeftCo :: Role -> Type -> CoercionN -> Coercion
- mkGReflRightCo :: Role -> Type -> CoercionN -> Coercion
- nthCoRole :: Int -> Coercion -> Role
- mkTransMCo :: MCoercion -> MCoercion -> MCoercion
- mkHoleCo :: CoercionHole -> Coercion
- mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
- mkAxInstLHS :: forall (br :: BranchFlag). CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type
- mkUnbranchedAxInstRHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
- mkAxInstRHS :: forall (br :: BranchFlag). CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type
- mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched -> [Type] -> [Coercion] -> Coercion
- mkAxInstCo :: forall (br :: BranchFlag). Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Coercion
- isCoVar_maybe :: Coercion -> Maybe CoVar
- mkCoVarCos :: [CoVar] -> [Coercion]
- mkHomoForAllCos :: [TyCoVar] -> Coercion -> Coercion
- mkForAllCos :: [(TyCoVar, CoercionN)] -> Coercion -> Coercion
- mkAppCos :: Coercion -> [Coercion] -> Coercion
- mkRepReflCo :: Type -> Coercion
- coToMCo :: Coercion -> MCoercion
- isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role)
- isReflCo_maybe :: Coercion -> Maybe (Type, Role)
- isGReflCo_maybe :: Coercion -> Maybe (Type, Role)
- isGReflMCo :: MCoercion -> Bool
- isReflCoVar_maybe :: Var -> Maybe Coercion
- coVarKind :: CoVar -> Type
- coVarTypes :: HasDebugCallStack => CoVar -> Pair Type
- splitForAllCo_co_maybe :: Coercion -> Maybe (CoVar, Coercion, Coercion)
- splitForAllCo_ty_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion)
- splitForAllCo_maybe :: Coercion -> Maybe (TyCoVar, Coercion, Coercion)
- splitFunCo_maybe :: Coercion -> Maybe (Coercion, Coercion)
- splitAppCo_maybe :: Coercion -> Maybe (Coercion, Coercion)
- splitTyConAppCo_maybe :: Coercion -> Maybe (TyCon, [Coercion])
- getCoVar_maybe :: Coercion -> Maybe CoVar
- decomposeFunCo :: HasDebugCallStack => Role -> Coercion -> (Coercion, Coercion)
- decomposeCo :: Arity -> Coercion -> [Role] -> [Coercion]
- tidyCoAxBndrsForUser :: TidyEnv -> [Var] -> (TidyEnv, [Var])
- pprCoAxBranch :: TyCon -> CoAxBranch -> SDoc
- pprCoAxBranchLHS :: TyCon -> CoAxBranch -> SDoc
- pprCoAxBranchUser :: TyCon -> CoAxBranch -> SDoc
- pprCoAxiom :: forall (br :: BranchFlag). CoAxiom br -> SDoc
- etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type)
- setCoVarName :: CoVar -> Name -> CoVar
- setCoVarUnique :: CoVar -> Unique -> CoVar
- coVarName :: CoVar -> Name
- type NormaliseStepper ev = RecTcChecker -> TyCon -> [Type] -> NormaliseStepResult ev
- data NormaliseStepResult ev
- = NS_Done
- | NS_Abort
- | NS_Step RecTcChecker Type ev
- type LiftCoEnv = VarEnv Coercion
- substCoVarBndr :: HasCallStack => TCvSubst -> CoVar -> (TCvSubst, CoVar)
- lookupCoVar :: TCvSubst -> Var -> Maybe Coercion
- substCoVars :: TCvSubst -> [CoVar] -> [Coercion]
- substCoVar :: TCvSubst -> CoVar -> Coercion
- substCos :: HasCallStack => TCvSubst -> [Coercion] -> [Coercion]
- substCoWith :: HasCallStack => [TyVar] -> [Type] -> Coercion -> Coercion
- extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
- getCvSubstEnv :: TCvSubst -> CvSubstEnv
- emptyCvSubstEnv :: CvSubstEnv
- type CvSubstEnv = CoVarEnv Coercion
- pprParendCo :: Coercion -> SDoc
- tidyCos :: TidyEnv -> [Coercion] -> [Coercion]
- tidyCo :: TidyEnv -> Coercion -> Coercion
- coVarsOfCo :: Coercion -> CoVarSet
- tyCoFVsOfCos :: [Coercion] -> FV
- tyCoFVsOfCo :: Coercion -> FV
- tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet
- tyCoVarsOfCos :: [Coercion] -> TyCoVarSet
- tyCoVarsOfCo :: Coercion -> TyCoVarSet
- coercionSize :: Coercion -> Int
- setCoHoleCoVar :: CoercionHole -> CoVar -> CoercionHole
- coHoleCoVar :: CoercionHole -> CoVar
- type CoercionR = Coercion
- type CoercionP = Coercion
- type MCoercionR = MCoercion
- data CoercionHole = CoercionHole {}
- mkReflCo :: Role -> Type -> Coercion
- mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion
- mkAppCo :: Coercion -> Coercion -> Coercion
- mkForAllCo :: TyCoVar -> CoercionN -> Coercion -> Coercion
- mkFunCo :: Role -> Coercion -> Coercion -> Coercion
- mkCoVarCo :: CoVar -> Coercion
- mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion
- mkPhantomCo :: Coercion -> Type -> Type -> Coercion
- mkUnsafeCo :: Role -> Type -> Type -> Coercion
- mkUnivCo :: UnivCoProvenance -> Role -> Type -> Type -> Coercion
- mkSymCo :: Coercion -> Coercion
- mkTransCo :: Coercion -> Coercion -> Coercion
- mkNthCo :: HasDebugCallStack => Role -> Int -> Coercion -> Coercion
- mkLRCo :: LeftOrRight -> Coercion -> Coercion
- mkInstCo :: Coercion -> Coercion -> Coercion
- mkGReflCo :: Role -> Type -> MCoercionN -> Coercion
- mkNomReflCo :: Type -> Coercion
- mkKindCo :: Coercion -> Coercion
- mkSubCo :: Coercion -> Coercion
- mkProofIrrelCo :: Role -> Coercion -> Coercion -> Coercion -> Coercion
- mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion
- isGReflCo :: Coercion -> Bool
- isReflCo :: Coercion -> Bool
- isReflexiveCo :: Coercion -> Bool
- decomposePiCos :: HasDebugCallStack => CoercionN -> Pair Type -> [Type] -> ([CoercionN], CoercionN)
- coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind, Kind, Type, Type, Role)
- coVarRole :: CoVar -> Role
- mkCoercionType :: Role -> Type -> Type -> Type
- liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion
- seqCo :: Coercion -> ()
- coercionKind :: Coercion -> Pair Type
- coercionType :: Coercion -> Type
- data LiftingContext = LC TCvSubst LiftCoEnv
- data Role
- isCoVar :: Var -> Bool
- mkCoVar :: Name -> Type -> CoVar
- type CoVar = Id
- type TyCoVar = Id
- pprCo :: Coercion -> SDoc
- data Coercion
- data UnivCoProvenance
- data MCoercion
- type CoercionN = Coercion
- data Var
- pickLR :: LeftOrRight -> (a, a) -> a
- data LeftOrRight
- module TysWiredIn
- module HscTypes
- isKindLevel :: TypeOrKind -> Bool
- isTypeLevel :: TypeOrKind -> Bool
- mkIntWithInf :: Int -> IntWithInf
- treatZeroAsInf :: Int -> IntWithInf
- intGtLimit :: Int -> IntWithInf -> Bool
- infinity :: IntWithInf
- integralFractionalLit :: Bool -> Integer -> FractionalLit
- negateFractionalLit :: FractionalLit -> FractionalLit
- mkFractionalLit :: Real a => a -> FractionalLit
- negateIntegralLit :: IntegralLit -> IntegralLit
- mkIntegralLit :: Integral a => a -> IntegralLit
- isEarlyActive :: Activation -> Bool
- isAlwaysActive :: Activation -> Bool
- isNeverActive :: Activation -> Bool
- competesWith :: Activation -> Activation -> Bool
- isActiveIn :: PhaseNum -> Activation -> Bool
- isActive :: CompilerPhase -> Activation -> Bool
- pprInlineDebug :: InlinePragma -> SDoc
- pprInline :: InlinePragma -> SDoc
- setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma
- setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma
- inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo
- inlinePragmaActivation :: InlinePragma -> Activation
- inlinePragmaSat :: InlinePragma -> Maybe Arity
- isAnyInlinePragma :: InlinePragma -> Bool
- isInlinablePragma :: InlinePragma -> Bool
- isInlinePragma :: InlinePragma -> Bool
- isDefaultInlinePragma :: InlinePragma -> Bool
- dfunInlinePragma :: InlinePragma
- inlinePragmaSpec :: InlinePragma -> InlineSpec
- neverInlinePragma :: InlinePragma
- alwaysInlinePragma :: InlinePragma
- defaultInlinePragma :: InlinePragma
- noUserInlineSpec :: InlineSpec -> Bool
- isFunLike :: RuleMatchInfo -> Bool
- isConLike :: RuleMatchInfo -> Bool
- activeDuringFinal :: Activation
- activeAfterInitial :: Activation
- pprWithSourceText :: SourceText -> SDoc -> SDoc
- failed :: SuccessFlag -> Bool
- succeeded :: SuccessFlag -> Bool
- successIf :: Bool -> SuccessFlag
- zapFragileOcc :: OccInfo -> OccInfo
- isOneOcc :: OccInfo -> Bool
- isDeadOcc :: OccInfo -> Bool
- isStrongLoopBreaker :: OccInfo -> Bool
- isWeakLoopBreaker :: OccInfo -> Bool
- weakLoopBreaker :: OccInfo
- strongLoopBreaker :: OccInfo
- isAlwaysTailCalled :: OccInfo -> Bool
- zapOccTailCallInfo :: OccInfo -> OccInfo
- tailCallInfo :: OccInfo -> TailCallInfo
- notInsideLam :: InsideLam
- insideLam :: InsideLam
- seqOccInfo :: OccInfo -> ()
- isManyOccs :: OccInfo -> Bool
- noOccInfo :: OccInfo
- oneBranch :: BranchCount
- pprAlternative :: (a -> SDoc) -> a -> ConTag -> Arity -> SDoc
- sumParens :: SDoc -> SDoc
- tupleParens :: TupleSort -> SDoc -> SDoc
- boxityTupleSort :: Boxity -> TupleSort
- tupleSortBoxity :: TupleSort -> Boxity
- maybeParen :: PprPrec -> PprPrec -> SDoc -> SDoc
- appPrec :: PprPrec
- opPrec :: PprPrec
- funPrec :: PprPrec
- sigPrec :: PprPrec
- topPrec :: PprPrec
- hasOverlappingFlag :: OverlapMode -> Bool
- hasOverlappableFlag :: OverlapMode -> Bool
- hasIncoherentFlag :: OverlapMode -> Bool
- setOverlapModeMaybe :: OverlapFlag -> Maybe OverlapMode -> OverlapFlag
- isGenerated :: Origin -> Bool
- boolToRecFlag :: Bool -> RecFlag
- isNonRec :: RecFlag -> Bool
- isRec :: RecFlag -> Bool
- isBoxed :: Boxity -> Bool
- isTopLevel :: TopLevelFlag -> Bool
- isNotTopLevel :: TopLevelFlag -> Bool
- compareFixity :: Fixity -> Fixity -> (Bool, Bool)
- funTyFixity :: Fixity
- negateFixity :: Fixity
- defaultFixity :: Fixity
- minPrecedence :: Int
- maxPrecedence :: Int
- pprRuleName :: RuleName -> SDoc
- pprWarningTxtForMsg :: WarningTxt -> SDoc
- initialVersion :: Version
- bumpVersion :: Version -> Version
- isPromoted :: PromotionFlag -> Bool
- unSwap :: SwapFlag -> (a -> a -> b) -> a -> a -> b
- isSwapped :: SwapFlag -> Bool
- flipSwap :: SwapFlag -> SwapFlag
- bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
- worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
- hasNoOneShotInfo :: OneShotInfo -> Bool
- isOneShotInfo :: OneShotInfo -> Bool
- noOneShotInfo :: OneShotInfo
- alignmentOf :: Int -> Alignment
- mkAlignment :: Int -> Alignment
- fIRST_TAG :: ConTag
- pickLR :: LeftOrRight -> (a, a) -> a
- data LeftOrRight
- type Arity = Int
- type RepArity = Int
- type JoinArity = Int
- type ConTag = Int
- type ConTagZ = Int
- data Alignment
- data OneShotInfo
- data SwapFlag
- data PromotionFlag
- data FunctionOrData
- = IsFunction
- | IsData
- data StringLiteral = StringLiteral {
- sl_st :: SourceText
- sl_fs :: FastString
- data WarningTxt
- type RuleName = FastString
- data Fixity = Fixity SourceText Int FixityDirection
- data FixityDirection
- data LexicalFixity
- data TopLevelFlag
- data Boxity
- data RecFlag
- data Origin
- data OverlapFlag = OverlapFlag {}
- data OverlapMode
- newtype PprPrec = PprPrec Int
- data TupleSort
- data EP a = EP {}
- data OccInfo
- = ManyOccs {
- occ_tail :: !TailCallInfo
- | IAmDead
- | OneOcc { }
- | IAmALoopBreaker {
- occ_rules_only :: !RulesOnly
- occ_tail :: !TailCallInfo
- = ManyOccs {
- type BranchCount = Int
- type InterestingCxt = Bool
- type InsideLam = Bool
- data TailCallInfo
- data DefMethSpec ty
- data SuccessFlag
- data SourceText
- type PhaseNum = Int
- data CompilerPhase
- data Activation
- data RuleMatchInfo
- data InlinePragma = InlinePragma {}
- data InlineSpec
- data IntegralLit = IL {}
- data FractionalLit = FL {}
- data IntWithInf
- data SpliceExplicitFlag
- data TypeOrKind
- module VarSet
- module VarEnv
- module NameSet
- module NameEnv
- module UniqSet
- module UniqFM
- module FiniteMap
- module Util
- module GHC.Serialized
- module SrcLoc
- module Outputable
- module UniqSupply
- data Unique
- class Uniquable a where
- module FastString
- thNameToGhcName :: Name -> CoreM (Maybe Name)
Documentation
module Plugins
module RdrName
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) #
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv #
initTidyOccEnv :: [OccName] -> TidyOccEnv #
mkMethodOcc :: OccName -> OccName #
Derive a name for the representation type constructor of a
data
/newtype
instance.
mkSuperDictAuxOcc :: Int -> OccName -> OccName #
mkDataConWorkerOcc :: OccName -> OccName #
mkRecFldSelOcc :: String -> OccName #
mkTyConRepOcc :: OccName -> OccName #
mkMaxTagOcc :: OccName -> OccName #
mkTag2ConOcc :: OccName -> OccName #
mkCon2TagOcc :: OccName -> OccName #
mkEqPredCoOcc :: OccName -> OccName #
mkInstTyCoOcc :: OccName -> OccName #
mkNewTyCoOcc :: OccName -> OccName #
mkClassDataConOcc :: OccName -> OccName #
mkRepEqOcc :: OccName -> OccName #
mkForeignExportOcc :: OccName -> OccName #
mkClassOpAuxOcc :: OccName -> OccName #
mkDefaultMethodOcc :: OccName -> OccName #
mkBuilderOcc :: OccName -> OccName #
mkMatcherOcc :: OccName -> OccName #
mkWorkerOcc :: OccName -> OccName #
mkDataConWrapperOcc :: OccName -> OccName #
isTypeableBindOcc :: OccName -> Bool #
Is an OccName
one of a Typeable TyCon
or Module
binding?
This is needed as these bindings are renamed differently.
See Note [Grand plan for Typeable] in TcTypeable.
isDefaultMethodOcc :: OccName -> Bool #
isDerivedOccName :: OccName -> Bool #
Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints
startsWithUnderscore :: OccName -> Bool #
Haskell 98 encourages compilers to suppress warnings about unsed
names in a pattern if they start with _
: this implements that test
parenSymOcc :: OccName -> SDoc -> SDoc #
Wrap parens around an operator
Test if the OccName
is that for any operator (whether
it is a data constructor or variable or whatever)
isDataSymOcc :: OccName -> Bool #
Test if the OccName
is a data constructor that starts with
a symbol (e.g. :
, or []
)
Value OccNames
s are those that are either in
the variable or data constructor namespaces
setOccNameSpace :: NameSpace -> OccName -> OccName #
occNameString :: OccName -> String #
intersectsOccSet :: OccSet -> OccSet -> Bool #
intersectOccSet :: OccSet -> OccSet -> OccSet #
isEmptyOccSet :: OccSet -> Bool #
elemOccSet :: OccName -> OccSet -> Bool #
minusOccSet :: OccSet -> OccSet -> OccSet #
unionManyOccSets :: [OccSet] -> OccSet #
unionOccSets :: OccSet -> OccSet -> OccSet #
extendOccSetList :: OccSet -> [OccName] -> OccSet #
extendOccSet :: OccSet -> OccName -> OccSet #
unitOccSet :: OccName -> OccSet #
emptyOccSet :: OccSet #
filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt #
delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a #
delFromOccEnv :: OccEnv a -> OccName -> OccEnv a #
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a #
extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b #
extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a #
plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a #
plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a #
occEnvElts :: OccEnv a -> [a] #
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b #
elemOccEnv :: OccName -> OccEnv a -> Bool #
lookupOccEnv :: OccEnv a -> OccName -> Maybe a #
extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a #
extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a #
unitOccEnv :: OccName -> a -> OccEnv a #
emptyOccEnv :: OccEnv a #
nameSpacesRelated :: NameSpace -> NameSpace -> Bool #
demoteOccName :: OccName -> Maybe OccName #
mkClsOccFS :: FastString -> OccName #
mkTcOccFS :: FastString -> OccName #
mkTyVarOccFS :: FastString -> OccName #
mkTyVarOcc :: String -> OccName #
mkDataOccFS :: FastString -> OccName #
mkVarOccFS :: FastString -> OccName #
mkOccNameFS :: NameSpace -> FastString -> OccName #
pprOccName :: OccName -> SDoc #
pprNameSpaceBrief :: NameSpace -> SDoc #
pprNonVarNameSpace :: NameSpace -> SDoc #
pprNameSpace :: NameSpace -> SDoc #
isValNameSpace :: NameSpace -> Bool #
isVarNameSpace :: NameSpace -> Bool #
isTvNameSpace :: NameSpace -> Bool #
isTcClsNameSpace :: NameSpace -> Bool #
isDataConNameSpace :: NameSpace -> Bool #
class HasOccName name where #
Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.
Instances
HasOccName HoleFitCandidate | |
Defined in TcHoleFitTypes occName :: HoleFitCandidate -> OccName # | |
HasOccName TcBinder | |
HasOccName IfaceDecl | |
HasOccName IfaceClassOp | |
Defined in IfaceSyn occName :: IfaceClassOp -> OccName # | |
HasOccName IfaceConDecl | |
Defined in IfaceSyn occName :: IfaceConDecl -> OccName # | |
HasOccName RdrName | |
HasOccName Var | |
HasOccName OccName | |
HasOccName Name | |
HasOccName name => HasOccName (IEWrappedName name) | |
Defined in GHC.Hs.ImpExp occName :: IEWrappedName name -> OccName # |
Instances
Data a => Data (OccEnv a) | |
Defined in OccName gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) # toConstr :: OccEnv a -> Constr # dataTypeOf :: OccEnv a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) # gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # | |
Outputable a => Outputable (OccEnv a) | |
type TidyOccEnv = UniqFM Int #
mkFsEnv :: [(FastString, a)] -> FastStringEnv a #
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a #
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a #
emptyFsEnv :: FastStringEnv a #
type FastStringEnv a = UniqFM a #
A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in UniqDFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.
Occurrence Name
In this context that means: "classified (i.e. as a type name, value name, etc) but not qualified and not yet resolved"
Instances
Eq OccName | |
Data OccName | |
Defined in OccName gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName # toConstr :: OccName -> Constr # dataTypeOf :: OccName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # | |
Ord OccName | |
NFData OccName | |
HasOccName OccName | |
Binary OccName | |
Uniquable OccName | |
Outputable OccName | |
OutputableBndr OccName | |
Defined in OccName pprBndr :: BindingSite -> OccName -> SDoc # pprPrefixOcc :: OccName -> SDoc # pprInfixOcc :: OccName -> SDoc # bndrIsJoin_maybe :: OccName -> Maybe Int # |
pprPrefixName :: NamedThing a => a -> SDoc #
pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc #
getOccFS :: NamedThing a => a -> FastString #
getOccString :: NamedThing a => a -> String #
getSrcSpan :: NamedThing a => a -> SrcSpan #
getSrcLoc :: NamedThing a => a -> SrcLoc #
nameStableString :: Name -> String #
Get a string representation of a Name
that's unique and stable
across recompilations. Used for deterministic generation of binds for
derived instances.
eg. "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal$String"
pprNameDefnLoc :: Name -> SDoc #
pprDefinedAt :: Name -> SDoc #
pprNameUnqualified :: Name -> SDoc #
Print the string of Name unqualifiedly directly.
stableNameCmp :: Name -> Name -> Ordering #
Compare Names lexicographically This only works for Names that originate in the source code or have been tidied.
localiseName :: Name -> Name #
Make the Name
into an internal name, regardless of what it was to begin with
tidyNameOcc :: Name -> OccName -> Name #
setNameLoc :: Name -> SrcSpan -> Name #
setNameUnique :: Name -> Unique -> Name #
mkFCallName :: Unique -> String -> Name #
Make a name for a foreign call
mkSysTvName :: Unique -> FastString -> Name #
mkSystemVarName :: Unique -> FastString -> Name #
mkSystemName :: Unique -> OccName -> Name #
Create a name brought into being by the compiler
mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name #
Create a name which is actually defined by the compiler itself
mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name #
Create a name which definitely originates in the given module
mkClonedInternalName :: Unique -> Name -> Name #
isSystemName :: Name -> Bool #
isDataConName :: Name -> Bool #
isTyConName :: Name -> Bool #
isTyVarName :: Name -> Bool #
nameIsFromExternalPackage :: UnitId -> Name -> Bool #
Returns True if the Name comes from some other package: neither this package nor the interactive package.
nameIsHomePackageImport :: Module -> Name -> Bool #
nameIsHomePackage :: Module -> Name -> Bool #
nameIsLocalOrFrom :: Module -> Name -> Bool #
Returns True if the name is
(a) Internal
(b) External but from the specified module
(c) External but from the interactive
package
The key idea is that False means: the entity is defined in some other module you can find the details (type, fixity, instances) in some interface file those details will be stored in the EPT or HPT
True means: the entity is defined in this module or earlier in the GHCi session you can find details (type, fixity, instances) in the TcGblEnv or TcLclEnv
The isInteractiveModule part is because successive interactions of a GHCi session
each give rise to a fresh module (Ghci1, Ghci2, etc), but they all come
from the magic interactive
package; and all the details are kept in the
TcLclEnv, TcGblEnv, NOT in the HPT or EPT.
See Note [The interactive package] in HscTypes
nameModule_maybe :: Name -> Maybe Module #
nameModule :: HasDebugCallStack => Name -> Module #
isHoleName :: Name -> Bool #
isInternalName :: Name -> Bool #
isExternalName :: Name -> Bool #
isBuiltInSyntax :: Name -> Bool #
isWiredInName :: Name -> Bool #
nameSrcSpan :: Name -> SrcSpan #
nameSrcLoc :: Name -> SrcLoc #
nameNameSpace :: Name -> NameSpace #
nameOccName :: Name -> OccName #
nameUnique :: Name -> Unique #
data BuiltInSyntax #
BuiltInSyntax is for things like (:)
, []
and tuples,
which have special syntactic forms. They aren't in scope
as such.
class NamedThing a where #
A class allowing convenient access to the Name
of various datatypes
Instances
NamedThing HoleFitCandidate | |
Defined in TcHoleFitTypes getOccName :: HoleFitCandidate -> OccName # getName :: HoleFitCandidate -> Name # | |
NamedThing ClsInst | |
NamedThing FamInst | |
Defined in FamInstEnv | |
NamedThing IfaceDecl | |
NamedThing IfaceClassOp | |
Defined in IfaceSyn getOccName :: IfaceClassOp -> OccName # getName :: IfaceClassOp -> Name # | |
NamedThing IfaceConDecl | |
Defined in IfaceSyn getOccName :: IfaceConDecl -> OccName # getName :: IfaceConDecl -> Name # | |
NamedThing Class | |
NamedThing ConLike | |
NamedThing DataCon | |
NamedThing PatSyn | |
NamedThing TyThing | |
NamedThing Var | |
NamedThing TyCon | |
NamedThing Name | |
NamedThing (HsTyVarBndr GhcRn) | |
Defined in GHC.Hs.Types getOccName :: HsTyVarBndr GhcRn -> OccName # getName :: HsTyVarBndr GhcRn -> Name # | |
NamedThing (CoAxiom br) | |
NamedThing e => NamedThing (Located e) | |
NamedThing tv => NamedThing (VarBndr tv flag) | |
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) #
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv #
initTidyOccEnv :: [OccName] -> TidyOccEnv #
mkMethodOcc :: OccName -> OccName #
Derive a name for the representation type constructor of a
data
/newtype
instance.
mkSuperDictAuxOcc :: Int -> OccName -> OccName #
mkDataConWorkerOcc :: OccName -> OccName #
mkRecFldSelOcc :: String -> OccName #
mkTyConRepOcc :: OccName -> OccName #
mkMaxTagOcc :: OccName -> OccName #
mkTag2ConOcc :: OccName -> OccName #
mkCon2TagOcc :: OccName -> OccName #
mkEqPredCoOcc :: OccName -> OccName #
mkInstTyCoOcc :: OccName -> OccName #
mkNewTyCoOcc :: OccName -> OccName #
mkClassDataConOcc :: OccName -> OccName #
mkRepEqOcc :: OccName -> OccName #
mkForeignExportOcc :: OccName -> OccName #
mkClassOpAuxOcc :: OccName -> OccName #
mkDefaultMethodOcc :: OccName -> OccName #
mkBuilderOcc :: OccName -> OccName #
mkMatcherOcc :: OccName -> OccName #
mkWorkerOcc :: OccName -> OccName #
mkDataConWrapperOcc :: OccName -> OccName #
isTypeableBindOcc :: OccName -> Bool #
Is an OccName
one of a Typeable TyCon
or Module
binding?
This is needed as these bindings are renamed differently.
See Note [Grand plan for Typeable] in TcTypeable.
isDefaultMethodOcc :: OccName -> Bool #
isDerivedOccName :: OccName -> Bool #
Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints
startsWithUnderscore :: OccName -> Bool #
Haskell 98 encourages compilers to suppress warnings about unsed
names in a pattern if they start with _
: this implements that test
parenSymOcc :: OccName -> SDoc -> SDoc #
Wrap parens around an operator
Test if the OccName
is that for any operator (whether
it is a data constructor or variable or whatever)
isDataSymOcc :: OccName -> Bool #
Test if the OccName
is a data constructor that starts with
a symbol (e.g. :
, or []
)
Value OccNames
s are those that are either in
the variable or data constructor namespaces
setOccNameSpace :: NameSpace -> OccName -> OccName #
occNameString :: OccName -> String #
intersectsOccSet :: OccSet -> OccSet -> Bool #
intersectOccSet :: OccSet -> OccSet -> OccSet #
isEmptyOccSet :: OccSet -> Bool #
elemOccSet :: OccName -> OccSet -> Bool #
minusOccSet :: OccSet -> OccSet -> OccSet #
unionManyOccSets :: [OccSet] -> OccSet #
unionOccSets :: OccSet -> OccSet -> OccSet #
extendOccSetList :: OccSet -> [OccName] -> OccSet #
extendOccSet :: OccSet -> OccName -> OccSet #
unitOccSet :: OccName -> OccSet #
emptyOccSet :: OccSet #
filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt #
delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a #
delFromOccEnv :: OccEnv a -> OccName -> OccEnv a #
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a #
extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b #
extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a #
plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a #
plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a #
occEnvElts :: OccEnv a -> [a] #
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b #
elemOccEnv :: OccName -> OccEnv a -> Bool #
lookupOccEnv :: OccEnv a -> OccName -> Maybe a #
extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a #
extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a #
unitOccEnv :: OccName -> a -> OccEnv a #
emptyOccEnv :: OccEnv a #
nameSpacesRelated :: NameSpace -> NameSpace -> Bool #
demoteOccName :: OccName -> Maybe OccName #
mkClsOccFS :: FastString -> OccName #
mkTcOccFS :: FastString -> OccName #
mkTyVarOccFS :: FastString -> OccName #
mkTyVarOcc :: String -> OccName #
mkDataOccFS :: FastString -> OccName #
mkVarOccFS :: FastString -> OccName #
mkOccNameFS :: NameSpace -> FastString -> OccName #
pprOccName :: OccName -> SDoc #
pprNameSpaceBrief :: NameSpace -> SDoc #
pprNonVarNameSpace :: NameSpace -> SDoc #
pprNameSpace :: NameSpace -> SDoc #
isValNameSpace :: NameSpace -> Bool #
isVarNameSpace :: NameSpace -> Bool #
isTvNameSpace :: NameSpace -> Bool #
isTcClsNameSpace :: NameSpace -> Bool #
isDataConNameSpace :: NameSpace -> Bool #
class HasOccName name where #
Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.
Instances
HasOccName HoleFitCandidate | |
Defined in TcHoleFitTypes occName :: HoleFitCandidate -> OccName # | |
HasOccName TcBinder | |
HasOccName IfaceDecl | |
HasOccName IfaceClassOp | |
Defined in IfaceSyn occName :: IfaceClassOp -> OccName # | |
HasOccName IfaceConDecl | |
Defined in IfaceSyn occName :: IfaceConDecl -> OccName # | |
HasOccName RdrName | |
HasOccName Var | |
HasOccName OccName | |
HasOccName Name | |
HasOccName name => HasOccName (IEWrappedName name) | |
Defined in GHC.Hs.ImpExp occName :: IEWrappedName name -> OccName # |
Instances
Data a => Data (OccEnv a) | |
Defined in OccName gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) # toConstr :: OccEnv a -> Constr # dataTypeOf :: OccEnv a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) # gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r # gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) # | |
Outputable a => Outputable (OccEnv a) | |
type TidyOccEnv = UniqFM Int #
mkFsEnv :: [(FastString, a)] -> FastStringEnv a #
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a #
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a #
emptyFsEnv :: FastStringEnv a #
type FastStringEnv a = UniqFM a #
A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in UniqDFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.
Occurrence Name
In this context that means: "classified (i.e. as a type name, value name, etc) but not qualified and not yet resolved"
Instances
Eq OccName | |
Data OccName | |
Defined in OccName gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName # toConstr :: OccName -> Constr # dataTypeOf :: OccName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName # | |
Ord OccName | |
NFData OccName | |
HasOccName OccName | |
Binary OccName | |
Uniquable OccName | |
Outputable OccName | |
OutputableBndr OccName | |
Defined in OccName pprBndr :: BindingSite -> OccName -> SDoc # pprPrefixOcc :: OccName -> SDoc # pprInfixOcc :: OccName -> SDoc # bndrIsJoin_maybe :: OccName -> Maybe Int # |
A unique, unambiguous name for something, containing information about where that thing originated.
Instances
Eq Name | |
Data Name | |
Defined in Name gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # | |
Ord Name | Caution: This instance is implemented via See |
NFData Name | |
NamedThing Name | |
HasOccName Name | |
Binary Name | Assumes that the |
Uniquable Name | |
HasSrcSpan Name | |
Defined in Name composeSrcSpan :: Located (SrcSpanLess Name) -> Name # decomposeSrcSpan :: Name -> Located (SrcSpanLess Name) # | |
Outputable Name | |
OutputableBndr Name | |
Defined in Name pprBndr :: BindingSite -> Name -> SDoc # pprPrefixOcc :: Name -> SDoc # pprInfixOcc :: Name -> SDoc # bndrIsJoin_maybe :: Name -> Maybe Int # | |
type SrcSpanLess Name | |
Defined in Name |
module Var
isNeverLevPolyId :: Id -> Bool #
zapStableUnfolding :: Id -> Id #
zapIdTailCallInfo :: Id -> Id #
zapIdUsedOnceInfo :: Id -> Id #
zapIdUsageEnvInfo :: Id -> Id #
zapIdUsageInfo :: Id -> Id #
zapIdDemandInfo :: Id -> Id #
zapFragileIdInfo :: Id -> Id #
zapLamIdInfo :: Id -> Id #
updOneShotInfo :: Id -> OneShotInfo -> Id #
setIdOneShotInfo :: Id -> OneShotInfo -> Id infixl 1 #
clearOneShotLambda :: Id -> Id #
setOneShotLambda :: Id -> Id #
isProbablyOneShotLambda :: Id -> Bool #
isStateHackType :: Type -> Bool #
typeOneShot :: Type -> OneShotInfo #
stateHackOneShot :: OneShotInfo #
Should we apply the state hack to values of this Type
?
isOneShotBndr :: Var -> Bool #
Returns whether the lambda associated with the Id
is certainly applied at most once
This one is the "business end", called externally.
It works on type variables as well as Ids, returning True
Its main purpose is to encapsulate the Horrible State Hack
See Note [The state-transformer hack] in CoreArity
idStateHackOneShotInfo :: Id -> OneShotInfo #
Like idOneShotInfo
, but taking the Horrible State Hack in to account
See Note [The state-transformer hack] in CoreArity
idOneShotInfo :: Id -> OneShotInfo #
isConLikeId :: Id -> Bool #
idRuleMatchInfo :: Id -> RuleMatchInfo #
setInlineActivation :: Id -> Activation -> Id infixl 1 #
idInlineActivation :: Id -> Activation #
modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id #
setInlinePragma :: Id -> InlinePragma -> Id infixl 1 #
idInlinePragma :: Id -> InlinePragma #
zapIdOccInfo :: Id -> Id #
setIdOccInfo :: Id -> OccInfo -> Id infixl 1 #
setIdCafInfo :: Id -> CafInfo -> Id #
setIdSpecialisation :: Id -> RuleInfo -> Id infixl 1 #
idHasRules :: Id -> Bool #
idCoreRules :: Id -> [CoreRule] #
idSpecialisation :: Id -> RuleInfo #
setCaseBndrEvald :: StrictnessMark -> Id -> Id #
setIdDemandInfo :: Id -> Demand -> Id infixl 1 #
idDemandInfo :: Id -> Demand #
setIdUnfolding :: Id -> Unfolding -> Id infixl 1 #
realIdUnfolding :: Id -> Unfolding #
idUnfolding :: Id -> Unfolding #
isStrictId :: Id -> Bool #
This predicate says whether the Id
has a strict demand placed on it or
has a type such that it can always be evaluated strictly (i.e an
unlifted type, as of GHC 7.6). We need to
check separately whether the Id
has a so-called "strict type" because if
the demand for the given id
hasn't been computed yet but id
has a strict
type, we still want isStrictId id
to be True
.
zapIdStrictness :: Id -> Id #
setIdStrictness :: Id -> StrictSig -> Id infixl 1 #
idStrictness :: Id -> StrictSig #
Accesses the Id'
s strictnessInfo
.
isBottomingId :: Var -> Bool #
Returns true if an application to n args would diverge
idFunRepArity :: Id -> RepArity #
setIdCallArity :: Id -> Arity -> Id infixl 1 #
idCallArity :: Id -> Arity #
setIdArity :: Id -> Arity -> Id infixl 1 #
idJoinArity :: JoinId -> JoinArity #
isDeadBinder :: Id -> Bool #
isImplicitId :: Id -> Bool #
isImplicitId
tells whether an Id
s info is implied by other
declarations, so we don't need to put its signature in an interface
file, even if it's mentioned in some other interface unfolding.
hasNoBinding :: Id -> Bool #
Returns True
of an Id
which may not have a
binding, even though it is defined in this module.
Get from either the worker or the wrapper Id
to the DataCon
. Currently used only in the desugarer.
INVARIANT: idDataCon (dataConWrapId d) = d
: remember, dataConWrapId
can return either the wrapper or the worker
isJoinId_maybe :: Var -> Maybe JoinArity #
isDataConId_maybe :: Id -> Maybe DataCon #
isDataConWrapId_maybe :: Id -> Maybe DataCon #
isDataConWrapId :: Id -> Bool #
isDataConWorkId_maybe :: Id -> Maybe DataCon #
isDataConWorkId :: Id -> Bool #
isFCallId_maybe :: Id -> Maybe ForeignCall #
isPrimOpId_maybe :: Id -> Maybe PrimOp #
isPrimOpId :: Id -> Bool #
isClassOpId_maybe :: Id -> Maybe Class #
isNaughtyRecordSelector :: Id -> Bool #
isPatSynRecordSelector :: Id -> Bool #
isDataConRecordSelector :: Id -> Bool #
isRecordSelector :: Id -> Bool #
recordSelectorTyCon :: Id -> RecSelParent #
mkTemplateLocalsNum :: Int -> [Type] -> [Id] #
Create a template local for a series of type, but start from a specified template local
mkTemplateLocals :: [Type] -> [Id] #
Create a template local for a series of types
mkTemplateLocal :: Int -> Type -> Id #
Create a template local: a family of system local Id
s in bijection with Int
s, typically used in unfoldings
mkWorkerId :: Unique -> Id -> Type -> Id #
Workers get local names. CoreTidy will externalise these if necessary
mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id #
Like mkUserLocal
, but checks if we have a coercion type
mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id #
mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id #
mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id #
Like mkSysLocal
, but checks to see if we have a covar type
mkSysLocal :: FastString -> Unique -> Type -> Id #
mkExportedVanillaId :: Name -> Type -> Id #
mkExportedLocalId :: IdDetails -> Name -> Type -> Id #
Create a local Id
that is marked as exported.
This prevents things attached to it from being removed as dead code.
See Note [Exported LocalIds]
mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id #
Make a local id, with the IdDetails set to CoVarId if the type indicates so.
mkLocalIdOrCoVar :: Name -> Type -> Id #
Like mkLocalId
, but checks the type to see if it should make a covar
mkLocalCoVar :: Name -> Type -> CoVar #
Make a local CoVar
modifyIdInfo :: HasDebugCallStack => (IdInfo -> IdInfo) -> Id -> Id #
localiseId :: Id -> Id #
setIdUnique :: Id -> Unique -> Id #
isExportedId :: Var -> Bool #
isExportedIdVar
means "don't throw this away"
isGlobalId :: Var -> Bool #
Is this a value-level (i.e., computationally relevant) Id
entifier?
Satisfies isId = not . isTyVar
.
globaliseId :: Id -> Id #
If it's a local, make it global
idInfo :: HasDebugCallStack => Id -> IdInfo #
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var | |
Data Var | |
Defined in Var gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var # dataTypeOf :: Var -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) # gmapT :: (forall b. Data b => b -> b) -> Var -> Var # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # | |
Ord Var | |
NamedThing Var | |
HasOccName Var | |
Uniquable Var | |
Outputable Var | |
Eq (DeBruijn CoreExpr) | |
Eq (DeBruijn CoreAlt) | |
module IdInfo
module CoreMonad
module CoreSyn
module Literal
module DataCon
module CoreUtils
module MkCore
module CoreFVs
substDVarSet :: Subst -> DVarSet -> DVarSet #
substRulesForImportedIds :: Subst -> [CoreRule] -> [CoreRule] #
substIdOcc :: Subst -> Id -> Id #
substIdType :: Subst -> Id -> Id #
getTCvSubst :: Subst -> TCvSubst #
cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) #
Clone a mutually recursive group of Id
s
cloneBndrs :: Subst -> UniqSupply -> [Var] -> (Subst, [Var]) #
cloneIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) #
Applies cloneIdBndr
to a number of Id
s, accumulating a final
substitution from left to right
cloneIdBndr :: Subst -> UniqSupply -> Id -> (Subst, Id) #
deShadowBinds :: CoreProgram -> CoreProgram #
De-shadowing the program is sometimes a useful pre-pass. It can be done simply by running over the bindings with an empty substitution, because substitution returns a result that has no-shadowing guaranteed.
(Actually, within a single type there might still be shadowing, because
substTy
is a no-op for the empty substitution, but that's probably OK.)
- Aug 09
- This function is not used in GHC at the moment, but seems so short and simple that I'm going to leave it here
substExprSC :: SDoc -> Subst -> CoreExpr -> CoreExpr #
Apply a substitution to an entire CoreExpr
. Remember, you may only
apply the substitution once:
See Note [Substitutions apply only once] in TyCoSubst
Do *not* attempt to short-cut in the case of an empty substitution! See Note [Extending the Subst]
setInScope :: Subst -> InScopeSet -> Subst #
extendInScopeIds :: Subst -> [Id] -> Subst #
Optimized version of extendInScopeList
that can be used if you are certain
all the things being added are Id
s and hence none are TyVar
s or CoVar
s
extendInScopeList :: Subst -> [Var] -> Subst #
Add the Var
s to the in-scope set: see also extendInScope
extendInScope :: Subst -> Var -> Subst #
Add the Var
to the in-scope set: as a side effect,
and remove any existing substitutions for it
addInScopeSet :: Subst -> VarSet -> Subst #
Add the Var
to the in-scope set, but do not remove
any existing substitutions for it
mkOpenSubst :: InScopeSet -> [(Var, CoreArg)] -> Subst #
Simultaneously substitute for a bunch of variables No left-right shadowing ie the substitution for (x y. e) a1 a2 so neither x nor y scope over a1 a2
extendSubstList :: Subst -> [(Var, CoreArg)] -> Subst #
Add a substitution as appropriate to each of the terms being
substituted (whether expressions, types, or coercions). See also
extendSubst
.
extendSubst :: Subst -> Var -> CoreArg -> Subst #
Add a substitution appropriate to the thing being substituted
(whether an expression, type, or coercion). See also
extendIdSubst
, extendTvSubst
, extendCvSubst
extendTvSubstList :: Subst -> [(TyVar, Type)] -> Subst #
Adds multiple TyVar
substitutions to the Subst
: see also extendTvSubst
extendIdSubstList :: Subst -> [(Id, CoreExpr)] -> Subst #
Adds multiple Id
substitutions to the Subst
: see also extendIdSubst
zapSubstEnv :: Subst -> Subst #
substInScope :: Subst -> InScopeSet #
Find the in-scope set: see TyCoSubst Note [The substitution invariant]
mkSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> IdSubstEnv -> Subst #
mkEmptySubst :: InScopeSet -> Subst #
emptySubst :: Subst #
isEmptySubst :: Subst -> Bool #
type IdSubstEnv = IdEnv CoreExpr #
An environment for substituting for Id
s
data InScopeSet #
A set of variables that are in scope at some point "Secrets of the Glasgow Haskell Compiler inliner" Section 3.2 provides the motivation for this abstraction.
Instances
Outputable InScopeSet | |
Defined in VarEnv ppr :: InScopeSet -> SDoc # pprPrec :: Rational -> InScopeSet -> SDoc # |
module Rules
module Annotations
module DynFlags
module Packages
module Module
:: Bool | Should specified binders count towards injective positions in the kind of the TyCon? (If you're using visible kind applications, then you want True here. |
-> TyCon | |
-> Int | The number of args the |
-> Bool | Does |
Does a TyCon
(that is applied to some number of arguments) need to be
ascribed with an explicit kind signature to resolve ambiguity if rendered as
a source-syntax type?
(See Note [When does a tycon application need an explicit kind signature?]
for a full explanation of what this function checks for.)
classifiesTypeWithValues :: Kind -> Bool #
Does this classify a type allowed to have values? Responds True to things like *, #, TYPE Lifted, TYPE v, Constraint.
True of any sub-kind of OpenTypeKind
isKindLevPoly :: Kind -> Bool #
Tests whether the given kind (which should look like TYPE x
)
is something other than a constructor tree (that is, constructors at every node).
E.g. True of TYPE k, TYPE (F Int)
False of TYPE 'LiftedRep
isConstraintKindCon :: TyCon -> Bool #
splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet #
splitVisVarsOfType :: Type -> Pair TyCoVarSet #
Retrieve the free variables in this type, splitting them based on whether they are used visibly or invisibly. Invisible ones come first.
synTyConResKind :: TyCon -> Kind #
tyConsOfType :: Type -> UniqSet TyCon #
All type constructors occurring in the type; looking through type synonyms, but not newtypes. When it finds a Class, it returns the class TyCon.
resultIsLevPoly :: Type -> Bool #
Looking past all pi-types, is the end result potentially levity polymorphic? Example: True for (forall r (a :: TYPE r). String -> a) Example: False for (forall r1 r2 (a :: TYPE r1) (b :: TYPE r2). a -> b -> Type)
isTypeLevPoly :: Type -> Bool #
Returns True if a type is levity polymorphic. Should be the same as (isKindLevPoly . typeKind) but much faster. Precondition: The type has kind (TYPE blah)
tcReturnsConstraintKind :: Kind -> Bool #
tcIsRuntimeTypeKind :: Kind -> Bool #
Is this kind equivalent to TYPE r
(for some unknown r)?
This considers Constraint
to be distinct from *
.
tcIsLiftedTypeKind :: Kind -> Bool #
Is this kind equivalent to *
?
This considers Constraint
to be distinct from *
. For a version that
treats them as the same type, see isLiftedTypeKind
.
tcIsConstraintKind :: Kind -> Bool #
tcTypeKind :: HasDebugCallStack => Type -> Kind #
typeKind :: HasDebugCallStack => Type -> Kind #
nonDetCmpTc :: TyCon -> TyCon -> Ordering #
nonDetCmpTypes :: [Type] -> [Type] -> Ordering #
nonDetCmpType :: Type -> Type -> Ordering #
eqTypes :: [Type] -> [Type] -> Bool #
Type equality on lists of types, looking through type synonyms but not newtypes.
eqTypeX :: RnEnv2 -> Type -> Type -> Bool #
Compare types with respect to a (presumably) non-empty RnEnv2
.
isValidJoinPointType :: JoinArity -> Type -> Bool #
Determine whether a type could be the type of a join point of given total
arity, according to the polymorphism rule. A join point cannot be polymorphic
in its return type, since given
join j a
b x y z = e1 in e2,
the types of e1 and e2 must be the same, and a and b are not in scope for e2.
(See Note [The polymorphism rule of join points] in CoreSyn.) Returns False
also if the type simply doesn't have enough arguments.
Note that we need to know how many arguments (type *and* value) the putative join point takes; for instance, if j :: forall a. a -> Int then j could be a binary join point returning an Int, but it could *not* be a unary join point returning a -> Int.
TODO: See Note [Excess polymorphism and join points]
isPrimitiveType :: Type -> Bool #
Returns true of types that are opaque to Haskell.
isStrictType :: HasDebugCallStack => Type -> Bool #
Computes whether an argument (or let right hand side) should
be computed strictly or lazily, based only on its type.
Currently, it's just isUnliftedType
. Panics on levity-polymorphic types.
isDataFamilyAppType :: Type -> Bool #
Check whether a type is a data family type
See Type for what an algebraic type is. Should only be applied to types, as opposed to e.g. partially saturated type constructors
isUnboxedSumType :: Type -> Bool #
isUnboxedTupleType :: Type -> Bool #
getRuntimeRep :: HasDebugCallStack => Type -> Type #
Extract the RuntimeRep classifier of a type. For instance,
getRuntimeRep_maybe Int = LiftedRep
. Panics if this is not possible.
getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type #
Extract the RuntimeRep classifier of a type. For instance,
getRuntimeRep_maybe Int = LiftedRep
. Returns Nothing
if this is not
possible.
dropRuntimeRepArgs :: [Type] -> [Type] #
Drops prefix of RuntimeRep constructors in TyConApp
s. Useful for e.g.
dropping 'LiftedRep arguments of unboxed tuple TyCon applications:
isRuntimeRepKindedTy :: Type -> Bool #
Is this a type of kind RuntimeRep? (e.g. LiftedRep)
mightBeUnliftedType :: Type -> Bool #
isUnliftedType :: HasDebugCallStack => Type -> Bool #
See Type for what an unlifted type is.
Panics on levity polymorphic types; See mightBeUnliftedType
for
a more approximate predicate that behaves better in the presence of
levity polymorphism.
isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool #
Returns Just True if this type is surely lifted, Just False if it is surely unlifted, Nothing if we can't be sure (i.e., it is levity polymorphic), and panics if the kind does not have the shape TYPE r.
isCoVarType :: Type -> Bool #
isFamFreeTy :: Type -> Bool #
coAxNthLHS :: forall (br :: BranchFlag). CoAxiom br -> Int -> Type #
Get the type on the LHS of a coercion induced by a type/data family instance.
mkFamilyTyConApp :: TyCon -> [Type] -> Type #
Given a family instance TyCon and its arg types, return the corresponding family type. E.g:
data family T a data instance T (Maybe b) = MkT b
Where the instance tycon is :RTL, so:
mkFamilyTyConApp :RTL Int = T (Maybe Int)
closeOverKindsDSet :: DTyVarSet -> DTyVarSet #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a deterministic set.
closeOverKindsList :: [TyVar] -> [TyVar] #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a deterministically ordered list.
closeOverKindsFV :: [TyVar] -> FV #
Given a list of tyvars returns a deterministic FV computation that returns the given tyvars with the kind variables free in the kinds of the given tyvars.
closeOverKinds :: TyVarSet -> TyVarSet #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a non-deterministic set.
binderRelevantType_maybe :: TyCoBinder -> Maybe Type #
Extract a relevant type, if there is one.
tyBinderType :: TyBinder -> Type #
tyCoBinderType :: TyCoBinder -> Type #
isAnonTyCoBinder :: TyCoBinder -> Bool #
Does this binder bind a variable that is not erased? Returns
True
for anonymous binders.
mkAnonBinder :: AnonArgFlag -> Type -> TyCoBinder #
Make an anonymous binder
appTyArgFlags :: Type -> [Type] -> [ArgFlag] #
Given a Type
and a list of argument types to which the Type
is
applied, determine each argument's visibility
(Inferred
, Specified
, or Required
).
Most of the time, the arguments will be Required
, but not always. Consider
f :: forall a. a -> Type
. In f Type Bool
, the first argument (Type
) is
Specified
and the second argument (Bool
) is Required
. It is precisely
this sort of higher-rank situation in which appTyArgFlags
comes in handy,
since f Type Bool
would be represented in Core using AppTy
s.
(See also #15792).
tyConArgFlags :: TyCon -> [Type] -> [ArgFlag] #
Given a TyCon
and a list of argument types to which the TyCon
is
applied, determine each argument's visibility
(Inferred
, Specified
, or Required
).
Wrinkle: consider the following scenario:
T :: forall k. k -> k tyConArgFlags T [forall m. m -> m -> m, S, R, Q]
After substituting, we get
T (forall m. m -> m -> m) :: (forall m. m -> m -> m) -> forall n. n -> n -> n
Thus, the first argument is invisible, S
is visible, R
is invisible again,
and Q
is visible.
partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a]) #
Given a list of things paired with their visibilities, partition the things into (invisible things, visible things).
filterOutInferredTypes :: TyCon -> [Type] -> [Type] #
filterOutInvisibleTypes :: TyCon -> [Type] -> [Type] #
splitPiTysInvisibleN :: Int -> Type -> ([TyCoBinder], Type) #
splitPiTysInvisible :: Type -> ([TyCoBinder], Type) #
invisibleTyBndrCount :: Type -> Int #
splitForAllVarBndrs :: Type -> ([TyCoVarBinder], Type) #
Like splitPiTys
but split off only named binders
and returns TyCoVarBinders rather than TyCoBinders
splitPiTys :: Type -> ([TyCoBinder], Type) #
Split off all TyCoBinders to a type, splitting both proper foralls and functions
splitPiTy :: Type -> (TyCoBinder, Type) #
Takes a forall type apart, or panics
splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type) #
Attempts to take a forall type apart; works with proper foralls and functions
splitForAllTy_co_maybe :: Type -> Maybe (TyCoVar, Type) #
Like splitForAllTy_maybe, but only returns Just if it is a covar binder.
splitForAllTy_ty_maybe :: Type -> Maybe (TyCoVar, Type) #
Like splitForAllTy_maybe, but only returns Just if it is a tyvar binder.
splitForAllTy_maybe :: Type -> Maybe (TyCoVar, Type) #
Attempts to take a forall type apart, but only if it's a proper forall, with a named binder
dropForAlls :: Type -> Type #
Drops all ForAllTys
splitForAllTy :: Type -> (TyCoVar, Type) #
Take a forall type apart, or panics if that is not possible.
isForAllTy_co :: Type -> Bool #
Like isForAllTy
, but returns True only if it is a covar binder
isForAllTy_ty :: Type -> Bool #
Like isForAllTy
, but returns True only if it is a tyvar binder
isForAllTy :: Type -> Bool #
Checks whether this is a proper forall (with a named binder)
splitForAllTysSameVis :: ArgFlag -> Type -> ([TyCoVar], Type) #
Like splitForAllTys
, but only splits a ForAllTy
if
is sameVis
argf supplied_argfTrue
, where argf
is the visibility
of the ForAllTy
's binder and supplied_argf
is the visibility provided
as an argument to this function.
splitForAllTys :: Type -> ([TyCoVar], Type) #
Take a ForAllTy apart, returning the list of tycovars and the result type. This always succeeds, even if it returns only an empty list. Note that the result type returned may have free variables that were bound by a forall.
:: [TyVar] | binders |
-> TyCoVarSet | free variables of result |
-> [TyConBinder] |
Given a list of type-level vars and the free vars of a result kind, makes TyCoBinders, preferring anonymous binders if the variable is, in fact, not dependent. e.g. mkTyConBindersPreferAnon (k:*),(b:k),(c:k) We want (k:*) Named, (b:k) Anon, (c:k) Anon
All non-coercion binders are visible.
mkLamType :: Var -> Type -> Type #
Makes a (->)
type or an implicit forall type, depending
on whether it is given a type variable or a term variable.
This is used, for example, when producing the type of a lambda.
Always uses Inferred binders.
mkVisForAllTys :: [TyVar] -> Type -> Type #
Like mkForAllTys, but assumes all variables are dependent and visible
mkSpecForAllTys :: [TyVar] -> Type -> Type #
Like mkForAllTys
, but assumes all variables are dependent and
Specified
, a common case
mkSpecForAllTy :: TyVar -> Type -> Type #
Like mkForAllTy
, but assumes the variable is dependent and Specified
,
a common case
mkInvForAllTys :: [TyVar] -> Type -> Type #
Like mkTyCoInvForAllTys
, but tvs should be a list of tyvar
mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type #
Like mkForAllTys
, but assumes all variables are dependent and
Inferred
, a common case
mkInvForAllTy :: TyVar -> Type -> Type #
Like mkTyCoInvForAllTy
, but tv should be a tyvar
stripCoercionTy :: Type -> Coercion #
isCoercionTy_maybe :: Type -> Maybe Coercion #
mkCoercionTy :: Coercion -> Type #
discardCast :: Type -> Type #
Drop the cast on a type, if any. If there is no cast, just return the original type. This is rarely what you want. The CastTy data constructor (in TyCoRep) has the invariant that another CastTy is not inside. See the data constructor for a full description of this invariant. Since CastTy cannot be nested, the result of discardCast cannot be a CastTy.
tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder] #
newTyConInstRhs :: TyCon -> [Type] -> Type #
Unwrap one layer
of newtype on a type constructor and its
arguments, using an eta-reduced version of the newtype
if possible.
This requires tys to have at least newTyConInstArity tycon
elements.
splitListTyConApp_maybe :: Type -> Maybe Type #
Attempts to tease a list type apart and gives the type of the elements if successful (looks through type synonyms)
repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) #
Like splitTyConApp_maybe
, but doesn't look through synonyms. This
assumes the synonyms have already been dealt with.
Moreover, for a FunTy, it only succeeds if the argument types have enough info to extract the runtime-rep arguments that the funTyCon requires. This will usually be true; but may be temporarily false during canonicalization: see Note [FunTy and decomposing tycon applications] in TcCanonical
tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type]) #
Split a type constructor application into its type constructor and
applied types. Note that this may fail in the case of a FunTy
with an
argument of unknown kind FunTy
(e.g. FunTy (a :: k) Int
. since the kind
of a
isn't of the form TYPE rep
). Consequently, you may need to zonk your
type before using this function.
If you only need the TyCon
, consider using tcTyConAppTyCon_maybe
.
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
tyConAppArgN :: Int -> Type -> Type #
tyConAppArgs :: Type -> [Type] #
tyConAppArgs_maybe :: Type -> Maybe [Type] #
The same as snd . splitTyConApp
tyConAppTyCon :: Type -> TyCon #
tyConAppTyCon_maybe :: Type -> Maybe TyCon #
The same as fst . splitTyConApp
tyConAppTyConPicky_maybe :: Type -> Maybe TyCon #
Retrieve the tycon heading this type, if there is one. Does not look through synonyms.
mkTyConApp :: TyCon -> [Type] -> Type #
piResultTys :: HasDebugCallStack => Type -> [Type] -> Type #
(piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn)
where f :: f_ty
piResultTys
is interesting because:
1. f_ty
may have more for-alls than there are args
2. Less obviously, it may have fewer for-alls
For case 2. think of:
piResultTys (forall a.a) [forall b.b, Int]
This really can happen, but only (I think) in situations involving
undefined. For example:
undefined :: forall a. a
Term: undefined (forall b. b->b)
Int
This term should have type (Int -> Int), but notice that
there are more type args than foralls in undefined
s type.
Just like piResultTys
but for a single argument
Try not to iterate piResultTy
, because it's inefficient to substitute
one variable at a time; instead use 'piResultTys"
Extract the function argument type and panic if that is not possible
funResultTy :: Type -> Type #
Extract the function result type and panic if that is not possible
splitFunTys :: Type -> ([Type], Type) #
splitFunTy_maybe :: Type -> Maybe (Type, Type) #
Attempts to extract the argument and result types from a type
splitFunTy :: Type -> (Type, Type) #
Attempts to extract the argument and result types from a type, and
panics if that is not possible. See also splitFunTy_maybe
pprUserTypeErrorTy :: Type -> SDoc #
Render a type corresponding to a user type error into a SDoc.
userTypeError_maybe :: Type -> Maybe Type #
Is this type a custom user error? If so, give us the kind and the error message.
isStrLitTy :: Type -> Maybe FastString #
Is this a symbol literal. We also look through type synonyms.
mkStrLitTy :: FastString -> Type #
isNumLitTy :: Type -> Maybe Integer #
Is this a numeric literal. We also look through type synonyms.
mkNumLitTy :: Integer -> Type #
repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type]) #
Like splitAppTys
, but doesn't look through type synonyms
splitAppTys :: Type -> (Type, [Type]) #
Recursively splits a type as far as is possible, leaving a residual type being applied to and the type arguments applied to it. Never fails, even if that means returning an empty list of type applications.
splitAppTy :: Type -> (Type, Type) #
Attempts to take a type application apart, as in splitAppTy_maybe
,
and panics if this is not possible
tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type) #
Does the AppTy split as in tcSplitAppTy_maybe
, but assumes that
any coreView stuff is already done. Refuses to look through (c => t)
repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type) #
Does the AppTy split as in splitAppTy_maybe
, but assumes that
any Core view stuff is already done
splitAppTy_maybe :: Type -> Maybe (Type, Type) #
Attempt to take a type application apart, whether it is a function, type constructor, or plain type application. Note that type family applications are NEVER unsaturated by this!
repGetTyVar_maybe :: Type -> Maybe TyVar #
Attempts to obtain the type variable underlying a Type
, without
any expansion
getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN) #
If the type is a tyvar, possibly under a cast, returns it, along with the coercion. Thus, the co is :: kind tv ~N kind ty
getTyVar :: String -> Type -> TyVar #
Attempts to obtain the type variable underlying a Type
, and panics with the
given message if this is not a type variable type. See also getTyVar_maybe
mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion #
isRuntimeRepVar :: TyVar -> Bool #
Is a tyvar of type RuntimeRep
?
isUnliftedRuntimeRep :: Type -> Bool #
isUnliftedTypeKind :: Kind -> Bool #
Returns True if the kind classifies unlifted types and False otherwise. Note that this returns False for levity-polymorphic kinds, which may be specialized to a kind that classifies unlifted types.
isLiftedRuntimeRep :: Type -> Bool #
kindRep_maybe :: HasDebugCallStack => Kind -> Maybe Type #
Given a kind (TYPE rr), extract its RuntimeRep classifier rr.
For example, kindRep_maybe * = Just LiftedRep
Returns Nothing
if the kind is not of form (TYPE rr)
Treats * and Constraint as the same
kindRep :: HasDebugCallStack => Kind -> Type #
Extract the RuntimeRep classifier of a type from its kind. For example,
kindRep * = LiftedRep
; Panics if this is not possible.
Treats * and Constraint as the same
expandTypeSynonyms :: Type -> Type #
Expand out all type synonyms. Actually, it'd suffice to expand out just the ones that discard type variables (e.g. type Funny a = Int) But we don't know which those are currently, so we just expand all.
expandTypeSynonyms
only expands out type synonyms mentioned in the type,
not in the kinds of any TyCon or TyVar mentioned in the type.
Keep this synchronized with synonymTyConsOfType
data TyCoMapper env (m :: Type -> Type) #
This describes how a "map" operation over a type/coercion should behave
TyCoMapper | |
|
cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar]) #
substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar]) #
substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar) #
substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar]) #
substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar) #
substCoUnchecked :: TCvSubst -> Coercion -> Coercion #
Substitute within a Coercion
disabling sanity checks.
The problems that the sanity checks in substCo catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substCoUnchecked to
substCo and remove this function. Please don't use in new code.
substTyVars :: TCvSubst -> [TyVar] -> [Type] #
substTyVar :: TCvSubst -> TyVar -> Type #
substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType #
Substitute within a ThetaType
disabling the sanity checks.
The problems that the sanity checks in substTys catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substThetaUnchecked to
substTheta and remove this function. Please don't use in new code.
substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType #
Substitute within a ThetaType
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substTysUnchecked :: TCvSubst -> [Type] -> [Type] #
Substitute within several Type
s disabling the sanity checks.
The problems that the sanity checks in substTys catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substTysUnchecked to
substTys and remove this function. Please don't use in new code.
substTys :: HasCallStack => TCvSubst -> [Type] -> [Type] #
Substitute within several Type
s
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substTyUnchecked :: TCvSubst -> Type -> Type #
Substitute within a Type
disabling the sanity checks.
The problems that the sanity checks in substTy catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substTyUnchecked to
substTy and remove this function. Please don't use in new code.
substTyAddInScope :: TCvSubst -> Type -> Type #
Substitute within a Type
after adding the free variables of the type
to the in-scope set. This is useful for the case when the free variables
aren't already in the in-scope set or easily available.
See also Note [The substitution invariant].
substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type] #
Type substitution, see zipTvSubst
substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion #
Coercion substitution, see zipTvSubst
. Disables sanity checks.
The problems that the sanity checks in substCo catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substCoUnchecked to
substCo and remove this function. Please don't use in new code.
substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type #
Type substitution, see zipTvSubst
. Disables sanity checks.
The problems that the sanity checks in substTy catch are described in
Note [The substitution invariant].
The goal of #11371 is to migrate all the calls of substTyUnchecked to
substTy and remove this function. Please don't use in new code.
substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type #
Type substitution, see zipTvSubst
zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv #
zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv #
mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst #
Generates the in-scope set for the TCvSubst
from the types in the
incoming environment. No CoVars, please!
zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst #
zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst #
Generates the in-scope set for the TCvSubst
from the types in the incoming
environment. No CoVars, please!
unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst #
extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst #
extendTCvInScopeSet :: TCvSubst -> VarSet -> TCvSubst #
extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst #
extendTCvInScope :: TCvSubst -> Var -> TCvSubst #
zapTCvSubst :: TCvSubst -> TCvSubst #
setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst #
notElemTCvSubst :: Var -> TCvSubst -> Bool #
getTCvSubstRangeFVs :: TCvSubst -> VarSet #
Returns the free variables of the types in the range of a substitution as a non-deterministic set.
getTCvInScope :: TCvSubst -> InScopeSet #
getTvSubstEnv :: TCvSubst -> TvSubstEnv #
mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst #
isEmptyTCvSubst :: TCvSubst -> Bool #
mkEmptyTCvSubst :: InScopeSet -> TCvSubst #
composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst #
Composes two substitutions, applying the second one provided first, like in function composition.
composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) #
(compose env1 env2)(x)
is env1(env2(x))
; i.e. apply env2
then env1
.
It assumes that both are idempotent.
Typically, env1
is the refinement to a base substitution env2
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.
tidyTopType :: Type -> Type #
Calls tidyType
on a top-level type (i.e. with an empty tidying environment)
tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type]) #
Grabs the free type variables, tidies them
and then uses tidyType
to work over the type itself
tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar #
tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) #
Treat a new TyCoVar
as a binder, and give it a fresh tidy name
using the environment if one has not already been allocated. See
also tidyVarBndr
tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv #
Add the free TyVar
s to the env in tidy form,
so that we can tidy the type they are free in
tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) #
This tidies up a type for printing in an error message, or in an interface file.
It doesn't change the uniques at all, just the print names.
tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar] #
Get the free vars of types in scoped order
tyCoVarsOfTypeWellScoped :: Type -> [TyVar] #
Get the free vars of a type in scoped order
scopedSort :: [TyCoVar] -> [TyCoVar] #
Do a topological sort on a list of tyvars, so that binders occur before occurrences E.g. given [ a::k, k::*, b::k ] it'll return a well-scoped list [ k::*, a::k, b::k ]
This is a deterministic sorting operation (that is, doesn't depend on Uniques).
It is also meant to be stable: that is, variables should not be reordered unnecessarily. This is specified in Note [ScopedSort] See also Note [Ordering of implicit variables] in RnTypes
noFreeVarsOfType :: Type -> Bool #
Returns True if this type has no free variables. Should be the same as isEmptyVarSet . tyCoVarsOfType, but faster in the non-forall case.
coVarsOfTypes :: [Type] -> TyCoVarSet #
coVarsOfType :: Type -> CoVarSet #
tyCoFVsVarBndr :: Var -> FV -> FV #
tyCoFVsVarBndrs :: [Var] -> FV -> FV #
tyCoFVsBndr :: TyCoVarBinder -> FV -> FV #
tyCoFVsOfType :: Type -> FV #
The worker for tyCoFVsOfType
and tyCoFVsOfTypeList
.
The previous implementation used unionVarSet
which is O(n+m) and can
make the function quadratic.
It's exported, so that it can be composed with
other functions that compute free variables.
See Note [FV naming conventions] in FV.
Eta-expanded because that makes it run faster (apparently) See Note [FV eta expansion] in FV for explanation.
tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet #
tyCoFVsOfType
that returns free variables of a type in a deterministic
set. For explanation of why using VarSet
is not deterministic see
Note [Deterministic FV] in FV.
tyCoVarsOfTypes :: [Type] -> TyCoVarSet #
tyCoVarsOfType :: Type -> TyCoVarSet #
The (->)
type constructor.
(->) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep). TYPE rep1 -> TYPE rep2 -> *
Create the plain type constructor type which has been applied to no type arguments at all.
mkPiTys :: [TyCoBinder] -> Type -> Type #
mkPiTy :: TyCoBinder -> Type -> Type #
mkForAllTys :: [TyCoVarBinder] -> Type -> Type #
Wraps foralls over the type using the provided TyCoVar
s from left to right
mkInvisFunTys :: [Type] -> Type -> Type #
Make nested arrow types
mkVisFunTys :: [Type] -> Type -> Type #
Make nested arrow types
mkInvisFunTy :: Type -> Type -> Type infixr 3 #
mkVisFunTy :: Type -> Type -> Type infixr 3 #
mkTyVarTys :: [TyVar] -> [Type] #
isNamedBinder :: TyCoBinder -> Bool #
isVisibleBinder :: TyCoBinder -> Bool #
Does this binder bind a visible argument?
isInvisibleBinder :: TyCoBinder -> Bool #
Does this binder bind an invisible argument?
type KindOrType = Type #
The key representation of types within the compiler
A type labeled KnotTied
might have knot-tied tycons in it. See
Note [Type checking recursive type and class declarations] in
TcTyClsDecls
Is this a type-level (i.e., computationally irrelevant, thus erasable)
variable? Satisfies isTyVar = not . isId
.
mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder] #
Make many named binders Input vars should be type variables
mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder] #
Make many named binders
mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder #
Make a named binder
binderType :: VarBndr TyCoVar argf -> Type #
binderArgFlag :: VarBndr tv argf -> argf #
binderVars :: [VarBndr tv argf] -> [tv] #
isInvisibleArgFlag :: ArgFlag -> Bool #
Does this ArgFlag
classify an argument that is not written in Haskell?
isVisibleArgFlag :: ArgFlag -> Bool #
Does this ArgFlag
classify an argument that is written in Haskell?
data ForallVisFlag #
Is a forall
invisible (e.g., forall a b. {...}
, with a dot) or visible
(e.g., forall a b -> {...}
, with an arrow)?
ForallVis | A visible |
ForallInvis | An invisible |
Instances
type TyCoVarBinder = VarBndr TyCoVar ArgFlag #
Variable Binder
A TyCoVarBinder
is the binder of a ForAllTy
It's convenient to define this synonym here rather its natural
home in TyCoRep, because it's used in DataCon.hs-boot
A TyVarBinder
is a binder with only TyVar
type TyVarBinder = VarBndr TyVar ArgFlag #
liftedTypeKind :: Kind #
isPredTy :: HasDebugCallStack => Type -> Bool #
isCoercionTy :: Type -> Bool #
mkCastTy :: Type -> Coercion -> Type #
Make a CastTy
. The Coercion must be nominal. Checks the
Coercion for reflexivity, dropping it if it's reflexive.
See Note [Respecting definitional equality] in TyCoRep
piResultTy :: HasDebugCallStack => Type -> Type -> Type #
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 TyCoRep.
coreView :: Type -> Maybe Type #
This function Strips off the top layer only of a type synonym
application (if any) its underlying representation type.
Returns Nothing if there is nothing to look through.
This function considers Constraint
to be a synonym of TYPE LiftedRep
.
By being non-recursive and inlined, this case analysis gets efficiently joined onto the case analysis that the caller is already doing
tcView :: Type -> Maybe Type #
Gives the typechecker view of a type. This unwraps synonyms but
leaves Constraint
alone. c.f. coreView, which turns Constraint into
TYPE LiftedRep. Returns Nothing if no unwrapping happens.
See also Note [coreView vs tcView]
isRuntimeRepTy :: Type -> Bool #
Is this the type RuntimeRep
?
isLiftedTypeKind :: Kind -> Bool #
This version considers Constraint to be the same as *. Returns True if the argument is equivalent to Type/Constraint and False otherwise. See Note [Kind Constraint and kind Type]
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
mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type #
Like mkTyCoForAllTy
, but does not check the occurrence of the binder
See Note [Unused coercion variable in ForAllTy]
Instances
Data Type | |
Defined in TyCoRep 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 | |
Eq (DeBruijn Type) | |
data TyCoBinder #
A TyCoBinder
represents an argument to a function. TyCoBinders can be
dependent (Named
) or nondependent (Anon
). They may also be visible or
not. See Note [TyCoBinders]
Instances
Data TyCoBinder | |
Defined in TyCoRep gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyCoBinder -> c TyCoBinder # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyCoBinder # toConstr :: TyCoBinder -> Constr # dataTypeOf :: TyCoBinder -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyCoBinder) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyCoBinder) # gmapT :: (forall b. Data b => b -> b) -> TyCoBinder -> TyCoBinder # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyCoBinder -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyCoBinder -> r # gmapQ :: (forall d. Data d => d -> u) -> TyCoBinder -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyCoBinder -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyCoBinder -> m TyCoBinder # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCoBinder -> m TyCoBinder # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyCoBinder -> m TyCoBinder # | |
Outputable TyCoBinder | |
Defined in TyCoRep ppr :: TyCoBinder -> SDoc # pprPrec :: Rational -> TyCoBinder -> SDoc # |
A type of the form p
of constraint kind represents a value whose type is
the Haskell predicate p
, where a predicate is what occurs before
the =>
in a Haskell type.
We use PredType
as documentation to mark those types that we guarantee to
have this kind.
It can be expanded into its representation, but:
- The type checker must treat it as opaque
- The rest of the compiler treats it as transparent
Consider these examples:
f :: (Eq a) => a -> Int g :: (?x :: Int -> Int) => a -> Int h :: (r\l) => {r} => {l::Int | r}
Here the Eq a
and ?x :: Int -> Int
and rl
are all called "predicates"
Argument Flag
Is something required to appear in source Haskell (Required
),
permitted by request (Specified
) (visible type application), or
prohibited entirely from appearing in source Haskell (Inferred
)?
See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep
Instances
Eq ArgFlag | |
Data ArgFlag | |
Defined in Var gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArgFlag -> c ArgFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArgFlag # toConstr :: ArgFlag -> Constr # dataTypeOf :: ArgFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArgFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag) # gmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> ArgFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # | |
Ord ArgFlag | |
Binary ArgFlag | |
Outputable ArgFlag | |
Outputable tv => Outputable (VarBndr tv ArgFlag) | |
data AnonArgFlag #
The non-dependent version of ArgFlag
.
VisArg | Used for |
InvisArg | Used for |
Instances
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var | |
Data Var | |
Defined in Var gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var # dataTypeOf :: Var -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) # gmapT :: (forall b. Data b => b -> b) -> Var -> Var # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # | |
Ord Var | |
NamedThing Var | |
HasOccName Var | |
Uniquable Var | |
Outputable Var | |
Eq (DeBruijn CoreExpr) | |
Eq (DeBruijn CoreAlt) | |
module TyCon
simplifyArgsWorker :: [TyCoBinder] -> Kind -> TyCoVarSet -> [Role] -> [(Type, Coercion)] -> ([Type], [Coercion], CoercionN) #
buildCoercion :: Type -> Type -> CoercionN #
Assuming that two types are the same, ignoring coercions, find a nominal coercion between the types. This is useful when optimizing transitivity over coercion applications, where splitting two AppCos might yield different kinds. See Note [EtaAppCo] in OptCoercion.
mkReprPrimEqPred :: Type -> Type -> Type #
mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #
Creates a primitive representational type equality predicate with explicit kinds
mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #
Creates a primite type equality predicate with explicit kinds
mkPrimEqPredRole :: Role -> Type -> Type -> PredType #
Makes a lifted equality predicate at the given role
mkPrimEqPred :: Type -> Type -> Type #
Creates a primitive type equality predicate. Invariant: the types are not Coercions
coercionRole :: Coercion -> Role #
Retrieve the role from a coercion.
coercionKinds :: [Coercion] -> Pair [Type] #
Apply coercionKind
to multiple Coercion
s
lcInScopeSet :: LiftingContext -> InScopeSet #
Get the InScopeSet
from a LiftingContext
lcTCvSubst :: LiftingContext -> TCvSubst #
Extract the underlying substitution from the LiftingContext
liftEnvSubstRight :: TCvSubst -> LiftCoEnv -> TCvSubst #
liftEnvSubstLeft :: TCvSubst -> LiftCoEnv -> TCvSubst #
lcSubstRight :: LiftingContext -> TCvSubst #
lcSubstLeft :: LiftingContext -> TCvSubst #
swapLiftCoEnv :: LiftCoEnv -> LiftCoEnv #
Apply "sym" to all coercions in a LiftCoEnv
substRightCo :: LiftingContext -> Coercion -> Coercion #
substLeftCo :: LiftingContext -> Coercion -> Coercion #
isMappedByLC :: TyCoVar -> LiftingContext -> Bool #
Is a var in the domain of a lifting context?
liftCoSubstVarBndrUsing :: (LiftingContext -> Type -> (CoercionN, a)) -> LiftingContext -> TyCoVar -> (LiftingContext, TyCoVar, CoercionN, a) #
liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion #
substForAllCoBndrUsingLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyCoVar -> Coercion -> (LiftingContext, TyCoVar, Coercion) #
Like substForAllCoBndr
, but works on a lifting context
zapLiftingContext :: LiftingContext -> LiftingContext #
Erase the environments in a lifting context
extendLiftingContextAndInScope #
:: LiftingContext | Original LC |
-> TyCoVar | new variable to map... |
-> Coercion | to this coercion |
-> LiftingContext |
Extend a lifting context with a new mapping, and extend the in-scope set
:: LiftingContext | original LC |
-> TyCoVar | new variable to map... |
-> Coercion | ...to this lifted version |
-> LiftingContext |
Extend a lifting context with a new mapping.
liftCoSubstWithEx :: Role -> [TyVar] -> [Coercion] -> [TyCoVar] -> [Type] -> (Type -> Coercion, [Type]) #
eqCoercionX :: RnEnv2 -> Coercion -> Coercion -> Bool #
Compare two Coercion
s, with respect to an RnEnv2
eqCoercion :: Coercion -> Coercion -> Bool #
Syntactic equality of coercions
topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type) #
Sometimes we want to look through a newtype
and get its associated coercion.
This function strips off newtype
layers enough to reveal something that isn't
a newtype
. Specifically, here's the invariant:
topNormaliseNewType_maybe rec_nts ty = Just (co, ty')
then (a) co : ty0 ~ ty'
.
(b) ty' is not a newtype.
The function returns Nothing
for non-newtypes
,
or unsaturated applications
This function does *not* look through type families, because it has no access to the type family environment. If you do have that at hand, consider to use topNormaliseType_maybe, which should be a drop-in replacement for topNormaliseNewType_maybe If topNormliseNewType_maybe ty = Just (co, ty'), then co : ty ~R ty'
topNormaliseTypeX :: NormaliseStepper ev -> (ev -> ev -> ev) -> Type -> Maybe (ev, Type) #
A general function for normalising the top-level of a type. It continues
to use the provided NormaliseStepper
until that function fails, and then
this function returns. The roles of the coercions produced by the
NormaliseStepper
must all be the same, which is the role returned from
the call to topNormaliseTypeX
.
Typically ev is Coercion.
If topNormaliseTypeX step plus ty = Just (ev, ty')
then ty ~ev1~ t1 ~ev2~ t2 ... ~evn~ ty'
and ev = ev1 plus
ev2 plus
... plus
evn
If it returns Nothing then no newtype unwrapping could happen
unwrapNewTypeStepper :: NormaliseStepper Coercion #
A NormaliseStepper
that unwraps newtypes, careful not to fall into
a loop. If it would fall into a loop, it produces NS_Abort
.
composeSteppers :: NormaliseStepper ev -> NormaliseStepper ev -> NormaliseStepper ev #
Try one stepper and then try the next, if the first doesn't make progress. So if it returns NS_Done, it means that both steppers are satisfied
mapStepResult :: (ev1 -> ev2) -> NormaliseStepResult ev1 -> NormaliseStepResult ev2 #
instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion) #
If co :: T ts ~ rep_ty
then:
instNewTyCon_maybe T ts = Just (rep_ty, co)
Checks for a newtype, and for being saturated
mkPiCo :: Role -> Var -> Coercion -> Coercion #
Make a forall Coercion
, where both types related by the coercion
are quantified over the same variable.
castCoercionKindI :: Coercion -> CoercionN -> CoercionN -> Coercion #
Creates a new coercion with both of its types casted by different casts
castCoercionKind g h1 h2
, where g :: t1 ~r t2
,
has type (t1 |> h1) ~r (t2 |> h2)
.
h1
and h2
must be nominal.
It calls coercionKindRole
, so it's quite inefficient (which I
stands for)
Use castCoercionKind
instead if t1
, t2
, and r
are known beforehand.
castCoercionKind :: Coercion -> Role -> Type -> Type -> CoercionN -> CoercionN -> Coercion #
Creates a new coercion with both of its types casted by different casts
castCoercionKind g r t1 t2 h1 h2
, where g :: t1 ~r t2
,
has type (t1 |> h1) ~r (t2 |> h2)
.
h1
and h2
must be nominal.
promoteCoercion :: Coercion -> CoercionN #
like mkKindCo, but aggressively & recursively optimizes to avoid using a KindCo constructor. The output role is nominal.
tyConRolesRepresentational :: TyCon -> [Role] #
tyConRolesX :: Role -> TyCon -> [Role] #
setNominalRole_maybe :: Role -> Coercion -> Maybe Coercion #
Converts a coercion to be nominal, if possible. See Note [Role twiddling functions]
downgradeRole :: Role -> Role -> Coercion -> Coercion #
Like downgradeRole_maybe
, but panics if the change isn't a downgrade.
See Note [Role twiddling functions]
mkCoherenceRightCo :: Role -> Type -> CoercionN -> Coercion -> Coercion #
Given ty :: k1
, co :: k1 ~ k2
, co2:: ty' ~r ty
,
produces @co' :: ty' ~r (ty |> co)
It is not only a utility function, but it saves allocation when co
is a GRefl coercion.
mkCoherenceLeftCo :: Role -> Type -> CoercionN -> Coercion -> Coercion #
Given ty :: k1
, co :: k1 ~ k2
, co2:: ty ~r ty'
,
produces @co' :: (ty |> co) ~r ty'
It is not only a utility function, but it saves allocation when co
is a GRefl coercion.
mkGReflLeftCo :: Role -> Type -> CoercionN -> Coercion #
Given ty :: k1
, co :: k1 ~ k2
,
produces co' :: (ty |> co) ~r ty
mkGReflRightCo :: Role -> Type -> CoercionN -> Coercion #
Given ty :: k1
, co :: k1 ~ k2
,
produces co' :: ty ~r (ty |> co)
nthCoRole :: Int -> Coercion -> Role #
If you're about to call mkNthCo r n co
, then r
should be
whatever nthCoRole n co
returns.
mkTransMCo :: MCoercion -> MCoercion -> MCoercion #
Compose two MCoercions via transitivity
mkHoleCo :: CoercionHole -> Coercion #
Make a coercion from a coercion hole
mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type #
Instantiate the left-hand side of an unbranched axiom
mkAxInstLHS :: forall (br :: BranchFlag). CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type #
Return the left-hand type of the axiom, when the axiom is instantiated at the types given.
mkUnbranchedAxInstRHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type #
mkAxInstRHS :: forall (br :: BranchFlag). CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type #
mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched -> [Type] -> [Coercion] -> Coercion #
mkAxInstCo :: forall (br :: BranchFlag). Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Coercion #
isCoVar_maybe :: Coercion -> Maybe CoVar #
Extract a covar, if possible. This check is dirty. Be ashamed of yourself. (It's dirty because it cares about the structure of a coercion, which is morally reprehensible.)
mkCoVarCos :: [CoVar] -> [Coercion] #
mkHomoForAllCos :: [TyCoVar] -> Coercion -> Coercion #
Make a Coercion quantified over a type/coercion variable; the variable has the same type in both sides of the coercion
mkRepReflCo :: Type -> Coercion #
Make a representational reflexive coercion
isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role) #
Extracts the coerced type from a reflexive coercion. This potentially walks over the entire coercion, so avoid doing this in a loop.
isReflCo_maybe :: Coercion -> Maybe (Type, Role) #
Returns the type coerced if this coercion is reflexive. Guaranteed
to work very quickly. Sometimes a coercion can be reflexive, but not
obviously so. c.f. isReflexiveCo_maybe
isGReflCo_maybe :: Coercion -> Maybe (Type, Role) #
Returns the type coerced if this coercion is a generalized reflexive coercion. Guaranteed to work very quickly.
isGReflMCo :: MCoercion -> Bool #
Tests if this MCoercion is obviously generalized reflexive Guaranteed to work very quickly.
isReflCoVar_maybe :: Var -> Maybe Coercion #
coVarTypes :: HasDebugCallStack => CoVar -> Pair Type #
splitForAllCo_co_maybe :: Coercion -> Maybe (CoVar, Coercion, Coercion) #
Like splitForAllCo_maybe
, but only returns Just for covar binder
splitForAllCo_ty_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion) #
Like splitForAllCo_maybe
, but only returns Just for tyvar binder
splitAppCo_maybe :: Coercion -> Maybe (Coercion, Coercion) #
Attempt to take a coercion application apart.
splitTyConAppCo_maybe :: Coercion -> Maybe (TyCon, [Coercion]) #
Attempts to tease a coercion apart into a type constructor and the application of a number of coercion arguments to that constructor
getCoVar_maybe :: Coercion -> Maybe CoVar #
Attempts to obtain the type variable underlying a Coercion
decomposeFunCo :: HasDebugCallStack => Role -> Coercion -> (Coercion, Coercion) #
pprCoAxBranch :: TyCon -> CoAxBranch -> SDoc #
pprCoAxBranchLHS :: TyCon -> CoAxBranch -> SDoc #
pprCoAxBranchUser :: TyCon -> CoAxBranch -> SDoc #
pprCoAxiom :: forall (br :: BranchFlag). CoAxiom br -> SDoc #
etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type) #
setCoVarName :: CoVar -> Name -> CoVar #
setCoVarUnique :: CoVar -> Unique -> CoVar #
type NormaliseStepper ev = RecTcChecker -> TyCon -> [Type] -> NormaliseStepResult ev #
A function to check if we can reduce a type by one step. Used
with topNormaliseTypeX
.
data NormaliseStepResult ev #
The result of stepping in a normalisation function.
See topNormaliseTypeX
.
NS_Done | Nothing more to do |
NS_Abort | Utter failure. The outer function should fail too. |
NS_Step RecTcChecker Type ev | We stepped, yielding new bits; ^ ev is evidence; Usually a co :: old type ~ new type |
substCoVarBndr :: HasCallStack => TCvSubst -> CoVar -> (TCvSubst, CoVar) #
substCoVars :: TCvSubst -> [CoVar] -> [Coercion] #
substCoVar :: TCvSubst -> CoVar -> Coercion #
substCos :: HasCallStack => TCvSubst -> [Coercion] -> [Coercion] #
Substitute within several Coercion
s
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substCoWith :: HasCallStack => [TyVar] -> [Type] -> Coercion -> Coercion #
Coercion substitution, see zipTvSubst
getCvSubstEnv :: TCvSubst -> CvSubstEnv #
pprParendCo :: Coercion -> SDoc #
coVarsOfCo :: Coercion -> CoVarSet #
tyCoFVsOfCos :: [Coercion] -> FV #
tyCoFVsOfCo :: Coercion -> FV #
tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet #
Get a deterministic set of the vars free in a coercion
tyCoVarsOfCos :: [Coercion] -> TyCoVarSet #
tyCoVarsOfCo :: Coercion -> TyCoVarSet #
coercionSize :: Coercion -> Int #
setCoHoleCoVar :: CoercionHole -> CoVar -> CoercionHole #
coHoleCoVar :: CoercionHole -> CoVar #
type MCoercionR = MCoercion #
data CoercionHole #
A coercion to be filled in by the type-checker. See Note [Coercion holes]
Instances
Data CoercionHole | |
Defined in TyCoRep gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoercionHole -> c CoercionHole # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoercionHole # toConstr :: CoercionHole -> Constr # dataTypeOf :: CoercionHole -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoercionHole) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoercionHole) # gmapT :: (forall b. Data b => b -> b) -> CoercionHole -> CoercionHole # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r # gmapQ :: (forall d. Data d => d -> u) -> CoercionHole -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CoercionHole -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole # | |
Outputable CoercionHole | |
Defined in TyCoRep ppr :: CoercionHole -> SDoc # pprPrec :: Rational -> CoercionHole -> SDoc # |
mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion #
Apply a type constructor to a list of coercions. It is the caller's responsibility to get the roles correct on argument coercions.
mkForAllCo :: TyCoVar -> CoercionN -> Coercion -> Coercion #
Make a Coercion from a tycovar, a kind coercion, and a body coercion. The kind of the tycovar should be the left-hand kind of the kind coercion. See Note [Unused coercion variable in ForAllCo]
mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion #
mkPhantomCo :: Coercion -> Type -> Type -> Coercion #
Make a phantom coercion between two types. The coercion passed in must be a nominal coercion between the kinds of the types.
mkUnsafeCo :: Role -> Type -> Type -> Coercion #
Manufacture an unsafe coercion from thin air.
Currently (May 14) this is used only to implement the
unsafeCoerce#
primitive. Optimise by pushing
down through type constructors.
:: 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.
mkSymCo :: Coercion -> Coercion #
Create a symmetric version of the given Coercion
that asserts
equality between the same types but in the other "direction", so
a kind of t1 ~ t2
becomes the kind t2 ~ t1
.
mkLRCo :: LeftOrRight -> Coercion -> Coercion #
mkNomReflCo :: Type -> Coercion #
Make a nominal reflexive coercion
:: Role | role of the created coercion, "r" |
-> Coercion | :: phi1 ~N phi2 |
-> Coercion | g1 :: phi1 |
-> Coercion | g2 :: phi2 |
-> Coercion | :: g1 ~r g2 |
Make a "coercion between coercions".
mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion #
isGReflCo :: Coercion -> Bool #
Tests if this coercion is obviously a generalized reflexive coercion. Guaranteed to work very quickly.
isReflCo :: Coercion -> Bool #
Tests if this coercion is obviously reflexive. Guaranteed to work
very quickly. Sometimes a coercion can be reflexive, but not obviously
so. c.f. isReflexiveCo
isReflexiveCo :: Coercion -> Bool #
Slowly checks if the coercion is reflexive. Don't call this in a loop, as it walks over the entire coercion.
decomposePiCos :: HasDebugCallStack => CoercionN -> Pair Type -> [Type] -> ([CoercionN], CoercionN) #
coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind, Kind, Type, Type, Role) #
mkCoercionType :: Role -> Type -> Type -> Type #
Makes a coercion type from two types: the types whose equality
is proven by the relevant Coercion
liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion #
liftCoSubst role lc ty
produces a coercion (at role role
)
that coerces between lc_left(ty)
and lc_right(ty)
, where
lc_left
is a substitution mapping type variables to the left-hand
types of the mapped coercions in lc
, and similar for lc_right
.
coercionKind :: Coercion -> Pair Type #
If it is the case that
c :: (t1 ~ t2)
i.e. the kind of c
relates t1
and t2
, then coercionKind c = Pair t1 t2
.
coercionType :: Coercion -> Type #
data LiftingContext #
Instances
Outputable LiftingContext | |
Defined in Coercion ppr :: LiftingContext -> SDoc # pprPrec :: Rational -> LiftingContext -> SDoc # |
Instances
Eq Role | |
Data Role | |
Defined in CoAxiom 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 # | |
Ord Role | |
Binary Role | |
Outputable Role | |
Is this a coercion variable?
Satisfies
.isId
v ==> isCoVar
v == not (isNonCoVarId
v)
A Coercion
is concrete evidence of the equality/convertibility
of two types.
Instances
Data Coercion | |
Defined in TyCoRep gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Coercion -> c Coercion # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Coercion # toConstr :: Coercion -> Constr # dataTypeOf :: Coercion -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Coercion) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Coercion) # gmapT :: (forall b. Data b => b -> b) -> Coercion -> Coercion # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r # gmapQ :: (forall d. Data d => d -> u) -> Coercion -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Coercion -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion # | |
Outputable Coercion | |
Eq (DeBruijn Coercion) | |
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
.
Instances
Data UnivCoProvenance | |
Defined in TyCoRep 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 TyCoRep ppr :: UnivCoProvenance -> SDoc # pprPrec :: Rational -> UnivCoProvenance -> SDoc # |
A semantically more meaningful type to represent what may or may not be a
useful Coercion
.
Instances
Data MCoercion | |
Defined in TyCoRep gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MCoercion -> c MCoercion # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MCoercion # toConstr :: MCoercion -> Constr # dataTypeOf :: MCoercion -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MCoercion) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MCoercion) # gmapT :: (forall b. Data b => b -> b) -> MCoercion -> MCoercion # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MCoercion -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MCoercion -> r # gmapQ :: (forall d. Data d => d -> u) -> MCoercion -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MCoercion -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MCoercion -> m MCoercion # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MCoercion -> m MCoercion # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MCoercion -> m MCoercion # | |
Outputable MCoercion | |
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var | |
Data Var | |
Defined in Var gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var # dataTypeOf :: Var -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) # gmapT :: (forall b. Data b => b -> b) -> Var -> Var # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var # | |
Ord Var | |
NamedThing Var | |
HasOccName Var | |
Uniquable Var | |
Outputable Var | |
Eq (DeBruijn CoreExpr) | |
Eq (DeBruijn CoreAlt) | |
pickLR :: LeftOrRight -> (a, a) -> a #
data LeftOrRight #
Instances
Eq LeftOrRight | |
Defined in BasicTypes (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool # | |
Data LeftOrRight | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight # toConstr :: LeftOrRight -> Constr # dataTypeOf :: LeftOrRight -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) # gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r # gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # | |
Binary LeftOrRight | |
Defined in Binary put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight # | |
Outputable LeftOrRight | |
Defined in BasicTypes ppr :: LeftOrRight -> SDoc # pprPrec :: Rational -> LeftOrRight -> SDoc # |
module TysWiredIn
module HscTypes
isKindLevel :: TypeOrKind -> Bool #
isTypeLevel :: TypeOrKind -> Bool #
mkIntWithInf :: Int -> IntWithInf #
Inject any integer into an IntWithInf
treatZeroAsInf :: Int -> IntWithInf #
Turn a positive number into an IntWithInf
, where 0 represents infinity
intGtLimit :: Int -> IntWithInf -> Bool #
infinity :: IntWithInf #
A representation of infinity
integralFractionalLit :: Bool -> Integer -> FractionalLit #
mkFractionalLit :: Real a => a -> FractionalLit #
mkIntegralLit :: Integral a => a -> IntegralLit #
isEarlyActive :: Activation -> Bool #
isAlwaysActive :: Activation -> Bool #
isNeverActive :: Activation -> Bool #
competesWith :: Activation -> Activation -> Bool #
isActiveIn :: PhaseNum -> Activation -> Bool #
isActive :: CompilerPhase -> Activation -> Bool #
pprInlineDebug :: InlinePragma -> SDoc #
pprInline :: InlinePragma -> SDoc #
inlinePragmaSat :: InlinePragma -> Maybe Arity #
isAnyInlinePragma :: InlinePragma -> Bool #
isInlinablePragma :: InlinePragma -> Bool #
isInlinePragma :: InlinePragma -> Bool #
noUserInlineSpec :: InlineSpec -> Bool #
isFunLike :: RuleMatchInfo -> Bool #
isConLike :: RuleMatchInfo -> Bool #
pprWithSourceText :: SourceText -> SDoc -> SDoc #
Special combinator for showing string literals.
failed :: SuccessFlag -> Bool #
succeeded :: SuccessFlag -> Bool #
successIf :: Bool -> SuccessFlag #
zapFragileOcc :: OccInfo -> OccInfo #
isStrongLoopBreaker :: OccInfo -> Bool #
isWeakLoopBreaker :: OccInfo -> Bool #
isAlwaysTailCalled :: OccInfo -> Bool #
zapOccTailCallInfo :: OccInfo -> OccInfo #
tailCallInfo :: OccInfo -> TailCallInfo #
seqOccInfo :: OccInfo -> () #
isManyOccs :: OccInfo -> Bool #
:: (a -> SDoc) | The pretty printing function to use |
-> a | The things to be pretty printed |
-> ConTag | Alternative (one-based) |
-> Arity | Arity |
-> SDoc |
|
Pretty print an alternative in an unboxed sum e.g. "| a | |".
tupleParens :: TupleSort -> SDoc -> SDoc #
boxityTupleSort :: Boxity -> TupleSort #
tupleSortBoxity :: TupleSort -> Boxity #
hasOverlappingFlag :: OverlapMode -> Bool #
hasOverlappableFlag :: OverlapMode -> Bool #
hasIncoherentFlag :: OverlapMode -> Bool #
isGenerated :: Origin -> Bool #
boolToRecFlag :: Bool -> RecFlag #
isTopLevel :: TopLevelFlag -> Bool #
isNotTopLevel :: TopLevelFlag -> Bool #
funTyFixity :: Fixity #
negateFixity :: Fixity #
defaultFixity :: Fixity #
minPrecedence :: Int #
maxPrecedence :: Int #
pprRuleName :: RuleName -> SDoc #
pprWarningTxtForMsg :: WarningTxt -> SDoc #
bumpVersion :: Version -> Version #
isPromoted :: PromotionFlag -> Bool #
bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo #
worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo #
hasNoOneShotInfo :: OneShotInfo -> Bool #
isOneShotInfo :: OneShotInfo -> Bool #
noOneShotInfo :: OneShotInfo #
It is always safe to assume that an Id
has no lambda-bound variable information
alignmentOf :: Int -> Alignment #
mkAlignment :: Int -> Alignment #
pickLR :: LeftOrRight -> (a, a) -> a #
data LeftOrRight #
Instances
Eq LeftOrRight | |
Defined in BasicTypes (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool # | |
Data LeftOrRight | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight # toConstr :: LeftOrRight -> Constr # dataTypeOf :: LeftOrRight -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) # gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r # gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight # | |
Binary LeftOrRight | |
Defined in Binary put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight # | |
Outputable LeftOrRight | |
Defined in BasicTypes ppr :: LeftOrRight -> SDoc # pprPrec :: Rational -> LeftOrRight -> SDoc # |
The number of value arguments that can be applied to a value before it does "real work". So: fib 100 has arity 0 x -> fib x has arity 1 See also Note [Definition of arity] in CoreArity
The number of arguments that a join point takes. Unlike the arity of a function, this is a purely syntactic property and is fixed when the join point is created (or converted from a value). Both type and value arguments are counted.
Constructor Tag
Type of the tags associated with each constructor possibility or superclass selector
A power-of-two alignment
Instances
Eq Alignment | |
Ord Alignment | |
Defined in BasicTypes | |
Outputable Alignment | |
data OneShotInfo #
If the Id
is a lambda-bound variable then it may have lambda-bound
variable info. Sometimes we know whether the lambda binding this variable
is a "one-shot" lambda; that is, whether it is applied at most once.
This information may be useful in optimisation, as computations may safely be floated inside such a lambda without risk of duplicating work.
NoOneShotInfo | No information |
OneShotLam | The lambda is applied at most once. |
Instances
Eq OneShotInfo | |
Defined in BasicTypes (==) :: OneShotInfo -> OneShotInfo -> Bool # (/=) :: OneShotInfo -> OneShotInfo -> Bool # | |
Outputable OneShotInfo | |
Defined in BasicTypes ppr :: OneShotInfo -> SDoc # pprPrec :: Rational -> OneShotInfo -> SDoc # |
data PromotionFlag #
Is a TyCon a promoted data constructor or just a normal type constructor?
Instances
Eq PromotionFlag | |
Defined in BasicTypes (==) :: PromotionFlag -> PromotionFlag -> Bool # (/=) :: PromotionFlag -> PromotionFlag -> Bool # | |
Data PromotionFlag | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PromotionFlag -> c PromotionFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PromotionFlag # toConstr :: PromotionFlag -> Constr # dataTypeOf :: PromotionFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PromotionFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PromotionFlag) # gmapT :: (forall b. Data b => b -> b) -> PromotionFlag -> PromotionFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PromotionFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PromotionFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> PromotionFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PromotionFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PromotionFlag -> m PromotionFlag # | |
Binary PromotionFlag | |
Defined in Binary put_ :: BinHandle -> PromotionFlag -> IO () # put :: BinHandle -> PromotionFlag -> IO (Bin PromotionFlag) # get :: BinHandle -> IO PromotionFlag # |
data FunctionOrData #
Instances
data StringLiteral #
A String Literal in the source, including its original raw format for use by source to source manipulation tools.
Instances
Eq StringLiteral | |
Defined in BasicTypes (==) :: StringLiteral -> StringLiteral -> Bool # (/=) :: StringLiteral -> StringLiteral -> Bool # | |
Data StringLiteral | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StringLiteral -> c StringLiteral # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StringLiteral # toConstr :: StringLiteral -> Constr # dataTypeOf :: StringLiteral -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StringLiteral) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StringLiteral) # gmapT :: (forall b. Data b => b -> b) -> StringLiteral -> StringLiteral # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StringLiteral -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StringLiteral -> r # gmapQ :: (forall d. Data d => d -> u) -> StringLiteral -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> StringLiteral -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral # | |
Binary StringLiteral | |
Defined in Binary put_ :: BinHandle -> StringLiteral -> IO () # put :: BinHandle -> StringLiteral -> IO (Bin StringLiteral) # get :: BinHandle -> IO StringLiteral # | |
Outputable StringLiteral | |
Defined in BasicTypes ppr :: StringLiteral -> SDoc # pprPrec :: Rational -> StringLiteral -> SDoc # |
data WarningTxt #
Warning Text
reason/explanation from a WARNING or DEPRECATED pragma
WarningTxt (Located SourceText) [Located StringLiteral] | |
DeprecatedTxt (Located SourceText) [Located StringLiteral] |
Instances
Eq WarningTxt | |
Defined in BasicTypes (==) :: WarningTxt -> WarningTxt -> Bool # (/=) :: WarningTxt -> WarningTxt -> Bool # | |
Data WarningTxt | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WarningTxt -> c WarningTxt # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WarningTxt # toConstr :: WarningTxt -> Constr # dataTypeOf :: WarningTxt -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WarningTxt) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WarningTxt) # gmapT :: (forall b. Data b => b -> b) -> WarningTxt -> WarningTxt # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WarningTxt -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WarningTxt -> r # gmapQ :: (forall d. Data d => d -> u) -> WarningTxt -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> WarningTxt -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt # | |
Binary WarningTxt | |
Defined in Binary put_ :: BinHandle -> WarningTxt -> IO () # put :: BinHandle -> WarningTxt -> IO (Bin WarningTxt) # get :: BinHandle -> IO WarningTxt # | |
Outputable WarningTxt | |
Defined in BasicTypes ppr :: WarningTxt -> SDoc # pprPrec :: Rational -> WarningTxt -> SDoc # |
type RuleName = FastString #
Instances
Eq Fixity | |
Data Fixity | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixity -> c Fixity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity # toConstr :: Fixity -> Constr # dataTypeOf :: Fixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # | |
Binary Fixity | |
Outputable Fixity | |
data FixityDirection #
Instances
data LexicalFixity #
Captures the fixity of declarations as they are parsed. This is not necessarily the same as the fixity declaration, as the normal fixity may be overridden using parens or backticks.
Instances
Eq LexicalFixity | |
Defined in BasicTypes (==) :: LexicalFixity -> LexicalFixity -> Bool # (/=) :: LexicalFixity -> LexicalFixity -> Bool # | |
Data LexicalFixity | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LexicalFixity -> c LexicalFixity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LexicalFixity # toConstr :: LexicalFixity -> Constr # dataTypeOf :: LexicalFixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LexicalFixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LexicalFixity) # gmapT :: (forall b. Data b => b -> b) -> LexicalFixity -> LexicalFixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r # gmapQ :: (forall d. Data d => d -> u) -> LexicalFixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LexicalFixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity # | |
Outputable LexicalFixity | |
Defined in BasicTypes ppr :: LexicalFixity -> SDoc # pprPrec :: Rational -> LexicalFixity -> SDoc # |
data TopLevelFlag #
Instances
Outputable TopLevelFlag | |
Defined in BasicTypes ppr :: TopLevelFlag -> SDoc # pprPrec :: Rational -> TopLevelFlag -> SDoc # |
Instances
Eq Boxity | |
Data Boxity | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Boxity -> c Boxity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Boxity # toConstr :: Boxity -> Constr # dataTypeOf :: Boxity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Boxity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Boxity) # gmapT :: (forall b. Data b => b -> b) -> Boxity -> Boxity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r # gmapQ :: (forall d. Data d => d -> u) -> Boxity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Boxity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity # | |
Outputable Boxity | |
Recursivity Flag
Instances
Eq RecFlag | |
Data RecFlag | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RecFlag -> c RecFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RecFlag # toConstr :: RecFlag -> Constr # dataTypeOf :: RecFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RecFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RecFlag) # gmapT :: (forall b. Data b => b -> b) -> RecFlag -> RecFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RecFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RecFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> RecFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RecFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag # | |
Binary RecFlag | |
Outputable RecFlag | |
Instances
Eq Origin | |
Data Origin | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Origin -> c Origin # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Origin # toConstr :: Origin -> Constr # dataTypeOf :: Origin -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Origin) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Origin) # gmapT :: (forall b. Data b => b -> b) -> Origin -> Origin # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Origin -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Origin -> r # gmapQ :: (forall d. Data d => d -> u) -> Origin -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Origin -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Origin -> m Origin # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Origin -> m Origin # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Origin -> m Origin # | |
Outputable Origin | |
data OverlapFlag #
The semantics allowed for overlapping instances for a particular
instance. See Note [Safe Haskell isSafeOverlap] (in hs
) for a
explanation of the isSafeOverlap
field.
AnnKeywordId
:AnnOpen
'{-# OVERLAPPABLE'
or'{-# OVERLAPPING'
or'{-# OVERLAPS'
or'{-# INCOHERENT'
,AnnClose
`#-}`
,
Instances
Eq OverlapFlag | |
Defined in BasicTypes (==) :: OverlapFlag -> OverlapFlag -> Bool # (/=) :: OverlapFlag -> OverlapFlag -> Bool # | |
Data OverlapFlag | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverlapFlag -> c OverlapFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverlapFlag # toConstr :: OverlapFlag -> Constr # dataTypeOf :: OverlapFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OverlapFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverlapFlag) # gmapT :: (forall b. Data b => b -> b) -> OverlapFlag -> OverlapFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverlapFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverlapFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> OverlapFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverlapFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag # | |
Binary OverlapFlag | |
Defined in Binary put_ :: BinHandle -> OverlapFlag -> IO () # put :: BinHandle -> OverlapFlag -> IO (Bin OverlapFlag) # get :: BinHandle -> IO OverlapFlag # | |
Outputable OverlapFlag | |
Defined in BasicTypes ppr :: OverlapFlag -> SDoc # pprPrec :: Rational -> OverlapFlag -> SDoc # |
data OverlapMode #
NoOverlap SourceText | This instance must not overlap another |
Overlappable SourceText | Silently ignore this instance if you find a more specific one that matches the constraint you are trying to resolve Example: constraint (Foo [Int]) instance Foo [Int] instance {--} Foo [a] Since the second instance has the Overlappable flag, the first instance will be chosen (otherwise its ambiguous which to choose) |
Overlapping SourceText | Silently ignore any more general instances that may be used to solve the constraint. Example: constraint (Foo [Int]) instance {--} Foo [Int] instance Foo [a] Since the first instance has the Overlapping flag, the second---more general---instance will be ignored (otherwise it is ambiguous which to choose) |
Overlaps SourceText | Equivalent to having both |
Incoherent SourceText | Behave like Overlappable and Overlapping, and in addition pick an an arbitrary one if there are multiple matching candidates, and don't worry about later instantiation Example: constraint (Foo [b])
instance {-# INCOHERENT -} Foo [Int]
instance Foo [a]
Without the Incoherent flag, we'd complain that
instantiating |
Instances
Eq OverlapMode | |
Defined in BasicTypes (==) :: OverlapMode -> OverlapMode -> Bool # (/=) :: OverlapMode -> OverlapMode -> Bool # | |
Data OverlapMode | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverlapMode -> c OverlapMode # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverlapMode # toConstr :: OverlapMode -> Constr # dataTypeOf :: OverlapMode -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OverlapMode) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverlapMode) # gmapT :: (forall b. Data b => b -> b) -> OverlapMode -> OverlapMode # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverlapMode -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverlapMode -> r # gmapQ :: (forall d. Data d => d -> u) -> OverlapMode -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverlapMode -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode # | |
Binary OverlapMode | |
Defined in Binary put_ :: BinHandle -> OverlapMode -> IO () # put :: BinHandle -> OverlapMode -> IO (Bin OverlapMode) # get :: BinHandle -> IO OverlapMode # | |
Outputable OverlapMode | |
Defined in BasicTypes ppr :: OverlapMode -> SDoc # pprPrec :: Rational -> OverlapMode -> SDoc # |
Instances
Eq TupleSort | |
Data TupleSort | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TupleSort -> c TupleSort # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TupleSort # toConstr :: TupleSort -> Constr # dataTypeOf :: TupleSort -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TupleSort) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TupleSort) # gmapT :: (forall b. Data b => b -> b) -> TupleSort -> TupleSort # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r # gmapQ :: (forall d. Data d => d -> u) -> TupleSort -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TupleSort -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort # | |
Binary TupleSort | |
Outputable TupleSort | |
identifier Occurrence Information
ManyOccs | There are many occurrences, or unknown occurrences |
| |
IAmDead | Marks unused variables. Sometimes useful for lambda and case-bound variables. |
OneOcc | Occurs exactly once (per branch), not inside a rule |
| |
IAmALoopBreaker | This identifier breaks a loop of mutually recursive functions. The field marks whether it is only a loop breaker due to a reference in a rule |
|
type BranchCount = Int #
type InterestingCxt = Bool #
Interesting Context
data TailCallInfo #
Instances
Eq TailCallInfo | |
Defined in BasicTypes (==) :: TailCallInfo -> TailCallInfo -> Bool # (/=) :: TailCallInfo -> TailCallInfo -> Bool # | |
Outputable TailCallInfo | |
Defined in BasicTypes ppr :: TailCallInfo -> SDoc # pprPrec :: Rational -> TailCallInfo -> SDoc # |
data DefMethSpec ty #
Default Method Specification
Instances
Binary (DefMethSpec IfaceType) | |
Outputable (DefMethSpec ty) | |
Defined in BasicTypes ppr :: DefMethSpec ty -> SDoc # pprPrec :: Rational -> DefMethSpec ty -> SDoc # |
data SuccessFlag #
Instances
Outputable SuccessFlag | |
Defined in BasicTypes ppr :: SuccessFlag -> SDoc # pprPrec :: Rational -> SuccessFlag -> SDoc # |
data SourceText #
SourceText String | |
NoSourceText | For when code is generated, e.g. TH, deriving. The pretty printer will then make its own representation of the item. |
Instances
Eq SourceText | |
Defined in BasicTypes (==) :: SourceText -> SourceText -> Bool # (/=) :: SourceText -> SourceText -> Bool # | |
Data SourceText | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceText -> c SourceText # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceText # toConstr :: SourceText -> Constr # dataTypeOf :: SourceText -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceText) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceText) # gmapT :: (forall b. Data b => b -> b) -> SourceText -> SourceText # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceText -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceText -> r # gmapQ :: (forall d. Data d => d -> u) -> SourceText -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceText -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText # | |
Show SourceText | |
Defined in BasicTypes showsPrec :: Int -> SourceText -> ShowS # show :: SourceText -> String # showList :: [SourceText] -> ShowS # | |
Binary SourceText | |
Defined in Binary put_ :: BinHandle -> SourceText -> IO () # put :: BinHandle -> SourceText -> IO (Bin SourceText) # get :: BinHandle -> IO SourceText # | |
Outputable SourceText | |
Defined in BasicTypes ppr :: SourceText -> SDoc # pprPrec :: Rational -> SourceText -> SDoc # |
data CompilerPhase #
Instances
Outputable CompilerPhase | |
Defined in BasicTypes ppr :: CompilerPhase -> SDoc # pprPrec :: Rational -> CompilerPhase -> SDoc # |
data Activation #
Instances
Eq Activation | |
Defined in BasicTypes (==) :: Activation -> Activation -> Bool # (/=) :: Activation -> Activation -> Bool # | |
Data Activation | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Activation -> c Activation # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Activation # toConstr :: Activation -> Constr # dataTypeOf :: Activation -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Activation) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Activation) # gmapT :: (forall b. Data b => b -> b) -> Activation -> Activation # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Activation -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Activation -> r # gmapQ :: (forall d. Data d => d -> u) -> Activation -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Activation -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Activation -> m Activation # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Activation -> m Activation # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Activation -> m Activation # | |
Binary Activation | |
Defined in Binary put_ :: BinHandle -> Activation -> IO () # put :: BinHandle -> Activation -> IO (Bin Activation) # get :: BinHandle -> IO Activation # | |
Outputable Activation | |
Defined in BasicTypes ppr :: Activation -> SDoc # pprPrec :: Rational -> Activation -> SDoc # |
data RuleMatchInfo #
Rule Match Information
Instances
data InlinePragma #
InlinePragma | |
|
Instances
Eq InlinePragma | |
Defined in BasicTypes (==) :: InlinePragma -> InlinePragma -> Bool # (/=) :: InlinePragma -> InlinePragma -> Bool # | |
Data InlinePragma | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InlinePragma -> c InlinePragma # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InlinePragma # toConstr :: InlinePragma -> Constr # dataTypeOf :: InlinePragma -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InlinePragma) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InlinePragma) # gmapT :: (forall b. Data b => b -> b) -> InlinePragma -> InlinePragma # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InlinePragma -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InlinePragma -> r # gmapQ :: (forall d. Data d => d -> u) -> InlinePragma -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> InlinePragma -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma # | |
Binary InlinePragma | |
Defined in Binary put_ :: BinHandle -> InlinePragma -> IO () # put :: BinHandle -> InlinePragma -> IO (Bin InlinePragma) # get :: BinHandle -> IO InlinePragma # | |
Outputable InlinePragma | |
Defined in BasicTypes ppr :: InlinePragma -> SDoc # pprPrec :: Rational -> InlinePragma -> SDoc # |
data InlineSpec #
Inline Specification
Instances
Eq InlineSpec | |
Defined in BasicTypes (==) :: InlineSpec -> InlineSpec -> Bool # (/=) :: InlineSpec -> InlineSpec -> Bool # | |
Data InlineSpec | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InlineSpec -> c InlineSpec # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InlineSpec # toConstr :: InlineSpec -> Constr # dataTypeOf :: InlineSpec -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InlineSpec) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InlineSpec) # gmapT :: (forall b. Data b => b -> b) -> InlineSpec -> InlineSpec # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InlineSpec -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InlineSpec -> r # gmapQ :: (forall d. Data d => d -> u) -> InlineSpec -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> InlineSpec -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec # | |
Show InlineSpec | |
Defined in BasicTypes showsPrec :: Int -> InlineSpec -> ShowS # show :: InlineSpec -> String # showList :: [InlineSpec] -> ShowS # | |
Binary InlineSpec | |
Defined in Binary put_ :: BinHandle -> InlineSpec -> IO () # put :: BinHandle -> InlineSpec -> IO (Bin InlineSpec) # get :: BinHandle -> IO InlineSpec # | |
Outputable InlineSpec | |
Defined in BasicTypes ppr :: InlineSpec -> SDoc # pprPrec :: Rational -> InlineSpec -> SDoc # |
data IntegralLit #
Integral Literal
Used (instead of Integer) to represent negative zegative zero which is required for NegativeLiterals extension to correctly parse `-0::Double` as negative zero. See also #13211.
Instances
data FractionalLit #
Fractional Literal
Used (instead of Rational) to represent exactly the floating point literal that we encountered in the user's source program. This allows us to pretty-print exactly what the user wrote, which is important e.g. for floating point numbers that can't represented as Doubles (we used to via Double for pretty-printing). See also #2245.
Instances
data IntWithInf #
An integer or infinity
Instances
Eq IntWithInf | |
Defined in BasicTypes (==) :: IntWithInf -> IntWithInf -> Bool # (/=) :: IntWithInf -> IntWithInf -> Bool # | |
Num IntWithInf | |
Defined in BasicTypes (+) :: IntWithInf -> IntWithInf -> IntWithInf # (-) :: IntWithInf -> IntWithInf -> IntWithInf # (*) :: IntWithInf -> IntWithInf -> IntWithInf # negate :: IntWithInf -> IntWithInf # abs :: IntWithInf -> IntWithInf # signum :: IntWithInf -> IntWithInf # fromInteger :: Integer -> IntWithInf # | |
Ord IntWithInf | |
Defined in BasicTypes compare :: IntWithInf -> IntWithInf -> Ordering # (<) :: IntWithInf -> IntWithInf -> Bool # (<=) :: IntWithInf -> IntWithInf -> Bool # (>) :: IntWithInf -> IntWithInf -> Bool # (>=) :: IntWithInf -> IntWithInf -> Bool # max :: IntWithInf -> IntWithInf -> IntWithInf # min :: IntWithInf -> IntWithInf -> IntWithInf # | |
Outputable IntWithInf | |
Defined in BasicTypes ppr :: IntWithInf -> SDoc # pprPrec :: Rational -> IntWithInf -> SDoc # |
data SpliceExplicitFlag #
ExplicitSplice | = $(f x y) |
ImplicitSplice | = f x y, i.e. a naked top level expression |
Instances
Data SpliceExplicitFlag | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpliceExplicitFlag -> c SpliceExplicitFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SpliceExplicitFlag # toConstr :: SpliceExplicitFlag -> Constr # dataTypeOf :: SpliceExplicitFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SpliceExplicitFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpliceExplicitFlag) # gmapT :: (forall b. Data b => b -> b) -> SpliceExplicitFlag -> SpliceExplicitFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpliceExplicitFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpliceExplicitFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> SpliceExplicitFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SpliceExplicitFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag # |
data TypeOrKind #
Flag to see whether we're type-checking terms or kind-checking types
Instances
Eq TypeOrKind | |
Defined in BasicTypes (==) :: TypeOrKind -> TypeOrKind -> Bool # (/=) :: TypeOrKind -> TypeOrKind -> Bool # | |
Outputable TypeOrKind | |
Defined in BasicTypes ppr :: TypeOrKind -> SDoc # pprPrec :: Rational -> TypeOrKind -> SDoc # |
module VarSet
module VarEnv
module NameSet
module NameEnv
module UniqSet
module UniqFM
module FiniteMap
module Util
module GHC.Serialized
module SrcLoc
module Outputable
module UniqSupply
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.
Class of things that we can obtain a Unique
from
Instances
module FastString
Getting Name
s
thNameToGhcName :: Name -> CoreM (Maybe Name) Source #
Attempt to convert a Template Haskell name to one that GHC can
understand. Original TH names such as those you get when you use
the 'foo
syntax will be translated to their equivalent GHC name
exactly. Qualified or unqualified TH names will be dynamically bound
to names in the module being compiled, if possible. Exact TH names
will be bound to the name they represent, exactly.