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
- data OccName
- type FastStringEnv a = UniqFM a
- emptyFsEnv :: FastStringEnv a
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a
- type TidyOccEnv = UniqFM Int
- type OccSet = UniqSet OccName
- data OccEnv a
- class HasOccName name where
- data NameSpace
- tcName :: NameSpace
- clsName :: NameSpace
- tcClsName :: NameSpace
- dataName :: NameSpace
- srcDataName :: NameSpace
- tvName :: NameSpace
- isDataConNameSpace :: NameSpace -> Bool
- isTcClsNameSpace :: NameSpace -> Bool
- isTvNameSpace :: NameSpace -> Bool
- isVarNameSpace :: NameSpace -> Bool
- isValNameSpace :: NameSpace -> Bool
- pprNameSpace :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpaceBrief :: NameSpace -> SDoc
- pprOccName :: OccName -> SDoc
- mkOccName :: NameSpace -> String -> OccName
- mkOccNameFS :: NameSpace -> FastString -> OccName
- mkVarOcc :: String -> OccName
- mkVarOccFS :: FastString -> OccName
- mkDataOcc :: String -> OccName
- mkDataOccFS :: FastString -> OccName
- mkTyVarOcc :: String -> OccName
- mkTyVarOccFS :: FastString -> OccName
- mkTcOcc :: String -> OccName
- mkTcOccFS :: FastString -> OccName
- mkClsOcc :: String -> OccName
- mkClsOccFS :: FastString -> OccName
- demoteOccName :: OccName -> Maybe OccName
- nameSpacesRelated :: NameSpace -> NameSpace -> Bool
- emptyOccEnv :: OccEnv a
- unitOccEnv :: OccName -> a -> OccEnv a
- extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
- extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
- lookupOccEnv :: OccEnv a -> OccName -> Maybe a
- mkOccEnv :: [(OccName, a)] -> OccEnv a
- elemOccEnv :: OccName -> OccEnv a -> Bool
- foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- occEnvElts :: OccEnv a -> [a]
- plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
- plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
- extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
- extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
- mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
- mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
- delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
- delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
- filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
- alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
- pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
- emptyOccSet :: OccSet
- unitOccSet :: OccName -> OccSet
- mkOccSet :: [OccName] -> OccSet
- extendOccSet :: OccSet -> OccName -> OccSet
- extendOccSetList :: OccSet -> [OccName] -> OccSet
- unionOccSets :: OccSet -> OccSet -> OccSet
- unionManyOccSets :: [OccSet] -> OccSet
- minusOccSet :: OccSet -> OccSet -> OccSet
- elemOccSet :: OccName -> OccSet -> Bool
- isEmptyOccSet :: OccSet -> Bool
- intersectOccSet :: OccSet -> OccSet -> OccSet
- intersectsOccSet :: OccSet -> OccSet -> Bool
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- occNameString :: OccName -> String
- setOccNameSpace :: NameSpace -> OccName -> OccName
- isVarOcc :: OccName -> Bool
- isTvOcc :: OccName -> Bool
- isTcOcc :: OccName -> Bool
- isValOcc :: OccName -> Bool
- isDataOcc :: OccName -> Bool
- isDataSymOcc :: OccName -> Bool
- isSymOcc :: OccName -> Bool
- parenSymOcc :: OccName -> SDoc -> SDoc
- startsWithUnderscore :: OccName -> Bool
- isDerivedOccName :: OccName -> Bool
- isDefaultMethodOcc :: OccName -> Bool
- isTypeableBindOcc :: OccName -> Bool
- mkDataConWrapperOcc :: OccName -> OccName
- mkWorkerOcc :: OccName -> OccName
- mkMatcherOcc :: OccName -> OccName
- mkBuilderOcc :: OccName -> OccName
- mkDefaultMethodOcc :: OccName -> OccName
- mkClassOpAuxOcc :: OccName -> OccName
- mkDictOcc :: OccName -> OccName
- mkIPOcc :: OccName -> OccName
- mkSpecOcc :: OccName -> OccName
- mkForeignExportOcc :: OccName -> OccName
- mkRepEqOcc :: OccName -> OccName
- mkClassDataConOcc :: OccName -> OccName
- mkNewTyCoOcc :: OccName -> OccName
- mkInstTyCoOcc :: OccName -> OccName
- mkEqPredCoOcc :: OccName -> OccName
- mkCon2TagOcc :: OccName -> OccName
- mkTag2ConOcc :: OccName -> OccName
- mkMaxTagOcc :: OccName -> OccName
- mkTyConRepOcc :: OccName -> OccName
- mkGenR :: OccName -> OccName
- mkGen1R :: OccName -> OccName
- mkRecFldSelOcc :: String -> OccName
- mkDataConWorkerOcc :: OccName -> OccName
- mkSuperDictAuxOcc :: Int -> OccName -> OccName
- mkSuperDictSelOcc :: Int -> OccName -> OccName
- mkLocalOcc :: Unique -> OccName -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- mkDFunOcc :: String -> Bool -> OccSet -> OccName
- mkDataTOcc :: OccName -> OccSet -> OccName
- mkDataCOcc :: OccName -> OccSet -> OccName
- mkMethodOcc :: OccName -> OccName
- emptyTidyOccEnv :: TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- data Name
- data OccName
- type FastStringEnv a = UniqFM a
- emptyFsEnv :: FastStringEnv a
- extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a
- lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a
- mkFsEnv :: [(FastString, a)] -> FastStringEnv a
- type TidyOccEnv = UniqFM Int
- type OccSet = UniqSet OccName
- data OccEnv a
- class HasOccName name where
- data NameSpace
- tcName :: NameSpace
- clsName :: NameSpace
- tcClsName :: NameSpace
- dataName :: NameSpace
- srcDataName :: NameSpace
- tvName :: NameSpace
- isDataConNameSpace :: NameSpace -> Bool
- isTcClsNameSpace :: NameSpace -> Bool
- isTvNameSpace :: NameSpace -> Bool
- isVarNameSpace :: NameSpace -> Bool
- isValNameSpace :: NameSpace -> Bool
- pprNameSpace :: NameSpace -> SDoc
- pprNonVarNameSpace :: NameSpace -> SDoc
- pprNameSpaceBrief :: NameSpace -> SDoc
- pprOccName :: OccName -> SDoc
- mkOccName :: NameSpace -> String -> OccName
- mkOccNameFS :: NameSpace -> FastString -> OccName
- mkVarOcc :: String -> OccName
- mkVarOccFS :: FastString -> OccName
- mkDataOcc :: String -> OccName
- mkDataOccFS :: FastString -> OccName
- mkTyVarOcc :: String -> OccName
- mkTyVarOccFS :: FastString -> OccName
- mkTcOcc :: String -> OccName
- mkTcOccFS :: FastString -> OccName
- mkClsOcc :: String -> OccName
- mkClsOccFS :: FastString -> OccName
- demoteOccName :: OccName -> Maybe OccName
- nameSpacesRelated :: NameSpace -> NameSpace -> Bool
- emptyOccEnv :: OccEnv a
- unitOccEnv :: OccName -> a -> OccEnv a
- extendOccEnv :: OccEnv a -> OccName -> a -> OccEnv a
- extendOccEnvList :: OccEnv a -> [(OccName, a)] -> OccEnv a
- lookupOccEnv :: OccEnv a -> OccName -> Maybe a
- mkOccEnv :: [(OccName, a)] -> OccEnv a
- elemOccEnv :: OccName -> OccEnv a -> Bool
- foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b
- occEnvElts :: OccEnv a -> [a]
- plusOccEnv :: OccEnv a -> OccEnv a -> OccEnv a
- plusOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccEnv a -> OccEnv a
- extendOccEnv_C :: (a -> a -> a) -> OccEnv a -> OccName -> a -> OccEnv a
- extendOccEnv_Acc :: (a -> b -> b) -> (a -> b) -> OccEnv b -> OccName -> a -> OccEnv b
- mapOccEnv :: (a -> b) -> OccEnv a -> OccEnv b
- mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a
- delFromOccEnv :: OccEnv a -> OccName -> OccEnv a
- delListFromOccEnv :: OccEnv a -> [OccName] -> OccEnv a
- filterOccEnv :: (elt -> Bool) -> OccEnv elt -> OccEnv elt
- alterOccEnv :: (Maybe elt -> Maybe elt) -> OccEnv elt -> OccName -> OccEnv elt
- pprOccEnv :: (a -> SDoc) -> OccEnv a -> SDoc
- emptyOccSet :: OccSet
- unitOccSet :: OccName -> OccSet
- mkOccSet :: [OccName] -> OccSet
- extendOccSet :: OccSet -> OccName -> OccSet
- extendOccSetList :: OccSet -> [OccName] -> OccSet
- unionOccSets :: OccSet -> OccSet -> OccSet
- unionManyOccSets :: [OccSet] -> OccSet
- minusOccSet :: OccSet -> OccSet -> OccSet
- elemOccSet :: OccName -> OccSet -> Bool
- isEmptyOccSet :: OccSet -> Bool
- intersectOccSet :: OccSet -> OccSet -> OccSet
- intersectsOccSet :: OccSet -> OccSet -> Bool
- filterOccSet :: (OccName -> Bool) -> OccSet -> OccSet
- occNameString :: OccName -> String
- setOccNameSpace :: NameSpace -> OccName -> OccName
- isVarOcc :: OccName -> Bool
- isTvOcc :: OccName -> Bool
- isTcOcc :: OccName -> Bool
- isValOcc :: OccName -> Bool
- isDataOcc :: OccName -> Bool
- isDataSymOcc :: OccName -> Bool
- isSymOcc :: OccName -> Bool
- parenSymOcc :: OccName -> SDoc -> SDoc
- startsWithUnderscore :: OccName -> Bool
- isDerivedOccName :: OccName -> Bool
- isDefaultMethodOcc :: OccName -> Bool
- isTypeableBindOcc :: OccName -> Bool
- mkDataConWrapperOcc :: OccName -> OccName
- mkWorkerOcc :: OccName -> OccName
- mkMatcherOcc :: OccName -> OccName
- mkBuilderOcc :: OccName -> OccName
- mkDefaultMethodOcc :: OccName -> OccName
- mkClassOpAuxOcc :: OccName -> OccName
- mkDictOcc :: OccName -> OccName
- mkIPOcc :: OccName -> OccName
- mkSpecOcc :: OccName -> OccName
- mkForeignExportOcc :: OccName -> OccName
- mkRepEqOcc :: OccName -> OccName
- mkClassDataConOcc :: OccName -> OccName
- mkNewTyCoOcc :: OccName -> OccName
- mkInstTyCoOcc :: OccName -> OccName
- mkEqPredCoOcc :: OccName -> OccName
- mkCon2TagOcc :: OccName -> OccName
- mkTag2ConOcc :: OccName -> OccName
- mkMaxTagOcc :: OccName -> OccName
- mkTyConRepOcc :: OccName -> OccName
- mkGenR :: OccName -> OccName
- mkGen1R :: OccName -> OccName
- mkRecFldSelOcc :: String -> OccName
- mkDataConWorkerOcc :: OccName -> OccName
- mkSuperDictAuxOcc :: Int -> OccName -> OccName
- mkSuperDictSelOcc :: Int -> OccName -> OccName
- mkLocalOcc :: Unique -> OccName -> OccName
- mkInstTyTcOcc :: String -> OccSet -> OccName
- mkDFunOcc :: String -> Bool -> OccSet -> OccName
- mkDataTOcc :: OccName -> OccSet -> OccName
- mkDataCOcc :: OccName -> OccSet -> OccName
- mkMethodOcc :: OccName -> OccName
- emptyTidyOccEnv :: TidyOccEnv
- initTidyOccEnv :: [OccName] -> TidyOccEnv
- avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv
- tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName)
- class NamedThing a where
- getOccName :: a -> OccName
- getName :: a -> Name
- data BuiltInSyntax
- nameUnique :: Name -> Unique
- nameOccName :: Name -> OccName
- nameSrcLoc :: Name -> SrcLoc
- nameSrcSpan :: Name -> SrcSpan
- isWiredInName :: Name -> Bool
- wiredInNameTyThing_maybe :: Name -> Maybe TyThing
- isBuiltInSyntax :: Name -> Bool
- isExternalName :: Name -> Bool
- isInternalName :: Name -> Bool
- isHoleName :: Name -> Bool
- nameModule :: HasDebugCallStack => Name -> Module
- nameModule_maybe :: Name -> Maybe Module
- nameIsLocalOrFrom :: Module -> Name -> Bool
- nameIsHomePackage :: Module -> Name -> Bool
- nameIsHomePackageImport :: Module -> Name -> Bool
- nameIsFromExternalPackage :: UnitId -> Name -> Bool
- isTyVarName :: Name -> Bool
- isTyConName :: Name -> Bool
- isDataConName :: Name -> Bool
- isValName :: Name -> Bool
- isVarName :: Name -> Bool
- isSystemName :: Name -> Bool
- mkInternalName :: Unique -> OccName -> SrcSpan -> Name
- mkClonedInternalName :: Unique -> Name -> Name
- mkDerivedInternalName :: (OccName -> OccName) -> Unique -> Name -> Name
- mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name
- mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name
- mkSystemName :: Unique -> OccName -> Name
- mkSystemNameAt :: Unique -> OccName -> SrcSpan -> Name
- mkSystemVarName :: Unique -> FastString -> Name
- mkSysTvName :: Unique -> FastString -> Name
- mkFCallName :: Unique -> String -> Name
- setNameUnique :: Name -> Unique -> Name
- setNameLoc :: Name -> SrcSpan -> Name
- tidyNameOcc :: Name -> OccName -> Name
- localiseName :: Name -> Name
- stableNameCmp :: Name -> Name -> Ordering
- pprNameUnqualified :: Name -> SDoc
- pprModulePrefix :: PprStyle -> Module -> OccName -> SDoc
- pprDefinedAt :: Name -> SDoc
- pprNameDefnLoc :: Name -> SDoc
- nameStableString :: Name -> String
- getSrcLoc :: NamedThing a => a -> SrcLoc
- getSrcSpan :: NamedThing a => a -> SrcSpan
- getOccString :: NamedThing a => a -> String
- getOccFS :: NamedThing a => a -> FastString
- pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc
- pprPrefixName :: NamedThing a => a -> SDoc
- module Var
- data Var
- type OutId = Id
- type OutVar = Var
- type InId = Id
- type InVar = Var
- type JoinId = Id
- type DictId = EvId
- type Id = Var
- idInfo :: HasDebugCallStack => Id -> IdInfo
- idDetails :: Id -> IdDetails
- globaliseId :: Id -> Id
- isId :: Var -> Bool
- isLocalId :: Var -> Bool
- isGlobalId :: Var -> Bool
- isExportedId :: Var -> Bool
- idName :: Id -> Name
- idUnique :: Id -> Unique
- idType :: Id -> Kind
- setIdName :: Id -> Name -> Id
- setIdUnique :: Id -> Unique -> Id
- setIdType :: Id -> Type -> Id
- localiseId :: Id -> Id
- setIdInfo :: Id -> IdInfo -> Id
- modifyIdInfo :: HasDebugCallStack => (IdInfo -> IdInfo) -> Id -> Id
- maybeModifyIdInfo :: Maybe IdInfo -> Id -> Id
- mkGlobalId :: IdDetails -> Name -> Type -> IdInfo -> Id
- mkVanillaGlobal :: Name -> Type -> Id
- mkVanillaGlobalWithInfo :: Name -> Type -> IdInfo -> Id
- mkLocalId :: Name -> Type -> Id
- mkLocalCoVar :: Name -> Type -> CoVar
- mkLocalIdOrCoVar :: Name -> Type -> Id
- mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id
- mkLocalIdWithInfo :: Name -> Type -> IdInfo -> Id
- mkExportedLocalId :: IdDetails -> Name -> Type -> Id
- mkExportedVanillaId :: Name -> Type -> Id
- mkSysLocal :: FastString -> Unique -> Type -> Id
- mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id
- mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id
- mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id
- mkUserLocal :: OccName -> Unique -> Type -> SrcSpan -> Id
- mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id
- mkWorkerId :: Unique -> Id -> Type -> Id
- mkTemplateLocal :: Int -> Type -> Id
- mkTemplateLocals :: [Type] -> [Id]
- mkTemplateLocalsNum :: Int -> [Type] -> [Id]
- recordSelectorTyCon :: Id -> RecSelParent
- isRecordSelector :: Id -> Bool
- isDataConRecordSelector :: Id -> Bool
- isPatSynRecordSelector :: Id -> Bool
- isNaughtyRecordSelector :: Id -> Bool
- isClassOpId_maybe :: Id -> Maybe Class
- isPrimOpId :: Id -> Bool
- isDFunId :: Id -> Bool
- isPrimOpId_maybe :: Id -> Maybe PrimOp
- isFCallId :: Id -> Bool
- isFCallId_maybe :: Id -> Maybe ForeignCall
- isDataConWorkId :: Id -> Bool
- isDataConWorkId_maybe :: Id -> Maybe DataCon
- isDataConId_maybe :: Id -> Maybe DataCon
- isJoinId :: Var -> Bool
- isJoinId_maybe :: Var -> Maybe JoinArity
- idDataCon :: Id -> DataCon
- hasNoBinding :: Id -> Bool
- isImplicitId :: Id -> Bool
- idIsFrom :: Module -> Id -> Bool
- isDeadBinder :: Id -> Bool
- isEvVar :: Var -> Bool
- isDictId :: Id -> Bool
- idJoinArity :: JoinId -> JoinArity
- asJoinId :: Id -> JoinArity -> JoinId
- zapJoinId :: Id -> Id
- asJoinId_maybe :: Id -> Maybe JoinArity -> Id
- idArity :: Id -> Arity
- setIdArity :: Id -> Arity -> Id
- idCallArity :: Id -> Arity
- setIdCallArity :: Id -> Arity -> Id
- idFunRepArity :: Id -> RepArity
- isBottomingId :: Var -> Bool
- idStrictness :: Id -> StrictSig
- setIdStrictness :: Id -> StrictSig -> Id
- zapIdStrictness :: Id -> Id
- isStrictId :: Id -> Bool
- idUnfolding :: Id -> Unfolding
- realIdUnfolding :: Id -> Unfolding
- setIdUnfolding :: Id -> Unfolding -> Id
- idDemandInfo :: Id -> Demand
- setIdDemandInfo :: Id -> Demand -> Id
- setCaseBndrEvald :: StrictnessMark -> Id -> Id
- idSpecialisation :: Id -> RuleInfo
- idCoreRules :: Id -> [CoreRule]
- idHasRules :: Id -> Bool
- setIdSpecialisation :: Id -> RuleInfo -> Id
- idCafInfo :: Id -> CafInfo
- setIdCafInfo :: Id -> CafInfo -> Id
- idOccInfo :: Id -> OccInfo
- setIdOccInfo :: Id -> OccInfo -> Id
- zapIdOccInfo :: Id -> Id
- idInlinePragma :: Id -> InlinePragma
- setInlinePragma :: Id -> InlinePragma -> Id
- modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id
- idInlineActivation :: Id -> Activation
- setInlineActivation :: Id -> Activation -> Id
- idRuleMatchInfo :: Id -> RuleMatchInfo
- isConLikeId :: Id -> Bool
- idOneShotInfo :: Id -> OneShotInfo
- idStateHackOneShotInfo :: Id -> OneShotInfo
- isOneShotBndr :: Var -> Bool
- stateHackOneShot :: OneShotInfo
- typeOneShot :: Type -> OneShotInfo
- isStateHackType :: Type -> Bool
- isProbablyOneShotLambda :: Id -> Bool
- setOneShotLambda :: Id -> Id
- clearOneShotLambda :: Id -> Id
- setIdOneShotInfo :: Id -> OneShotInfo -> Id
- updOneShotInfo :: Id -> OneShotInfo -> Id
- zapLamIdInfo :: Id -> Id
- zapFragileIdInfo :: Id -> Id
- zapIdDemandInfo :: Id -> Id
- zapIdUsageInfo :: Id -> Id
- zapIdUsageEnvInfo :: Id -> Id
- zapIdUsedOnceInfo :: Id -> Id
- zapIdTailCallInfo :: Id -> Id
- zapStableUnfolding :: Id -> Id
- transferPolyIdInfo :: Id -> [Var] -> Id -> Id
- isNeverLevPolyId :: Id -> Bool
- module IdInfo
- module CoreMonad
- module CoreSyn
- module Literal
- module DataCon
- module CoreUtils
- module MkCore
- module CoreFVs
- data InScopeSet
- type TvSubstEnv = TyVarEnv Type
- extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
- type IdSubstEnv = IdEnv CoreExpr
- data Subst = Subst InScopeSet IdSubstEnv TvSubstEnv CvSubstEnv
- isEmptySubst :: Subst -> Bool
- emptySubst :: Subst
- mkEmptySubst :: InScopeSet -> Subst
- mkSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> IdSubstEnv -> Subst
- substInScope :: Subst -> InScopeSet
- zapSubstEnv :: Subst -> Subst
- extendIdSubst :: Subst -> Id -> CoreExpr -> Subst
- extendIdSubstList :: Subst -> [(Id, CoreExpr)] -> Subst
- extendTvSubst :: Subst -> TyVar -> Type -> Subst
- extendTvSubstList :: Subst -> [(TyVar, Type)] -> Subst
- extendSubst :: Subst -> Var -> CoreArg -> Subst
- extendSubstWithVar :: Subst -> Var -> Var -> Subst
- extendSubstList :: Subst -> [(Var, CoreArg)] -> Subst
- lookupIdSubst :: SDoc -> Subst -> Id -> CoreExpr
- lookupTCvSubst :: Subst -> TyVar -> Type
- delBndr :: Subst -> Var -> Subst
- delBndrs :: Subst -> [Var] -> Subst
- mkOpenSubst :: InScopeSet -> [(Var, CoreArg)] -> Subst
- isInScope :: Var -> Subst -> Bool
- addInScopeSet :: Subst -> VarSet -> Subst
- extendInScope :: Subst -> Var -> Subst
- extendInScopeList :: Subst -> [Var] -> Subst
- extendInScopeIds :: Subst -> [Id] -> Subst
- setInScope :: Subst -> InScopeSet -> Subst
- substExprSC :: SDoc -> Subst -> CoreExpr -> CoreExpr
- substExpr :: SDoc -> Subst -> CoreExpr -> CoreExpr
- substBindSC :: Subst -> CoreBind -> (Subst, CoreBind)
- substBind :: Subst -> CoreBind -> (Subst, CoreBind)
- deShadowBinds :: CoreProgram -> CoreProgram
- substBndr :: Subst -> Var -> (Subst, Var)
- substBndrs :: Subst -> [Var] -> (Subst, [Var])
- substRecBndrs :: Subst -> [Id] -> (Subst, [Id])
- cloneIdBndr :: Subst -> UniqSupply -> Id -> (Subst, Id)
- cloneIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id])
- cloneBndrs :: Subst -> UniqSupply -> [Var] -> (Subst, [Var])
- cloneBndr :: Subst -> Unique -> Var -> (Subst, Var)
- cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id])
- substTy :: Subst -> Type -> Type
- getTCvSubst :: Subst -> TCvSubst
- substCo :: Subst -> Coercion -> Coercion
- substIdInfo :: Subst -> Id -> IdInfo -> Maybe IdInfo
- substUnfoldingSC :: Subst -> Unfolding -> Unfolding
- substUnfolding :: Subst -> Unfolding -> Unfolding
- substIdOcc :: Subst -> Id -> Id
- substSpec :: Subst -> Id -> RuleInfo -> RuleInfo
- substRulesForImportedIds :: Subst -> [CoreRule] -> [CoreRule]
- substDVarSet :: Subst -> DVarSet -> DVarSet
- substTickish :: Subst -> Tickish Id -> Tickish Id
- module Rules
- module Annotations
- module DynFlags
- module Packages
- module Module
- type ThetaType = [PredType]
- type Kind = Type
- type PredType = Type
- data TyCoBinder
- data TCvSubst = TCvSubst InScopeSet TvSubstEnv CvSubstEnv
- data TyThing
- data Type
- isRuntimeRepTy :: Type -> Bool
- pprType :: Type -> SDoc
- pprKind :: Kind -> SDoc
- newtype PprPrec = PprPrec Int
- topPrec :: PprPrec
- sigPrec :: PprPrec
- funPrec :: PprPrec
- opPrec :: PprPrec
- appPrec :: PprPrec
- maybeParen :: PprPrec -> PprPrec -> SDoc -> SDoc
- type TyVarBinder = VarBndr TyVar ArgFlag
- type TyCoVarBinder = VarBndr TyCoVar ArgFlag
- data ArgFlag
- data Var
- type TyCoVar = Id
- type TyVar = Var
- isVisibleArgFlag :: ArgFlag -> Bool
- isInvisibleArgFlag :: ArgFlag -> Bool
- sameVis :: ArgFlag -> ArgFlag -> Bool
- binderVar :: VarBndr tv argf -> tv
- binderVars :: [VarBndr tv argf] -> [tv]
- binderArgFlag :: VarBndr tv argf -> argf
- binderType :: VarBndr TyCoVar argf -> Type
- mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder
- mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder]
- mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder]
- tyVarKind :: TyVar -> Kind
- isTyVar :: Var -> Bool
- liftedTypeKind :: Kind
- splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- scopedSort :: [TyCoVar] -> [TyCoVar]
- tyCoVarsOfTypeWellScoped :: Type -> [TyVar]
- tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar]
- tcView :: Type -> Maybe Type
- coreView :: Type -> Maybe Type
- eqType :: Type -> Type -> Bool
- piResultTy :: HasDebugCallStack => Type -> Type -> Type
- mkCastTy :: Type -> Coercion -> Type
- mkAppTy :: Type -> Type -> Type
- isCoercionTy :: Type -> Bool
- isPredTy :: Type -> Bool
- type TvSubstEnv = TyVarEnv Type
- type KnotTied ty = ty
- type KindOrType = Type
- pprShortTyThing :: TyThing -> SDoc
- pprTyThingCategory :: TyThing -> SDoc
- isInvisibleBinder :: TyCoBinder -> Bool
- isVisibleBinder :: TyCoBinder -> Bool
- isNamedBinder :: TyCoBinder -> Bool
- mkTyVarTy :: TyVar -> Type
- mkTyVarTys :: [TyVar] -> [Type]
- mkFunTy :: Type -> Type -> Type
- mkFunTys :: [Type] -> Type -> Type
- mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type
- mkForAllTys :: [TyCoVarBinder] -> Type -> Type
- mkTyCoPiTy :: TyCoBinder -> Type -> Type
- mkTyCoPiTys :: [TyCoBinder] -> Type -> Type
- mkPiTys :: [TyCoBinder] -> Type -> Type
- mkTyConTy :: TyCon -> Type
- kindRep :: HasDebugCallStack => Kind -> Type
- kindRep_maybe :: HasDebugCallStack => Kind -> Maybe Type
- isRuntimeRepVar :: TyVar -> Bool
- tyCoVarsOfType :: Type -> TyCoVarSet
- tyCoVarsOfTypes :: [Type] -> TyCoVarSet
- tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet
- tyCoFVsOfType :: Type -> FV
- tyCoFVsBndr :: TyCoVarBinder -> FV -> FV
- tyCoFVsVarBndrs :: [Var] -> FV -> FV
- tyCoFVsVarBndr :: Var -> FV -> FV
- coVarsOfType :: Type -> CoVarSet
- coVarsOfTypes :: [Type] -> TyCoVarSet
- noFreeVarsOfType :: Type -> Bool
- emptyTvSubstEnv :: TvSubstEnv
- composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv)
- composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- emptyTCvSubst :: TCvSubst
- mkEmptyTCvSubst :: InScopeSet -> TCvSubst
- isEmptyTCvSubst :: TCvSubst -> Bool
- mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst
- getTvSubstEnv :: TCvSubst -> TvSubstEnv
- getTCvInScope :: TCvSubst -> InScopeSet
- getTCvSubstRangeFVs :: TCvSubst -> VarSet
- notElemTCvSubst :: Var -> TCvSubst -> Bool
- setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst
- zapTCvSubst :: TCvSubst -> TCvSubst
- extendTCvInScope :: TCvSubst -> Var -> TCvSubst
- extendTCvInScopeList :: TCvSubst -> [Var] -> TCvSubst
- extendTCvInScopeSet :: TCvSubst -> VarSet -> TCvSubst
- extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst
- extendTCvSubstWithClone :: TCvSubst -> TyCoVar -> TyCoVar -> TCvSubst
- extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst
- extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
- extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
- extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
- extendTCvSubstList :: TCvSubst -> [Var] -> [Type] -> TCvSubst
- unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst
- zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst
- mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst
- zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv
- zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv
- substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type
- substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type
- substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion
- substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type]
- substTyAddInScope :: TCvSubst -> Type -> Type
- substTyUnchecked :: TCvSubst -> Type -> Type
- substTys :: HasCallStack => TCvSubst -> [Type] -> [Type]
- substTysUnchecked :: TCvSubst -> [Type] -> [Type]
- substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType
- substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType
- substTyVar :: TCvSubst -> TyVar -> Type
- substTyVars :: TCvSubst -> [TyVar] -> [Type]
- lookupTyVar :: TCvSubst -> TyVar -> Maybe Type
- substCoUnchecked :: TCvSubst -> Coercion -> Coercion
- substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar)
- substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar])
- substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar)
- substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar])
- cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar)
- cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar])
- pprParendType :: Type -> SDoc
- pprPrecType :: PprPrec -> Type -> SDoc
- pprParendKind :: Kind -> SDoc
- pprClassPred :: Class -> [Type] -> SDoc
- pprTheta :: ThetaType -> SDoc
- pprThetaArrowTy :: ThetaType -> SDoc
- pprSigmaType :: Type -> SDoc
- pprForAll :: [TyCoVarBinder] -> SDoc
- pprUserForAll :: [TyCoVarBinder] -> SDoc
- pprTCvBndrs :: [TyCoVarBinder] -> SDoc
- pprTCvBndr :: TyCoVarBinder -> SDoc
- pprTyVars :: [TyVar] -> SDoc
- pprTyVar :: TyVar -> SDoc
- pprTypeApp :: TyCon -> [Type] -> SDoc
- pprWithExplicitKindsWhen :: Bool -> SDoc -> SDoc
- tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyTyCoVarBinder :: TidyEnv -> VarBndr TyCoVar vis -> (TidyEnv, VarBndr TyCoVar vis)
- tidyTyCoVarBinders :: TidyEnv -> [VarBndr TyCoVar vis] -> (TidyEnv, [VarBndr TyCoVar vis])
- tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
- tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyTyCoVarOcc :: TidyEnv -> TyCoVar -> TyCoVar
- tidyTypes :: TidyEnv -> [Type] -> [Type]
- tidyType :: TidyEnv -> Type -> Type
- tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type])
- tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type)
- tidyTopType :: Type -> Type
- tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind)
- tidyKind :: TidyEnv -> Kind -> Kind
- typeSize :: Type -> Int
- funTyCon :: TyCon
- data PredTree
- data EqRel
- data TyCoMapper env m = TyCoMapper {}
- expandTypeSynonyms :: Type -> Type
- mapType :: Monad m => TyCoMapper env m -> env -> Type -> m Type
- mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion
- getTyVar :: String -> Type -> TyVar
- isTyVarTy :: Type -> Bool
- getTyVar_maybe :: Type -> Maybe TyVar
- getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN)
- repGetTyVar_maybe :: Type -> Maybe TyVar
- mkAppTys :: Type -> [Type] -> Type
- splitAppTy_maybe :: Type -> Maybe (Type, Type)
- repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type)
- tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type)
- tcRepSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])
- tcRepSplitTyConApp :: HasCallStack => Type -> (TyCon, [Type])
- splitAppTy :: Type -> (Type, Type)
- splitAppTys :: Type -> (Type, [Type])
- repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type])
- mkNumLitTy :: Integer -> Type
- isNumLitTy :: Type -> Maybe Integer
- mkStrLitTy :: FastString -> Type
- isStrLitTy :: Type -> Maybe FastString
- isLitTy :: Type -> Maybe TyLit
- userTypeError_maybe :: Type -> Maybe Type
- pprUserTypeErrorTy :: Type -> SDoc
- isFunTy :: Type -> Bool
- splitFunTy :: Type -> (Type, Type)
- splitFunTy_maybe :: Type -> Maybe (Type, Type)
- splitFunTys :: Type -> ([Type], Type)
- funResultTy :: Type -> Type
- funArgTy :: Type -> Type
- piResultTys :: HasDebugCallStack => Type -> [Type] -> Type
- applyTysX :: [TyVar] -> Type -> [Type] -> Type
- mkTyConApp :: TyCon -> [Type] -> Type
- tyConAppTyConPicky_maybe :: Type -> Maybe TyCon
- tyConAppTyCon_maybe :: Type -> Maybe TyCon
- tyConAppTyCon :: Type -> TyCon
- tyConAppArgs_maybe :: Type -> Maybe [Type]
- tyConAppArgs :: Type -> [Type]
- tyConAppArgN :: Int -> Type -> Type
- splitTyConApp :: Type -> (TyCon, [Type])
- repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- splitListTyConApp_maybe :: Type -> Maybe Type
- nextRole :: Type -> Role
- newTyConInstRhs :: TyCon -> [Type] -> Type
- splitCastTy_maybe :: Type -> Maybe (Type, Coercion)
- tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder]
- mkCoercionTy :: Coercion -> Type
- isCoercionTy_maybe :: Type -> Maybe Coercion
- stripCoercionTy :: Type -> Coercion
- mkTyCoInvForAllTy :: TyCoVar -> Type -> Type
- mkInvForAllTy :: TyVar -> Type -> Type
- mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type
- mkInvForAllTys :: [TyVar] -> Type -> Type
- mkSpecForAllTys :: [TyVar] -> Type -> Type
- mkVisForAllTys :: [TyVar] -> Type -> Type
- mkLamType :: Var -> Type -> Type
- mkLamTypes :: [Var] -> Type -> Type
- mkTyConBindersPreferAnon :: [TyVar] -> TyCoVarSet -> [TyConBinder]
- splitForAllTys :: Type -> ([TyCoVar], Type)
- isForAllTy :: Type -> Bool
- isForAllTy_ty :: Type -> Bool
- isForAllTy_co :: Type -> Bool
- isPiTy :: Type -> Bool
- splitForAllTy :: Type -> (TyCoVar, Type)
- dropForAlls :: Type -> Type
- splitForAllTy_maybe :: Type -> Maybe (TyCoVar, Type)
- splitForAllTy_ty_maybe :: Type -> Maybe (TyCoVar, Type)
- splitForAllTy_co_maybe :: Type -> Maybe (TyCoVar, Type)
- splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type)
- splitPiTy :: Type -> (TyCoBinder, Type)
- splitPiTys :: Type -> ([TyCoBinder], Type)
- splitForAllVarBndrs :: Type -> ([TyCoVarBinder], Type)
- invisibleTyBndrCount :: Type -> Int
- splitPiTysInvisible :: Type -> ([TyCoBinder], Type)
- splitPiTysInvisibleN :: Int -> Type -> ([TyCoBinder], Type)
- filterOutInvisibleTypes :: TyCon -> [Type] -> [Type]
- filterOutInferredTypes :: TyCon -> [Type] -> [Type]
- partitionInvisibleTypes :: TyCon -> [Type] -> ([Type], [Type])
- partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a])
- tyConArgFlags :: TyCon -> [Type] -> [ArgFlag]
- appTyArgFlags :: Type -> [Type] -> [ArgFlag]
- isTauTy :: Type -> Bool
- mkAnonBinder :: Type -> TyCoBinder
- isAnonTyCoBinder :: TyCoBinder -> Bool
- tyCoBinderVar_maybe :: TyCoBinder -> Maybe TyCoVar
- tyCoBinderType :: TyCoBinder -> Type
- tyBinderType :: TyBinder -> Type
- binderRelevantType_maybe :: TyCoBinder -> Maybe Type
- caseBinder :: TyCoBinder -> (TyCoVarBinder -> a) -> (Type -> a) -> a
- tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])
- tcIsConstraintKind :: Kind -> Bool
- tcIsLiftedTypeKind :: Kind -> Bool
- tcReturnsConstraintKind :: Kind -> Bool
- isEvVarType :: Type -> Bool
- isCoVarType :: Type -> Bool
- isClassPred :: PredType -> Bool
- isEqPred :: PredType -> Bool
- isNomEqPred :: PredType -> Bool
- isIPPred :: PredType -> Bool
- isIPTyCon :: TyCon -> Bool
- isIPClass :: Class -> Bool
- isCTupleClass :: Class -> Bool
- isIPPred_maybe :: Type -> Maybe (FastString, Type)
- mkPrimEqPredRole :: Role -> Type -> Type -> PredType
- mkPrimEqPred :: Type -> Type -> Type
- mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type
- splitCoercionType_maybe :: Type -> Maybe (Type, Type)
- mkReprPrimEqPred :: Type -> Type -> Type
- equalityTyCon :: Role -> TyCon
- mkClassPred :: Class -> [Type] -> PredType
- isDictTy :: Type -> Bool
- isDictLikeTy :: Type -> Bool
- eqRelRole :: EqRel -> Role
- classifyPredType :: PredType -> PredTree
- getClassPredTys :: HasDebugCallStack => PredType -> (Class, [Type])
- getClassPredTys_maybe :: PredType -> Maybe (Class, [Type])
- getEqPredTys :: PredType -> (Type, Type)
- getEqPredTys_maybe :: PredType -> Maybe (Role, Type, Type)
- getEqPredRole :: PredType -> Role
- predTypeEqRel :: PredType -> EqRel
- dVarSetElemsWellScoped :: DVarSet -> [Var]
- tyCoVarsOfBindersWellScoped :: [TyVar] -> [TyVar]
- closeOverKinds :: TyVarSet -> TyVarSet
- closeOverKindsFV :: [TyVar] -> FV
- closeOverKindsList :: [TyVar] -> [TyVar]
- closeOverKindsDSet :: DTyVarSet -> DTyVarSet
- mkFamilyTyConApp :: TyCon -> [Type] -> Type
- coAxNthLHS :: CoAxiom br -> Int -> Type
- pprSourceTyCon :: TyCon -> SDoc
- isFamFreeTy :: Type -> Bool
- isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool
- isUnliftedType :: HasDebugCallStack => Type -> Bool
- isRuntimeRepKindedTy :: Type -> Bool
- dropRuntimeRepArgs :: [Type] -> [Type]
- getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type
- getRuntimeRep :: HasDebugCallStack => Type -> Type
- isUnboxedTupleType :: Type -> Bool
- isUnboxedSumType :: Type -> Bool
- isAlgType :: Type -> Bool
- isDataFamilyAppType :: Type -> Bool
- isStrictType :: HasDebugCallStack => Type -> Bool
- isPrimitiveType :: Type -> Bool
- isValidJoinPointType :: JoinArity -> Type -> Bool
- seqType :: Type -> ()
- seqTypes :: [Type] -> ()
- eqTypeX :: RnEnv2 -> Type -> Type -> Bool
- eqTypes :: [Type] -> [Type] -> Bool
- eqVarBndrs :: RnEnv2 -> [Var] -> [Var] -> Maybe RnEnv2
- nonDetCmpType :: Type -> Type -> Ordering
- nonDetCmpTypes :: [Type] -> [Type] -> Ordering
- nonDetCmpTypeX :: RnEnv2 -> Type -> Type -> Ordering
- nonDetCmpTypesX :: RnEnv2 -> [Type] -> [Type] -> Ordering
- nonDetCmpTc :: TyCon -> TyCon -> Ordering
- typeKind :: HasDebugCallStack => Type -> Kind
- tcTypeKind :: HasDebugCallStack => Type -> Kind
- isTypeLevPoly :: Type -> Bool
- resultIsLevPoly :: Type -> Bool
- occCheckExpand :: [Var] -> Type -> Maybe Type
- tyConsOfType :: Type -> UniqSet TyCon
- synTyConResKind :: TyCon -> Kind
- splitVisVarsOfType :: Type -> Pair TyCoVarSet
- splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet
- modifyJoinResTy :: Int -> (Type -> Type) -> Type -> Type
- setJoinResTy :: Int -> Type -> Type -> Type
- pprWithTYPE :: Type -> SDoc
- module TyCon
- type CoercionN = Coercion
- data MCoercion
- data UnivCoProvenance
- data Coercion
- data LeftOrRight
- pickLR :: LeftOrRight -> (a, a) -> a
- data Var
- type TyCoVar = Id
- type CoVar = Id
- mkCoVar :: Name -> Type -> CoVar
- isCoVar :: Var -> Bool
- data Role
- data LiftingContext = LC TCvSubst LiftCoEnv
- coercionType :: Coercion -> Type
- coercionKind :: Coercion -> Pair Type
- seqCo :: Coercion -> ()
- liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion
- mkCoercionType :: Role -> Type -> Type -> Type
- coVarRole :: CoVar -> Role
- coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind, Kind, Type, Type, Role)
- decomposePiCos :: HasDebugCallStack => CoercionN -> Pair Type -> [Type] -> ([CoercionN], CoercionN)
- isReflexiveCo :: Coercion -> Bool
- isReflCo :: Coercion -> Bool
- isGReflCo :: Coercion -> Bool
- mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion
- mkProofIrrelCo :: Role -> Coercion -> Coercion -> Coercion -> Coercion
- mkSubCo :: Coercion -> Coercion
- mkKindCo :: Coercion -> Coercion
- mkNomReflCo :: Type -> Coercion
- mkGReflCo :: Role -> Type -> MCoercionN -> Coercion
- mkInstCo :: Coercion -> Coercion -> Coercion
- mkLRCo :: LeftOrRight -> Coercion -> Coercion
- mkNthCo :: HasDebugCallStack => Role -> Int -> Coercion -> Coercion
- mkTransCo :: Coercion -> Coercion -> Coercion
- mkSymCo :: Coercion -> Coercion
- mkUnivCo :: UnivCoProvenance -> Role -> Type -> Type -> Coercion
- mkUnsafeCo :: Role -> Type -> Type -> Coercion
- mkPhantomCo :: Coercion -> Type -> Type -> Coercion
- mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion
- mkCoVarCo :: CoVar -> Coercion
- mkFunCo :: Role -> Coercion -> Coercion -> Coercion
- mkForAllCo :: TyCoVar -> CoercionN -> Coercion -> Coercion
- mkAppCo :: Coercion -> Coercion -> Coercion
- mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion
- mkReflCo :: Role -> Type -> Coercion
- type CvSubstEnv = CoVarEnv Coercion
- data CoercionHole = CoercionHole {}
- type MCoercionR = MCoercion
- type CoercionP = Coercion
- type CoercionR = Coercion
- coHoleCoVar :: CoercionHole -> CoVar
- setCoHoleCoVar :: CoercionHole -> CoVar -> CoercionHole
- tyCoVarsOfCo :: Coercion -> TyCoVarSet
- tyCoVarsOfCos :: [Coercion] -> TyCoVarSet
- tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet
- tyCoFVsOfCo :: Coercion -> FV
- tyCoFVsOfCos :: [Coercion] -> FV
- coVarsOfCo :: Coercion -> CoVarSet
- emptyCvSubstEnv :: CvSubstEnv
- getCvSubstEnv :: TCvSubst -> CvSubstEnv
- extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
- substCoWith :: HasCallStack => [TyVar] -> [Type] -> Coercion -> Coercion
- substCos :: HasCallStack => TCvSubst -> [Coercion] -> [Coercion]
- substCoVar :: TCvSubst -> CoVar -> Coercion
- substCoVars :: TCvSubst -> [CoVar] -> [Coercion]
- lookupCoVar :: TCvSubst -> Var -> Maybe Coercion
- substCoVarBndr :: HasCallStack => TCvSubst -> CoVar -> (TCvSubst, CoVar)
- pprCo :: Coercion -> SDoc
- pprParendCo :: Coercion -> SDoc
- tidyCo :: TidyEnv -> Coercion -> Coercion
- tidyCos :: TidyEnv -> [Coercion] -> [Coercion]
- coercionSize :: Coercion -> Int
- type LiftCoEnv = VarEnv Coercion
- data NormaliseStepResult ev
- = NS_Done
- | NS_Abort
- | NS_Step RecTcChecker Type ev
- type NormaliseStepper ev = RecTcChecker -> TyCon -> [Type] -> NormaliseStepResult ev
- coVarName :: CoVar -> Name
- setCoVarUnique :: CoVar -> Unique -> CoVar
- setCoVarName :: CoVar -> Name -> CoVar
- etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type)
- pprCoAxiom :: CoAxiom br -> SDoc
- pprCoAxBranchUser :: TyCon -> CoAxBranch -> SDoc
- pprCoAxBranchLHS :: TyCon -> CoAxBranch -> SDoc
- pprCoAxBranch :: TyCon -> CoAxBranch -> SDoc
- tidyCoAxBndrsForUser :: TidyEnv -> [Var] -> (TidyEnv, [Var])
- decomposeCo :: Arity -> Coercion -> [Role] -> [Coercion]
- decomposeFunCo :: HasDebugCallStack => Role -> Coercion -> (Coercion, Coercion)
- getCoVar_maybe :: Coercion -> Maybe CoVar
- splitTyConAppCo_maybe :: Coercion -> Maybe (TyCon, [Coercion])
- splitAppCo_maybe :: Coercion -> Maybe (Coercion, Coercion)
- splitFunCo_maybe :: Coercion -> Maybe (Coercion, Coercion)
- splitForAllCo_maybe :: Coercion -> Maybe (TyCoVar, Coercion, Coercion)
- splitForAllCo_ty_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion)
- splitForAllCo_co_maybe :: Coercion -> Maybe (CoVar, Coercion, Coercion)
- coVarTypes :: HasDebugCallStack => CoVar -> Pair Type
- coVarKind :: CoVar -> Type
- mkHeteroCoercionType :: Role -> Kind -> Kind -> Type -> Type -> Type
- isReflCoVar_maybe :: Var -> Maybe Coercion
- isGReflCo_maybe :: Coercion -> Maybe (Type, Role)
- isReflCo_maybe :: Coercion -> Maybe (Type, Role)
- isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role)
- mkRepReflCo :: Type -> Coercion
- mkAppCos :: Coercion -> [Coercion] -> Coercion
- mkForAllCos :: [(TyCoVar, CoercionN)] -> Coercion -> Coercion
- mkHomoForAllCos :: [TyCoVar] -> Coercion -> Coercion
- mkCoVarCos :: [CoVar] -> [Coercion]
- isCoVar_maybe :: Coercion -> Maybe CoVar
- mkAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Coercion
- mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched -> [Type] -> [Coercion] -> Coercion
- mkAxInstRHS :: CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type
- mkUnbranchedAxInstRHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
- mkAxInstLHS :: CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type
- mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
- mkHoleCo :: CoercionHole -> Coercion
- mkTransMCo :: MCoercion -> MCoercion -> MCoercion
- nthCoRole :: Int -> Coercion -> Role
- mkGReflRightCo :: Role -> Type -> CoercionN -> Coercion
- mkGReflLeftCo :: Role -> Type -> CoercionN -> Coercion
- mkCoherenceLeftCo :: Role -> Type -> CoercionN -> Coercion -> Coercion
- mkCoherenceRightCo :: Role -> Type -> CoercionN -> Coercion -> Coercion
- downgradeRole :: Role -> Role -> Coercion -> Coercion
- maybeSubCo :: EqRel -> Coercion -> Coercion
- setNominalRole_maybe :: Role -> Coercion -> Maybe Coercion
- tyConRolesX :: Role -> TyCon -> [Role]
- tyConRolesRepresentational :: TyCon -> [Role]
- nthRole :: Role -> TyCon -> Int -> Role
- ltRole :: Role -> Role -> Bool
- promoteCoercion :: Coercion -> CoercionN
- castCoercionKind :: Coercion -> Role -> Type -> Type -> CoercionN -> CoercionN -> Coercion
- castCoercionKindI :: Coercion -> CoercionN -> CoercionN -> Coercion
- mkPiCos :: Role -> [Var] -> Coercion -> Coercion
- mkPiCo :: Role -> Var -> Coercion -> Coercion
- mkCoCast :: Coercion -> CoercionR -> Coercion
- instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion)
- mapStepResult :: (ev1 -> ev2) -> NormaliseStepResult ev1 -> NormaliseStepResult ev2
- composeSteppers :: NormaliseStepper ev -> NormaliseStepper ev -> NormaliseStepper ev
- unwrapNewTypeStepper :: NormaliseStepper Coercion
- topNormaliseTypeX :: NormaliseStepper ev -> (ev -> ev -> ev) -> Type -> Maybe (ev, Type)
- topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type)
- eqCoercion :: Coercion -> Coercion -> Bool
- eqCoercionX :: RnEnv2 -> Coercion -> Coercion -> Bool
- liftCoSubstWithEx :: Role -> [TyVar] -> [Coercion] -> [TyCoVar] -> [Type] -> (Type -> Coercion, [Type])
- liftCoSubstWith :: Role -> [TyCoVar] -> [Coercion] -> Type -> Coercion
- emptyLiftingContext :: InScopeSet -> LiftingContext
- mkSubstLiftingContext :: TCvSubst -> LiftingContext
- extendLiftingContext :: LiftingContext -> TyCoVar -> Coercion -> LiftingContext
- extendLiftingContextAndInScope :: LiftingContext -> TyCoVar -> Coercion -> LiftingContext
- zapLiftingContext :: LiftingContext -> LiftingContext
- substForAllCoBndrUsingLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyCoVar -> Coercion -> (LiftingContext, TyCoVar, Coercion)
- liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion
- liftCoSubstVarBndrUsing :: (LiftingContext -> Type -> (CoercionN, a)) -> LiftingContext -> TyCoVar -> (LiftingContext, TyCoVar, CoercionN, a)
- isMappedByLC :: TyCoVar -> LiftingContext -> Bool
- substLeftCo :: LiftingContext -> Coercion -> Coercion
- substRightCo :: LiftingContext -> Coercion -> Coercion
- swapLiftCoEnv :: LiftCoEnv -> LiftCoEnv
- lcSubstLeft :: LiftingContext -> TCvSubst
- lcSubstRight :: LiftingContext -> TCvSubst
- liftEnvSubstLeft :: TCvSubst -> LiftCoEnv -> TCvSubst
- liftEnvSubstRight :: TCvSubst -> LiftCoEnv -> TCvSubst
- lcTCvSubst :: LiftingContext -> TCvSubst
- lcInScopeSet :: LiftingContext -> InScopeSet
- coercionKinds :: [Coercion] -> Pair [Type]
- coercionKindRole :: Coercion -> (Pair Type, Role)
- coercionRole :: Coercion -> Role
- buildCoercion :: Type -> Type -> CoercionN
- simplifyArgsWorker :: [TyCoBinder] -> Kind -> TyCoVarSet -> [Role] -> [(Type, Coercion)] -> ([Type], [Coercion], CoercionN)
- module TysWiredIn
- module HscTypes
- data SpliceExplicitFlag
- data IntWithInf
- data FractionalLit = FL {}
- data IntegralLit = IL {}
- data InlineSpec
- data InlinePragma = InlinePragma {}
- data RuleMatchInfo
- data Activation
- data CompilerPhase
- type PhaseNum = Int
- data SourceText
- data SuccessFlag
- data DefMethSpec ty
- data TailCallInfo
- type OneBranch = Bool
- type InsideLam = Bool
- type InterestingCxt = Bool
- data OccInfo
- = ManyOccs {
- occ_tail :: !TailCallInfo
- | IAmDead
- | OneOcc { }
- | IAmALoopBreaker {
- occ_rules_only :: !RulesOnly
- occ_tail :: !TailCallInfo
- = ManyOccs {
- data EP a = EP {}
- data TupleSort
- newtype PprPrec = PprPrec Int
- data OverlapMode
- data OverlapFlag = OverlapFlag {}
- data Origin
- data RecFlag
- data Boxity
- data TopLevelFlag
- data LexicalFixity
- data FixityDirection
- data Fixity = Fixity SourceText Int FixityDirection
- type RuleName = FastString
- data WarningTxt
- data StringLiteral = StringLiteral {
- sl_st :: SourceText
- sl_fs :: FastString
- data FunctionOrData
- = IsFunction
- | IsData
- data PromotionFlag
- data SwapFlag
- data OneShotInfo
- type Alignment = Int
- type ConTagZ = Int
- type ConTag = Int
- type JoinArity = Int
- type RepArity = Int
- type Arity = Int
- data LeftOrRight
- pickLR :: LeftOrRight -> (a, a) -> a
- fIRST_TAG :: ConTag
- noOneShotInfo :: OneShotInfo
- isOneShotInfo :: OneShotInfo -> Bool
- hasNoOneShotInfo :: OneShotInfo -> Bool
- worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
- bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo
- flipSwap :: SwapFlag -> SwapFlag
- isSwapped :: SwapFlag -> Bool
- unSwap :: SwapFlag -> (a -> a -> b) -> a -> a -> b
- isPromoted :: PromotionFlag -> Bool
- bumpVersion :: Version -> Version
- initialVersion :: Version
- pprWarningTxtForMsg :: WarningTxt -> SDoc
- pprRuleName :: RuleName -> SDoc
- maxPrecedence :: Int
- minPrecedence :: Int
- defaultFixity :: Fixity
- negateFixity :: Fixity
- funTyFixity :: Fixity
- compareFixity :: Fixity -> Fixity -> (Bool, Bool)
- isNotTopLevel :: TopLevelFlag -> Bool
- isTopLevel :: TopLevelFlag -> Bool
- isBoxed :: Boxity -> Bool
- isRec :: RecFlag -> Bool
- isNonRec :: RecFlag -> Bool
- boolToRecFlag :: Bool -> RecFlag
- isGenerated :: Origin -> Bool
- setOverlapModeMaybe :: OverlapFlag -> Maybe OverlapMode -> OverlapFlag
- hasIncoherentFlag :: OverlapMode -> Bool
- hasOverlappableFlag :: OverlapMode -> Bool
- hasOverlappingFlag :: OverlapMode -> Bool
- topPrec :: PprPrec
- sigPrec :: PprPrec
- funPrec :: PprPrec
- opPrec :: PprPrec
- appPrec :: PprPrec
- maybeParen :: PprPrec -> PprPrec -> SDoc -> SDoc
- tupleSortBoxity :: TupleSort -> Boxity
- boxityTupleSort :: Boxity -> TupleSort
- tupleParens :: TupleSort -> SDoc -> SDoc
- sumParens :: SDoc -> SDoc
- pprAlternative :: (a -> SDoc) -> a -> ConTag -> Arity -> SDoc
- noOccInfo :: OccInfo
- isManyOccs :: OccInfo -> Bool
- seqOccInfo :: OccInfo -> ()
- insideLam :: InsideLam
- notInsideLam :: InsideLam
- oneBranch :: OneBranch
- notOneBranch :: OneBranch
- tailCallInfo :: OccInfo -> TailCallInfo
- zapOccTailCallInfo :: OccInfo -> OccInfo
- isAlwaysTailCalled :: OccInfo -> Bool
- strongLoopBreaker :: OccInfo
- weakLoopBreaker :: OccInfo
- isWeakLoopBreaker :: OccInfo -> Bool
- isStrongLoopBreaker :: OccInfo -> Bool
- isDeadOcc :: OccInfo -> Bool
- isOneOcc :: OccInfo -> Bool
- zapFragileOcc :: OccInfo -> OccInfo
- successIf :: Bool -> SuccessFlag
- succeeded :: SuccessFlag -> Bool
- failed :: SuccessFlag -> Bool
- pprWithSourceText :: SourceText -> SDoc -> SDoc
- activeAfterInitial :: Activation
- activeDuringFinal :: Activation
- isConLike :: RuleMatchInfo -> Bool
- isFunLike :: RuleMatchInfo -> Bool
- noUserInlineSpec :: InlineSpec -> Bool
- defaultInlinePragma :: InlinePragma
- alwaysInlinePragma :: InlinePragma
- neverInlinePragma :: InlinePragma
- inlinePragmaSpec :: InlinePragma -> InlineSpec
- dfunInlinePragma :: InlinePragma
- isDefaultInlinePragma :: InlinePragma -> Bool
- isInlinePragma :: InlinePragma -> Bool
- isInlinablePragma :: InlinePragma -> Bool
- isAnyInlinePragma :: InlinePragma -> Bool
- inlinePragmaSat :: InlinePragma -> Maybe Arity
- inlinePragmaActivation :: InlinePragma -> Activation
- inlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo
- setInlinePragmaActivation :: InlinePragma -> Activation -> InlinePragma
- setInlinePragmaRuleMatchInfo :: InlinePragma -> RuleMatchInfo -> InlinePragma
- pprInline :: InlinePragma -> SDoc
- pprInlineDebug :: InlinePragma -> SDoc
- isActive :: CompilerPhase -> Activation -> Bool
- isActiveIn :: PhaseNum -> Activation -> Bool
- competesWith :: Activation -> Activation -> Bool
- isNeverActive :: Activation -> Bool
- isAlwaysActive :: Activation -> Bool
- isEarlyActive :: Activation -> Bool
- mkIntegralLit :: Integral a => a -> IntegralLit
- negateIntegralLit :: IntegralLit -> IntegralLit
- mkFractionalLit :: Real a => a -> FractionalLit
- negateFractionalLit :: FractionalLit -> FractionalLit
- integralFractionalLit :: Bool -> Integer -> FractionalLit
- infinity :: IntWithInf
- intGtLimit :: Int -> IntWithInf -> Bool
- treatZeroAsInf :: Int -> IntWithInf
- mkIntWithInf :: Int -> IntWithInf
- 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
- class Uniquable a where
- data Unique
- module FastString
- thNameToGhcName :: Name -> CoreM (Maybe Name)
Documentation
module Plugins
module RdrName
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 Source # | |
Data OccName Source # | |
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 Source # | |
NFData OccName Source # | |
OutputableBndr OccName Source # | |
Outputable OccName Source # | |
Uniquable OccName Source # | |
Binary OccName Source # | |
HasOccName OccName Source # | |
type FastStringEnv a = UniqFM a Source #
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.
emptyFsEnv :: FastStringEnv a Source #
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a Source #
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a Source #
mkFsEnv :: [(FastString, a)] -> FastStringEnv a Source #
type TidyOccEnv = UniqFM Int Source #
Instances
Data a => Data (OccEnv a) Source # | |
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) Source # | |
class HasOccName name where Source #
Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.
Instances
isDataConNameSpace :: NameSpace -> Bool Source #
isTcClsNameSpace :: NameSpace -> Bool Source #
isTvNameSpace :: NameSpace -> Bool Source #
isVarNameSpace :: NameSpace -> Bool Source #
isValNameSpace :: NameSpace -> Bool Source #
pprNameSpace :: NameSpace -> SDoc Source #
pprNonVarNameSpace :: NameSpace -> SDoc Source #
pprNameSpaceBrief :: NameSpace -> SDoc Source #
pprOccName :: OccName -> SDoc Source #
mkOccNameFS :: NameSpace -> FastString -> OccName Source #
mkVarOccFS :: FastString -> OccName Source #
mkDataOccFS :: FastString -> OccName Source #
mkTyVarOcc :: String -> OccName Source #
mkTyVarOccFS :: FastString -> OccName Source #
mkTcOccFS :: FastString -> OccName Source #
mkClsOccFS :: FastString -> OccName Source #
emptyOccEnv :: OccEnv a Source #
unitOccEnv :: OccName -> a -> OccEnv a Source #
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #
occEnvElts :: OccEnv a -> [a] Source #
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a Source #
emptyOccSet :: OccSet Source #
unitOccSet :: OccName -> OccSet Source #
unionManyOccSets :: [OccSet] -> OccSet Source #
isEmptyOccSet :: OccSet -> Bool Source #
occNameString :: OccName -> String Source #
isValOcc :: OccName -> Bool Source #
Value OccNames
s are those that are either in
the variable or data constructor namespaces
isDataSymOcc :: OccName -> Bool Source #
Test if the OccName
is a data constructor that starts with
a symbol (e.g. :
, or []
)
isSymOcc :: OccName -> Bool Source #
Test if the OccName
is that for any operator (whether
it is a data constructor or variable or whatever)
startsWithUnderscore :: OccName -> Bool Source #
Haskell 98 encourages compilers to suppress warnings about unsed
names in a pattern if they start with _
: this implements that test
isDerivedOccName :: OccName -> Bool Source #
Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints
isDefaultMethodOcc :: OccName -> Bool Source #
isTypeableBindOcc :: OccName -> Bool Source #
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.
mkDataConWrapperOcc :: OccName -> OccName Source #
mkWorkerOcc :: OccName -> OccName Source #
mkMatcherOcc :: OccName -> OccName Source #
mkBuilderOcc :: OccName -> OccName Source #
mkDefaultMethodOcc :: OccName -> OccName Source #
mkClassOpAuxOcc :: OccName -> OccName Source #
mkForeignExportOcc :: OccName -> OccName Source #
mkRepEqOcc :: OccName -> OccName Source #
mkClassDataConOcc :: OccName -> OccName Source #
mkNewTyCoOcc :: OccName -> OccName Source #
mkInstTyCoOcc :: OccName -> OccName Source #
mkEqPredCoOcc :: OccName -> OccName Source #
mkCon2TagOcc :: OccName -> OccName Source #
mkTag2ConOcc :: OccName -> OccName Source #
mkMaxTagOcc :: OccName -> OccName Source #
mkTyConRepOcc :: OccName -> OccName Source #
mkRecFldSelOcc :: String -> OccName Source #
mkDataConWorkerOcc :: OccName -> OccName Source #
Derive a name for the representation type constructor of a
data
/newtype
instance.
mkMethodOcc :: OccName -> OccName Source #
initTidyOccEnv :: [OccName] -> TidyOccEnv Source #
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv Source #
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) Source #
A unique, unambiguous name for something, containing information about where that thing originated.
Instances
Eq Name Source # | |
Data Name Source # | |
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 Source # | Caution: This instance is implemented via See |
NFData Name Source # | |
OutputableBndr Name Source # | |
Outputable Name Source # | |
HasSrcSpan Name Source # | |
Defined in Name composeSrcSpan :: Located (SrcSpanLess Name) -> Name Source # decomposeSrcSpan :: Name -> Located (SrcSpanLess Name) Source # | |
Uniquable Name Source # | |
Binary Name Source # | Assumes that the |
HasOccName Name Source # | |
NamedThing Name Source # | |
type SrcSpanLess Name Source # | |
Defined in Name |
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 Source # | |
Data OccName Source # | |
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 Source # | |
NFData OccName Source # | |
OutputableBndr OccName Source # | |
Outputable OccName Source # | |
Uniquable OccName Source # | |
Binary OccName Source # | |
HasOccName OccName Source # | |
type FastStringEnv a = UniqFM a Source #
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.
emptyFsEnv :: FastStringEnv a Source #
extendFsEnv :: FastStringEnv a -> FastString -> a -> FastStringEnv a Source #
lookupFsEnv :: FastStringEnv a -> FastString -> Maybe a Source #
mkFsEnv :: [(FastString, a)] -> FastStringEnv a Source #
type TidyOccEnv = UniqFM Int Source #
Instances
Data a => Data (OccEnv a) Source # | |
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) Source # | |
class HasOccName name where Source #
Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.
Instances
isDataConNameSpace :: NameSpace -> Bool Source #
isTcClsNameSpace :: NameSpace -> Bool Source #
isTvNameSpace :: NameSpace -> Bool Source #
isVarNameSpace :: NameSpace -> Bool Source #
isValNameSpace :: NameSpace -> Bool Source #
pprNameSpace :: NameSpace -> SDoc Source #
pprNonVarNameSpace :: NameSpace -> SDoc Source #
pprNameSpaceBrief :: NameSpace -> SDoc Source #
pprOccName :: OccName -> SDoc Source #
mkOccNameFS :: NameSpace -> FastString -> OccName Source #
mkVarOccFS :: FastString -> OccName Source #
mkDataOccFS :: FastString -> OccName Source #
mkTyVarOcc :: String -> OccName Source #
mkTyVarOccFS :: FastString -> OccName Source #
mkTcOccFS :: FastString -> OccName Source #
mkClsOccFS :: FastString -> OccName Source #
emptyOccEnv :: OccEnv a Source #
unitOccEnv :: OccName -> a -> OccEnv a Source #
foldOccEnv :: (a -> b -> b) -> b -> OccEnv a -> b Source #
occEnvElts :: OccEnv a -> [a] Source #
mkOccEnv_C :: (a -> a -> a) -> [(OccName, a)] -> OccEnv a Source #
emptyOccSet :: OccSet Source #
unitOccSet :: OccName -> OccSet Source #
unionManyOccSets :: [OccSet] -> OccSet Source #
isEmptyOccSet :: OccSet -> Bool Source #
occNameString :: OccName -> String Source #
isValOcc :: OccName -> Bool Source #
Value OccNames
s are those that are either in
the variable or data constructor namespaces
isDataSymOcc :: OccName -> Bool Source #
Test if the OccName
is a data constructor that starts with
a symbol (e.g. :
, or []
)
isSymOcc :: OccName -> Bool Source #
Test if the OccName
is that for any operator (whether
it is a data constructor or variable or whatever)
startsWithUnderscore :: OccName -> Bool Source #
Haskell 98 encourages compilers to suppress warnings about unsed
names in a pattern if they start with _
: this implements that test
isDerivedOccName :: OccName -> Bool Source #
Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints
isDefaultMethodOcc :: OccName -> Bool Source #
isTypeableBindOcc :: OccName -> Bool Source #
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.
mkDataConWrapperOcc :: OccName -> OccName Source #
mkWorkerOcc :: OccName -> OccName Source #
mkMatcherOcc :: OccName -> OccName Source #
mkBuilderOcc :: OccName -> OccName Source #
mkDefaultMethodOcc :: OccName -> OccName Source #
mkClassOpAuxOcc :: OccName -> OccName Source #
mkForeignExportOcc :: OccName -> OccName Source #
mkRepEqOcc :: OccName -> OccName Source #
mkClassDataConOcc :: OccName -> OccName Source #
mkNewTyCoOcc :: OccName -> OccName Source #
mkInstTyCoOcc :: OccName -> OccName Source #
mkEqPredCoOcc :: OccName -> OccName Source #
mkCon2TagOcc :: OccName -> OccName Source #
mkTag2ConOcc :: OccName -> OccName Source #
mkMaxTagOcc :: OccName -> OccName Source #
mkTyConRepOcc :: OccName -> OccName Source #
mkRecFldSelOcc :: String -> OccName Source #
mkDataConWorkerOcc :: OccName -> OccName Source #
Derive a name for the representation type constructor of a
data
/newtype
instance.
mkMethodOcc :: OccName -> OccName Source #
initTidyOccEnv :: [OccName] -> TidyOccEnv Source #
avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv Source #
tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) Source #
class NamedThing a where Source #
A class allowing convenient access to the Name
of various datatypes
Instances
NamedThing Name Source # | |
NamedThing TyCon Source # | |
NamedThing TyThing Source # | |
NamedThing Var Source # | |
NamedThing PatSyn Source # | |
NamedThing DataCon Source # | |
NamedThing ConLike Source # | |
NamedThing Class Source # | |
NamedThing IfaceConDecl Source # | |
Defined in IfaceSyn getOccName :: IfaceConDecl -> OccName Source # getName :: IfaceConDecl -> Name Source # | |
NamedThing IfaceClassOp Source # | |
Defined in IfaceSyn getOccName :: IfaceClassOp -> OccName Source # getName :: IfaceClassOp -> Name Source # | |
NamedThing IfaceDecl Source # | |
NamedThing FamInst Source # | |
NamedThing ClsInst Source # | |
NamedThing e => NamedThing (Located e) Source # | |
NamedThing (CoAxiom br) Source # | |
NamedThing tv => NamedThing (VarBndr tv flag) Source # | |
data BuiltInSyntax Source #
BuiltInSyntax is for things like (:)
, []
and tuples,
which have special syntactic forms. They aren't in scope
as such.
nameUnique :: Name -> Unique Source #
nameOccName :: Name -> OccName Source #
nameSrcLoc :: Name -> SrcLoc Source #
nameSrcSpan :: Name -> SrcSpan Source #
isWiredInName :: Name -> Bool Source #
isBuiltInSyntax :: Name -> Bool Source #
isExternalName :: Name -> Bool Source #
isInternalName :: Name -> Bool Source #
isHoleName :: Name -> Bool Source #
nameModule :: HasDebugCallStack => Name -> Module Source #
nameIsLocalOrFrom :: Module -> Name -> Bool Source #
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
nameIsFromExternalPackage :: UnitId -> Name -> Bool Source #
Returns True if the Name comes from some other package: neither this package nor the interactive package.
isTyVarName :: Name -> Bool Source #
isTyConName :: Name -> Bool Source #
isDataConName :: Name -> Bool Source #
isSystemName :: Name -> Bool Source #
mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name Source #
Create a name which definitely originates in the given module
mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name Source #
Create a name which is actually defined by the compiler itself
mkSystemVarName :: Unique -> FastString -> Name Source #
mkSysTvName :: Unique -> FastString -> Name Source #
localiseName :: Name -> Name Source #
Make the Name
into an internal name, regardless of what it was to begin with
stableNameCmp :: Name -> Name -> Ordering Source #
Compare Names lexicographically This only works for Names that originate in the source code or have been tidied.
pprNameUnqualified :: Name -> SDoc Source #
Print the string of Name unqualifiedly directly.
pprDefinedAt :: Name -> SDoc Source #
pprNameDefnLoc :: Name -> SDoc Source #
nameStableString :: Name -> String Source #
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"
getSrcLoc :: NamedThing a => a -> SrcLoc Source #
getSrcSpan :: NamedThing a => a -> SrcSpan Source #
getOccString :: NamedThing a => a -> String Source #
getOccFS :: NamedThing a => a -> FastString Source #
pprInfixName :: (Outputable a, NamedThing a) => a -> SDoc Source #
pprPrefixName :: NamedThing a => a -> SDoc Source #
module Var
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var Source # | |
Data Var Source # | |
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 Source # | |
OutputableBndr Var Source # | |
Outputable Var Source # | |
Uniquable Var Source # | |
HasOccName Var Source # | |
NamedThing Var Source # | |
globaliseId :: Id -> Id Source #
If it's a local, make it global
isGlobalId :: Var -> Bool Source #
isExportedId :: Var -> Bool Source #
isExportedIdVar
means "don't throw this away"
localiseId :: Id -> Id Source #
modifyIdInfo :: HasDebugCallStack => (IdInfo -> IdInfo) -> Id -> Id Source #
mkLocalIdOrCoVar :: Name -> Type -> Id Source #
Like mkLocalId
, but checks the type to see if it should make a covar
mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id Source #
Make a local id, with the IdDetails set to CoVarId if the type indicates so.
mkExportedLocalId :: IdDetails -> Name -> Type -> Id Source #
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]
mkSysLocal :: FastString -> Unique -> Type -> Id Source #
mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id Source #
Like mkSysLocal
, but checks to see if we have a covar type
mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id Source #
mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id Source #
mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id Source #
Like mkUserLocal
, but checks if we have a coercion type
mkWorkerId :: Unique -> Id -> Type -> Id Source #
Workers get local names. CoreTidy will externalise these if necessary
mkTemplateLocal :: Int -> Type -> Id Source #
Create a template local: a family of system local Id
s in bijection with Int
s, typically used in unfoldings
mkTemplateLocals :: [Type] -> [Id] Source #
Create a template local for a series of types
mkTemplateLocalsNum :: Int -> [Type] -> [Id] Source #
Create a template local for a series of type, but start from a specified template local
recordSelectorTyCon :: Id -> RecSelParent Source #
isRecordSelector :: Id -> Bool Source #
isDataConRecordSelector :: Id -> Bool Source #
isPatSynRecordSelector :: Id -> Bool Source #
isNaughtyRecordSelector :: Id -> Bool Source #
isPrimOpId :: Id -> Bool Source #
isFCallId_maybe :: Id -> Maybe ForeignCall Source #
isDataConWorkId :: Id -> Bool Source #
idDataCon :: Id -> DataCon Source #
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
hasNoBinding :: Id -> Bool Source #
Returns True
of an Id
which may not have a
binding, even though it is defined in this module.
isImplicitId :: Id -> Bool Source #
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.
isDeadBinder :: Id -> Bool Source #
idJoinArity :: JoinId -> JoinArity Source #
idCallArity :: Id -> Arity Source #
idFunRepArity :: Id -> RepArity Source #
isBottomingId :: Var -> Bool Source #
Returns true if an application to n args would diverge
idStrictness :: Id -> StrictSig Source #
zapIdStrictness :: Id -> Id Source #
isStrictId :: Id -> Bool Source #
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
.
idUnfolding :: Id -> Unfolding Source #
realIdUnfolding :: Id -> Unfolding Source #
idDemandInfo :: Id -> Demand Source #
setCaseBndrEvald :: StrictnessMark -> Id -> Id Source #
idSpecialisation :: Id -> RuleInfo Source #
idCoreRules :: Id -> [CoreRule] Source #
idHasRules :: Id -> Bool Source #
zapIdOccInfo :: Id -> Id Source #
idInlinePragma :: Id -> InlinePragma Source #
setInlinePragma :: Id -> InlinePragma -> Id infixl 1 Source #
modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id Source #
idInlineActivation :: Id -> Activation Source #
setInlineActivation :: Id -> Activation -> Id infixl 1 Source #
idRuleMatchInfo :: Id -> RuleMatchInfo Source #
isConLikeId :: Id -> Bool Source #
idOneShotInfo :: Id -> OneShotInfo Source #
idStateHackOneShotInfo :: Id -> OneShotInfo Source #
Like idOneShotInfo
, but taking the Horrible State Hack in to account
See Note [The state-transformer hack] in CoreArity
isOneShotBndr :: Var -> Bool Source #
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
stateHackOneShot :: OneShotInfo Source #
Should we apply the state hack to values of this Type
?
typeOneShot :: Type -> OneShotInfo Source #
isStateHackType :: Type -> Bool Source #
isProbablyOneShotLambda :: Id -> Bool Source #
setOneShotLambda :: Id -> Id Source #
clearOneShotLambda :: Id -> Id Source #
setIdOneShotInfo :: Id -> OneShotInfo -> Id infixl 1 Source #
updOneShotInfo :: Id -> OneShotInfo -> Id Source #
zapLamIdInfo :: Id -> Id Source #
zapFragileIdInfo :: Id -> Id Source #
zapIdDemandInfo :: Id -> Id Source #
zapIdUsageInfo :: Id -> Id Source #
zapIdUsageEnvInfo :: Id -> Id Source #
zapIdUsedOnceInfo :: Id -> Id Source #
zapIdTailCallInfo :: Id -> Id Source #
zapStableUnfolding :: Id -> Id Source #
isNeverLevPolyId :: Id -> Bool Source #
module IdInfo
module CoreMonad
module CoreSyn
module Literal
module DataCon
module CoreUtils
module MkCore
module CoreFVs
data InScopeSet Source #
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
isEmptySubst :: Subst -> Bool Source #
emptySubst :: Subst Source #
mkEmptySubst :: InScopeSet -> Subst Source #
mkSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> IdSubstEnv -> Subst Source #
substInScope :: Subst -> InScopeSet Source #
Find the in-scope set: see TyCoRep Note [The substitution invariant]
zapSubstEnv :: Subst -> Subst Source #
extendIdSubstList :: Subst -> [(Id, CoreExpr)] -> Subst Source #
Adds multiple Id
substitutions to the Subst
: see also extendIdSubst
extendTvSubstList :: Subst -> [(TyVar, Type)] -> Subst Source #
Adds multiple TyVar
substitutions to the Subst
: see also extendTvSubst
extendSubst :: Subst -> Var -> CoreArg -> Subst Source #
Add a substitution appropriate to the thing being substituted
(whether an expression, type, or coercion). See also
extendIdSubst
, extendTvSubst
, extendCvSubst
extendSubstList :: Subst -> [(Var, CoreArg)] -> Subst Source #
Add a substitution as appropriate to each of the terms being
substituted (whether expressions, types, or coercions). See also
extendSubst
.
mkOpenSubst :: InScopeSet -> [(Var, CoreArg)] -> Subst Source #
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
addInScopeSet :: Subst -> VarSet -> Subst Source #
Add the Var
to the in-scope set, but do not remove
any existing substitutions for it
extendInScope :: Subst -> Var -> Subst Source #
Add the Var
to the in-scope set: as a side effect,
and remove any existing substitutions for it
extendInScopeList :: Subst -> [Var] -> Subst Source #
Add the Var
s to the in-scope set: see also extendInScope
extendInScopeIds :: Subst -> [Id] -> Subst Source #
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
setInScope :: Subst -> InScopeSet -> Subst Source #
substExprSC :: SDoc -> Subst -> CoreExpr -> CoreExpr Source #
Apply a substitution to an entire CoreExpr
. Remember, you may only
apply the substitution once:
see Note [Substitutions apply only once] in TyCoRep
Do *not* attempt to short-cut in the case of an empty substitution! See Note [Extending the Subst]
deShadowBinds :: CoreProgram -> CoreProgram Source #
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
substRecBndrs :: Subst -> [Id] -> (Subst, [Id]) Source #
Substitute in a mutually recursive group of Id
s
cloneIdBndr :: Subst -> UniqSupply -> Id -> (Subst, Id) Source #
cloneIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) Source #
Applies cloneIdBndr
to a number of Id
s, accumulating a final
substitution from left to right
cloneBndrs :: Subst -> UniqSupply -> [Var] -> (Subst, [Var]) Source #
cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) Source #
Clone a mutually recursive group of Id
s
getTCvSubst :: Subst -> TCvSubst Source #
substUnfoldingSC :: Subst -> Unfolding -> Unfolding Source #
Substitutes for the Id
s within an unfolding
substUnfolding :: Subst -> Unfolding -> Unfolding Source #
Substitutes for the Id
s within an unfolding
module Rules
module Annotations
module DynFlags
module Packages
module Module
A type of the form p
of kind Constraint
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"
data TyCoBinder Source #
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 Source # | |
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 Source # | |
Type & coercion substitution
The following invariants must hold of a TCvSubst
:
- The in-scope set is needed only to guide the generation of fresh uniques
- In particular, the kind of the type variables in the in-scope set is not relevant
- The substitution is only applied ONCE! This is because in general such application will not reach a fixed point.
Instances
Data Type Source # | |
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 Source # | |
isRuntimeRepTy :: Type -> Bool Source #
Is this the type RuntimeRep
?
A general-purpose pretty-printing precedence type.
type TyCoVarBinder = VarBndr TyCoVar ArgFlag Source #
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
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 Source # | |
Data ArgFlag Source # | |
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 Source # | |
Outputable ArgFlag Source # | |
Binary ArgFlag Source # | |
Outputable tv => Outputable (VarBndr tv ArgFlag) Source # | |
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var Source # | |
Data Var Source # | |
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 Source # | |
OutputableBndr Var Source # | |
Outputable Var Source # | |
Uniquable Var Source # | |
HasOccName Var Source # | |
NamedThing Var Source # | |
isVisibleArgFlag :: ArgFlag -> Bool Source #
Does this ArgFlag
classify an argument that is written in Haskell?
isInvisibleArgFlag :: ArgFlag -> Bool Source #
Does this ArgFlag
classify an argument that is not written in Haskell?
binderVars :: [VarBndr tv argf] -> [tv] Source #
binderArgFlag :: VarBndr tv argf -> argf Source #
mkTyCoVarBinder :: ArgFlag -> TyCoVar -> TyCoVarBinder Source #
Make a named binder
mkTyCoVarBinders :: ArgFlag -> [TyCoVar] -> [TyCoVarBinder] Source #
Make many named binders
mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder] Source #
Make many named binders Input vars should be type variables
splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) Source #
Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor
scopedSort :: [TyCoVar] -> [TyCoVar] Source #
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
tyCoVarsOfTypeWellScoped :: Type -> [TyVar] Source #
Get the free vars of a type in scoped order
tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar] Source #
Get the free vars of types in scoped order
tcView :: Type -> Maybe Type Source #
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]
coreView :: Type -> Maybe Type Source #
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
eqType :: Type -> Type -> Bool Source #
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.
piResultTy :: HasDebugCallStack => Type -> Type -> Type Source #
mkCastTy :: Type -> Coercion -> Type Source #
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
isCoercionTy :: Type -> Bool Source #
type KnotTied ty = ty Source #
A type labeled KnotTied
might have knot-tied tycons in it. See
Note [Type checking recursive type and class declarations] in
TcTyClsDecls
type KindOrType = Type Source #
The key representation of types within the compiler
pprShortTyThing :: TyThing -> SDoc Source #
pprTyThingCategory :: TyThing -> SDoc Source #
isInvisibleBinder :: TyCoBinder -> Bool Source #
Does this binder bind an invisible argument?
isVisibleBinder :: TyCoBinder -> Bool Source #
Does this binder bind a visible argument?
isNamedBinder :: TyCoBinder -> Bool Source #
mkTyVarTys :: [TyVar] -> [Type] Source #
mkForAllTy :: TyCoVar -> ArgFlag -> Type -> Type Source #
Like mkTyCoForAllTy
, but does not check the occurrence of the binder
See Note [Unused coercion variable in ForAllTy]
mkForAllTys :: [TyCoVarBinder] -> Type -> Type Source #
Wraps foralls over the type using the provided TyCoVar
s from left to right
mkTyCoPiTy :: TyCoBinder -> Type -> Type Source #
mkTyCoPiTys :: [TyCoBinder] -> Type -> Type Source #
mkPiTys :: [TyCoBinder] -> Type -> Type Source #
Like mkTyCoPiTys
, but does not check the occurrence of the binder
mkTyConTy :: TyCon -> Type Source #
Create the plain type constructor type which has been applied to no type arguments at all.
kindRep :: HasDebugCallStack => Kind -> Type Source #
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
kindRep_maybe :: HasDebugCallStack => Kind -> Maybe Type Source #
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
isRuntimeRepVar :: TyVar -> Bool Source #
Is a tyvar of type RuntimeRep
?
tyCoVarsOfType :: Type -> TyCoVarSet Source #
tyCoVarsOfTypes :: [Type] -> TyCoVarSet Source #
tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet Source #
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.
tyCoFVsOfType :: Type -> FV Source #
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.
tyCoFVsBndr :: TyCoVarBinder -> FV -> FV Source #
coVarsOfType :: Type -> CoVarSet Source #
coVarsOfTypes :: [Type] -> TyCoVarSet Source #
noFreeVarsOfType :: Type -> Bool Source #
Returns True if this type has no free variables. Should be the same as isEmptyVarSet . tyCoVarsOfType, but faster in the non-forall case.
composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) Source #
(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
composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst Source #
Composes two substitutions, applying the second one provided first, like in function composition.
mkEmptyTCvSubst :: InScopeSet -> TCvSubst Source #
isEmptyTCvSubst :: TCvSubst -> Bool Source #
mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst Source #
getTvSubstEnv :: TCvSubst -> TvSubstEnv Source #
getTCvInScope :: TCvSubst -> InScopeSet Source #
getTCvSubstRangeFVs :: TCvSubst -> VarSet Source #
Returns the free variables of the types in the range of a substitution as a non-deterministic set.
setTvSubstEnv :: TCvSubst -> TvSubstEnv -> TCvSubst Source #
zapTCvSubst :: TCvSubst -> TCvSubst Source #
extendTvSubstBinderAndInScope :: TCvSubst -> TyCoBinder -> Type -> TCvSubst Source #
zipTvSubst :: HasDebugCallStack => [TyVar] -> [Type] -> TCvSubst Source #
Generates the in-scope set for the TCvSubst
from the types in the incoming
environment. No CoVars, please!
zipTCvSubst :: HasDebugCallStack => [TyCoVar] -> [Type] -> TCvSubst Source #
mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst Source #
Generates the in-scope set for the TCvSubst
from the types in the
incoming environment. No CoVars, please!
zipTyEnv :: HasDebugCallStack => [TyVar] -> [Type] -> TvSubstEnv Source #
zipCoEnv :: HasDebugCallStack => [CoVar] -> [Coercion] -> CvSubstEnv Source #
substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type Source #
Type substitution, see zipTvSubst
substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type Source #
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.
substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion Source #
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.
substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type] Source #
Type substitution, see zipTvSubst
substTyAddInScope :: TCvSubst -> Type -> Type Source #
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].
substTyUnchecked :: TCvSubst -> Type -> Type Source #
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.
substTys :: HasCallStack => TCvSubst -> [Type] -> [Type] Source #
Substitute within several Type
s
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substTysUnchecked :: TCvSubst -> [Type] -> [Type] Source #
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.
substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType Source #
Substitute within a ThetaType
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType Source #
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.
substCoUnchecked :: TCvSubst -> Coercion -> Coercion Source #
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.
substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar) Source #
substTyVarBndrs :: HasCallStack => TCvSubst -> [TyVar] -> (TCvSubst, [TyVar]) Source #
substVarBndr :: HasCallStack => TCvSubst -> TyCoVar -> (TCvSubst, TyCoVar) Source #
substVarBndrs :: HasCallStack => TCvSubst -> [TyCoVar] -> (TCvSubst, [TyCoVar]) Source #
cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar]) Source #
pprParendType :: Type -> SDoc Source #
pprParendKind :: Kind -> SDoc Source #
pprThetaArrowTy :: ThetaType -> SDoc Source #
pprSigmaType :: Type -> SDoc Source #
pprForAll :: [TyCoVarBinder] -> SDoc Source #
pprUserForAll :: [TyCoVarBinder] -> SDoc Source #
Print a user-level forall; see Note [When to print foralls]
pprTCvBndrs :: [TyCoVarBinder] -> SDoc Source #
pprTCvBndr :: TyCoVarBinder -> SDoc Source #
tidyVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) Source #
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.
tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv Source #
Add the free TyVar
s to the env in tidy form,
so that we can tidy the type they are free in
tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) Source #
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
tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type]) Source #
Grabs the free type variables, tidies them
and then uses tidyType
to work over the type itself
tidyTopType :: Type -> Type Source #
Calls tidyType
on a top-level type (i.e. with an empty tidying environment)
The (->)
type constructor.
(->) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep). TYPE rep1 -> TYPE rep2 -> *
A choice of equality relation. This is separate from the type Role
because Phantom
does not define a (non-trivial) equality relation.
data TyCoMapper env m Source #
This describes how a "map" operation over a type/coercion should behave
TyCoMapper | |
|
expandTypeSynonyms :: Type -> Type Source #
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
mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion Source #
getTyVar :: String -> Type -> TyVar Source #
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
getTyVar_maybe :: Type -> Maybe TyVar Source #
Attempts to obtain the type variable underlying a Type
getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN) Source #
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
repGetTyVar_maybe :: Type -> Maybe TyVar Source #
Attempts to obtain the type variable underlying a Type
, without
any expansion
splitAppTy_maybe :: Type -> Maybe (Type, Type) Source #
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!
repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type) Source #
Does the AppTy split as in splitAppTy_maybe
, but assumes that
any Core view stuff is already done
tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type) Source #
Does the AppTy split as in tcSplitAppTy_maybe
, but assumes that
any coreView stuff is already done. Refuses to look through (c => t)
tcRepSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type]) Source #
Like tcSplitTyConApp_maybe
but doesn't look through type synonyms.
tcRepSplitTyConApp :: HasCallStack => Type -> (TyCon, [Type]) Source #
Like tcSplitTyConApp
but doesn't look through type synonyms.
splitAppTy :: Type -> (Type, Type) Source #
Attempts to take a type application apart, as in splitAppTy_maybe
,
and panics if this is not possible
splitAppTys :: Type -> (Type, [Type]) Source #
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.
repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type]) Source #
Like splitAppTys
, but doesn't look through type synonyms
mkNumLitTy :: Integer -> Type Source #
isNumLitTy :: Type -> Maybe Integer Source #
Is this a numeric literal. We also look through type synonyms.
mkStrLitTy :: FastString -> Type Source #
isStrLitTy :: Type -> Maybe FastString Source #
Is this a symbol literal. We also look through type synonyms.
userTypeError_maybe :: Type -> Maybe Type Source #
Is this type a custom user error? If so, give us the kind and the error message.
pprUserTypeErrorTy :: Type -> SDoc Source #
Render a type corresponding to a user type error into a SDoc.
splitFunTy :: Type -> (Type, Type) Source #
Attempts to extract the argument and result types from a type, and
panics if that is not possible. See also splitFunTy_maybe
splitFunTy_maybe :: Type -> Maybe (Type, Type) Source #
Attempts to extract the argument and result types from a type
funResultTy :: Type -> Type Source #
Extract the function result type and panic if that is not possible
funArgTy :: Type -> Type Source #
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
piResultTys :: HasDebugCallStack => Type -> [Type] -> Type Source #
(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.
tyConAppTyConPicky_maybe :: Type -> Maybe TyCon Source #
Retrieve the tycon heading this type, if there is one. Does not look through synonyms.
tyConAppTyCon :: Type -> TyCon Source #
tyConAppArgs :: Type -> [Type] Source #
splitTyConApp :: Type -> (TyCon, [Type]) Source #
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
repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) Source #
Like splitTyConApp_maybe
, but doesn't look through synonyms. This
assumes the synonyms have already been dealt with.
splitListTyConApp_maybe :: Type -> Maybe Type Source #
Attempts to tease a list type apart and gives the type of the elements if successful (looks through type synonyms)
newTyConInstRhs :: TyCon -> [Type] -> Type Source #
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.
tyConBindersTyCoBinders :: [TyConBinder] -> [TyCoBinder] Source #
mkCoercionTy :: Coercion -> Type Source #
stripCoercionTy :: Type -> Coercion Source #
mkTyCoInvForAllTy :: TyCoVar -> Type -> Type Source #
Make a dependent forall over an Inferred variablem
mkTyCoInvForAllTys :: [TyCoVar] -> Type -> Type Source #
Like mkForAllTys, but assumes all variables are dependent and Inferred, a common case
mkInvForAllTys :: [TyVar] -> Type -> Type Source #
Like mkTyCoInvForAllTys
, but tvs should be a list of tyvar
mkSpecForAllTys :: [TyVar] -> Type -> Type Source #
Like mkForAllTys, but assumes all variables are dependent and Specified, a common case
mkVisForAllTys :: [TyVar] -> Type -> Type Source #
Like mkForAllTys, but assumes all variables are dependent and visible
mkLamType :: Var -> Type -> Type Source #
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.
mkTyConBindersPreferAnon Source #
:: [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.
splitForAllTys :: Type -> ([TyCoVar], Type) Source #
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.
isForAllTy :: Type -> Bool Source #
Checks whether this is a proper forall (with a named binder)
isForAllTy_ty :: Type -> Bool Source #
Like isForAllTy
, but returns True only if it is a tyvar binder
isForAllTy_co :: Type -> Bool Source #
Like isForAllTy
, but returns True only if it is a covar binder
splitForAllTy :: Type -> (TyCoVar, Type) Source #
Take a forall type apart, or panics if that is not possible.
dropForAlls :: Type -> Type Source #
Drops all ForAllTys
splitForAllTy_maybe :: Type -> Maybe (TyCoVar, Type) Source #
Attempts to take a forall type apart, but only if it's a proper forall, with a named binder
splitForAllTy_ty_maybe :: Type -> Maybe (TyCoVar, Type) Source #
Like splitForAllTy_maybe, but only returns Just if it is a tyvar binder.
splitForAllTy_co_maybe :: Type -> Maybe (TyCoVar, Type) Source #
Like splitForAllTy_maybe, but only returns Just if it is a covar binder.
splitPiTy_maybe :: Type -> Maybe (TyCoBinder, Type) Source #
Attempts to take a forall type apart; works with proper foralls and functions
splitPiTys :: Type -> ([TyCoBinder], Type) Source #
Split off all TyCoBinders to a type, splitting both proper foralls and functions
splitForAllVarBndrs :: Type -> ([TyCoVarBinder], Type) Source #
Like splitPiTys
but split off only named binders
and returns TyCoVarBinders rather than TyCoBinders
invisibleTyBndrCount :: Type -> Int Source #
splitPiTysInvisible :: Type -> ([TyCoBinder], Type) Source #
splitPiTysInvisibleN :: Int -> Type -> ([TyCoBinder], Type) Source #
partitionInvisibles :: [(a, ArgFlag)] -> ([a], [a]) Source #
Given a list of things paired with their visibilities, partition the things into (invisible things, visible things).
tyConArgFlags :: TyCon -> [Type] -> [ArgFlag] Source #
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.
appTyArgFlags :: Type -> [Type] -> [ArgFlag] Source #
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 Trac #15792).
mkAnonBinder :: Type -> TyCoBinder Source #
Make an anonymous binder
isAnonTyCoBinder :: TyCoBinder -> Bool Source #
Does this binder bind a variable that is not erased? Returns
True
for anonymous binders.
tyCoBinderType :: TyCoBinder -> Type Source #
tyBinderType :: TyBinder -> Type Source #
binderRelevantType_maybe :: TyCoBinder -> Maybe Type Source #
Extract a relevant type, if there is one.
:: TyCoBinder | binder to scrutinize |
-> (TyCoVarBinder -> a) | named case |
-> (Type -> a) | anonymous case |
-> a |
Like maybe
, but for binders.
tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type]) Source #
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
.
tcIsConstraintKind :: Kind -> Bool Source #
tcIsLiftedTypeKind :: Kind -> Bool Source #
Is this kind equivalent to *
?
This considers Constraint
to be distinct from *
. For a version that
treats them as the same type, see isLiftedTypeKind
.
tcReturnsConstraintKind :: Kind -> Bool Source #
isEvVarType :: Type -> Bool Source #
isCoVarType :: Type -> Bool Source #
isClassPred :: PredType -> Bool Source #
isNomEqPred :: PredType -> Bool Source #
isCTupleClass :: Class -> Bool Source #
isIPPred_maybe :: Type -> Maybe (FastString, Type) Source #
mkPrimEqPredRole :: Role -> Type -> Type -> PredType Source #
Makes a lifted equality predicate at the given role
mkPrimEqPred :: Type -> Type -> Type Source #
Creates a primitive type equality predicate. Invariant: the types are not Coercions
mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type Source #
Creates a primite type equality predicate with explicit kinds
mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type Source #
Creates a primitive representational type equality predicate with explicit kinds
splitCoercionType_maybe :: Type -> Maybe (Type, Type) Source #
Try to split up a coercion type into the types that it coerces
equalityTyCon :: Role -> TyCon Source #
isDictLikeTy :: Type -> Bool Source #
classifyPredType :: PredType -> PredTree Source #
getClassPredTys :: HasDebugCallStack => PredType -> (Class, [Type]) Source #
getEqPredRole :: PredType -> Role Source #
predTypeEqRel :: PredType -> EqRel Source #
Get the equality relation relevant for a pred type.
dVarSetElemsWellScoped :: DVarSet -> [Var] Source #
Extract a well-scoped list of variables from a deterministic set of variables. The result is deterministic. NB: There used to exist varSetElemsWellScoped :: VarSet -> [Var] which took a non-deterministic set and produced a non-deterministic well-scoped list. If you care about the list being well-scoped you also most likely care about it being in deterministic order.
tyCoVarsOfBindersWellScoped :: [TyVar] -> [TyVar] Source #
Given the suffix of a telescope, returns the prefix. Ex: given [(k :: j), (a :: Proxy k)], returns [(j :: *)].
closeOverKinds :: TyVarSet -> TyVarSet Source #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a non-deterministic set.
closeOverKindsFV :: [TyVar] -> FV Source #
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.
closeOverKindsList :: [TyVar] -> [TyVar] Source #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a deterministically ordered list.
closeOverKindsDSet :: DTyVarSet -> DTyVarSet Source #
Add the kind variables free in the kinds of the tyvars in the given set. Returns a deterministic set.
mkFamilyTyConApp :: TyCon -> [Type] -> Type Source #
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)
coAxNthLHS :: CoAxiom br -> Int -> Type Source #
Get the type on the LHS of a coercion induced by a type/data family instance.
pprSourceTyCon :: TyCon -> SDoc Source #
isFamFreeTy :: Type -> Bool Source #
isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool Source #
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.
isUnliftedType :: HasDebugCallStack => Type -> Bool Source #
See Type for what an unlifted type is. Panics on levity polymorphic types.
isRuntimeRepKindedTy :: Type -> Bool Source #
Is this a type of kind RuntimeRep? (e.g. LiftedRep)
dropRuntimeRepArgs :: [Type] -> [Type] Source #
Drops prefix of RuntimeRep constructors in TyConApp
s. Useful for e.g.
dropping 'LiftedRep arguments of unboxed tuple TyCon applications:
getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type Source #
Extract the RuntimeRep classifier of a type. For instance,
getRuntimeRep_maybe Int = LiftedRep
. Returns Nothing
if this is not
possible.
getRuntimeRep :: HasDebugCallStack => Type -> Type Source #
Extract the RuntimeRep classifier of a type. For instance,
getRuntimeRep_maybe Int = LiftedRep
. Panics if this is not possible.
isUnboxedTupleType :: Type -> Bool Source #
isUnboxedSumType :: Type -> Bool Source #
isAlgType :: Type -> Bool Source #
See Type for what an algebraic type is. Should only be applied to types, as opposed to e.g. partially saturated type constructors
isDataFamilyAppType :: Type -> Bool Source #
Check whether a type is a data family type
isStrictType :: HasDebugCallStack => Type -> Bool Source #
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.
isPrimitiveType :: Type -> Bool Source #
Returns true of types that are opaque to Haskell.
isValidJoinPointType :: JoinArity -> Type -> Bool Source #
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]
eqTypeX :: RnEnv2 -> Type -> Type -> Bool Source #
Compare types with respect to a (presumably) non-empty RnEnv2
.
eqTypes :: [Type] -> [Type] -> Bool Source #
Type equality on lists of types, looking through type synonyms but not newtypes.
tcTypeKind :: HasDebugCallStack => Type -> Kind Source #
isTypeLevPoly :: Type -> Bool Source #
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)
resultIsLevPoly :: Type -> Bool Source #
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)
tyConsOfType :: Type -> UniqSet TyCon Source #
All type constructors occurring in the type; looking through type synonyms, but not newtypes. When it finds a Class, it returns the class TyCon.
synTyConResKind :: TyCon -> Kind Source #
splitVisVarsOfType :: Type -> Pair TyCoVarSet Source #
Retrieve the free variables in this type, splitting them based on whether they are used visibly or invisibly. Invisible ones come first.
splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet Source #
pprWithTYPE :: Type -> SDoc Source #
This variant preserves any use of TYPE in a type, effectively locally setting -fprint-explicit-runtime-reps.
module TyCon
A semantically more meaningful type to represent what may or may not be a
useful Coercion
.
Instances
Data MCoercion Source # | |
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 Source # | |
data UnivCoProvenance Source #
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 Source # | |
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 Source # | |
A Coercion
is concrete evidence of the equality/convertibility
of two types.
Instances
Data Coercion Source # | |
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 Source # | |
data LeftOrRight Source #
Instances
Eq LeftOrRight Source # | |
Defined in BasicTypes (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool # | |
Data LeftOrRight Source # | |
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 # | |
Outputable LeftOrRight Source # | |
Defined in BasicTypes | |
Binary LeftOrRight Source # | |
pickLR :: LeftOrRight -> (a, a) -> a Source #
Variable
Essentially a typed Name
, that may also contain some additional information
about the Var
and its use sites.
Instances
Eq Var Source # | |
Data Var Source # | |
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 Source # | |
OutputableBndr Var Source # | |
Outputable Var Source # | |
Uniquable Var Source # | |
HasOccName Var Source # | |
NamedThing Var Source # | |
Instances
Eq Role Source # | |
Data Role Source # | |
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 Source # | |
Outputable Role Source # | |
Binary Role Source # | |
data LiftingContext Source #
Instances
coercionType :: Coercion -> Type Source #
coercionKind :: Coercion -> Pair Type Source #
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
.
liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion Source #
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
.
mkCoercionType :: Role -> Type -> Type -> Type Source #
Makes a coercion type from two types: the types whose equality
is proven by the relevant Coercion
coVarKindsTypesRole :: HasDebugCallStack => CoVar -> (Kind, Kind, Type, Type, Role) Source #
decomposePiCos :: HasDebugCallStack => CoercionN -> Pair Type -> [Type] -> ([CoercionN], CoercionN) Source #
isReflexiveCo :: Coercion -> Bool Source #
Slowly checks if the coercion is reflexive. Don't call this in a loop, as it walks over the entire coercion.
isReflCo :: Coercion -> Bool Source #
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
isGReflCo :: Coercion -> Bool Source #
Tests if this coercion is obviously a generalized reflexive coercion. Guaranteed to work very quickly.
mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion Source #
:: 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".
mkNomReflCo :: Type -> Coercion Source #
Make a nominal reflexive coercion
mkSymCo :: Coercion -> Coercion Source #
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
.
:: 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.
mkUnsafeCo :: Role -> Type -> Type -> Coercion Source #
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.
mkPhantomCo :: Coercion -> Type -> Type -> Coercion Source #
Make a phantom coercion between two types. The coercion passed in must be a nominal coercion between the kinds of the types.
mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion Source #
mkForAllCo :: TyCoVar -> CoercionN -> Coercion -> Coercion Source #
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]
mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion Source #
Apply a type constructor to a list of coercions. It is the caller's responsibility to get the roles correct on argument coercions.
data CoercionHole Source #
A coercion to be filled in by the type-checker. See Note [Coercion holes]
Instances
Data CoercionHole Source # | |
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 Source # | |
type MCoercionR = MCoercion Source #
coHoleCoVar :: CoercionHole -> CoVar Source #
setCoHoleCoVar :: CoercionHole -> CoVar -> CoercionHole Source #
tyCoVarsOfCo :: Coercion -> TyCoVarSet Source #
tyCoVarsOfCos :: [Coercion] -> TyCoVarSet Source #
tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet Source #
Get a deterministic set of the vars free in a coercion
tyCoFVsOfCo :: Coercion -> FV Source #
tyCoFVsOfCos :: [Coercion] -> FV Source #
coVarsOfCo :: Coercion -> CoVarSet Source #
getCvSubstEnv :: TCvSubst -> CvSubstEnv Source #
substCoWith :: HasCallStack => [TyVar] -> [Type] -> Coercion -> Coercion Source #
Coercion substitution, see zipTvSubst
substCos :: HasCallStack => TCvSubst -> [Coercion] -> [Coercion] Source #
Substitute within several Coercion
s
The substitution has to satisfy the invariants described in
Note [The substitution invariant].
substCoVarBndr :: HasCallStack => TCvSubst -> CoVar -> (TCvSubst, CoVar) Source #
pprParendCo :: Coercion -> SDoc Source #
coercionSize :: Coercion -> Int Source #
data NormaliseStepResult ev Source #
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 |
type NormaliseStepper ev = RecTcChecker -> TyCon -> [Type] -> NormaliseStepResult ev Source #
A function to check if we can reduce a type by one step. Used
with topNormaliseTypeX
.
etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type) Source #
pprCoAxiom :: CoAxiom br -> SDoc Source #
pprCoAxBranchUser :: TyCon -> CoAxBranch -> SDoc Source #
pprCoAxBranchLHS :: TyCon -> CoAxBranch -> SDoc Source #
pprCoAxBranch :: TyCon -> CoAxBranch -> SDoc Source #
decomposeFunCo :: HasDebugCallStack => Role -> Coercion -> (Coercion, Coercion) Source #
getCoVar_maybe :: Coercion -> Maybe CoVar Source #
Attempts to obtain the type variable underlying a Coercion
splitTyConAppCo_maybe :: Coercion -> Maybe (TyCon, [Coercion]) Source #
Attempts to tease a coercion apart into a type constructor and the application of a number of coercion arguments to that constructor
splitAppCo_maybe :: Coercion -> Maybe (Coercion, Coercion) Source #
Attempt to take a coercion application apart.
splitForAllCo_ty_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion) Source #
Like splitForAllCo_maybe
, but only returns Just for tyvar binder
splitForAllCo_co_maybe :: Coercion -> Maybe (CoVar, Coercion, Coercion) Source #
Like splitForAllCo_maybe
, but only returns Just for covar binder
coVarTypes :: HasDebugCallStack => CoVar -> Pair Type Source #
isGReflCo_maybe :: Coercion -> Maybe (Type, Role) Source #
Returns the type coerced if this coercion is a generalized reflexive coercion. Guaranteed to work very quickly.
isReflCo_maybe :: Coercion -> Maybe (Type, Role) Source #
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
isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role) Source #
Extracts the coerced type from a reflexive coercion. This potentially walks over the entire coercion, so avoid doing this in a loop.
mkRepReflCo :: Type -> Coercion Source #
Make a representational reflexive coercion
mkHomoForAllCos :: [TyCoVar] -> Coercion -> Coercion Source #
Make a Coercion quantified over a type/coercion variable; the variable has the same type in both sides of the coercion
mkCoVarCos :: [CoVar] -> [Coercion] Source #
isCoVar_maybe :: Coercion -> Maybe CoVar Source #
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.)
mkAxInstCo :: Role -> CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Coercion Source #
mkUnbranchedAxInstCo :: Role -> CoAxiom Unbranched -> [Type] -> [Coercion] -> Coercion Source #
mkAxInstRHS :: CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type Source #
mkUnbranchedAxInstRHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type Source #
mkAxInstLHS :: CoAxiom br -> BranchIndex -> [Type] -> [Coercion] -> Type Source #
Return the left-hand type of the axiom, when the axiom is instantiated at the types given.
mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type Source #
Instantiate the left-hand side of an unbranched axiom
mkHoleCo :: CoercionHole -> Coercion Source #
Make a coercion from a coercion hole
nthCoRole :: Int -> Coercion -> Role Source #
If you're about to call mkNthCo r n co
, then r
should be
whatever nthCoRole n co
returns.
mkGReflRightCo :: Role -> Type -> CoercionN -> Coercion Source #
Given ty :: k1
, co :: k1 ~ k2
,
produces co' :: ty ~r (ty |> co)
mkGReflLeftCo :: Role -> Type -> CoercionN -> Coercion Source #
Given ty :: k1
, co :: k1 ~ k2
,
produces co' :: (ty |> co) ~r ty
mkCoherenceLeftCo :: Role -> Type -> CoercionN -> Coercion -> Coercion Source #
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.
mkCoherenceRightCo :: Role -> Type -> CoercionN -> Coercion -> Coercion Source #
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.
downgradeRole :: Role -> Role -> Coercion -> Coercion Source #
Like downgradeRole_maybe
, but panics if the change isn't a downgrade.
See Note [Role twiddling functions]
maybeSubCo :: EqRel -> Coercion -> Coercion Source #
If the EqRel is ReprEq, makes a SubCo; otherwise, does nothing. Note that the input coercion should always be nominal.
setNominalRole_maybe :: Role -> Coercion -> Maybe Coercion Source #
Converts a coercion to be nominal, if possible. See Note [Role twiddling functions]
tyConRolesRepresentational :: TyCon -> [Role] Source #
promoteCoercion :: Coercion -> CoercionN Source #
like mkKindCo, but aggressively & recursively optimizes to avoid using a KindCo constructor. The output role is nominal.
castCoercionKind :: Coercion -> Role -> Type -> Type -> CoercionN -> CoercionN -> Coercion Source #
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.
castCoercionKindI :: Coercion -> CoercionN -> CoercionN -> Coercion Source #
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.
mkPiCo :: Role -> Var -> Coercion -> Coercion Source #
Make a forall Coercion
, where both types related by the coercion
are quantified over the same variable.
instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion) Source #
If co :: T ts ~ rep_ty
then:
instNewTyCon_maybe T ts = Just (rep_ty, co)
Checks for a newtype, and for being saturated
mapStepResult :: (ev1 -> ev2) -> NormaliseStepResult ev1 -> NormaliseStepResult ev2 Source #
composeSteppers :: NormaliseStepper ev -> NormaliseStepper ev -> NormaliseStepper ev Source #
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
unwrapNewTypeStepper :: NormaliseStepper Coercion Source #
A NormaliseStepper
that unwraps newtypes, careful not to fall into
a loop. If it would fall into a loop, it produces NS_Abort
.
topNormaliseTypeX :: NormaliseStepper ev -> (ev -> ev -> ev) -> Type -> Maybe (ev, Type) Source #
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
topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type) Source #
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'
eqCoercionX :: RnEnv2 -> Coercion -> Coercion -> Bool Source #
Compare two Coercion
s, with respect to an RnEnv2
liftCoSubstWithEx :: Role -> [TyVar] -> [Coercion] -> [TyCoVar] -> [Type] -> (Type -> Coercion, [Type]) Source #
:: LiftingContext | original LC |
-> TyCoVar | new variable to map... |
-> Coercion | ...to this lifted version |
-> LiftingContext |
Extend a lifting context with a new mapping.
extendLiftingContextAndInScope Source #
:: 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
zapLiftingContext :: LiftingContext -> LiftingContext Source #
Erase the environments in a lifting context
substForAllCoBndrUsingLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyCoVar -> Coercion -> (LiftingContext, TyCoVar, Coercion) Source #
Like substForAllCoBndr
, but works on a lifting context
liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion Source #
liftCoSubstVarBndrUsing :: (LiftingContext -> Type -> (CoercionN, a)) -> LiftingContext -> TyCoVar -> (LiftingContext, TyCoVar, CoercionN, a) Source #
isMappedByLC :: TyCoVar -> LiftingContext -> Bool Source #
Is a var in the domain of a lifting context?
substLeftCo :: LiftingContext -> Coercion -> Coercion Source #
substRightCo :: LiftingContext -> Coercion -> Coercion Source #
lcSubstLeft :: LiftingContext -> TCvSubst Source #
lcTCvSubst :: LiftingContext -> TCvSubst Source #
Extract the underlying substitution from the LiftingContext
lcInScopeSet :: LiftingContext -> InScopeSet Source #
Get the InScopeSet
from a LiftingContext
coercionKinds :: [Coercion] -> Pair [Type] Source #
Apply coercionKind
to multiple Coercion
s
coercionRole :: Coercion -> Role Source #
Retrieve the role from a coercion.
buildCoercion :: Type -> Type -> CoercionN Source #
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.
simplifyArgsWorker :: [TyCoBinder] -> Kind -> TyCoVarSet -> [Role] -> [(Type, Coercion)] -> ([Type], [Coercion], CoercionN) Source #
module TysWiredIn
module HscTypes
data SpliceExplicitFlag Source #
ExplicitSplice | = $(f x y) |
ImplicitSplice | = f x y, i.e. a naked top level expression |
Instances
Data SpliceExplicitFlag Source # | |
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 IntWithInf Source #
An integer or infinity
Instances
Eq IntWithInf Source # | |
Defined in BasicTypes (==) :: IntWithInf -> IntWithInf -> Bool # (/=) :: IntWithInf -> IntWithInf -> Bool # | |
Num IntWithInf Source # | |
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 Source # | |
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 Source # | |
Defined in BasicTypes |
data FractionalLit Source #
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 IntegralLit Source #
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 InlineSpec Source #
Inline Specification
Instances
Eq InlineSpec Source # | |
Defined in BasicTypes (==) :: InlineSpec -> InlineSpec -> Bool # (/=) :: InlineSpec -> InlineSpec -> Bool # | |
Data InlineSpec Source # | |
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 Source # | |
Defined in BasicTypes showsPrec :: Int -> InlineSpec -> ShowS # show :: InlineSpec -> String # showList :: [InlineSpec] -> ShowS # | |
Outputable InlineSpec Source # | |
Defined in BasicTypes | |
Binary InlineSpec Source # | |
data InlinePragma Source #
InlinePragma | |
|
Instances
Eq InlinePragma Source # | |
Defined in BasicTypes (==) :: InlinePragma -> InlinePragma -> Bool # (/=) :: InlinePragma -> InlinePragma -> Bool # | |
Data InlinePragma Source # | |
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 # | |
Outputable InlinePragma Source # | |
Defined in BasicTypes | |
Binary InlinePragma Source # | |
data RuleMatchInfo Source #
Rule Match Information
Instances
Eq RuleMatchInfo Source # | |
Defined in BasicTypes (==) :: RuleMatchInfo -> RuleMatchInfo -> Bool # (/=) :: RuleMatchInfo -> RuleMatchInfo -> Bool # | |
Data RuleMatchInfo Source # | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RuleMatchInfo -> c RuleMatchInfo # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RuleMatchInfo # toConstr :: RuleMatchInfo -> Constr # dataTypeOf :: RuleMatchInfo -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RuleMatchInfo) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatchInfo) # gmapT :: (forall b. Data b => b -> b) -> RuleMatchInfo -> RuleMatchInfo # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatchInfo -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatchInfo -> r # gmapQ :: (forall d. Data d => d -> u) -> RuleMatchInfo -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> RuleMatchInfo -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo # | |
Show RuleMatchInfo Source # | |
Defined in BasicTypes showsPrec :: Int -> RuleMatchInfo -> ShowS # show :: RuleMatchInfo -> String # showList :: [RuleMatchInfo] -> ShowS # | |
Outputable RuleMatchInfo Source # | |
Defined in BasicTypes | |
Binary RuleMatchInfo Source # | |
data Activation Source #
Instances
Eq Activation Source # | |
Defined in BasicTypes (==) :: Activation -> Activation -> Bool # (/=) :: Activation -> Activation -> Bool # | |
Data Activation Source # | |
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 # | |
Outputable Activation Source # | |
Defined in BasicTypes | |
Binary Activation Source # | |
data CompilerPhase Source #
Instances
Outputable CompilerPhase Source # | |
Defined in BasicTypes |
data SourceText Source #
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 Source # | |
Defined in BasicTypes (==) :: SourceText -> SourceText -> Bool # (/=) :: SourceText -> SourceText -> Bool # | |
Data SourceText Source # | |
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 Source # | |
Defined in BasicTypes showsPrec :: Int -> SourceText -> ShowS # show :: SourceText -> String # showList :: [SourceText] -> ShowS # | |
Outputable SourceText Source # | |
Defined in BasicTypes | |
Binary SourceText Source # | |
data SuccessFlag Source #
Instances
Outputable SuccessFlag Source # | |
Defined in BasicTypes |
data DefMethSpec ty Source #
Default Method Specification
Instances
Outputable (DefMethSpec ty) Source # | |
Defined in BasicTypes | |
Binary (DefMethSpec IfaceType) Source # | |
data TailCallInfo Source #
Instances
Eq TailCallInfo Source # | |
Defined in BasicTypes (==) :: TailCallInfo -> TailCallInfo -> Bool # (/=) :: TailCallInfo -> TailCallInfo -> Bool # | |
Outputable TailCallInfo Source # | |
Defined in BasicTypes |
type InterestingCxt = Bool Source #
Interesting Context
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 |
|
Instances
Eq TupleSort Source # | |
Data TupleSort Source # | |
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 Source # | |
A general-purpose pretty-printing precedence type.
data OverlapMode Source #
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 Source # | |
Defined in BasicTypes (==) :: OverlapMode -> OverlapMode -> Bool # (/=) :: OverlapMode -> OverlapMode -> Bool # | |
Data OverlapMode Source # | |
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 # | |
Outputable OverlapMode Source # | |
Defined in BasicTypes | |
Binary OverlapMode Source # | |
data OverlapFlag Source #
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 Source # | |
Defined in BasicTypes (==) :: OverlapFlag -> OverlapFlag -> Bool # (/=) :: OverlapFlag -> OverlapFlag -> Bool # | |
Data OverlapFlag Source # | |
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 # | |
Outputable OverlapFlag Source # | |
Defined in BasicTypes | |
Binary OverlapFlag Source # | |
Instances
Eq Origin Source # | |
Data Origin Source # | |
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 Source # | |
Recursivity Flag
Instances
Eq RecFlag Source # | |
Data RecFlag Source # | |
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 # | |
Outputable RecFlag Source # | |
Binary RecFlag Source # | |
Instances
Eq Boxity Source # | |
Data Boxity Source # | |
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 Source # | |
data TopLevelFlag Source #
Instances
Outputable TopLevelFlag Source # | |
Defined in BasicTypes |
data LexicalFixity Source #
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 Source # | |
Defined in BasicTypes (==) :: LexicalFixity -> LexicalFixity -> Bool # (/=) :: LexicalFixity -> LexicalFixity -> Bool # | |
Data LexicalFixity Source # | |
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 Source # | |
Defined in BasicTypes |
data FixityDirection Source #
Instances
Eq FixityDirection Source # | |
Defined in BasicTypes (==) :: FixityDirection -> FixityDirection -> Bool # (/=) :: FixityDirection -> FixityDirection -> Bool # | |
Data FixityDirection Source # | |
Defined in BasicTypes gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FixityDirection -> c FixityDirection # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FixityDirection # toConstr :: FixityDirection -> Constr # dataTypeOf :: FixityDirection -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FixityDirection) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FixityDirection) # gmapT :: (forall b. Data b => b -> b) -> FixityDirection -> FixityDirection # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r # gmapQ :: (forall d. Data d => d -> u) -> FixityDirection -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FixityDirection -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection # | |
Outputable FixityDirection Source # | |
Defined in BasicTypes | |
Binary FixityDirection Source # | |
Instances
Eq Fixity Source # | |
Data Fixity Source # | |
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 # | |
Outputable Fixity Source # | |
Binary Fixity Source # | |
type RuleName = FastString Source #
data WarningTxt Source #
Warning Text
reason/explanation from a WARNING or DEPRECATED pragma
WarningTxt (Located SourceText) [Located StringLiteral] | |
DeprecatedTxt (Located SourceText) [Located StringLiteral] |
Instances
Eq WarningTxt Source # | |
Defined in BasicTypes (==) :: WarningTxt -> WarningTxt -> Bool # (/=) :: WarningTxt -> WarningTxt -> Bool # | |
Data WarningTxt Source # | |
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 # | |
Outputable WarningTxt Source # | |
Defined in BasicTypes | |
Binary WarningTxt Source # | |
data StringLiteral Source #
A String Literal in the source, including its original raw format for use by source to source manipulation tools.
Instances
Eq StringLiteral Source # | |
Defined in BasicTypes (==) :: StringLiteral -> StringLiteral -> Bool # (/=) :: StringLiteral -> StringLiteral -> Bool # | |
Data StringLiteral Source # | |
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 # | |
Outputable StringLiteral Source # | |
Defined in BasicTypes | |
Binary StringLiteral Source # | |
data FunctionOrData Source #
Instances
data PromotionFlag Source #
Is a TyCon a promoted data constructor or just a normal type constructor?
Instances
Eq PromotionFlag Source # | |
Defined in BasicTypes (==) :: PromotionFlag -> PromotionFlag -> Bool # (/=) :: PromotionFlag -> PromotionFlag -> Bool # | |
Data PromotionFlag Source # | |
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 Source # | |
data OneShotInfo Source #
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 Source # | |
Defined in BasicTypes (==) :: OneShotInfo -> OneShotInfo -> Bool # (/=) :: OneShotInfo -> OneShotInfo -> Bool # | |
Outputable OneShotInfo Source # | |
Defined in BasicTypes |
Constructor Tag
Type of the tags associated with each constructor possibility or superclass selector
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.
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
data LeftOrRight Source #
Instances
Eq LeftOrRight Source # | |
Defined in BasicTypes (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool # | |
Data LeftOrRight Source # | |
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 # | |
Outputable LeftOrRight Source # | |
Defined in BasicTypes | |
Binary LeftOrRight Source # | |
pickLR :: LeftOrRight -> (a, a) -> a Source #
Tags are allocated from here for real constructors or for superclass selectors
noOneShotInfo :: OneShotInfo Source #
It is always safe to assume that an Id
has no lambda-bound variable information
isOneShotInfo :: OneShotInfo -> Bool Source #
hasNoOneShotInfo :: OneShotInfo -> Bool Source #
worstOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo Source #
bestOneShot :: OneShotInfo -> OneShotInfo -> OneShotInfo Source #
isPromoted :: PromotionFlag -> Bool Source #
bumpVersion :: Version -> Version Source #
pprWarningTxtForMsg :: WarningTxt -> SDoc Source #
pprRuleName :: RuleName -> SDoc Source #
maxPrecedence :: Int Source #
minPrecedence :: Int Source #
funTyFixity :: Fixity Source #
isNotTopLevel :: TopLevelFlag -> Bool Source #
isTopLevel :: TopLevelFlag -> Bool Source #
boolToRecFlag :: Bool -> RecFlag Source #
isGenerated :: Origin -> Bool Source #
hasIncoherentFlag :: OverlapMode -> Bool Source #
hasOverlappingFlag :: OverlapMode -> Bool Source #
tupleSortBoxity :: TupleSort -> Boxity Source #
boxityTupleSort :: Boxity -> TupleSort Source #
:: (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 | |".
isManyOccs :: OccInfo -> Bool Source #
seqOccInfo :: OccInfo -> () Source #
tailCallInfo :: OccInfo -> TailCallInfo Source #
zapOccTailCallInfo :: OccInfo -> OccInfo Source #
isAlwaysTailCalled :: OccInfo -> Bool Source #
isWeakLoopBreaker :: OccInfo -> Bool Source #
isStrongLoopBreaker :: OccInfo -> Bool Source #
zapFragileOcc :: OccInfo -> OccInfo Source #
successIf :: Bool -> SuccessFlag Source #
succeeded :: SuccessFlag -> Bool Source #
failed :: SuccessFlag -> Bool Source #
pprWithSourceText :: SourceText -> SDoc -> SDoc Source #
Special combinator for showing string literals.
isConLike :: RuleMatchInfo -> Bool Source #
isFunLike :: RuleMatchInfo -> Bool Source #
noUserInlineSpec :: InlineSpec -> Bool Source #
isInlinePragma :: InlinePragma -> Bool Source #
isInlinablePragma :: InlinePragma -> Bool Source #
isAnyInlinePragma :: InlinePragma -> Bool Source #
inlinePragmaSat :: InlinePragma -> Maybe Arity Source #
pprInline :: InlinePragma -> SDoc Source #
pprInlineDebug :: InlinePragma -> SDoc Source #
isActive :: CompilerPhase -> Activation -> Bool Source #
isActiveIn :: PhaseNum -> Activation -> Bool Source #
competesWith :: Activation -> Activation -> Bool Source #
isNeverActive :: Activation -> Bool Source #
isAlwaysActive :: Activation -> Bool Source #
isEarlyActive :: Activation -> Bool Source #
mkIntegralLit :: Integral a => a -> IntegralLit Source #
mkFractionalLit :: Real a => a -> FractionalLit Source #
integralFractionalLit :: Bool -> Integer -> FractionalLit Source #
infinity :: IntWithInf Source #
A representation of infinity
intGtLimit :: Int -> IntWithInf -> Bool Source #
treatZeroAsInf :: Int -> IntWithInf Source #
Turn a positive number into an IntWithInf
, where 0 represents infinity
mkIntWithInf :: Int -> IntWithInf Source #
Inject any integer into an IntWithInf
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
class Uniquable a where Source #
Class of things that we can obtain a Unique
from
Instances
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.
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.