GhcPlugins

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

GhcPlugins

Description

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
- mkVectOcc :: Maybe String -> OccName -> OccName
- mkVectTyConOcc :: Maybe String -> OccName -> OccName
- mkVectDataConOcc :: Maybe String -> OccName -> OccName
- mkVectIsoOcc :: Maybe String -> OccName -> OccName
- mkPADFunOcc :: Maybe String -> OccName -> OccName
- mkPReprTyConOcc :: Maybe String -> OccName -> OccName
- mkPDataTyConOcc :: Maybe String -> OccName -> OccName
- mkPDatasTyConOcc :: Maybe String -> OccName -> OccName
- mkPDataDataConOcc :: Maybe String -> OccName -> OccName
- mkPDatasDataConOcc :: Maybe String -> 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
- mkVectOcc :: Maybe String -> OccName -> OccName
- mkVectTyConOcc :: Maybe String -> OccName -> OccName
- mkVectDataConOcc :: Maybe String -> OccName -> OccName
- mkVectIsoOcc :: Maybe String -> OccName -> OccName
- mkPADFunOcc :: Maybe String -> OccName -> OccName
- mkPReprTyConOcc :: Maybe String -> OccName -> OccName
- mkPDataTyConOcc :: Maybe String -> OccName -> OccName
- mkPDatasTyConOcc :: Maybe String -> OccName -> OccName
- mkPDataDataConOcc :: Maybe String -> OccName -> OccName
- mkPDatasDataConOcc :: Maybe String -> 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
- data BuiltInSyntax
  - = BuiltInSyntax
  - | UserSyntax
- 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 :: 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
- mkLocalisedOccName :: Module -> (Maybe String -> OccName -> OccName) -> Name -> OccName
- stableNameCmp :: Name -> Name -> Ordering
- 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 :: (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
- isExitJoinId :: Var -> Bool
- 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 TyBinder
- data TCvSubst = TCvSubst InScopeSet TvSubstEnv CvSubstEnv
- data TyThing
  - = AnId Id
  - | AConLike ConLike
  - | ATyCon TyCon
  - | ACoAxiom (CoAxiom Branched)
- data Type
- pprType :: Type -> SDoc
- pprKind :: Kind -> SDoc
- data TyPrec
  - = TopPrec
  - | FunPrec
  - | TyOpPrec
  - | TyConPrec
- maybeParen :: TyPrec -> TyPrec -> SDoc -> SDoc
- type TyVarBinder = TyVarBndr TyVar ArgFlag
- data ArgFlag
  - = Required
  - | Specified
  - | Inferred
- data Var
- type TyCoVar = Id
- type TyVar = Var
- isVisibleArgFlag :: ArgFlag -> Bool
- isInvisibleArgFlag :: ArgFlag -> Bool
- sameVis :: ArgFlag -> ArgFlag -> Bool
- binderVar :: TyVarBndr tv argf -> tv
- binderVars :: [TyVarBndr tv argf] -> [tv]
- binderArgFlag :: TyVarBndr tv argf -> argf
- binderKind :: TyVarBndr TyVar argf -> Kind
- mkTyVarBinder :: ArgFlag -> Var -> TyVarBinder
- mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder]
- tyVarKind :: TyVar -> Kind
- isTyVar :: Var -> Bool
- liftedTypeKind :: Kind
- splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type])
- toposortTyVars :: [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 KindOrType = Type
- pprShortTyThing :: TyThing -> SDoc
- pprTyThingCategory :: TyThing -> SDoc
- isInvisibleBinder :: TyBinder -> Bool
- isVisibleBinder :: TyBinder -> Bool
- mkTyVarTy :: TyVar -> Type
- mkTyVarTys :: [TyVar] -> [Type]
- mkFunTy :: Type -> Type -> Type
- mkFunTys :: [Type] -> Type -> Type
- mkForAllTy :: TyVar -> ArgFlag -> Type -> Type
- mkForAllTys :: [TyVarBinder] -> Type -> Type
- mkPiTy :: TyBinder -> Type -> Type
- mkPiTys :: [TyBinder] -> Type -> Type
- isCoercionType :: Type -> Bool
- mkTyConTy :: TyCon -> Type
- isRuntimeRepTy :: Type -> Bool
- isRuntimeRepVar :: TyVar -> Bool
- tyCoVarsOfType :: Type -> TyCoVarSet
- tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet
- tyCoFVsOfType :: Type -> FV
- tyCoFVsBndr :: TyVarBinder -> FV -> FV
- tyCoVarsOfTypes :: [Type] -> TyCoVarSet
- coVarsOfType :: Type -> CoVarSet
- coVarsOfTypes :: [Type] -> TyCoVarSet
- closeOverKinds :: TyVarSet -> TyVarSet
- closeOverKindsList :: [TyVar] -> [TyVar]
- 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
- extendTvSubstBinderAndInScope :: TCvSubst -> TyBinder -> Type -> TCvSubst
- extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst
- extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst
- extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst
- unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst
- zipTvSubst :: [TyVar] -> [Type] -> TCvSubst
- mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst
- zipTyEnv :: [TyVar] -> [Type] -> TvSubstEnv
- zipCoEnv :: [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)
- cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar)
- cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar])
- pprParendType :: Type -> SDoc
- pprPrecType :: TyPrec -> Type -> SDoc
- pprParendKind :: Kind -> SDoc
- pprClassPred :: Class -> [Type] -> SDoc
- pprTheta :: ThetaType -> SDoc
- pprThetaArrowTy :: ThetaType -> SDoc
- pprSigmaType :: Type -> SDoc
- pprForAll :: [TyVarBinder] -> SDoc
- pprUserForAll :: [TyVarBinder] -> SDoc
- pprTvBndrs :: [TyVarBinder] -> SDoc
- pprTvBndr :: TyVarBinder -> SDoc
- pprTyVars :: [TyVar] -> SDoc
- pprTyVar :: TyVar -> SDoc
- pprTypeApp :: TyCon -> [Type] -> SDoc
- ppSuggestExplicitKinds :: SDoc
- tidyTyCoVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyTyCoVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyTyVarBinder :: TidyEnv -> TyVarBndr TyVar vis -> (TidyEnv, TyVarBndr TyVar vis)
- tidyTyVarBinders :: TidyEnv -> [TyVarBndr TyVar vis] -> (TidyEnv, [TyVarBndr TyVar vis])
- tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv
- tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar])
- tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar)
- tidyTyVarOcc :: TidyEnv -> TyVar -> TyVar
- 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
  - = ClassPred Class [Type]
  - | EqPred EqRel Type Type
  - | IrredPred PredType
- data EqRel
  - = NomEq
  - | ReprEq
- data TyCoMapper env m = TyCoMapper {
  - tcm_smart :: Bool
  - tcm_tyvar :: env -> TyVar -> m Type
  - tcm_covar :: env -> CoVar -> m Coercion
  - tcm_hole :: env -> CoercionHole -> m Coercion
  - tcm_tybinder :: env -> TyVar -> ArgFlag -> m (env, TyVar)
  }
- 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)
- tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type])
- tcRepSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (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
- 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)
- tyConBindersTyBinders :: [TyConBinder] -> [TyBinder]
- mkCoercionTy :: Coercion -> Type
- isCoercionTy_maybe :: Type -> Maybe Coercion
- stripCoercionTy :: Type -> Coercion
- mkInvForAllTy :: TyVar -> Type -> Type
- mkInvForAllTys :: [TyVar] -> Type -> Type
- mkSpecForAllTys :: [TyVar] -> Type -> Type
- mkVisForAllTys :: [TyVar] -> Type -> Type
- mkLamType :: Var -> Type -> Type
- mkLamTypes :: [Var] -> Type -> Type
- mkTyConBindersPreferAnon :: [TyVar] -> Type -> [TyConBinder]
- splitForAllTys :: Type -> ([TyVar], Type)
- splitForAllTyVarBndrs :: Type -> ([TyVarBinder], Type)
- isForAllTy :: Type -> Bool
- isPiTy :: Type -> Bool
- splitForAllTy :: Type -> (TyVar, Type)
- dropForAlls :: Type -> Type
- splitForAllTy_maybe :: Type -> Maybe (TyVar, Type)
- splitPiTy_maybe :: Type -> Maybe (TyBinder, Type)
- splitPiTy :: Type -> (TyBinder, Type)
- splitPiTys :: Type -> ([TyBinder], Type)
- splitPiTysInvisible :: Type -> ([TyBinder], Type)
- filterOutInvisibleTypes :: TyCon -> [Type] -> [Type]
- partitionInvisibles :: TyCon -> (a -> Type) -> [a] -> ([a], [a])
- isTauTy :: Type -> Bool
- mkAnonBinder :: Type -> TyBinder
- isAnonTyBinder :: TyBinder -> Bool
- isNamedTyBinder :: TyBinder -> Bool
- tyBinderType :: TyBinder -> Type
- binderRelevantType_maybe :: TyBinder -> Maybe Type
- caseBinder :: TyBinder -> (TyVarBinder -> a) -> (Type -> a) -> a
- 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 :: 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]
- 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
- getRuntimeRepFromKind :: HasDebugCallStack => Type -> Type
- getRuntimeRepFromKind_maybe :: HasDebugCallStack => Type -> Maybe 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
- isTypeLevPoly :: Type -> Bool
- resultIsLevPoly :: Type -> Bool
- 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
- module TyCon
- data UnivCoProvenance
- data Coercion
- data LeftOrRight
  - = CLeft
  - | CRight
- pickLR :: LeftOrRight -> (a, a) -> a
- data Var
- type TyCoVar = Id
- type CoVar = Id
- mkCoVar :: Name -> Type -> CoVar
- isCoVar :: Var -> Bool
- data Role
  - = Nominal
  - | Representational
  - | Phantom
- 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 :: CoVar -> (Kind, Kind, Type, Type, Role)
- isReflexiveCo :: Coercion -> Bool
- isReflCo :: Coercion -> Bool
- mkFunCos :: Role -> [Coercion] -> Coercion -> Coercion
- mkProofIrrelCo :: Role -> Coercion -> Coercion -> Coercion -> Coercion
- mkSubCo :: Coercion -> Coercion
- mkKindCo :: Coercion -> Coercion
- mkCoherenceCo :: Coercion -> Coercion -> Coercion
- mkInstCo :: Coercion -> Coercion -> Coercion
- mkLRCo :: LeftOrRight -> Coercion -> Coercion
- mkNthCo :: 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 :: TyVar -> Coercion -> Coercion -> Coercion
- mkAppCo :: Coercion -> Coercion -> Coercion
- mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion
- mkReflCo :: Role -> Type -> Coercion
- type CvSubstEnv = CoVarEnv Coercion
- data CoercionHole
- type CoercionP = Coercion
- type CoercionR = Coercion
- type CoercionN = Coercion
- tyCoVarsOfCo :: Coercion -> TyCoVarSet
- tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet
- tyCoFVsOfCo :: Coercion -> FV
- tyCoVarsOfCos :: [Coercion] -> TyCoVarSet
- 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 :: 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
- pprCoAxiom :: CoAxiom br -> SDoc
- pprCoAxBranch :: CoAxiom br -> CoAxBranch -> SDoc
- pprCoAxBranchHdr :: CoAxiom br -> BranchIndex -> SDoc
- decomposeCo :: Arity -> Coercion -> [Coercion]
- decomposeFunCo :: 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 (TyVar, Coercion, Coercion)
- coVarTypes :: CoVar -> Pair Type
- coVarKind :: CoVar -> Type
- mkHeteroCoercionType :: Role -> Kind -> Kind -> Type -> Type -> Type
- isReflCoVar_maybe :: CoVar -> Maybe Coercion
- isReflCo_maybe :: Coercion -> Maybe (Type, Role)
- isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role)
- mkRepReflCo :: Type -> Coercion
- mkNomReflCo :: Type -> Coercion
- mkAppCos :: Coercion -> [Coercion] -> Coercion
- mkTransAppCo :: Role -> Coercion -> Type -> Type -> Role -> Coercion -> Type -> Type -> Role -> Coercion
- mkForAllCos :: [(TyVar, Coercion)] -> Coercion -> Coercion
- mkHomoForAllCos :: [TyVar] -> Coercion -> Coercion
- mkHomoForAllCos_NoRefl :: [TyVar] -> 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
- mkNthCoRole :: Role -> Int -> Coercion -> Coercion
- mkCoherenceRightCo :: Coercion -> Coercion -> Coercion
- mkCoherenceLeftCo :: Coercion -> Coercion -> Coercion
- downgradeRole :: Role -> Role -> Coercion -> Coercion
- maybeSubCo :: EqRel -> Coercion -> Coercion
- mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion
- setNominalRole_maybe :: Coercion -> Maybe Coercion
- mkHomoPhantomCo :: Type -> Type -> Coercion
- toPhantomCo :: Coercion -> Coercion
- tyConRolesX :: Role -> TyCon -> [Role]
- tyConRolesRepresentational :: TyCon -> [Role]
- nthRole :: Role -> TyCon -> Int -> Role
- ltRole :: Role -> Role -> Bool
- promoteCoercion :: Coercion -> Coercion
- castCoercionKind :: Coercion -> Coercion -> Coercion -> Coercion
- mkPiCos :: Role -> [Var] -> Coercion -> Coercion
- mkPiCo :: Role -> Var -> Coercion -> Coercion
- mkCoCast :: Coercion -> Coercion -> 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] -> [TyVar] -> [Type] -> (Type -> Coercion, [Type])
- liftCoSubstWith :: Role -> [TyCoVar] -> [Coercion] -> Type -> Coercion
- emptyLiftingContext :: InScopeSet -> LiftingContext
- mkSubstLiftingContext :: TCvSubst -> LiftingContext
- extendLiftingContext :: LiftingContext -> TyVar -> Coercion -> LiftingContext
- zapLiftingContext :: LiftingContext -> LiftingContext
- substForAllCoBndrCallbackLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyVar -> Coercion -> (LiftingContext, TyVar, Coercion)
- liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion
- liftCoSubstVarBndrCallback :: (LiftingContext -> Type -> (Coercion, a)) -> LiftingContext -> TyVar -> (LiftingContext, TyVar, Coercion, 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
- module TysWiredIn
- module HscTypes
- data SpliceExplicitFlag
  - = ExplicitSplice
  - | ImplicitSplice
- data IntWithInf
- data FractionalLit = FL {
  - fl_text :: SourceText
  - fl_neg :: Bool
  - fl_value :: Rational
  }
- data IntegralLit = IL {
  - il_text :: SourceText
  - il_neg :: Bool
  - il_value :: Integer
  }
- data InlineSpec
  - = Inline
  - | Inlinable
  - | NoInline
  - | NoUserInline
- data InlinePragma = InlinePragma {
  - inl_src :: SourceText
  - inl_inline :: InlineSpec
  - inl_sat :: Maybe Arity
  - inl_act :: Activation
  - inl_rule :: RuleMatchInfo
  }
- data RuleMatchInfo
  - = ConLike
  - | FunLike
- data Activation
  - = NeverActive
  - | AlwaysActive
  - | ActiveBefore SourceText PhaseNum
  - | ActiveAfter SourceText PhaseNum
- data CompilerPhase
  - = Phase PhaseNum
  - | InitialPhase
- type PhaseNum = Int
- data SourceText
  - = SourceText String
  - | NoSourceText
- data SuccessFlag
  - = Succeeded
  - | Failed
- data DefMethSpec ty
  - = VanillaDM
  - | GenericDM ty
- data TailCallInfo
  - = AlwaysTailCalled JoinArity
  - | NoTailCallInfo
- type OneBranch = Bool
- type InsideLam = Bool
- type InterestingCxt = Bool
- data OccInfo
  - = ManyOccs {
    - occ_tail :: !TailCallInfo
    }
  - | IAmDead
  - | OneOcc {
    - occ_in_lam :: !InsideLam
    - occ_one_br :: !OneBranch
    - occ_int_cxt :: !InterestingCxt
    - occ_tail :: !TailCallInfo
    }
  - | IAmALoopBreaker {
    - occ_rules_only :: !RulesOnly
    - occ_tail :: !TailCallInfo
    }
- data EP a = EP {
  - fromEP :: a
  - toEP :: a
  }
- data TupleSort
  - = BoxedTuple
  - | UnboxedTuple
  - | ConstraintTuple
- data TyPrec
  - = TopPrec
  - | FunPrec
  - | TyOpPrec
  - | TyConPrec
- data OverlapMode
  - = NoOverlap SourceText
  - | Overlappable SourceText
  - | Overlapping SourceText
  - | Overlaps SourceText
  - | Incoherent SourceText
- data OverlapFlag = OverlapFlag {
  - overlapMode :: OverlapMode
  - isSafeOverlap :: Bool
  }
- data DerivStrategy
  - = StockStrategy
  - | AnyclassStrategy
  - | NewtypeStrategy
- data Origin
  - = FromSource
  - | Generated
- data RecFlag
  - = Recursive
  - | NonRecursive
- data Boxity
  - = Boxed
  - | Unboxed
- data TopLevelFlag
  - = TopLevel
  - | NotTopLevel
- data LexicalFixity
  - = Prefix
  - | Infix
- data FixityDirection
  - = InfixL
  - | InfixR
  - | InfixN
- data Fixity = Fixity SourceText Int FixityDirection
- type RuleName = FastString
- data WarningTxt
  - = WarningTxt (Located SourceText) [Located StringLiteral]
  - | DeprecatedTxt (Located SourceText) [Located StringLiteral]
- data StringLiteral = StringLiteral {
  - sl_st :: SourceText
  - sl_fs :: FastString
  }
- data FunctionOrData
  - = IsFunction
  - | IsData
- data SwapFlag
  - = NotSwapped
  - | IsSwapped
- data OneShotInfo
  - = NoOneShotInfo
  - | OneShotLam
- type Alignment = Int
- type ConTagZ = Int
- type ConTag = Int
- type JoinArity = Int
- type RepArity = Int
- type Arity = Int
- data LeftOrRight
  - = CLeft
  - | CRight
- 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
- 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
- maybeParen :: TyPrec -> TyPrec -> 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
- 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

# Documentation

module Plugins

module RdrName

data OccName #

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 # |
Instance details Defined in OccName Methods (==) :: OccName -> OccName -> Bool # (/=) :: OccName -> OccName -> Bool #
Data OccName # |
Instance details Defined in OccName Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName Source # toConstr :: OccName -> Constr Source # dataTypeOf :: OccName -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) Source # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source #
Ord OccName # |
Instance details Defined in OccName Methods compare :: OccName -> OccName -> Ordering # (<) :: OccName -> OccName -> Bool # (<=) :: OccName -> OccName -> Bool # (>) :: OccName -> OccName -> Bool # (>=) :: OccName -> OccName -> Bool # max :: OccName -> OccName -> OccName # min :: OccName -> OccName -> OccName #
NFData OccName # |
Instance details Defined in OccName Methods rnf :: OccName -> () Source #
OutputableBndr OccName # |
Instance details Defined in OccName Methods pprBndr :: BindingSite -> OccName -> SDoc # pprPrefixOcc :: OccName -> SDoc # pprInfixOcc :: OccName -> SDoc # bndrIsJoin_maybe :: OccName -> Maybe Int #
Outputable OccName # |
Instance details Defined in OccName Methods ppr :: OccName -> SDoc # pprPrec :: Rational -> OccName -> SDoc #
Uniquable OccName # |
Instance details Defined in OccName Methods getUnique :: OccName -> Unique #
Binary OccName # |
Instance details Defined in OccName Methods put_ :: BinHandle -> OccName -> IO () # put :: BinHandle -> OccName -> IO (Bin OccName) # get :: BinHandle -> IO OccName #
HasOccName OccName # |
Instance details Defined in OccName Methods occName :: OccName -> OccName #

type FastStringEnv a = UniqFM a #

A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in UniqDFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.

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 #

Instances

Data a => Data (OccEnv a) # |
Instance details Defined in OccName Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) Source # toConstr :: OccEnv a -> Constr Source # dataTypeOf :: OccEnv a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) Source # gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source #
Outputable a => Outputable (OccEnv a) # |
Instance details Defined in OccName Methods ppr :: OccEnv a -> SDoc # pprPrec :: Rational -> OccEnv a -> SDoc #

class HasOccName name where #

Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.

Minimal complete definition

occName

Methods

occName :: name -> OccName #

Instances

HasOccName Name # |
Instance details Defined in Name Methods occName :: Name -> OccName #
HasOccName OccName # |
Instance details Defined in OccName Methods occName :: OccName -> OccName #
HasOccName RdrName # |
Instance details Defined in RdrName Methods occName :: RdrName -> OccName #
HasOccName Var # |
Instance details Defined in Var Methods occName :: Var -> OccName #
HasOccName IfaceConDecl # |
Instance details Defined in IfaceSyn Methods occName :: IfaceConDecl -> OccName #
HasOccName IfaceClassOp # |
Instance details Defined in IfaceSyn Methods occName :: IfaceClassOp -> OccName #
HasOccName IfaceDecl # |
Instance details Defined in IfaceSyn Methods occName :: IfaceDecl -> OccName #
HasOccName TcBinder # |
Instance details Defined in TcRnTypes Methods occName :: TcBinder -> OccName #
HasOccName name => HasOccName (IEWrappedName name) # |
Instance details Defined in HsImpExp Methods occName :: IEWrappedName name -> OccName #

data NameSpace #

Instances

Eq NameSpace # |
Instance details Defined in OccName Methods (==) :: NameSpace -> NameSpace -> Bool # (/=) :: NameSpace -> NameSpace -> Bool #
Ord NameSpace # |
Instance details Defined in OccName Methods compare :: NameSpace -> NameSpace -> Ordering # (<) :: NameSpace -> NameSpace -> Bool # (<=) :: NameSpace -> NameSpace -> Bool # (>) :: NameSpace -> NameSpace -> Bool # (>=) :: NameSpace -> NameSpace -> Bool # max :: NameSpace -> NameSpace -> NameSpace # min :: NameSpace -> NameSpace -> NameSpace #
Binary NameSpace # |
Instance details Defined in OccName Methods put_ :: BinHandle -> NameSpace -> IO () # put :: BinHandle -> NameSpace -> IO (Bin NameSpace) # get :: BinHandle -> IO 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 #

Value `OccNames`s are those that are either in the variable or data constructor namespaces

isDataOcc :: OccName -> Bool #

isDataSymOcc :: OccName -> Bool #

Test if the `OccName` is a data constructor that starts with a symbol (e.g. `:`, or `[]`)

isSymOcc :: OccName -> Bool #

Test if the `OccName` is that for any operator (whether it is a data constructor or variable or whatever)

parenSymOcc :: OccName -> SDoc -> SDoc #

Wrap parens around an operator

startsWithUnderscore :: OccName -> Bool #

Haskell 98 encourages compilers to suppress warnings about unsed names in a pattern if they start with `_`: this implements that test

isDerivedOccName :: OccName -> Bool #

Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints

isDefaultMethodOcc :: OccName -> Bool #

isTypeableBindOcc :: OccName -> Bool #

Is an `OccName` one of a Typeable `TyCon` or `Module` binding? This is needed as these bindings are renamed differently. See Note [Grand plan for Typeable] in TcTypeable.

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 #

mkVectOcc :: Maybe String -> OccName -> OccName #

mkVectTyConOcc :: Maybe String -> OccName -> OccName #

mkVectDataConOcc :: Maybe String -> OccName -> OccName #

mkVectIsoOcc :: Maybe String -> OccName -> OccName #

mkPADFunOcc :: Maybe String -> OccName -> OccName #

mkPReprTyConOcc :: Maybe String -> OccName -> OccName #

mkPDataTyConOcc :: Maybe String -> OccName -> OccName #

mkPDatasTyConOcc :: Maybe String -> OccName -> OccName #

mkPDataDataConOcc :: Maybe String -> OccName -> OccName #

mkPDatasDataConOcc :: Maybe String -> OccName -> OccName #

mkRecFldSelOcc :: String -> OccName #

mkDataConWorkerOcc :: OccName -> OccName #

mkSuperDictAuxOcc :: Int -> OccName -> OccName #

mkSuperDictSelOcc #

Arguments

:: Int | Index of superclass, e.g. 3
-> OccName | Class, e.g. `Ord`
-> OccName | Derived `Occname`, e.g. `$p3Ord`

mkLocalOcc #

Arguments

:: Unique | Unique to combine with the `OccName`
-> OccName | Local name, e.g. `sat`
-> OccName | Nice unique version, e.g. `$L23sat`

mkInstTyTcOcc #

Arguments

:: String | Family name, e.g. `Map`
-> OccSet | avoid these Occs
-> OccName |
    R:Map

Derive a name for the representation type constructor of a `data`/`newtype` instance.

mkDFunOcc #

Arguments

:: String | Typically the class and type glommed together e.g. `OrdMaybe`. Only used in debug mode, for extra clarity
-> Bool | Is this a hs-boot instance DFun?
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe`

mkDataTOcc #

Arguments

:: OccName | TyCon or data con string
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe` data T = MkT ... deriving( Data ) needs definitions for $tT :: Data.Generics.Basics.DataType $cMkT :: Data.Generics.Basics.Constr

mkDataCOcc #

Arguments

:: OccName | TyCon or data con string
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe` data T = MkT ... deriving( Data ) needs definitions for $tT :: Data.Generics.Basics.DataType $cMkT :: Data.Generics.Basics.Constr

mkMethodOcc :: OccName -> OccName #

emptyTidyOccEnv :: TidyOccEnv #

initTidyOccEnv :: [OccName] -> TidyOccEnv #

avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv #

tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) #

data Name #

A unique, unambiguous name for something, containing information about where that thing originated.

Instances

Eq Name # |
Instance details Defined in Name Methods (==) :: Name -> Name -> Bool # (/=) :: Name -> Name -> Bool #
Data Name # |
Instance details Defined in Name Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name Source # toConstr :: Name -> Constr Source # dataTypeOf :: Name -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) Source # gmapT :: (forall b. Data b => b -> b) -> Name -> Name Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source #
Ord Name # |
Instance details Defined in Name Methods compare :: Name -> Name -> Ordering # (<) :: Name -> Name -> Bool # (<=) :: Name -> Name -> Bool # (>) :: Name -> Name -> Bool # (>=) :: Name -> Name -> Bool # max :: Name -> Name -> Name # min :: Name -> Name -> Name #
NFData Name # |
Instance details Defined in Name Methods rnf :: Name -> () Source #
OutputableBndr Name # |
Instance details Defined in Name Methods pprBndr :: BindingSite -> Name -> SDoc # pprPrefixOcc :: Name -> SDoc # pprInfixOcc :: Name -> SDoc # bndrIsJoin_maybe :: Name -> Maybe Int #
Outputable Name # |
Instance details Defined in Name Methods ppr :: Name -> SDoc # pprPrec :: Rational -> Name -> SDoc #
Uniquable Name # |
Instance details Defined in Name Methods getUnique :: Name -> Unique #
Binary Name # | Assumes that the `Name` is a non-binding one. See `putIfaceTopBndr` and `getIfaceTopBndr` for serializing binding `Name`s. See `UserData` for the rationale for this distinction.
Instance details Defined in Name Methods put_ :: BinHandle -> Name -> IO () # put :: BinHandle -> Name -> IO (Bin Name) # get :: BinHandle -> IO Name #
HasOccName Name # |
Instance details Defined in Name Methods occName :: Name -> OccName #
NamedThing Name # |
Instance details Defined in Name Methods getOccName :: Name -> OccName # getName :: Name -> Name #

data OccName #

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 # |
Instance details Defined in OccName Methods (==) :: OccName -> OccName -> Bool # (/=) :: OccName -> OccName -> Bool #
Data OccName # |
Instance details Defined in OccName Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccName -> c OccName Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OccName Source # toConstr :: OccName -> Constr Source # dataTypeOf :: OccName -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OccName) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OccName) Source # gmapT :: (forall b. Data b => b -> b) -> OccName -> OccName Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccName -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OccName -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccName -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccName -> m OccName Source #
Ord OccName # |
Instance details Defined in OccName Methods compare :: OccName -> OccName -> Ordering # (<) :: OccName -> OccName -> Bool # (<=) :: OccName -> OccName -> Bool # (>) :: OccName -> OccName -> Bool # (>=) :: OccName -> OccName -> Bool # max :: OccName -> OccName -> OccName # min :: OccName -> OccName -> OccName #
NFData OccName # |
Instance details Defined in OccName Methods rnf :: OccName -> () Source #
OutputableBndr OccName # |
Instance details Defined in OccName Methods pprBndr :: BindingSite -> OccName -> SDoc # pprPrefixOcc :: OccName -> SDoc # pprInfixOcc :: OccName -> SDoc # bndrIsJoin_maybe :: OccName -> Maybe Int #
Outputable OccName # |
Instance details Defined in OccName Methods ppr :: OccName -> SDoc # pprPrec :: Rational -> OccName -> SDoc #
Uniquable OccName # |
Instance details Defined in OccName Methods getUnique :: OccName -> Unique #
Binary OccName # |
Instance details Defined in OccName Methods put_ :: BinHandle -> OccName -> IO () # put :: BinHandle -> OccName -> IO (Bin OccName) # get :: BinHandle -> IO OccName #
HasOccName OccName # |
Instance details Defined in OccName Methods occName :: OccName -> OccName #

type FastStringEnv a = UniqFM a #

A non-deterministic set of FastStrings. See Note [Deterministic UniqFM] in UniqDFM for explanation why it's not deterministic and why it matters. Use DFastStringEnv if the set eventually gets converted into a list or folded over in a way where the order changes the generated code.

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 #

Instances

Data a => Data (OccEnv a) # |
Instance details Defined in OccName Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OccEnv a -> c (OccEnv a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (OccEnv a) Source # toConstr :: OccEnv a -> Constr Source # dataTypeOf :: OccEnv a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (OccEnv a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (OccEnv a)) Source # gmapT :: (forall b. Data b => b -> b) -> OccEnv a -> OccEnv a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OccEnv a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OccEnv a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OccEnv a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OccEnv a -> m (OccEnv a) Source #
Outputable a => Outputable (OccEnv a) # |
Instance details Defined in OccName Methods ppr :: OccEnv a -> SDoc # pprPrec :: Rational -> OccEnv a -> SDoc #

class HasOccName name where #

Other names in the compiler add additional information to an OccName. This class provides a consistent way to access the underlying OccName.

Minimal complete definition

occName

Methods

occName :: name -> OccName #

Instances

HasOccName Name # |
Instance details Defined in Name Methods occName :: Name -> OccName #
HasOccName OccName # |
Instance details Defined in OccName Methods occName :: OccName -> OccName #
HasOccName RdrName # |
Instance details Defined in RdrName Methods occName :: RdrName -> OccName #
HasOccName Var # |
Instance details Defined in Var Methods occName :: Var -> OccName #
HasOccName IfaceConDecl # |
Instance details Defined in IfaceSyn Methods occName :: IfaceConDecl -> OccName #
HasOccName IfaceClassOp # |
Instance details Defined in IfaceSyn Methods occName :: IfaceClassOp -> OccName #
HasOccName IfaceDecl # |
Instance details Defined in IfaceSyn Methods occName :: IfaceDecl -> OccName #
HasOccName TcBinder # |
Instance details Defined in TcRnTypes Methods occName :: TcBinder -> OccName #
HasOccName name => HasOccName (IEWrappedName name) # |
Instance details Defined in HsImpExp Methods occName :: IEWrappedName name -> OccName #

data NameSpace #

Instances

Eq NameSpace # |
Instance details Defined in OccName Methods (==) :: NameSpace -> NameSpace -> Bool # (/=) :: NameSpace -> NameSpace -> Bool #
Ord NameSpace # |
Instance details Defined in OccName Methods compare :: NameSpace -> NameSpace -> Ordering # (<) :: NameSpace -> NameSpace -> Bool # (<=) :: NameSpace -> NameSpace -> Bool # (>) :: NameSpace -> NameSpace -> Bool # (>=) :: NameSpace -> NameSpace -> Bool # max :: NameSpace -> NameSpace -> NameSpace # min :: NameSpace -> NameSpace -> NameSpace #
Binary NameSpace # |
Instance details Defined in OccName Methods put_ :: BinHandle -> NameSpace -> IO () # put :: BinHandle -> NameSpace -> IO (Bin NameSpace) # get :: BinHandle -> IO 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 #

Value `OccNames`s are those that are either in the variable or data constructor namespaces

isDataOcc :: OccName -> Bool #

isDataSymOcc :: OccName -> Bool #

Test if the `OccName` is a data constructor that starts with a symbol (e.g. `:`, or `[]`)

isSymOcc :: OccName -> Bool #

Test if the `OccName` is that for any operator (whether it is a data constructor or variable or whatever)

parenSymOcc :: OccName -> SDoc -> SDoc #

Wrap parens around an operator

startsWithUnderscore :: OccName -> Bool #

Haskell 98 encourages compilers to suppress warnings about unsed names in a pattern if they start with `_`: this implements that test

isDerivedOccName :: OccName -> Bool #

Test for definitions internally generated by GHC. This predicte is used to suppress printing of internal definitions in some debug prints

isDefaultMethodOcc :: OccName -> Bool #

isTypeableBindOcc :: OccName -> Bool #

Is an `OccName` one of a Typeable `TyCon` or `Module` binding? This is needed as these bindings are renamed differently. See Note [Grand plan for Typeable] in TcTypeable.

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 #

mkVectOcc :: Maybe String -> OccName -> OccName #

mkVectTyConOcc :: Maybe String -> OccName -> OccName #

mkVectDataConOcc :: Maybe String -> OccName -> OccName #

mkVectIsoOcc :: Maybe String -> OccName -> OccName #

mkPADFunOcc :: Maybe String -> OccName -> OccName #

mkPReprTyConOcc :: Maybe String -> OccName -> OccName #

mkPDataTyConOcc :: Maybe String -> OccName -> OccName #

mkPDatasTyConOcc :: Maybe String -> OccName -> OccName #

mkPDataDataConOcc :: Maybe String -> OccName -> OccName #

mkPDatasDataConOcc :: Maybe String -> OccName -> OccName #

mkRecFldSelOcc :: String -> OccName #

mkDataConWorkerOcc :: OccName -> OccName #

mkSuperDictAuxOcc :: Int -> OccName -> OccName #

mkSuperDictSelOcc #

Arguments

:: Int | Index of superclass, e.g. 3
-> OccName | Class, e.g. `Ord`
-> OccName | Derived `Occname`, e.g. `$p3Ord`

mkLocalOcc #

Arguments

:: Unique | Unique to combine with the `OccName`
-> OccName | Local name, e.g. `sat`
-> OccName | Nice unique version, e.g. `$L23sat`

mkInstTyTcOcc #

Arguments

:: String | Family name, e.g. `Map`
-> OccSet | avoid these Occs
-> OccName |
    R:Map

Derive a name for the representation type constructor of a `data`/`newtype` instance.

mkDFunOcc #

Arguments

:: String | Typically the class and type glommed together e.g. `OrdMaybe`. Only used in debug mode, for extra clarity
-> Bool | Is this a hs-boot instance DFun?
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe`

mkDataTOcc #

Arguments

:: OccName | TyCon or data con string
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe` data T = MkT ... deriving( Data ) needs definitions for $tT :: Data.Generics.Basics.DataType $cMkT :: Data.Generics.Basics.Constr

mkDataCOcc #

Arguments

:: OccName | TyCon or data con string
-> OccSet | avoid these Occs
-> OccName | E.g. `$f3OrdMaybe` data T = MkT ... deriving( Data ) needs definitions for $tT :: Data.Generics.Basics.DataType $cMkT :: Data.Generics.Basics.Constr

mkMethodOcc :: OccName -> OccName #

emptyTidyOccEnv :: TidyOccEnv #

initTidyOccEnv :: [OccName] -> TidyOccEnv #

avoidClashesOccEnv :: TidyOccEnv -> [OccName] -> TidyOccEnv #

tidyOccName :: TidyOccEnv -> OccName -> (TidyOccEnv, OccName) #

class NamedThing a where #

A class allowing convenient access to the `Name` of various datatypes

Minimal complete definition

getName

Methods

getOccName :: a -> OccName #

getName :: a -> Name #

Instances

NamedThing Name # |
Instance details Defined in Name Methods getOccName :: Name -> OccName # getName :: Name -> Name #
NamedThing TyCon # |
Instance details Defined in TyCon Methods getOccName :: TyCon -> OccName # getName :: TyCon -> Name #
NamedThing TyThing # |
Instance details Defined in TyCoRep Methods getOccName :: TyThing -> OccName # getName :: TyThing -> Name #
NamedThing Var # |
Instance details Defined in Var Methods getOccName :: Var -> OccName # getName :: Var -> Name #
NamedThing PatSyn # |
Instance details Defined in PatSyn Methods getOccName :: PatSyn -> OccName # getName :: PatSyn -> Name #
NamedThing DataCon # |
Instance details Defined in DataCon Methods getOccName :: DataCon -> OccName # getName :: DataCon -> Name #
NamedThing ConLike # |
Instance details Defined in ConLike Methods getOccName :: ConLike -> OccName # getName :: ConLike -> Name #
NamedThing Class # |
Instance details Defined in Class Methods getOccName :: Class -> OccName # getName :: Class -> Name #
NamedThing FamInst # |
Instance details Defined in FamInstEnv Methods getOccName :: FamInst -> OccName # getName :: FamInst -> Name #
NamedThing IfaceConDecl # |
Instance details Defined in IfaceSyn Methods getOccName :: IfaceConDecl -> OccName # getName :: IfaceConDecl -> Name #
NamedThing IfaceClassOp # |
Instance details Defined in IfaceSyn Methods getOccName :: IfaceClassOp -> OccName # getName :: IfaceClassOp -> Name #
NamedThing IfaceDecl # |
Instance details Defined in IfaceSyn Methods getOccName :: IfaceDecl -> OccName # getName :: IfaceDecl -> Name #
NamedThing ClsInst # |
Instance details Defined in InstEnv Methods getOccName :: ClsInst -> OccName # getName :: ClsInst -> Name #
NamedThing (CoAxiom br) # |
Instance details Defined in CoAxiom Methods getOccName :: CoAxiom br -> OccName # getName :: CoAxiom br -> Name #
NamedThing e => NamedThing (GenLocated l e) # |
Instance details Defined in Name Methods getOccName :: GenLocated l e -> OccName # getName :: GenLocated l e -> Name #

data BuiltInSyntax #

BuiltInSyntax is for things like `(:)`, `[]` and tuples, which have special syntactic forms. They aren't in scope as such.

Constructors

BuiltInSyntax |
UserSyntax |

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 :: Name -> Module #

nameModule_maybe :: Name -> Maybe Module #

nameIsLocalOrFrom :: Module -> Name -> Bool #

Returns True if the name is (a) Internal (b) External but from the specified module (c) External but from the `interactive` package

The key idea is that False means: the entity is defined in some other module you can find the details (type, fixity, instances) in some interface file those details will be stored in the EPT or HPT

True means: the entity is defined in this module or earlier in the GHCi session you can find details (type, fixity, instances) in the TcGblEnv or TcLclEnv

The isInteractiveModule part is because successive interactions of a GCHi 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

nameIsHomePackage :: Module -> Name -> Bool #

nameIsHomePackageImport :: Module -> Name -> Bool #

nameIsFromExternalPackage :: UnitId -> Name -> Bool #

Returns True if the Name comes from some other package: neither this pacakge nor the interactive package.

isTyVarName :: Name -> Bool #

isTyConName :: Name -> Bool #

isDataConName :: Name -> Bool #

isValName :: Name -> Bool #

isVarName :: Name -> Bool #

isSystemName :: Name -> Bool #

mkInternalName :: Unique -> OccName -> SrcSpan -> Name #

Create a name which is (for now at least) local to the current module and hence does not need a `Module` to disambiguate it from other `Name`s

mkClonedInternalName :: Unique -> Name -> Name #

mkDerivedInternalName :: (OccName -> OccName) -> Unique -> Name -> Name #

mkExternalName :: Unique -> Module -> OccName -> SrcSpan -> Name #

Create a name which definitely originates in the given module

mkWiredInName :: Module -> OccName -> Unique -> TyThing -> BuiltInSyntax -> Name #

Create a name which is actually defined by the compiler itself

mkSystemName :: Unique -> OccName -> Name #

Create a name brought into being by the compiler

mkSystemNameAt :: Unique -> OccName -> SrcSpan -> Name #

mkSystemVarName :: Unique -> FastString -> Name #

mkSysTvName :: Unique -> FastString -> Name #

mkFCallName :: Unique -> String -> Name #

Make a name for a foreign call

setNameUnique :: Name -> Unique -> Name #

setNameLoc :: Name -> SrcSpan -> Name #

tidyNameOcc :: Name -> OccName -> Name #

localiseName :: Name -> Name #

Make the `Name` into an internal name, regardless of what it was to begin with

mkLocalisedOccName :: Module -> (Maybe String -> OccName -> OccName) -> Name -> OccName #

Create a localised variant of a name.

If the name is external, encode the original's module name to disambiguate. SPJ says: this looks like a rather odd-looking function; but it seems to be used only during vectorisation, so I'm not going to worry

stableNameCmp :: Name -> Name -> Ordering #

Compare Names lexicographically This only works for Names that originate in the source code or have been tidied.

pprModulePrefix :: PprStyle -> Module -> OccName -> SDoc #

pprDefinedAt :: Name -> SDoc #

pprNameDefnLoc :: Name -> SDoc #

nameStableString :: Name -> String #

Get a string representation of a `Name` that's unique and stable across recompilations. Used for deterministic generation of binds for derived instances. eg. "$aeson_70dylHtv1FFGeai1IoxcQr$Data.Aeson.Types.Internal$String"

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 #

Variable

Essentially a typed `Name`, that may also contain some additional information about the `Var` and it's use sites.

Instances

Eq Var # |
Instance details Defined in Var Methods (==) :: Var -> Var -> Bool # (/=) :: Var -> Var -> Bool #
Data Var # |
Instance details Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var Source # toConstr :: Var -> Constr Source # dataTypeOf :: Var -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) Source # gmapT :: (forall b. Data b => b -> b) -> Var -> Var Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source #
Ord Var # |
Instance details Defined in Var Methods compare :: Var -> Var -> Ordering # (<) :: Var -> Var -> Bool # (<=) :: Var -> Var -> Bool # (>) :: Var -> Var -> Bool # (>=) :: Var -> Var -> Bool # max :: Var -> Var -> Var # min :: Var -> Var -> Var #
OutputableBndr Var # |
Instance details Defined in PprCore Methods pprBndr :: BindingSite -> Var -> SDoc # pprPrefixOcc :: Var -> SDoc # pprInfixOcc :: Var -> SDoc # bndrIsJoin_maybe :: Var -> Maybe Int #
Outputable Var # |
Instance details Defined in Var Methods ppr :: Var -> SDoc # pprPrec :: Rational -> Var -> SDoc #
Uniquable Var # |
Instance details Defined in Var Methods getUnique :: Var -> Unique #
HasOccName Var # |
Instance details Defined in Var Methods occName :: Var -> OccName #
NamedThing Var # |
Instance details Defined in Var Methods getOccName :: Var -> OccName # getName :: Var -> Name #

type OutId = Id #

type OutVar = Var #

type InId = Id #

type InVar = Var #

type JoinId = Id #

type DictId = EvId #

Dictionary Identifier

type Id = Var #

Identifier

idInfo :: HasDebugCallStack => Id -> IdInfo #

idDetails :: Id -> IdDetails #

globaliseId :: Id -> Id #

If it's a local, make it global

isId :: Var -> Bool #

isLocalId :: Var -> Bool #

isGlobalId :: Var -> Bool #

isExportedId :: Var -> Bool #

`isExportedIdVar` means "don't throw this away"

idName :: Id -> Name #

idUnique :: Id -> Unique #

idType :: Id -> Kind #

setIdName :: Id -> Name -> Id #

setIdUnique :: Id -> Unique -> Id #

setIdType :: Id -> Type -> Id #

Not only does this set the `Id` `Type`, it also evaluates the type to try and reduce space usage

localiseId :: Id -> Id #

setIdInfo :: Id -> IdInfo -> Id #

modifyIdInfo :: (IdInfo -> IdInfo) -> Id -> Id #

maybeModifyIdInfo :: Maybe IdInfo -> Id -> Id #

mkGlobalId :: IdDetails -> Name -> Type -> IdInfo -> Id #

For an explanation of global vs. local `Id`s, see Var

mkVanillaGlobal :: Name -> Type -> Id #

Make a global `Id` without any extra information at all

mkVanillaGlobalWithInfo :: Name -> Type -> IdInfo -> Id #

Make a global `Id` with no global information but some generic `IdInfo`

mkLocalId :: Name -> Type -> Id #

For an explanation of global vs. local `Id`s, see Var

mkLocalCoVar :: Name -> Type -> CoVar #

Make a local CoVar

mkLocalIdOrCoVar :: Name -> Type -> Id #

Like `mkLocalId`, but checks the type to see if it should make a covar

mkLocalIdOrCoVarWithInfo :: Name -> Type -> IdInfo -> Id #

Make a local id, with the IdDetails set to CoVarId if the type indicates so.

mkLocalIdWithInfo :: Name -> Type -> IdInfo -> Id #

mkExportedLocalId :: IdDetails -> Name -> Type -> Id #

Create a local `Id` that is marked as exported. This prevents things attached to it from being removed as dead code. See Note [Exported LocalIds]

mkExportedVanillaId :: Name -> Type -> Id #

mkSysLocal :: FastString -> Unique -> Type -> Id #

Create a system local `Id`. These are local `Id`s (see Var) that are created by the compiler out of thin air

mkSysLocalOrCoVar :: FastString -> Unique -> Type -> Id #

Like `mkSysLocal`, but checks to see if we have a covar type

mkSysLocalM :: MonadUnique m => FastString -> Type -> m Id #

mkSysLocalOrCoVarM :: MonadUnique m => FastString -> Type -> m Id #

mkUserLocal :: OccName -> Unique -> Type -> SrcSpan -> Id #

Create a user local `Id`. These are local `Id`s (see Var) with a name and location that the user might recognize

mkUserLocalOrCoVar :: OccName -> Unique -> Type -> SrcSpan -> Id #

Like `mkUserLocal`, but checks if we have a coercion type

mkWorkerId :: Unique -> Id -> Type -> Id #

Workers get local names. CoreTidy will externalise these if necessary

mkTemplateLocal :: Int -> Type -> Id #

Create a template local: a family of system local `Id`s in bijection with `Int`s, typically used in unfoldings

mkTemplateLocals :: [Type] -> [Id] #

Create a template local for a series of types

mkTemplateLocalsNum :: Int -> [Type] -> [Id] #

Create a template local for a series of type, but start from a specified template local

recordSelectorTyCon :: Id -> RecSelParent #

If the `Id` is that for a record selector, extract the `sel_tycon`. Panic otherwise.

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 #

isExitJoinId :: Var -> Bool #

idDataCon :: Id -> DataCon #

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 #

Returns `True` of an `Id` which may not have a binding, even though it is defined in this module.

isImplicitId :: Id -> Bool #

`isImplicitId` tells whether an `Id`s info is implied by other declarations, so we don't need to put its signature in an interface file, even if it's mentioned in some other interface unfolding.

idIsFrom :: Module -> Id -> Bool #

isDeadBinder :: Id -> Bool #

isEvVar :: Var -> Bool #

isDictId :: Id -> Bool #

idJoinArity :: JoinId -> JoinArity #

asJoinId :: Id -> JoinArity -> JoinId infixl 1 #

zapJoinId :: Id -> Id #

asJoinId_maybe :: Id -> Maybe JoinArity -> Id infixl 1 #

idArity :: Id -> Arity #

setIdArity :: Id -> Arity -> Id infixl 1 #

idCallArity :: Id -> Arity #

setIdCallArity :: Id -> Arity -> Id infixl 1 #

idFunRepArity :: Id -> RepArity #

isBottomingId :: Var -> Bool #

Returns true if an application to n args would diverge

idStrictness :: Id -> StrictSig #

setIdStrictness :: Id -> StrictSig -> Id infixl 1 #

zapIdStrictness :: Id -> Id #

isStrictId :: Id -> Bool #

This predicate says whether the `Id` has a strict demand placed on it or has a type such that it can always be evaluated strictly (i.e an unlifted type, as of GHC 7.6). We need to check separately whether the `Id` has a so-called "strict type" because if the demand for the given `id` hasn't been computed yet but `id` has a strict type, we still want `isStrictId id` to be `True`.

idUnfolding :: Id -> Unfolding #

realIdUnfolding :: Id -> Unfolding #

setIdUnfolding :: Id -> Unfolding -> Id infixl 1 #

idDemandInfo :: Id -> Demand #

setIdDemandInfo :: Id -> Demand -> Id infixl 1 #

setCaseBndrEvald :: StrictnessMark -> Id -> Id #

idSpecialisation :: Id -> RuleInfo #

idCoreRules :: Id -> [CoreRule] #

idHasRules :: Id -> Bool #

setIdSpecialisation :: Id -> RuleInfo -> Id infixl 1 #

idCafInfo :: Id -> CafInfo infixl 1 #

setIdCafInfo :: Id -> CafInfo -> Id #

idOccInfo :: Id -> OccInfo #

setIdOccInfo :: Id -> OccInfo -> Id infixl 1 #

zapIdOccInfo :: Id -> Id #

idInlinePragma :: Id -> InlinePragma #

setInlinePragma :: Id -> InlinePragma -> Id infixl 1 #

modifyInlinePragma :: Id -> (InlinePragma -> InlinePragma) -> Id #

idInlineActivation :: Id -> Activation #

setInlineActivation :: Id -> Activation -> Id infixl 1 #

idRuleMatchInfo :: Id -> RuleMatchInfo #

isConLikeId :: Id -> Bool #

idOneShotInfo :: Id -> OneShotInfo #

idStateHackOneShotInfo :: Id -> OneShotInfo #

Like `idOneShotInfo`, but taking the Horrible State Hack in to account See Note [The state-transformer hack] in CoreArity

isOneShotBndr :: Var -> Bool #

Returns whether the lambda associated with the `Id` is certainly applied at most once This one is the "business end", called externally. It works on type variables as well as Ids, returning True Its main purpose is to encapsulate the Horrible State Hack See Note [The state-transformer hack] in CoreArity

stateHackOneShot :: OneShotInfo #

Should we apply the state hack to values of this `Type`?

typeOneShot :: Type -> OneShotInfo #

isStateHackType :: Type -> Bool #

isProbablyOneShotLambda :: Id -> Bool #

setOneShotLambda :: Id -> Id #

clearOneShotLambda :: Id -> Id #

setIdOneShotInfo :: Id -> OneShotInfo -> Id infixl 1 #

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 #

A set of variables that are in scope at some point "Secrets of the Glasgow Haskell Compiler inliner" Section 3.2 provides the motivation for this abstraction.

Instances

Outputable InScopeSet # |
Instance details Defined in VarEnv Methods ppr :: InScopeSet -> SDoc # pprPrec :: Rational -> InScopeSet -> SDoc #

type TvSubstEnv = TyVarEnv Type #

A substitution of `Type`s for `TyVar`s and `Kind`s for `KindVar`s

extendTCvSubst :: TCvSubst -> TyCoVar -> Type -> TCvSubst #

type IdSubstEnv = IdEnv CoreExpr #

An environment for substituting for `Id`s

data Subst #

A substitution environment, containing `Id`, `TyVar`, and `CoVar` substitutions.

Some invariants apply to how you use the substitution:

1. The in-scope set contains at least those `Id`s and `TyVar`s that will be in scope after applying the substitution to a term. Precisely, the in-scope set must be a superset of the free vars of the substitution range that might possibly clash with locally-bound variables in the thing being substituted in.
2. You may apply the substitution only once

There are various ways of setting up the in-scope set such that the first of these invariants hold:

- Arrange that the in-scope set really is all the things in scope
- Arrange that it's the free vars of the range of the substitution
- Make it empty, if you know that all the free vars of the substitution are fresh, and hence can't possibly clash

Constructors

Subst InScopeSet IdSubstEnv TvSubstEnv CvSubstEnv |

Instances

Outputable Subst # |
Instance details Defined in CoreSubst Methods ppr :: Subst -> SDoc # pprPrec :: Rational -> Subst -> SDoc #

isEmptySubst :: Subst -> Bool #

emptySubst :: Subst #

mkEmptySubst :: InScopeSet -> Subst #

mkSubst :: InScopeSet -> TvSubstEnv -> CvSubstEnv -> IdSubstEnv -> Subst #

substInScope :: Subst -> InScopeSet #

Find the in-scope set: see CoreSubst

zapSubstEnv :: Subst -> Subst #

Remove all substitutions for `Id`s and `Var`s that might have been built up while preserving the in-scope set

extendIdSubst :: Subst -> Id -> CoreExpr -> Subst #

Add a substitution for an `Id` to the `Subst`: you must ensure that the in-scope set is such that the CoreSubst is true after extending the substitution like this

extendIdSubstList :: Subst -> [(Id, CoreExpr)] -> Subst #

Adds multiple `Id` substitutions to the `Subst`: see also `extendIdSubst`

extendTvSubst :: Subst -> TyVar -> Type -> Subst #

Add a substitution for a `TyVar` to the `Subst` The `TyVar` *must* be a real TyVar, and not a CoVar You must ensure that the in-scope set is such that the CoreSubst is true after extending the substitution like this.

extendTvSubstList :: Subst -> [(TyVar, Type)] -> Subst #

Adds multiple `TyVar` substitutions to the `Subst`: see also `extendTvSubst`

extendSubst :: Subst -> Var -> CoreArg -> Subst #

Add a substitution appropriate to the thing being substituted (whether an expression, type, or coercion). See also `extendIdSubst`, `extendTvSubst`, `extendCvSubst`

extendSubstWithVar :: Subst -> Var -> Var -> Subst #

extendSubstList :: Subst -> [(Var, CoreArg)] -> Subst #

Add a substitution as appropriate to each of the terms being substituted (whether expressions, types, or coercions). See also `extendSubst`.

lookupIdSubst :: SDoc -> Subst -> Id -> CoreExpr #

Find the substitution for an `Id` in the `Subst`

lookupTCvSubst :: Subst -> TyVar -> Type #

Find the substitution for a `TyVar` in the `Subst`

delBndr :: Subst -> Var -> Subst #

delBndrs :: Subst -> [Var] -> Subst #

mkOpenSubst :: InScopeSet -> [(Var, CoreArg)] -> Subst #

Simultaneously substitute for a bunch of variables No left-right shadowing ie the substitution for (x y. e) a1 a2 so neither x nor y scope over a1 a2

isInScope :: Var -> Subst -> Bool #

addInScopeSet :: Subst -> VarSet -> Subst #

Add the `Var` to the in-scope set, but do not remove any existing substitutions for it

extendInScope :: Subst -> Var -> Subst #

Add the `Var` to the in-scope set: as a side effect, and remove any existing substitutions for it

extendInScopeList :: Subst -> [Var] -> Subst #

Add the `Var`s to the in-scope set: see also `extendInScope`

extendInScopeIds :: Subst -> [Id] -> Subst #

Optimized version of `extendInScopeList` that can be used if you are certain all the things being added are `Id`s and hence none are `TyVar`s or `CoVar`s

setInScope :: Subst -> InScopeSet -> Subst #

substExprSC :: SDoc -> Subst -> CoreExpr -> CoreExpr #

Apply a substitution to an entire `CoreExpr`. Remember, you may only apply the substitution once: see CoreSubst

Do *not* attempt to short-cut in the case of an empty substitution! See Note [Extending the Subst]

substExpr :: SDoc -> Subst -> CoreExpr -> CoreExpr #

substBindSC :: Subst -> CoreBind -> (Subst, CoreBind) #

Apply a substitution to an entire `CoreBind`, additionally returning an updated `Subst` that should be used by subsequent substitutions.

substBind :: Subst -> CoreBind -> (Subst, CoreBind) #

Apply a substitution to an entire `CoreBind`, additionally returning an updated `Subst` that should be used by subsequent substitutions.

deShadowBinds :: CoreProgram -> CoreProgram #

De-shadowing the program is sometimes a useful pre-pass. It can be done simply by running over the bindings with an empty substitution, because substitution returns a result that has no-shadowing guaranteed.

(Actually, within a single type there might still be shadowing, because `substTy` is a no-op for the empty substitution, but that's probably OK.)

Aug 09
  This function is not used in GHC at the moment, but seems so short and simple that I'm going to leave it here

substBndr :: Subst -> Var -> (Subst, Var) #

Substitutes a `Var` for another one according to the `Subst` given, returning the result and an updated `Subst` that should be used by subsequent substitutions. `IdInfo` is preserved by this process, although it is substituted into appropriately.

substBndrs :: Subst -> [Var] -> (Subst, [Var]) #

Applies `substBndr` to a number of `Var`s, accumulating a new `Subst` left-to-right

substRecBndrs :: Subst -> [Id] -> (Subst, [Id]) #

Substitute in a mutually recursive group of `Id`s

cloneIdBndr :: Subst -> UniqSupply -> Id -> (Subst, Id) #

Very similar to `substBndr`, but it always allocates a new `Unique` for each variable in its output. It substitutes the IdInfo though.

cloneIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) #

Applies `cloneIdBndr` to a number of `Id`s, accumulating a final substitution from left to right

cloneBndrs :: Subst -> UniqSupply -> [Var] -> (Subst, [Var]) #

cloneBndr :: Subst -> Unique -> Var -> (Subst, Var) #

cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) #

Clone a mutually recursive group of `Id`s

substTy :: Subst -> Type -> Type #

See `substTy`

getTCvSubst :: Subst -> TCvSubst #

substCo :: Subst -> Coercion -> Coercion #

See `substCo`

substIdInfo :: Subst -> Id -> IdInfo -> Maybe IdInfo #

Substitute into some `IdInfo` with regard to the supplied new `Id`.

substUnfoldingSC :: Subst -> Unfolding -> Unfolding #

Substitutes for the `Id`s within an unfolding

substUnfolding :: Subst -> Unfolding -> Unfolding #

Substitutes for the `Id`s within an unfolding

substIdOcc :: Subst -> Id -> Id #

substSpec :: Subst -> Id -> RuleInfo -> RuleInfo #

Substitutes for the `Id`s within the `WorkerInfo` given the new function `Id`

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] #

A collection of `PredType`s

type Kind = Type #

The key type representing kinds in the compiler.

type PredType = Type #

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 TyBinder #

A `TyBinder` represents an argument to a function. TyBinders can be dependent (`Named`) or nondependent (`Anon`). They may also be visible or not. See Note [TyBinders]

Instances

Data TyBinder # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TyBinder -> c TyBinder Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TyBinder Source # toConstr :: TyBinder -> Constr Source # dataTypeOf :: TyBinder -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TyBinder) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TyBinder) Source # gmapT :: (forall b. Data b => b -> b) -> TyBinder -> TyBinder Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TyBinder -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TyBinder -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TyBinder -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TyBinder -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TyBinder -> m TyBinder Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TyBinder -> m TyBinder Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TyBinder -> m TyBinder Source #
Outputable TyBinder # |
Instance details Defined in TyCoRep Methods ppr :: TyBinder -> SDoc # pprPrec :: Rational -> TyBinder -> SDoc #

data TCvSubst #

Type & coercion substitution

The following invariants must hold of a `TCvSubst`:

1. The in-scope set is needed only to guide the generation of fresh uniques
2. In particular, the kind of the type variables in the in-scope set is not relevant
3. The substitution is only applied ONCE! This is because in general such application will not reach a fixed point.

Constructors

TCvSubst InScopeSet TvSubstEnv CvSubstEnv |

Instances

Outputable TCvSubst # |
Instance details Defined in TyCoRep Methods ppr :: TCvSubst -> SDoc # pprPrec :: Rational -> TCvSubst -> SDoc #

data TyThing #

A global typecheckable-thing, essentially anything that has a name. Not to be confused with a `TcTyThing`, which is also a typecheckable thing but in the *local* context. See `TcEnv` for how to retrieve a `TyThing` given a `Name`.

Constructors

AnId Id |
AConLike ConLike |
ATyCon TyCon |
ACoAxiom (CoAxiom Branched) |

Instances

Outputable TyThing # |
Instance details Defined in TyCoRep Methods ppr :: TyThing -> SDoc # pprPrec :: Rational -> TyThing -> SDoc #
NamedThing TyThing # |
Instance details Defined in TyCoRep Methods getOccName :: TyThing -> OccName # getName :: TyThing -> Name #

data Type #

Instances

Data Type # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type Source # toConstr :: Type -> Constr Source # dataTypeOf :: Type -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) Source # gmapT :: (forall b. Data b => b -> b) -> Type -> Type Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type Source #
Outputable Type # |
Instance details Defined in TyCoRep Methods ppr :: Type -> SDoc # pprPrec :: Rational -> Type -> SDoc #

pprType :: Type -> SDoc #

pprKind :: Kind -> SDoc #

data TyPrec #

Constructors

TopPrec |
FunPrec |
TyOpPrec |
TyConPrec |

Instances

Eq TyPrec # |
Instance details Defined in BasicTypes Methods (==) :: TyPrec -> TyPrec -> Bool # (/=) :: TyPrec -> TyPrec -> Bool #
Ord TyPrec # |
Instance details Defined in BasicTypes Methods compare :: TyPrec -> TyPrec -> Ordering # (<) :: TyPrec -> TyPrec -> Bool # (<=) :: TyPrec -> TyPrec -> Bool # (>) :: TyPrec -> TyPrec -> Bool # (>=) :: TyPrec -> TyPrec -> Bool # max :: TyPrec -> TyPrec -> TyPrec # min :: TyPrec -> TyPrec -> TyPrec #

maybeParen :: TyPrec -> TyPrec -> SDoc -> SDoc #

type TyVarBinder = TyVarBndr TyVar ArgFlag #

Type Variable Binder

A `TyVarBinder` 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

data ArgFlag #

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 [TyVarBndrs, TyVarBinders, TyConBinders, and visibility] in TyCoRep

Constructors

Required |
Specified |
Inferred |

Instances

Eq ArgFlag # |
Instance details Defined in Var Methods (==) :: ArgFlag -> ArgFlag -> Bool # (/=) :: ArgFlag -> ArgFlag -> Bool #
Data ArgFlag # |
Instance details Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArgFlag -> c ArgFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArgFlag Source # toConstr :: ArgFlag -> Constr Source # dataTypeOf :: ArgFlag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArgFlag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag) Source # gmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ArgFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source #
Outputable ArgFlag # |
Instance details Defined in Var Methods ppr :: ArgFlag -> SDoc # pprPrec :: Rational -> ArgFlag -> SDoc #
Binary ArgFlag # |
Instance details Defined in Var Methods put_ :: BinHandle -> ArgFlag -> IO () # put :: BinHandle -> ArgFlag -> IO (Bin ArgFlag) # get :: BinHandle -> IO ArgFlag #
Outputable tv => Outputable (TyVarBndr tv ArgFlag) # |
Instance details Defined in Var Methods ppr :: TyVarBndr tv ArgFlag -> SDoc # pprPrec :: Rational -> TyVarBndr tv ArgFlag -> SDoc #

data Var #

Variable

Essentially a typed `Name`, that may also contain some additional information about the `Var` and it's use sites.

Instances

Eq Var # |
Instance details Defined in Var Methods (==) :: Var -> Var -> Bool # (/=) :: Var -> Var -> Bool #
Data Var # |
Instance details Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var Source # toConstr :: Var -> Constr Source # dataTypeOf :: Var -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) Source # gmapT :: (forall b. Data b => b -> b) -> Var -> Var Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source #
Ord Var # |
Instance details Defined in Var Methods compare :: Var -> Var -> Ordering # (<) :: Var -> Var -> Bool # (<=) :: Var -> Var -> Bool # (>) :: Var -> Var -> Bool # (>=) :: Var -> Var -> Bool # max :: Var -> Var -> Var # min :: Var -> Var -> Var #
OutputableBndr Var # |
Instance details Defined in PprCore Methods pprBndr :: BindingSite -> Var -> SDoc # pprPrefixOcc :: Var -> SDoc # pprInfixOcc :: Var -> SDoc # bndrIsJoin_maybe :: Var -> Maybe Int #
Outputable Var # |
Instance details Defined in Var Methods ppr :: Var -> SDoc # pprPrec :: Rational -> Var -> SDoc #
Uniquable Var # |
Instance details Defined in Var Methods getUnique :: Var -> Unique #
HasOccName Var # |
Instance details Defined in Var Methods occName :: Var -> OccName #
NamedThing Var # |
Instance details Defined in Var Methods getOccName :: Var -> OccName # getName :: Var -> Name #

type TyCoVar = Id #

Type or Coercion Variable

type TyVar = Var #

Type or kind Variable

isVisibleArgFlag :: ArgFlag -> Bool #

Does this `ArgFlag` classify an argument that is written in Haskell?

isInvisibleArgFlag :: ArgFlag -> Bool #

Does this `ArgFlag` classify an argument that is not written in Haskell?

sameVis :: ArgFlag -> ArgFlag -> Bool #

Do these denote the same level of visibility? `Required` arguments are visible, others are not. So this function equates `Specified` and `Inferred`. Used for printing.

binderVar :: TyVarBndr tv argf -> tv #

binderVars :: [TyVarBndr tv argf] -> [tv] #

binderArgFlag :: TyVarBndr tv argf -> argf #

binderKind :: TyVarBndr TyVar argf -> Kind #

mkTyVarBinder :: ArgFlag -> Var -> TyVarBinder #

Make a named binder

mkTyVarBinders :: ArgFlag -> [TyVar] -> [TyVarBinder] #

Make many named binders

tyVarKind :: TyVar -> Kind #

isTyVar :: Var -> Bool #

liftedTypeKind :: Kind #

splitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) #

Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor

toposortTyVars :: [TyCoVar] -> [TyCoVar] #

Do a topological sort on a list of tyvars, so that binders occur before occurrences E.g. given [ a::k, k::*, b::k ] it'll return a well-scoped list [ k::*, a::k, b::k ]

This is a deterministic sorting operation (that is, doesn't depend on Uniques).

tyCoVarsOfTypeWellScoped :: Type -> [TyVar] #

Get the free vars of a type in scoped order

tyCoVarsOfTypesWellScoped :: [Type] -> [TyVar] #

Get the free vars of types in scoped order

tcView :: Type -> Maybe Type #

Gives the typechecker view of a type. This unwraps synonyms but leaves `Constraint` alone. c.f. coreView, which turns Constraint into TYPE LiftedRep. Returns Nothing if no unwrapping happens. See also Note [coreView vs tcView] in Type.

coreView :: Type -> Maybe Type #

This function Strips off the top layer only of a type synonym application (if any) its underlying representation type. Returns Nothing if there is nothing to look through. This function considers `Constraint` to be a synonym of `TYPE LiftedRep`.

By being non-recursive and inlined, this case analysis gets efficiently joined onto the case analysis that the caller is already doing

eqType :: Type -> Type -> Bool #

Type equality on source types. Does not look through `newtypes` or `PredType`s, but it does look through type synonyms. This first checks that the kinds of the types are equal and then checks whether the types are equal, ignoring casts and coercions. (The kind check is a recursive call, but since all kinds have type `Type`, there is no need to check the types of kinds.) See also Note [Non-trivial definitional equality] in TyCoRep.

piResultTy :: HasDebugCallStack => Type -> Type -> Type #

mkCastTy :: Type -> Coercion -> Type #

Make a `CastTy`. The Coercion must be nominal. Checks the Coercion for reflexivity, dropping it if it's reflexive. See Note [No reflexive casts in types]

mkAppTy :: Type -> Type -> Type #

Applies a type to another, as in e.g. `k a`

isCoercionTy :: Type -> Bool #

isPredTy :: Type -> Bool #

Is the type suitable to classify a given/wanted in the typechecker?

type TvSubstEnv = TyVarEnv Type #

A substitution of `Type`s for `TyVar`s and `Kind`s for `KindVar`s

type KindOrType = Type #

The key representation of types within the compiler

pprShortTyThing :: TyThing -> SDoc #

pprTyThingCategory :: TyThing -> SDoc #

isInvisibleBinder :: TyBinder -> Bool #

Does this binder bind an invisible argument?

isVisibleBinder :: TyBinder -> Bool #

Does this binder bind a visible argument?

mkTyVarTy :: TyVar -> Type #

mkTyVarTys :: [TyVar] -> [Type] #

mkFunTy :: Type -> Type -> Type infixr 3 #

Make an arrow type

mkFunTys :: [Type] -> Type -> Type #

Make nested arrow types

mkForAllTy :: TyVar -> ArgFlag -> Type -> Type #

mkForAllTys :: [TyVarBinder] -> Type -> Type #

Wraps foralls over the type using the provided `TyVar`s from left to right

mkPiTy :: TyBinder -> Type -> Type #

mkPiTys :: [TyBinder] -> Type -> Type #

isCoercionType :: Type -> Bool #

Does this type classify a core (unlifted) Coercion? At either role nominal or representational (t1 ~ t2)

mkTyConTy :: TyCon -> Type #

Create the plain type constructor type which has been applied to no type arguments at all.

isRuntimeRepTy :: Type -> Bool #

Is this the type `RuntimeRep`?

isRuntimeRepVar :: TyVar -> Bool #

Is a tyvar of type `RuntimeRep`?

tyCoVarsOfType :: Type -> TyCoVarSet #

Returns free variables of a type, including kind variables as a non-deterministic set. For type synonyms it does not expand the synonym.

tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet #

`tyCoFVsOfType` that returns free variables of a type in a deterministic set. For explanation of why using `VarSet` is not deterministic see Note [Deterministic FV] in FV.

tyCoFVsOfType :: Type -> FV #

The worker for `tyCoFVsOfType` and `tyCoFVsOfTypeList`. The previous implementation used `unionVarSet` which is O(n+m) and can make the function quadratic. It's exported, so that it can be composed with other functions that compute free variables. See Note [FV naming conventions] in FV.

Eta-expanded because that makes it run faster (apparently) See Note [FV eta expansion] in FV for explanation.

tyCoFVsBndr :: TyVarBinder -> FV -> FV #

tyCoVarsOfTypes :: [Type] -> TyCoVarSet #

Returns free variables of types, including kind variables as a non-deterministic set. For type synonyms it does not expand the synonym.

coVarsOfType :: Type -> CoVarSet #

coVarsOfTypes :: [Type] -> TyCoVarSet #

closeOverKinds :: TyVarSet -> TyVarSet #

Add the kind variables free in the kinds of the tyvars in the given set. Returns a non-deterministic set.

closeOverKindsList :: [TyVar] -> [TyVar] #

Add the kind variables free in the kinds of the tyvars in the given set. Returns a deterministically ordered list.

noFreeVarsOfType :: Type -> Bool #

Returns True if this type has no free variables. Should be the same as isEmptyVarSet . tyCoVarsOfType, but faster in the non-forall case.

emptyTvSubstEnv :: TvSubstEnv #

composeTCvSubstEnv :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) -> (TvSubstEnv, CvSubstEnv) #

`(compose env1 env2)(x)` is `env1(env2(x))`; i.e. apply `env2` then `env1`. It assumes that both are idempotent. Typically, `env1` is the refinement to a base substitution `env2`

composeTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst #

Composes two substitutions, applying the second one provided first, like in function composition.

emptyTCvSubst :: TCvSubst #

mkEmptyTCvSubst :: InScopeSet -> TCvSubst #

isEmptyTCvSubst :: TCvSubst -> Bool #

mkTCvSubst :: InScopeSet -> (TvSubstEnv, CvSubstEnv) -> TCvSubst #

getTvSubstEnv :: TCvSubst -> TvSubstEnv #

getTCvInScope :: TCvSubst -> InScopeSet #

getTCvSubstRangeFVs :: TCvSubst -> VarSet #

Returns the free variables of the types in the range of a substitution as a non-deterministic set.

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 #

extendTvSubstBinderAndInScope :: TCvSubst -> TyBinder -> Type -> TCvSubst #

extendTvSubstWithClone :: TCvSubst -> TyVar -> TyVar -> TCvSubst #

extendCvSubst :: TCvSubst -> CoVar -> Coercion -> TCvSubst #

extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst #

unionTCvSubst :: TCvSubst -> TCvSubst -> TCvSubst #

zipTvSubst :: [TyVar] -> [Type] -> TCvSubst #

Generates the in-scope set for the `TCvSubst` from the types in the incoming environment. No CoVars, please!

mkTvSubstPrs :: [(TyVar, Type)] -> TCvSubst #

Generates the in-scope set for the `TCvSubst` from the types in the incoming environment. No CoVars, please!

zipTyEnv :: [TyVar] -> [Type] -> TvSubstEnv #

zipCoEnv :: [CoVar] -> [Coercion] -> CvSubstEnv #

substTyWith :: HasCallStack => [TyVar] -> [Type] -> Type -> Type #

Type substitution, see `zipTvSubst`

substTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type #

Type substitution, see `zipTvSubst`. Disables sanity checks. The problems that the sanity checks in substTy catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTyUnchecked to substTy and remove this function. Please don't use in new code.

substCoWithUnchecked :: [TyVar] -> [Type] -> Coercion -> Coercion #

Coercion substitution, see `zipTvSubst`. Disables sanity checks. The problems that the sanity checks in substCo catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substCoUnchecked to substCo and remove this function. Please don't use in new code.

substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type] #

Type substitution, see `zipTvSubst`

substTyAddInScope :: TCvSubst -> Type -> Type #

Substitute within a `Type` after adding the free variables of the type to the in-scope set. This is useful for the case when the free variables aren't already in the in-scope set or easily available. See also Note [The substitution invariant].

substTyUnchecked :: TCvSubst -> Type -> Type #

Substitute within a `Type` disabling the sanity checks. The problems that the sanity checks in substTy catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTyUnchecked to substTy and remove this function. Please don't use in new code.

substTys :: HasCallStack => TCvSubst -> [Type] -> [Type] #

Substitute within several `Type`s The substitution has to satisfy the invariants described in Note [The substitution invariant].

substTysUnchecked :: TCvSubst -> [Type] -> [Type] #

Substitute within several `Type`s disabling the sanity checks. The problems that the sanity checks in substTys catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTysUnchecked to substTys and remove this function. Please don't use in new code.

substTheta :: HasCallStack => TCvSubst -> ThetaType -> ThetaType #

Substitute within a `ThetaType` The substitution has to satisfy the invariants described in Note [The substitution invariant].

substThetaUnchecked :: TCvSubst -> ThetaType -> ThetaType #

Substitute within a `ThetaType` disabling the sanity checks. The problems that the sanity checks in substTys catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substThetaUnchecked to substTheta and remove this function. Please don't use in new code.

substTyVar :: TCvSubst -> TyVar -> Type #

substTyVars :: TCvSubst -> [TyVar] -> [Type] #

lookupTyVar :: TCvSubst -> TyVar -> Maybe Type #

substCoUnchecked :: TCvSubst -> Coercion -> Coercion #

Substitute within a `Coercion` disabling sanity checks. The problems that the sanity checks in substCo catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substCoUnchecked to substCo and remove this function. Please don't use in new code.

substTyVarBndr :: HasCallStack => TCvSubst -> TyVar -> (TCvSubst, TyVar) #

cloneTyVarBndr :: TCvSubst -> TyVar -> Unique -> (TCvSubst, TyVar) #

cloneTyVarBndrs :: TCvSubst -> [TyVar] -> UniqSupply -> (TCvSubst, [TyVar]) #

pprParendType :: Type -> SDoc #

pprPrecType :: TyPrec -> Type -> SDoc #

pprParendKind :: Kind -> SDoc #

pprClassPred :: Class -> [Type] -> SDoc #

pprTheta :: ThetaType -> SDoc #

pprThetaArrowTy :: ThetaType -> SDoc #

pprSigmaType :: Type -> SDoc #

pprForAll :: [TyVarBinder] -> SDoc #

pprUserForAll :: [TyVarBinder] -> SDoc #

Print a user-level forall; see Note [When to print foralls]

pprTvBndrs :: [TyVarBinder] -> SDoc #

pprTvBndr :: TyVarBinder -> SDoc #

pprTyVars :: [TyVar] -> SDoc #

pprTyVar :: TyVar -> SDoc #

pprTypeApp :: TyCon -> [Type] -> SDoc #

ppSuggestExplicitKinds :: SDoc #

tidyTyCoVarBndrs :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) #

This tidies up a type for printing in an error message, or in an interface file.

It doesn't change the uniques at all, just the print names.

tidyTyCoVarBndr :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) #

tidyTyVarBinder :: TidyEnv -> TyVarBndr TyVar vis -> (TidyEnv, TyVarBndr TyVar vis) #

tidyTyVarBinders :: TidyEnv -> [TyVarBndr TyVar vis] -> (TidyEnv, [TyVarBndr TyVar vis]) #

tidyFreeTyCoVars :: TidyEnv -> [TyCoVar] -> TidyEnv #

Add the free `TyVar`s to the env in tidy form, so that we can tidy the type they are free in

tidyOpenTyCoVars :: TidyEnv -> [TyCoVar] -> (TidyEnv, [TyCoVar]) #

tidyOpenTyCoVar :: TidyEnv -> TyCoVar -> (TidyEnv, TyCoVar) #

Treat a new `TyCoVar` as a binder, and give it a fresh tidy name using the environment if one has not already been allocated. See also `tidyTyCoVarBndr`

tidyTyVarOcc :: TidyEnv -> TyVar -> TyVar #

tidyTypes :: TidyEnv -> [Type] -> [Type] #

tidyType :: TidyEnv -> Type -> Type #

tidyOpenTypes :: TidyEnv -> [Type] -> (TidyEnv, [Type]) #

Grabs the free type variables, tidies them and then uses `tidyType` to work over the type itself

tidyOpenType :: TidyEnv -> Type -> (TidyEnv, Type) #

tidyTopType :: Type -> Type #

Calls `tidyType` on a top-level type (i.e. with an empty tidying environment)

tidyOpenKind :: TidyEnv -> Kind -> (TidyEnv, Kind) #

tidyKind :: TidyEnv -> Kind -> Kind #

typeSize :: Type -> Int #

funTyCon :: TyCon #

The `(->)` type constructor.

    (->) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep).
            TYPE rep1 -> TYPE rep2 -> *

data PredTree #

Constructors

ClassPred Class [Type] |
EqPred EqRel Type Type |
IrredPred PredType |

data EqRel #

A choice of equality relation. This is separate from the type `Role` because `Phantom` does not define a (non-trivial) equality relation.

Constructors

NomEq |
ReprEq |

Instances

Eq EqRel # |
Instance details Defined in Type Methods (==) :: EqRel -> EqRel -> Bool # (/=) :: EqRel -> EqRel -> Bool #
Ord EqRel # |
Instance details Defined in Type Methods compare :: EqRel -> EqRel -> Ordering # (<) :: EqRel -> EqRel -> Bool # (<=) :: EqRel -> EqRel -> Bool # (>) :: EqRel -> EqRel -> Bool # (>=) :: EqRel -> EqRel -> Bool # max :: EqRel -> EqRel -> EqRel # min :: EqRel -> EqRel -> EqRel #
Outputable EqRel # |
Instance details Defined in Type Methods ppr :: EqRel -> SDoc # pprPrec :: Rational -> EqRel -> SDoc #

data TyCoMapper env m #

This describes how a "map" operation over a type/coercion should behave

Constructors

TyCoMapper |
Fields tcm_smart :: Bool Should the new type be created with smart constructors? tcm_tyvar :: env -> TyVar -> m Type tcm_covar :: env -> CoVar -> m Coercion tcm_hole :: env -> CoercionHole -> m Coercion What to do with coercion holes. See Note [Coercion holes] in TyCoRep. tcm_tybinder :: env -> TyVar -> ArgFlag -> m (env, TyVar) The returned env is used in the extended scope

expandTypeSynonyms :: Type -> Type #

Expand out all type synonyms. Actually, it'd suffice to expand out just the ones that discard type variables (e.g. type Funny a = Int) But we don't know which those are currently, so we just expand all.

`expandTypeSynonyms` only expands out type synonyms mentioned in the type, not in the kinds of any TyCon or TyVar mentioned in the type.

Keep this synchronized with `synonymTyConsOfType`

mapType :: Monad m => TyCoMapper env m -> env -> Type -> m Type #

mapCoercion :: Monad m => TyCoMapper env m -> env -> Coercion -> m Coercion #

getTyVar :: String -> Type -> TyVar #

Attempts to obtain the type variable underlying a `Type`, and panics with the given message if this is not a type variable type. See also `getTyVar_maybe`

isTyVarTy :: Type -> Bool #

getTyVar_maybe :: Type -> Maybe TyVar #

Attempts to obtain the type variable underlying a `Type`

getCastedTyVar_maybe :: Type -> Maybe (TyVar, CoercionN) #

If the type is a tyvar, possibly under a cast, returns it, along with the coercion. Thus, the co is :: kind tv ~N kind type

repGetTyVar_maybe :: Type -> Maybe TyVar #

Attempts to obtain the type variable underlying a `Type`, without any expansion

mkAppTys :: Type -> [Type] -> Type #

splitAppTy_maybe :: Type -> Maybe (Type, Type) #

Attempt to take a type application apart, whether it is a function, type constructor, or plain type application. Note that type family applications are NEVER unsaturated by this!

repSplitAppTy_maybe :: HasDebugCallStack => Type -> Maybe (Type, Type) #

Does the AppTy split as in `splitAppTy_maybe`, but assumes that any Core view stuff is already done

tcRepSplitAppTy_maybe :: Type -> Maybe (Type, Type) #

Does the AppTy split as in `tcSplitAppTy_maybe`, but assumes that any coreView stuff is already done. Refuses to look through (c => t)

tcSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type]) #

Split a type constructor application into its type constructor and applied types. Note that this may fail in the case of a `FunTy` with an argument of unknown kind `FunTy` (e.g. `FunTy (a :: k) Int`. since the kind of `a` isn't of the form `TYPE rep`). Consequently, you may need to zonk your type before using this function.

If you only need the `TyCon`, consider using `tcTyConAppTyCon_maybe`.

tcRepSplitTyConApp_maybe :: HasCallStack => Type -> Maybe (TyCon, [Type]) #

Like `tcSplitTyConApp_maybe` but doesn't look through type synonyms.

splitAppTy :: Type -> (Type, Type) #

Attempts to take a type application apart, as in `splitAppTy_maybe`, and panics if this is not possible

splitAppTys :: Type -> (Type, [Type]) #

Recursively splits a type as far as is possible, leaving a residual type being applied to and the type arguments applied to it. Never fails, even if that means returning an empty list of type applications.

repSplitAppTys :: HasDebugCallStack => Type -> (Type, [Type]) #

Like `splitAppTys`, but doesn't look through type synonyms

mkNumLitTy :: Integer -> Type #

isNumLitTy :: Type -> Maybe Integer #

Is this a numeric literal. We also look through type synonyms.

mkStrLitTy :: FastString -> Type #

isStrLitTy :: Type -> Maybe FastString #

Is this a symbol literal. We also look through type synonyms.

userTypeError_maybe :: Type -> Maybe Type #

Is this type a custom user error? If so, give us the kind and the error message.

pprUserTypeErrorTy :: Type -> SDoc #

Render a type corresponding to a user type error into a SDoc.

isFunTy :: Type -> Bool #

splitFunTy :: Type -> (Type, Type) #

Attempts to extract the argument and result types from a type, and panics if that is not possible. See also `splitFunTy_maybe`

splitFunTy_maybe :: Type -> Maybe (Type, Type) #

Attempts to extract the argument and result types from a type

splitFunTys :: Type -> ([Type], Type) #

funResultTy :: Type -> Type #

Extract the function result type and panic if that is not possible

funArgTy :: Type -> Type #

Extract the function argument type and panic if that is not possible

piResultTys :: HasDebugCallStack => Type -> [Type] -> Type #

(piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn) where f :: f_ty `piResultTys` is interesting because: 1. `f_ty` may have more for-alls than there are args 2. Less obviously, it may have fewer for-alls For case 2. think of: piResultTys (forall a.a) [forall b.b, Int] This really can happen, but only (I think) in situations involving undefined. For example: undefined :: forall a. a Term: undefined `(forall b. b->b)` Int This term should have type (Int -> Int), but notice that there are more type args than foralls in `undefined`s type.

applyTysX :: [TyVar] -> Type -> [Type] -> Type #

mkTyConApp :: TyCon -> [Type] -> Type #

A key function: builds a `TyConApp` or `FunTy` as appropriate to its arguments. Applies its arguments to the constructor from left to right.

tyConAppTyConPicky_maybe :: Type -> Maybe TyCon #

Retrieve the tycon heading this type, if there is one. Does not look through synonyms.

tyConAppTyCon_maybe :: Type -> Maybe TyCon #

The same as `fst . splitTyConApp`

tyConAppTyCon :: Type -> TyCon #

tyConAppArgs_maybe :: Type -> Maybe [Type] #

The same as `snd . splitTyConApp`

tyConAppArgs :: Type -> [Type] #

tyConAppArgN :: Int -> Type -> Type #

splitTyConApp :: Type -> (TyCon, [Type]) #

Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor. Panics if that is not possible. See also `splitTyConApp_maybe`

repSplitTyConApp_maybe :: HasDebugCallStack => Type -> Maybe (TyCon, [Type]) #

Like `splitTyConApp_maybe`, but doesn't look through synonyms. This assumes the synonyms have already been dealt with.

splitListTyConApp_maybe :: Type -> Maybe Type #

Attempts to tease a list type apart and gives the type of the elements if successful (looks through type synonyms)

nextRole :: Type -> Role #

What is the role assigned to the next parameter of this type? Usually, this will be `Nominal`, but if the type is a `TyConApp`, we may be able to do better. The type does *not* have to be well-kinded when applied for this to work!

newTyConInstRhs :: TyCon -> [Type] -> Type #

Unwrap one `layer` of newtype on a type constructor and its arguments, using an eta-reduced version of the `newtype` if possible. This requires tys to have at least `newTyConInstArity tycon` elements.

splitCastTy_maybe :: Type -> Maybe (Type, Coercion) #

tyConBindersTyBinders :: [TyConBinder] -> [TyBinder] #

mkCoercionTy :: Coercion -> Type #

isCoercionTy_maybe :: Type -> Maybe Coercion #

stripCoercionTy :: Type -> Coercion #

mkInvForAllTy :: TyVar -> Type -> Type #

Make a dependent forall over an Inferred (as opposed to Specified) variable

mkInvForAllTys :: [TyVar] -> Type -> Type #

Like mkForAllTys, but assumes all variables are dependent and Inferred, a common case

mkSpecForAllTys :: [TyVar] -> Type -> Type #

Like mkForAllTys, but assumes all variables are dependent and specified, a common case

mkVisForAllTys :: [TyVar] -> Type -> Type #

Like mkForAllTys, but assumes all variables are dependent and visible

mkLamType :: Var -> Type -> Type #

Makes a `(->)` type or an implicit forall type, depending on whether it is given a type variable or a term variable. This is used, for example, when producing the type of a lambda. Always uses Inferred binders.

mkLamTypes :: [Var] -> Type -> Type #

`mkLamType` for multiple type or value arguments

mkTyConBindersPreferAnon :: [TyVar] -> Type -> [TyConBinder] #

Given a list of type-level vars and a result kind, makes TyBinders, preferring anonymous binders if the variable is, in fact, not dependent. e.g. mkTyConBindersPreferAnon (k:*),(b:k),(c:k) We want (k:*) Named, (a;k) Anon, (c:k) Anon

All binders are visible.

splitForAllTys :: Type -> ([TyVar], Type) #

Take a ForAllTy apart, returning the list of tyvars 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.

splitForAllTyVarBndrs :: Type -> ([TyVarBinder], Type) #

Like `splitPiTys` but split off only named binders.

isForAllTy :: Type -> Bool #

Checks whether this is a proper forall (with a named binder)

isPiTy :: Type -> Bool #

Is this a function or forall?

splitForAllTy :: Type -> (TyVar, Type) #

Take a forall type apart, or panics if that is not possible.

dropForAlls :: Type -> Type #

Drops all ForAllTys

splitForAllTy_maybe :: Type -> Maybe (TyVar, Type) #

Attempts to take a forall type apart, but only if it's a proper forall, with a named binder

splitPiTy_maybe :: Type -> Maybe (TyBinder, Type) #

Attempts to take a forall type apart; works with proper foralls and functions

splitPiTy :: Type -> (TyBinder, Type) #

Takes a forall type apart, or panics

splitPiTys :: Type -> ([TyBinder], Type) #

Split off all TyBinders to a type, splitting both proper foralls and functions

splitPiTysInvisible :: Type -> ([TyBinder], Type) #

filterOutInvisibleTypes :: TyCon -> [Type] -> [Type] #

Given a tycon and its arguments, filters out any invisible arguments

partitionInvisibles :: TyCon -> (a -> Type) -> [a] -> ([a], [a]) #

Given a tycon and a list of things (which correspond to arguments), partitions the things into Inferred or Specified ones and Required ones The callback function is necessary for this scenario:

    T :: forall k. k -> k
    partitionInvisibles 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.

If you're absolutely sure that your tycon's kind doesn't end in a variable, it's OK if the callback function panics, as that's the only time it's consulted.

isTauTy :: Type -> Bool #

mkAnonBinder :: Type -> TyBinder #

Make an anonymous binder

isAnonTyBinder :: TyBinder -> Bool #

Does this binder bind a variable that is not erased? Returns `True` for anonymous binders.

isNamedTyBinder :: TyBinder -> Bool #

tyBinderType :: TyBinder -> Type #

binderRelevantType_maybe :: TyBinder -> Maybe Type #

Extract a relevant type, if there is one.

caseBinder #

Arguments

:: TyBinder | binder to scrutinize
-> (TyVarBinder -> a) | named case
-> (Type -> a) | anonymous case
-> a |

Like `maybe`, but for binders.

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 #

Makes a lifted equality predicate at the given role

mkPrimEqPred :: Type -> Type -> Type #

Creates a primitive type equality predicate. Invariant: the types are not Coercions

mkHeteroPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #

Creates a primite type equality predicate with explicit kinds

mkHeteroReprPrimEqPred :: Kind -> Kind -> Type -> Type -> Type #

Creates a primitive representational type equality predicate with explicit kinds

splitCoercionType_maybe :: Type -> Maybe (Type, Type) #

Try to split up a coercion type into the types that it coerces

mkReprPrimEqPred :: Type -> Type -> Type #

equalityTyCon :: Role -> TyCon #

mkClassPred :: Class -> [Type] -> PredType #

isDictTy :: Type -> Bool #

isDictLikeTy :: Type -> Bool #

eqRelRole :: EqRel -> Role #

classifyPredType :: PredType -> PredTree #

getClassPredTys :: 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 #

Get the equality relation relevant for a pred type.

dVarSetElemsWellScoped :: DVarSet -> [Var] #

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.

mkFamilyTyConApp :: TyCon -> [Type] -> Type #

Given a family instance TyCon and its arg types, return the corresponding family type. E.g:

    data family T a
    data instance T (Maybe b) = MkT b

Where the instance tycon is :RTL, so:

    mkFamilyTyConApp :RTL Int  =  T (Maybe Int)

coAxNthLHS :: CoAxiom br -> Int -> Type #

Get the type on the LHS of a coercion induced by a type/data family instance.

pprSourceTyCon :: TyCon -> SDoc #

Pretty prints a `TyCon`, using the family instance in case of a representation tycon. For example:

    data T [a] = ...

In that case we want to print `T [a]`, where `T` is the family `TyCon`

isFamFreeTy :: Type -> Bool #

isLiftedType_maybe :: HasDebugCallStack => Type -> Maybe Bool #

Returns Just True if this type is surely lifted, Just False if it is surely unlifted, Nothing if we can't be sure (i.e., it is levity polymorphic), and panics if the kind does not have the shape TYPE r.

isUnliftedType :: HasDebugCallStack => Type -> Bool #

See Type for what an unlifted type is. Panics on levity polymorphic types.

isRuntimeRepKindedTy :: Type -> Bool #

Is this a type of kind RuntimeRep? (e.g. LiftedRep)

dropRuntimeRepArgs :: [Type] -> [Type] #

Drops prefix of RuntimeRep constructors in `TyConApp`s. Useful for e.g. dropping 'LiftedRep arguments of unboxed tuple TyCon applications:

dropRuntimeRepArgs [ 'LiftedRep, 'IntRep , String, Int]

getRuntimeRep_maybe :: HasDebugCallStack => Type -> Maybe Type #

Extract the RuntimeRep classifier of a type. For instance, `getRuntimeRep_maybe Int = LiftedRep`. Returns `Nothing` if this is not possible.

getRuntimeRep :: HasDebugCallStack => Type -> Type #

Extract the RuntimeRep classifier of a type. For instance, `getRuntimeRep_maybe Int = LiftedRep`. Panics if this is not possible.

getRuntimeRepFromKind :: HasDebugCallStack => Type -> Type #

Extract the RuntimeRep classifier of a type from its kind. For example, `getRuntimeRepFromKind * = LiftedRep`; Panics if this is not possible.

getRuntimeRepFromKind_maybe :: HasDebugCallStack => Type -> Maybe Type #

Extract the RuntimeRep classifier of a type from its kind. For example, `getRuntimeRepFromKind * = LiftedRep`; Returns `Nothing` if this is not possible.

isUnboxedTupleType :: Type -> Bool #

isUnboxedSumType :: Type -> Bool #

isAlgType :: Type -> Bool #

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 #

Check whether a type is a data family type

isStrictType :: HasDebugCallStack => Type -> Bool #

Computes whether an argument (or let right hand side) should be computed strictly or lazily, based only on its type. Currently, it's just `isUnliftedType`. Panics on levity-polymorphic types.

isPrimitiveType :: Type -> Bool #

Returns true of types that are opaque to Haskell.

isValidJoinPointType :: JoinArity -> Type -> Bool #

Determine whether a type could be the type of a join point of given total arity, according to the polymorphism rule. A join point cannot be polymorphic in its return type, since given join j `a` b x y z = e1 in e2, the types of e1 and e2 must be the same, and a and b are not in scope for e2. (See Note [The polymorphism rule of join points] in CoreSyn.) Returns False also if the type simply doesn't have enough arguments.

Note that we need to know how many arguments (type *and* value) the putative join point takes; for instance, if j :: forall a. a -> Int then j could be a binary join point returning an Int, but it could *not* be a unary join point returning a -> Int.

TODO: See Note [Excess polymorphism and join points]

seqType :: Type -> () #

seqTypes :: [Type] -> () #

eqTypeX :: RnEnv2 -> Type -> Type -> Bool #

Compare types with respect to a (presumably) non-empty `RnEnv2`.

eqTypes :: [Type] -> [Type] -> Bool #

Type equality on lists of types, looking through type synonyms but not newtypes.

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 #

Compare two `TyCon`s. NB: This should never see the "star synonyms", as recognized by Kind.isStarKindSynonymTyCon. See Note [Kind Constraint and kind *] in Kind. See Note [nonDetCmpType nondeterminism]

typeKind :: HasDebugCallStack => Type -> Kind #

isTypeLevPoly :: Type -> Bool #

Returns True if a type is levity polymorphic. Should be the same as (isKindLevPoly . typeKind) but much faster. Precondition: The type has kind (TYPE blah)

resultIsLevPoly :: Type -> Bool #

Looking past all pi-types, is the end result potentially levity polymorphic? Example: True for (forall r (a :: TYPE r). String -> a) Example: False for (forall r1 r2 (a :: TYPE r1) (b :: TYPE r2). a -> b -> Type)

tyConsOfType :: Type -> UniqSet TyCon #

All type constructors occurring in the type; looking through type synonyms, but not newtypes. When it finds a Class, it returns the class TyCon.

synTyConResKind :: TyCon -> Kind #

Find the result `Kind` of a type synonym, after applying it to its `arity` number of type variables Actually this function works fine on data types too, but they'd always return `*`, so we never need to ask

splitVisVarsOfType :: Type -> Pair TyCoVarSet #

Retrieve the free variables in this type, splitting them based on whether they are used visibly or invisibly. Invisible ones come first.

splitVisVarsOfTypes :: [Type] -> Pair TyCoVarSet #

modifyJoinResTy :: Int -> (Type -> Type) -> Type -> Type #

setJoinResTy :: Int -> Type -> Type -> Type #

module TyCon

data UnivCoProvenance #

For simplicity, we have just one UnivCo that represents a coercion from some type to some other type, with (in general) no restrictions on the type. The UnivCoProvenance specifies more exactly what the coercion really is and why a program should (or shouldn't!) trust the coercion. It is reasonable to consider each constructor of `UnivCoProvenance` as a totally independent coercion form; their only commonality is that they don't tell you what types they coercion between. (That info is in the `UnivCo` constructor of `Coercion`.

Instances

Data UnivCoProvenance # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnivCoProvenance -> c UnivCoProvenance Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnivCoProvenance Source # toConstr :: UnivCoProvenance -> Constr Source # dataTypeOf :: UnivCoProvenance -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnivCoProvenance) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnivCoProvenance) Source # gmapT :: (forall b. Data b => b -> b) -> UnivCoProvenance -> UnivCoProvenance Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnivCoProvenance -> r Source # gmapQ :: (forall d. Data d => d -> u) -> UnivCoProvenance -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnivCoProvenance -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnivCoProvenance -> m UnivCoProvenance Source #
Outputable UnivCoProvenance # |
Instance details Defined in TyCoRep Methods ppr :: UnivCoProvenance -> SDoc # pprPrec :: Rational -> UnivCoProvenance -> SDoc #

data Coercion #

A `Coercion` is concrete evidence of the equality/convertibility of two types.

Instances

Data Coercion # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Coercion -> c Coercion Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Coercion Source # toConstr :: Coercion -> Constr Source # dataTypeOf :: Coercion -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Coercion) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Coercion) Source # gmapT :: (forall b. Data b => b -> b) -> Coercion -> Coercion Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coercion -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Coercion -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Coercion -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Coercion -> m Coercion Source #
Outputable Coercion # |
Instance details Defined in TyCoRep Methods ppr :: Coercion -> SDoc # pprPrec :: Rational -> Coercion -> SDoc #

data LeftOrRight #

Constructors

CLeft |
CRight |

Instances

Eq LeftOrRight # |
Instance details Defined in BasicTypes Methods (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool #
Data LeftOrRight # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight Source # toConstr :: LeftOrRight -> Constr Source # dataTypeOf :: LeftOrRight -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) Source # gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source #
Outputable LeftOrRight # |
Instance details Defined in BasicTypes Methods ppr :: LeftOrRight -> SDoc # pprPrec :: Rational -> LeftOrRight -> SDoc #
Binary LeftOrRight # |
Instance details Defined in Binary Methods put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight #

pickLR :: LeftOrRight -> (a, a) -> a #

data Var #

Variable

Essentially a typed `Name`, that may also contain some additional information about the `Var` and it's use sites.

Instances

Eq Var # |
Instance details Defined in Var Methods (==) :: Var -> Var -> Bool # (/=) :: Var -> Var -> Bool #
Data Var # |
Instance details Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Var -> c Var Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Var Source # toConstr :: Var -> Constr Source # dataTypeOf :: Var -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Var) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Var) Source # gmapT :: (forall b. Data b => b -> b) -> Var -> Var Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Var -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Var -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Var -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Var -> m Var Source #
Ord Var # |
Instance details Defined in Var Methods compare :: Var -> Var -> Ordering # (<) :: Var -> Var -> Bool # (<=) :: Var -> Var -> Bool # (>) :: Var -> Var -> Bool # (>=) :: Var -> Var -> Bool # max :: Var -> Var -> Var # min :: Var -> Var -> Var #
OutputableBndr Var # |
Instance details Defined in PprCore Methods pprBndr :: BindingSite -> Var -> SDoc # pprPrefixOcc :: Var -> SDoc # pprInfixOcc :: Var -> SDoc # bndrIsJoin_maybe :: Var -> Maybe Int #
Outputable Var # |
Instance details Defined in Var Methods ppr :: Var -> SDoc # pprPrec :: Rational -> Var -> SDoc #
Uniquable Var # |
Instance details Defined in Var Methods getUnique :: Var -> Unique #
HasOccName Var # |
Instance details Defined in Var Methods occName :: Var -> OccName #
NamedThing Var # |
Instance details Defined in Var Methods getOccName :: Var -> OccName # getName :: Var -> Name #

type TyCoVar = Id #

Type or Coercion Variable

type CoVar = Id #

Coercion Variable

mkCoVar :: Name -> Type -> CoVar #

isCoVar :: Var -> Bool #

data Role #

Constructors

Nominal |
Representational |
Phantom |

Instances

Eq Role # |
Instance details Defined in CoAxiom Methods (==) :: Role -> Role -> Bool # (/=) :: Role -> Role -> Bool #
Data Role # |
Instance details Defined in CoAxiom Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Role -> c Role Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role Source # toConstr :: Role -> Constr Source # dataTypeOf :: Role -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) Source # gmapT :: (forall b. Data b => b -> b) -> Role -> Role Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role Source #
Ord Role # |
Instance details Defined in CoAxiom Methods compare :: Role -> Role -> Ordering # (<) :: Role -> Role -> Bool # (<=) :: Role -> Role -> Bool # (>) :: Role -> Role -> Bool # (>=) :: Role -> Role -> Bool # max :: Role -> Role -> Role # min :: Role -> Role -> Role #
Outputable Role # |
Instance details Defined in CoAxiom Methods ppr :: Role -> SDoc # pprPrec :: Rational -> Role -> SDoc #
Binary Role # |
Instance details Defined in CoAxiom Methods put_ :: BinHandle -> Role -> IO () # put :: BinHandle -> Role -> IO (Bin Role) # get :: BinHandle -> IO Role #

data LiftingContext #

Constructors

LC TCvSubst LiftCoEnv |

Instances

Outputable LiftingContext # |
Instance details Defined in Coercion Methods ppr :: LiftingContext -> SDoc # pprPrec :: Rational -> LiftingContext -> SDoc #

coercionType :: Coercion -> Type #

coercionKind :: Coercion -> Pair Type #

If it is the case that

    c :: (t1 ~ t2)

i.e. the kind of `c` relates `t1` and `t2`, then `coercionKind c = Pair t1 t2`.

seqCo :: Coercion -> () #

liftCoSubst :: HasDebugCallStack => Role -> LiftingContext -> Type -> Coercion #

`liftCoSubst role lc ty` produces a coercion (at role `role`) that coerces between `lc_left(ty)` and `lc_right(ty)`, where `lc_left` is a substitution mapping type variables to the left-hand types of the mapped coercions in `lc`, and similar for `lc_right`.

mkCoercionType :: Role -> Type -> Type -> Type #

Makes a coercion type from two types: the types whose equality is proven by the relevant `Coercion`

coVarRole :: CoVar -> Role #

coVarKindsTypesRole :: CoVar -> (Kind, Kind, Type, Type, Role) #

isReflexiveCo :: Coercion -> Bool #

Slowly checks if the coercion is reflexive. Don't call this in a loop, as it walks over the entire coercion.

isReflCo :: Coercion -> Bool #

Tests if this coercion is obviously reflexive. Guaranteed to work very quickly. Sometimes a coercion can be reflexive, but not obviously so. c.f. `isReflexiveCo`

mkFunCos :: Role -> [Coercion] -> Coercion -> Coercion #

Make nested function `Coercion`s

mkProofIrrelCo #

Arguments

:: 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".

mkSubCo :: Coercion -> Coercion #

mkKindCo :: Coercion -> Coercion #

Given `co :: (a :: k) ~ (b :: k')` produce `co' :: k ~ k'`.

mkCoherenceCo :: Coercion -> Coercion -> Coercion infixl 5 #

mkInstCo :: Coercion -> Coercion -> Coercion #

Instantiates a `Coercion`.

mkLRCo :: LeftOrRight -> Coercion -> Coercion #

mkNthCo :: Int -> Coercion -> Coercion #

mkTransCo :: Coercion -> Coercion -> Coercion #

Create a new `Coercion` by composing the two given `Coercion`s transitively. (co1 ; co2)

mkSymCo :: Coercion -> Coercion #

Create a symmetric version of the given `Coercion` that asserts equality between the same types but in the other "direction", so a kind of `t1 ~ t2` becomes the kind `t2 ~ t1`.

mkUnivCo #

Arguments

:: UnivCoProvenance |
-> Role | role of the built coercion, "r"
-> Type | t1 :: k1
-> Type | t2 :: k2
-> Coercion | :: t1 ~r t2

Make a universal coercion between two arbitrary types.

mkUnsafeCo :: Role -> Type -> Type -> Coercion #

Manufacture an unsafe coercion from thin air. Currently (May 14) this is used only to implement the `unsafeCoerce#` primitive. Optimise by pushing down through type constructors.

mkPhantomCo :: Coercion -> Type -> Type -> Coercion #

Make a phantom coercion between two types. The coercion passed in must be a nominal coercion between the kinds of the types.

mkAxiomInstCo :: CoAxiom Branched -> BranchIndex -> [Coercion] -> Coercion #

mkCoVarCo :: CoVar -> Coercion #

mkFunCo :: Role -> Coercion -> Coercion -> Coercion #

Build a function `Coercion` from two other `Coercion`s. That is, given `co1 :: a ~ b` and `co2 :: x ~ y` produce `co :: (a -> x) ~ (b -> y)`.

mkForAllCo :: TyVar -> Coercion -> Coercion -> Coercion #

Make a Coercion from a tyvar, a kind coercion, and a body coercion. The kind of the tyvar should be the left-hand kind of the kind coercion.

mkAppCo #

Arguments

:: Coercion | :: t1 ~r t2
-> Coercion | :: s1 ~N s2, where s1 :: k1, s2 :: k2
-> Coercion | :: t1 s1 ~r t2 s2

Apply a `Coercion` to another `Coercion`. The second coercion must be Nominal, unless the first is Phantom. If the first is Phantom, then the second can be either Phantom or Nominal.

mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion #

Apply a type constructor to a list of coercions. It is the caller's responsibility to get the roles correct on argument coercions.

mkReflCo :: Role -> Type -> Coercion #

type CvSubstEnv = CoVarEnv Coercion #

A substitution of `Coercion`s for `CoVar`s

data CoercionHole #

A coercion to be filled in by the type-checker. See Note [Coercion holes]

Instances

Data CoercionHole # |
Instance details Defined in TyCoRep Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CoercionHole -> c CoercionHole Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CoercionHole Source # toConstr :: CoercionHole -> Constr Source # dataTypeOf :: CoercionHole -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CoercionHole) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CoercionHole) Source # gmapT :: (forall b. Data b => b -> b) -> CoercionHole -> CoercionHole Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CoercionHole -> r Source # gmapQ :: (forall d. Data d => d -> u) -> CoercionHole -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> CoercionHole -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CoercionHole -> m CoercionHole Source #
Outputable CoercionHole # |
Instance details Defined in TyCoRep Methods ppr :: CoercionHole -> SDoc # pprPrec :: Rational -> CoercionHole -> SDoc #

type CoercionP = Coercion #

type CoercionR = Coercion #

type CoercionN = Coercion #

tyCoVarsOfCo :: Coercion -> TyCoVarSet #

tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet #

Get a deterministic set of the vars free in a coercion

tyCoFVsOfCo :: Coercion -> FV #

tyCoVarsOfCos :: [Coercion] -> TyCoVarSet #

tyCoFVsOfCos :: [Coercion] -> FV #

coVarsOfCo :: Coercion -> CoVarSet #

emptyCvSubstEnv :: CvSubstEnv #

getCvSubstEnv :: TCvSubst -> CvSubstEnv #

extendTvSubstAndInScope :: TCvSubst -> TyVar -> Type -> TCvSubst #

substCoWith :: HasCallStack => [TyVar] -> [Type] -> Coercion -> Coercion #

Coercion substitution, see `zipTvSubst`

substCos :: HasCallStack => TCvSubst -> [Coercion] -> [Coercion] #

Substitute within several `Coercion`s The substitution has to satisfy the invariants described in Note [The substitution invariant].

substCoVar :: TCvSubst -> CoVar -> Coercion #

substCoVars :: TCvSubst -> [CoVar] -> [Coercion] #

lookupCoVar :: TCvSubst -> Var -> Maybe Coercion #

substCoVarBndr :: 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 #

The result of stepping in a normalisation function. See `topNormaliseTypeX`.

Constructors

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 #

A function to check if we can reduce a type by one step. Used with `topNormaliseTypeX`.

coVarName :: CoVar -> Name #

setCoVarUnique :: CoVar -> Unique -> CoVar #

setCoVarName :: CoVar -> Name -> CoVar #

pprCoAxiom :: CoAxiom br -> SDoc #

pprCoAxBranch :: CoAxiom br -> CoAxBranch -> SDoc #

pprCoAxBranchHdr :: CoAxiom br -> BranchIndex -> SDoc #

decomposeCo :: Arity -> Coercion -> [Coercion] #

This breaks a `Coercion` with type `T A B C ~ T D E F` into a list of `Coercion`s of kinds `A ~ D`, `B ~ E` and `E ~ F`. Hence:

    decomposeCo 3 c = [nth 0 c, nth 1 c, nth 2 c]

decomposeFunCo :: Coercion -> (Coercion, Coercion) #

getCoVar_maybe :: Coercion -> Maybe CoVar #

Attempts to obtain the type variable underlying a `Coercion`

splitTyConAppCo_maybe :: Coercion -> Maybe (TyCon, [Coercion]) #

Attempts to tease a coercion apart into a type constructor and the application of a number of coercion arguments to that constructor

splitAppCo_maybe :: Coercion -> Maybe (Coercion, Coercion) #

Attempt to take a coercion application apart.

splitFunCo_maybe :: Coercion -> Maybe (Coercion, Coercion) #

splitForAllCo_maybe :: Coercion -> Maybe (TyVar, Coercion, Coercion) #

coVarTypes :: CoVar -> Pair Type #

coVarKind :: CoVar -> Type #

mkHeteroCoercionType :: Role -> Kind -> Kind -> Type -> Type -> Type #

isReflCoVar_maybe :: CoVar -> Maybe Coercion #

isReflCo_maybe :: Coercion -> Maybe (Type, Role) #

Returns the type coerced if this coercion is reflexive. Guaranteed to work very quickly. Sometimes a coercion can be reflexive, but not obviously so. c.f. `isReflexiveCo_maybe`

isReflexiveCo_maybe :: Coercion -> Maybe (Type, Role) #

Extracts the coerced type from a reflexive coercion. This potentially walks over the entire coercion, so avoid doing this in a loop.

mkRepReflCo :: Type -> Coercion #

Make a representational reflexive coercion

mkNomReflCo :: Type -> Coercion #

Make a nominal reflexive coercion

mkAppCos :: Coercion -> [Coercion] -> Coercion #

Applies multiple `Coercion`s to another `Coercion`, from left to right. See also `mkAppCo`.

mkTransAppCo #

Arguments

:: Role | r1
-> Coercion | co1 :: ty1a ~r1 ty1b
-> Type | ty1a
-> Type | ty1b
-> Role | r2
-> Coercion | co2 :: ty2a ~r2 ty2b
-> Type | ty2a
-> Type | ty2b
-> Role | r3
-> Coercion | :: ty1a ty2a ~r3 ty1b ty2b

Like `mkAppCo`, but allows the second coercion to be other than nominal. See Note [mkTransAppCo]. Role r3 cannot be more stringent than either r1 or r2.

mkForAllCos :: [(TyVar, Coercion)] -> Coercion -> Coercion #

Make nested ForAllCos

mkHomoForAllCos :: [TyVar] -> Coercion -> Coercion #

Make a Coercion quantified over a type variable; the variable has the same type in both sides of the coercion

mkHomoForAllCos_NoRefl :: [TyVar] -> Coercion -> Coercion #

Like `mkHomoForAllCos`, but doesn't check if the inner coercion is reflexive.

mkCoVarCos :: [CoVar] -> [Coercion] #

isCoVar_maybe :: Coercion -> Maybe CoVar #

Extract a covar, if possible. This check is dirty. Be ashamed of yourself. (It's dirty because it cares about the structure of a coercion, which is morally reprehensible.)

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 #

Return the left-hand type of the axiom, when the axiom is instantiated at the types given.

mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type #

Instantiate the left-hand side of an unbranched axiom

mkHoleCo :: CoercionHole -> Coercion #

Make a coercion from a coercion hole

mkNthCoRole :: Role -> Int -> Coercion -> Coercion #

mkCoherenceRightCo :: Coercion -> Coercion -> Coercion infixl 5 #

A CoherenceCo c1 c2 applies the coercion c2 to the left-hand type in the kind of c1. This function uses sym to get the coercion on the right-hand type of c1. Thus, if c1 :: s ~ t, then mkCoherenceRightCo c1 c2 has the kind (s ~ (t |> c2)) down through type constructors. The second coercion must be representational.

mkCoherenceLeftCo :: Coercion -> Coercion -> Coercion infixl 5 #

An explicitly directed synonym of mkCoherenceCo. The second coercion must be representational.

downgradeRole :: Role -> Role -> Coercion -> Coercion #

Like `downgradeRole_maybe`, but panics if the change isn't a downgrade. See Note [Role twiddling functions]

maybeSubCo :: EqRel -> Coercion -> Coercion #

If the EqRel is ReprEq, makes a SubCo; otherwise, does nothing. Note that the input coercion should always be nominal.

mkAxiomRuleCo :: CoAxiomRule -> [Coercion] -> Coercion #

setNominalRole_maybe :: Coercion -> Maybe Coercion #

Converts a coercion to be nominal, if possible. See Note [Role twiddling functions]

mkHomoPhantomCo :: Type -> Type -> Coercion #

Make a phantom coercion between two types of the same kind.

toPhantomCo :: Coercion -> Coercion #

tyConRolesX :: Role -> TyCon -> [Role] #

tyConRolesRepresentational :: TyCon -> [Role] #

nthRole :: Role -> TyCon -> Int -> Role #

ltRole :: Role -> Role -> Bool #

promoteCoercion :: Coercion -> Coercion #

like mkKindCo, but aggressively & recursively optimizes to avoid using a KindCo constructor. The output role is nominal.

castCoercionKind :: Coercion -> Coercion -> Coercion -> Coercion #

Creates a new coercion with both of its types casted by different casts castCoercionKind g h1 h2, where g :: t1 ~ t2, has type (t1 |> h1) ~ (t2 |> h2) The second and third coercions must be nominal.

mkPiCos :: Role -> [Var] -> Coercion -> Coercion #

mkPiCo :: Role -> Var -> Coercion -> Coercion #

Make a forall `Coercion`, where both types related by the coercion are quantified over the same type variable.

mkCoCast :: Coercion -> Coercion -> Coercion #

instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion) #

If `co :: T ts ~ rep_ty` then:

    instNewTyCon_maybe T ts = Just (rep_ty, co)

Checks for a newtype, and for being saturated

mapStepResult :: (ev1 -> ev2) -> NormaliseStepResult ev1 -> NormaliseStepResult ev2 #

composeSteppers :: NormaliseStepper ev -> NormaliseStepper ev -> NormaliseStepper ev #

Try one stepper and then try the next, if the first doesn't make progress. So if it returns NS_Done, it means that both steppers are satisfied

unwrapNewTypeStepper :: NormaliseStepper Coercion #

A `NormaliseStepper` that unwraps newtypes, careful not to fall into a loop. If it would fall into a loop, it produces `NS_Abort`.

topNormaliseTypeX :: NormaliseStepper ev -> (ev -> ev -> ev) -> Type -> Maybe (ev, Type) #

A general function for normalising the top-level of a type. It continues to use the provided `NormaliseStepper` until that function fails, and then this function returns. The roles of the coercions produced by the `NormaliseStepper` must all be the same, which is the role returned from the call to `topNormaliseTypeX`.

Typically ev is Coercion.

If topNormaliseTypeX step plus ty = Just (ev, ty') then ty ~ev1~ t1 ~ev2~ t2 ... ~evn~ ty' and ev = ev1 `plus` ev2 `plus` ... `plus` evn If it returns Nothing then no newtype unwrapping could happen

topNormaliseNewType_maybe :: Type -> Maybe (Coercion, Type) #

Sometimes we want to look through a `newtype` and get its associated coercion. This function strips off `newtype` layers enough to reveal something that isn't a `newtype`. Specifically, here's the invariant:

    topNormaliseNewType_maybe rec_nts ty = Just (co, ty')

then (a) `co : ty0 ~ ty'`. (b) ty' is not a newtype.

The function returns `Nothing` for non-`newtypes`, or unsaturated applications

This function does *not* look through type families, because it has no access to the type family environment. If you do have that at hand, consider to use topNormaliseType_maybe, which should be a drop-in replacement for topNormaliseNewType_maybe If topNormliseNewType_maybe ty = Just (co, ty'), then co : ty ~R ty'

eqCoercion :: Coercion -> Coercion -> Bool #

Syntactic equality of coercions

eqCoercionX :: RnEnv2 -> Coercion -> Coercion -> Bool #

Compare two `Coercion`s, with respect to an RnEnv2

liftCoSubstWithEx :: Role -> [TyVar] -> [Coercion] -> [TyVar] -> [Type] -> (Type -> Coercion, [Type]) #

liftCoSubstWith :: Role -> [TyCoVar] -> [Coercion] -> Type -> Coercion #

emptyLiftingContext :: InScopeSet -> LiftingContext #

mkSubstLiftingContext :: TCvSubst -> LiftingContext #

extendLiftingContext #

Arguments

:: LiftingContext | original LC
-> TyVar | new variable to map...
-> Coercion | ...to this lifted version
-> LiftingContext |

Extend a lifting context with a new type mapping.

zapLiftingContext :: LiftingContext -> LiftingContext #

Erase the environments in a lifting context

substForAllCoBndrCallbackLC :: Bool -> (Coercion -> Coercion) -> LiftingContext -> TyVar -> Coercion -> (LiftingContext, TyVar, Coercion) #

Like `substForAllCoBndr`, but works on a lifting context

liftCoSubstTyVar :: LiftingContext -> Role -> TyVar -> Maybe Coercion #

liftCoSubstVarBndrCallback :: (LiftingContext -> Type -> (Coercion, a)) -> LiftingContext -> TyVar -> (LiftingContext, TyVar, Coercion, a) #

isMappedByLC :: TyCoVar -> LiftingContext -> Bool #

Is a var in the domain of a lifting context?

substLeftCo :: LiftingContext -> Coercion -> Coercion #

substRightCo :: LiftingContext -> Coercion -> Coercion #

swapLiftCoEnv :: LiftCoEnv -> LiftCoEnv #

Apply "sym" to all coercions in a `LiftCoEnv`

lcSubstLeft :: LiftingContext -> TCvSubst #

lcSubstRight :: LiftingContext -> TCvSubst #

liftEnvSubstLeft :: TCvSubst -> LiftCoEnv -> TCvSubst #

liftEnvSubstRight :: TCvSubst -> LiftCoEnv -> TCvSubst #

lcTCvSubst :: LiftingContext -> TCvSubst #

Extract the underlying substitution from the LiftingContext

lcInScopeSet :: LiftingContext -> InScopeSet #

Get the `InScopeSet` from a `LiftingContext`

coercionKinds :: [Coercion] -> Pair [Type] #

Apply `coercionKind` to multiple `Coercion`s

coercionKindRole :: Coercion -> (Pair Type, Role) #

Get a coercion's kind and role. Why both at once? See Note [Computing a coercion kind and role]

coercionRole :: Coercion -> Role #

Retrieve the role from a coercion.

module TysWiredIn

module HscTypes

data SpliceExplicitFlag #

Constructors

ExplicitSplice | = $(f x y)
ImplicitSplice | = f x y, i.e. a naked top level expression

Instances

Data SpliceExplicitFlag # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SpliceExplicitFlag -> c SpliceExplicitFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SpliceExplicitFlag Source # toConstr :: SpliceExplicitFlag -> Constr Source # dataTypeOf :: SpliceExplicitFlag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SpliceExplicitFlag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SpliceExplicitFlag) Source # gmapT :: (forall b. Data b => b -> b) -> SpliceExplicitFlag -> SpliceExplicitFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SpliceExplicitFlag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SpliceExplicitFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SpliceExplicitFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SpliceExplicitFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SpliceExplicitFlag -> m SpliceExplicitFlag Source #

data IntWithInf #

An integer or infinity

Instances

Eq IntWithInf # |
Instance details Defined in BasicTypes Methods (==) :: IntWithInf -> IntWithInf -> Bool # (/=) :: IntWithInf -> IntWithInf -> Bool #
Num IntWithInf # |
Instance details Defined in BasicTypes Methods (+) :: IntWithInf -> IntWithInf -> IntWithInf Source # (-) :: IntWithInf -> IntWithInf -> IntWithInf Source # (*) :: IntWithInf -> IntWithInf -> IntWithInf Source # negate :: IntWithInf -> IntWithInf Source # abs :: IntWithInf -> IntWithInf Source # signum :: IntWithInf -> IntWithInf Source # fromInteger :: Integer -> IntWithInf Source #
Ord IntWithInf # |
Instance details Defined in BasicTypes Methods 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 # |
Instance details Defined in BasicTypes Methods ppr :: IntWithInf -> SDoc # pprPrec :: Rational -> IntWithInf -> SDoc #

data FractionalLit #

Fractional Literal

Used (instead of Rational) to represent exactly the floating point literal that we encountered in the user's source program. This allows us to pretty-print exactly what the user wrote, which is important e.g. for floating point numbers that can't represented as Doubles (we used to via Double for pretty-printing). See also #2245.

Constructors

FL |
Fields fl_text :: SourceText fl_neg :: Bool fl_value :: Rational

Instances

Eq FractionalLit # |
Instance details Defined in BasicTypes Methods (==) :: FractionalLit -> FractionalLit -> Bool # (/=) :: FractionalLit -> FractionalLit -> Bool #
Data FractionalLit # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FractionalLit -> c FractionalLit Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FractionalLit Source # toConstr :: FractionalLit -> Constr Source # dataTypeOf :: FractionalLit -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FractionalLit) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FractionalLit) Source # gmapT :: (forall b. Data b => b -> b) -> FractionalLit -> FractionalLit Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FractionalLit -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FractionalLit -> r Source # gmapQ :: (forall d. Data d => d -> u) -> FractionalLit -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> FractionalLit -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FractionalLit -> m FractionalLit Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FractionalLit -> m FractionalLit Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FractionalLit -> m FractionalLit Source #
Ord FractionalLit # |
Instance details Defined in BasicTypes Methods compare :: FractionalLit -> FractionalLit -> Ordering # (<) :: FractionalLit -> FractionalLit -> Bool # (<=) :: FractionalLit -> FractionalLit -> Bool # (>) :: FractionalLit -> FractionalLit -> Bool # (>=) :: FractionalLit -> FractionalLit -> Bool # max :: FractionalLit -> FractionalLit -> FractionalLit # min :: FractionalLit -> FractionalLit -> FractionalLit #
Show FractionalLit # |
Instance details Defined in BasicTypes Methods showsPrec :: Int -> FractionalLit -> ShowS Source # show :: FractionalLit -> String Source # showList :: [FractionalLit] -> ShowS Source #
Outputable FractionalLit # |
Instance details Defined in BasicTypes Methods ppr :: FractionalLit -> SDoc # pprPrec :: Rational -> FractionalLit -> SDoc #

data IntegralLit #

Integral Literal

Used (instead of Integer) to represent negative zegative zero which is required for NegativeLiterals extension to correctly parse `-0::Double` as negative zero. See also #13211.

Constructors

IL |
Fields il_text :: SourceText il_neg :: Bool il_value :: Integer

Instances

Eq IntegralLit # |
Instance details Defined in BasicTypes Methods (==) :: IntegralLit -> IntegralLit -> Bool # (/=) :: IntegralLit -> IntegralLit -> Bool #
Data IntegralLit # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IntegralLit -> c IntegralLit Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IntegralLit Source # toConstr :: IntegralLit -> Constr Source # dataTypeOf :: IntegralLit -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c IntegralLit) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IntegralLit) Source # gmapT :: (forall b. Data b => b -> b) -> IntegralLit -> IntegralLit Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IntegralLit -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IntegralLit -> r Source # gmapQ :: (forall d. Data d => d -> u) -> IntegralLit -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> IntegralLit -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IntegralLit -> m IntegralLit Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IntegralLit -> m IntegralLit Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IntegralLit -> m IntegralLit Source #
Ord IntegralLit # |
Instance details Defined in BasicTypes Methods compare :: IntegralLit -> IntegralLit -> Ordering # (<) :: IntegralLit -> IntegralLit -> Bool # (<=) :: IntegralLit -> IntegralLit -> Bool # (>) :: IntegralLit -> IntegralLit -> Bool # (>=) :: IntegralLit -> IntegralLit -> Bool # max :: IntegralLit -> IntegralLit -> IntegralLit # min :: IntegralLit -> IntegralLit -> IntegralLit #
Show IntegralLit # |
Instance details Defined in BasicTypes Methods showsPrec :: Int -> IntegralLit -> ShowS Source # show :: IntegralLit -> String Source # showList :: [IntegralLit] -> ShowS Source #
Outputable IntegralLit # |
Instance details Defined in BasicTypes Methods ppr :: IntegralLit -> SDoc # pprPrec :: Rational -> IntegralLit -> SDoc #

data InlineSpec #

Inline Specification

Constructors

Inline |
Inlinable |
NoInline |
NoUserInline |

Instances

Eq InlineSpec # |
Instance details Defined in BasicTypes Methods (==) :: InlineSpec -> InlineSpec -> Bool # (/=) :: InlineSpec -> InlineSpec -> Bool #
Data InlineSpec # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InlineSpec -> c InlineSpec Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InlineSpec Source # toConstr :: InlineSpec -> Constr Source # dataTypeOf :: InlineSpec -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InlineSpec) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InlineSpec) Source # gmapT :: (forall b. Data b => b -> b) -> InlineSpec -> InlineSpec Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InlineSpec -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InlineSpec -> r Source # gmapQ :: (forall d. Data d => d -> u) -> InlineSpec -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> InlineSpec -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InlineSpec -> m InlineSpec Source #
Show InlineSpec # |
Instance details Defined in BasicTypes Methods showsPrec :: Int -> InlineSpec -> ShowS Source # show :: InlineSpec -> String Source # showList :: [InlineSpec] -> ShowS Source #
Outputable InlineSpec # |
Instance details Defined in BasicTypes Methods ppr :: InlineSpec -> SDoc # pprPrec :: Rational -> InlineSpec -> SDoc #
Binary InlineSpec # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlineSpec -> IO () # put :: BinHandle -> InlineSpec -> IO (Bin InlineSpec) # get :: BinHandle -> IO InlineSpec #

data InlinePragma #

Constructors

InlinePragma |
Fields inl_src :: SourceText inl_inline :: InlineSpec inl_sat :: Maybe Arity inl_act :: Activation inl_rule :: RuleMatchInfo

Instances

Eq InlinePragma # |
Instance details Defined in BasicTypes Methods (==) :: InlinePragma -> InlinePragma -> Bool # (/=) :: InlinePragma -> InlinePragma -> Bool #
Data InlinePragma # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InlinePragma -> c InlinePragma Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InlinePragma Source # toConstr :: InlinePragma -> Constr Source # dataTypeOf :: InlinePragma -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InlinePragma) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InlinePragma) Source # gmapT :: (forall b. Data b => b -> b) -> InlinePragma -> InlinePragma Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InlinePragma -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InlinePragma -> r Source # gmapQ :: (forall d. Data d => d -> u) -> InlinePragma -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> InlinePragma -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InlinePragma -> m InlinePragma Source #
Outputable InlinePragma # |
Instance details Defined in BasicTypes Methods ppr :: InlinePragma -> SDoc # pprPrec :: Rational -> InlinePragma -> SDoc #
Binary InlinePragma # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlinePragma -> IO () # put :: BinHandle -> InlinePragma -> IO (Bin InlinePragma) # get :: BinHandle -> IO InlinePragma #

data RuleMatchInfo #

Rule Match Information

Constructors

ConLike |
FunLike |

Instances

Eq RuleMatchInfo # |
Instance details Defined in BasicTypes Methods (==) :: RuleMatchInfo -> RuleMatchInfo -> Bool # (/=) :: RuleMatchInfo -> RuleMatchInfo -> Bool #
Data RuleMatchInfo # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RuleMatchInfo -> c RuleMatchInfo Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RuleMatchInfo Source # toConstr :: RuleMatchInfo -> Constr Source # dataTypeOf :: RuleMatchInfo -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RuleMatchInfo) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RuleMatchInfo) Source # gmapT :: (forall b. Data b => b -> b) -> RuleMatchInfo -> RuleMatchInfo Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatchInfo -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RuleMatchInfo -> r Source # gmapQ :: (forall d. Data d => d -> u) -> RuleMatchInfo -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> RuleMatchInfo -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RuleMatchInfo -> m RuleMatchInfo Source #
Show RuleMatchInfo # |
Instance details Defined in BasicTypes Methods showsPrec :: Int -> RuleMatchInfo -> ShowS Source # show :: RuleMatchInfo -> String Source # showList :: [RuleMatchInfo] -> ShowS Source #
Outputable RuleMatchInfo # |
Instance details Defined in BasicTypes Methods ppr :: RuleMatchInfo -> SDoc # pprPrec :: Rational -> RuleMatchInfo -> SDoc #
Binary RuleMatchInfo # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RuleMatchInfo -> IO () # put :: BinHandle -> RuleMatchInfo -> IO (Bin RuleMatchInfo) # get :: BinHandle -> IO RuleMatchInfo #

data Activation #

Constructors

NeverActive |
AlwaysActive |
ActiveBefore SourceText PhaseNum |
ActiveAfter SourceText PhaseNum |

Instances

Eq Activation # |
Instance details Defined in BasicTypes Methods (==) :: Activation -> Activation -> Bool # (/=) :: Activation -> Activation -> Bool #
Data Activation # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Activation -> c Activation Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Activation Source # toConstr :: Activation -> Constr Source # dataTypeOf :: Activation -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Activation) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Activation) Source # gmapT :: (forall b. Data b => b -> b) -> Activation -> Activation Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Activation -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Activation -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Activation -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Activation -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Activation -> m Activation Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Activation -> m Activation Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Activation -> m Activation Source #
Outputable Activation # |
Instance details Defined in BasicTypes Methods ppr :: Activation -> SDoc # pprPrec :: Rational -> Activation -> SDoc #
Binary Activation # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Activation -> IO () # put :: BinHandle -> Activation -> IO (Bin Activation) # get :: BinHandle -> IO Activation #

data CompilerPhase #

Constructors

Phase PhaseNum |
InitialPhase |

Instances

Outputable CompilerPhase # |
Instance details Defined in BasicTypes Methods ppr :: CompilerPhase -> SDoc # pprPrec :: Rational -> CompilerPhase -> SDoc #

type PhaseNum = Int #

Phase Number

data SourceText #

Constructors

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 # |
Instance details Defined in BasicTypes Methods (==) :: SourceText -> SourceText -> Bool # (/=) :: SourceText -> SourceText -> Bool #
Data SourceText # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceText -> c SourceText Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceText Source # toConstr :: SourceText -> Constr Source # dataTypeOf :: SourceText -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourceText) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourceText) Source # gmapT :: (forall b. Data b => b -> b) -> SourceText -> SourceText Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceText -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceText -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SourceText -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceText -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceText -> m SourceText Source #
Show SourceText # |
Instance details Defined in BasicTypes Methods showsPrec :: Int -> SourceText -> ShowS Source # show :: SourceText -> String Source # showList :: [SourceText] -> ShowS Source #
Outputable SourceText # |
Instance details Defined in BasicTypes Methods ppr :: SourceText -> SDoc # pprPrec :: Rational -> SourceText -> SDoc #
Binary SourceText # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SourceText -> IO () # put :: BinHandle -> SourceText -> IO (Bin SourceText) # get :: BinHandle -> IO SourceText #
HasDefault SourceText # |
Instance details Defined in HsExtension Methods def :: SourceText #
HasSourceText SourceText # | `SourceText` trivially implements `HasSourceText`
Instance details Defined in HsExtension Methods noSourceText :: SourceText # sourceText :: String -> SourceText # setSourceText :: SourceText -> SourceText # getSourceText :: SourceText -> SourceText #

data SuccessFlag #

Constructors

Succeeded |
Failed |

Instances

Outputable SuccessFlag # |
Instance details Defined in BasicTypes Methods ppr :: SuccessFlag -> SDoc # pprPrec :: Rational -> SuccessFlag -> SDoc #

data DefMethSpec ty #

Default Method Specification

Constructors

VanillaDM |
GenericDM ty |

Instances

Outputable (DefMethSpec ty) # |
Instance details Defined in BasicTypes Methods ppr :: DefMethSpec ty -> SDoc # pprPrec :: Rational -> DefMethSpec ty -> SDoc #
Binary (DefMethSpec IfaceType) # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> DefMethSpec IfaceType -> IO () # put :: BinHandle -> DefMethSpec IfaceType -> IO (Bin (DefMethSpec IfaceType)) # get :: BinHandle -> IO (DefMethSpec IfaceType) #

data TailCallInfo #

Constructors

AlwaysTailCalled JoinArity |
NoTailCallInfo |

Instances

Eq TailCallInfo # |
Instance details Defined in BasicTypes Methods (==) :: TailCallInfo -> TailCallInfo -> Bool # (/=) :: TailCallInfo -> TailCallInfo -> Bool #
Outputable TailCallInfo # |
Instance details Defined in BasicTypes Methods ppr :: TailCallInfo -> SDoc # pprPrec :: Rational -> TailCallInfo -> SDoc #

type OneBranch = Bool #

type InsideLam = Bool #

Inside Lambda

type InterestingCxt = Bool #

Interesting Context

data OccInfo #

identifier Occurrence Information

Constructors

ManyOccs | There are many occurrences, or unknown occurrences
Fields occ_tail :: !TailCallInfo
IAmDead | Marks unused variables. Sometimes useful for lambda and case-bound variables.
OneOcc | Occurs exactly once (per branch), not inside a rule
Fields occ_in_lam :: !InsideLam occ_one_br :: !OneBranch occ_int_cxt :: !InterestingCxt occ_tail :: !TailCallInfo
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
Fields occ_rules_only :: !RulesOnly occ_tail :: !TailCallInfo

Instances

Eq OccInfo # |
Instance details Defined in BasicTypes Methods (==) :: OccInfo -> OccInfo -> Bool # (/=) :: OccInfo -> OccInfo -> Bool #
Outputable OccInfo # |
Instance details Defined in BasicTypes Methods ppr :: OccInfo -> SDoc # pprPrec :: Rational -> OccInfo -> SDoc #

data EP a #

Embedding Projection pair

Constructors

EP |
Fields fromEP :: a toEP :: a

data TupleSort #

Constructors

BoxedTuple |
UnboxedTuple |
ConstraintTuple |

Instances

Eq TupleSort # |
Instance details Defined in BasicTypes Methods (==) :: TupleSort -> TupleSort -> Bool # (/=) :: TupleSort -> TupleSort -> Bool #
Data TupleSort # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TupleSort -> c TupleSort Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TupleSort Source # toConstr :: TupleSort -> Constr Source # dataTypeOf :: TupleSort -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TupleSort) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TupleSort) Source # gmapT :: (forall b. Data b => b -> b) -> TupleSort -> TupleSort Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TupleSort -> r Source # gmapQ :: (forall d. Data d => d -> u) -> TupleSort -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> TupleSort -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TupleSort -> m TupleSort Source #
Binary TupleSort # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TupleSort -> IO () # put :: BinHandle -> TupleSort -> IO (Bin TupleSort) # get :: BinHandle -> IO TupleSort #

data TyPrec #

Constructors

TopPrec |
FunPrec |
TyOpPrec |
TyConPrec |

Instances

Eq TyPrec # |
Instance details Defined in BasicTypes Methods (==) :: TyPrec -> TyPrec -> Bool # (/=) :: TyPrec -> TyPrec -> Bool #
Ord TyPrec # |
Instance details Defined in BasicTypes Methods compare :: TyPrec -> TyPrec -> Ordering # (<) :: TyPrec -> TyPrec -> Bool # (<=) :: TyPrec -> TyPrec -> Bool # (>) :: TyPrec -> TyPrec -> Bool # (>=) :: TyPrec -> TyPrec -> Bool # max :: TyPrec -> TyPrec -> TyPrec # min :: TyPrec -> TyPrec -> TyPrec #

data OverlapMode #

Constructors

NoOverlap SourceText | This instance must not overlap another `NoOverlap` instance. However, it may be overlapped by `Overlapping` instances, and it may overlap `Overlappable` instances.
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 `Overlapping` and `Overlappable` flags.
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 `b` would change which instance was chosen. See also note [Incoherent instances] in InstEnv

Instances

Eq OverlapMode # |
Instance details Defined in BasicTypes Methods (==) :: OverlapMode -> OverlapMode -> Bool # (/=) :: OverlapMode -> OverlapMode -> Bool #
Data OverlapMode # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverlapMode -> c OverlapMode Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverlapMode Source # toConstr :: OverlapMode -> Constr Source # dataTypeOf :: OverlapMode -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OverlapMode) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverlapMode) Source # gmapT :: (forall b. Data b => b -> b) -> OverlapMode -> OverlapMode Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverlapMode -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverlapMode -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OverlapMode -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverlapMode -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapMode -> m OverlapMode Source #
Outputable OverlapMode # |
Instance details Defined in BasicTypes Methods ppr :: OverlapMode -> SDoc # pprPrec :: Rational -> OverlapMode -> SDoc #
Binary OverlapMode # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapMode -> IO () # put :: BinHandle -> OverlapMode -> IO (Bin OverlapMode) # get :: BinHandle -> IO OverlapMode #

data OverlapFlag #

The semantics allowed for overlapping instances for a particular instance. See Note [Safe Haskell isSafeOverlap] (in `hs`) for a explanation of the `isSafeOverlap` field.

- `AnnKeywordId` : `AnnOpen` `'{-# OVERLAPPABLE'` or `'{-# OVERLAPPING'` or `'{-# OVERLAPS'` or `'{-# INCOHERENT'`, `AnnClose` ``#-}``,

Constructors

OverlapFlag |
Fields overlapMode :: OverlapMode isSafeOverlap :: Bool

Instances

Eq OverlapFlag # |
Instance details Defined in BasicTypes Methods (==) :: OverlapFlag -> OverlapFlag -> Bool # (/=) :: OverlapFlag -> OverlapFlag -> Bool #
Data OverlapFlag # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OverlapFlag -> c OverlapFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OverlapFlag Source # toConstr :: OverlapFlag -> Constr Source # dataTypeOf :: OverlapFlag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OverlapFlag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OverlapFlag) Source # gmapT :: (forall b. Data b => b -> b) -> OverlapFlag -> OverlapFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OverlapFlag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OverlapFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> OverlapFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> OverlapFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OverlapFlag -> m OverlapFlag Source #
Outputable OverlapFlag # |
Instance details Defined in BasicTypes Methods ppr :: OverlapFlag -> SDoc # pprPrec :: Rational -> OverlapFlag -> SDoc #
Binary OverlapFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapFlag -> IO () # put :: BinHandle -> OverlapFlag -> IO (Bin OverlapFlag) # get :: BinHandle -> IO OverlapFlag #

data DerivStrategy #

Which technique the user explicitly requested when deriving an instance.

Constructors

StockStrategy | GHC's "standard" strategy, which is to implement a custom instance for the data type. This only works for certain types that GHC knows about (e.g., `Eq`, `Show`, `Functor` when `-XDeriveFunctor` is enabled, etc.)
AnyclassStrategy |
    -XDeriveAnyClass
NewtypeStrategy |
    -XGeneralizedNewtypeDeriving

Instances

Eq DerivStrategy # |
Instance details Defined in BasicTypes Methods (==) :: DerivStrategy -> DerivStrategy -> Bool # (/=) :: DerivStrategy -> DerivStrategy -> Bool #
Data DerivStrategy # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DerivStrategy -> c DerivStrategy Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DerivStrategy Source # toConstr :: DerivStrategy -> Constr Source # dataTypeOf :: DerivStrategy -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DerivStrategy) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DerivStrategy) Source # gmapT :: (forall b. Data b => b -> b) -> DerivStrategy -> DerivStrategy Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DerivStrategy -> r Source # gmapQ :: (forall d. Data d => d -> u) -> DerivStrategy -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> DerivStrategy -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DerivStrategy -> m DerivStrategy Source #
Outputable DerivStrategy # |
Instance details Defined in BasicTypes Methods ppr :: DerivStrategy -> SDoc # pprPrec :: Rational -> DerivStrategy -> SDoc #

data Origin #

Constructors

FromSource |
Generated |

Instances

Eq Origin # |
Instance details Defined in BasicTypes Methods (==) :: Origin -> Origin -> Bool # (/=) :: Origin -> Origin -> Bool #
Data Origin # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Origin -> c Origin Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Origin Source # toConstr :: Origin -> Constr Source # dataTypeOf :: Origin -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Origin) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Origin) Source # gmapT :: (forall b. Data b => b -> b) -> Origin -> Origin Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Origin -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Origin -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Origin -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Origin -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Origin -> m Origin Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Origin -> m Origin Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Origin -> m Origin Source #
Outputable Origin # |
Instance details Defined in BasicTypes Methods ppr :: Origin -> SDoc # pprPrec :: Rational -> Origin -> SDoc #

data RecFlag #

Recursivity Flag

Constructors

Recursive |
NonRecursive |

Instances

Eq RecFlag # |
Instance details Defined in BasicTypes Methods (==) :: RecFlag -> RecFlag -> Bool # (/=) :: RecFlag -> RecFlag -> Bool #
Data RecFlag # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RecFlag -> c RecFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RecFlag Source # toConstr :: RecFlag -> Constr Source # dataTypeOf :: RecFlag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c RecFlag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RecFlag) Source # gmapT :: (forall b. Data b => b -> b) -> RecFlag -> RecFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RecFlag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RecFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> RecFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> RecFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RecFlag -> m RecFlag Source #
Outputable RecFlag # |
Instance details Defined in BasicTypes Methods ppr :: RecFlag -> SDoc # pprPrec :: Rational -> RecFlag -> SDoc #
Binary RecFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RecFlag -> IO () # put :: BinHandle -> RecFlag -> IO (Bin RecFlag) # get :: BinHandle -> IO RecFlag #

data Boxity #

Constructors

Boxed |
Unboxed |

Instances

Eq Boxity # |
Instance details Defined in BasicTypes Methods (==) :: Boxity -> Boxity -> Bool # (/=) :: Boxity -> Boxity -> Bool #
Data Boxity # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Boxity -> c Boxity Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Boxity Source # toConstr :: Boxity -> Constr Source # dataTypeOf :: Boxity -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Boxity) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Boxity) Source # gmapT :: (forall b. Data b => b -> b) -> Boxity -> Boxity Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Boxity -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Boxity -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity Source #
Outputable Boxity # |
Instance details Defined in BasicTypes Methods ppr :: Boxity -> SDoc # pprPrec :: Rational -> Boxity -> SDoc #

data TopLevelFlag #

Constructors

TopLevel |
NotTopLevel |

Instances

Outputable TopLevelFlag # |
Instance details Defined in BasicTypes Methods ppr :: TopLevelFlag -> SDoc # pprPrec :: Rational -> TopLevelFlag -> SDoc #

data LexicalFixity #

Captures the fixity of declarations as they are parsed. This is not necessarily the same as the fixity declaration, as the normal fixity may be overridden using parens or backticks.

Constructors

Prefix |
Infix |

Instances

Eq LexicalFixity # |
Instance details Defined in BasicTypes Methods (==) :: LexicalFixity -> LexicalFixity -> Bool # (/=) :: LexicalFixity -> LexicalFixity -> Bool #
Data LexicalFixity # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LexicalFixity -> c LexicalFixity Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LexicalFixity Source # toConstr :: LexicalFixity -> Constr Source # dataTypeOf :: LexicalFixity -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LexicalFixity) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LexicalFixity) Source # gmapT :: (forall b. Data b => b -> b) -> LexicalFixity -> LexicalFixity Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r Source # gmapQ :: (forall d. Data d => d -> u) -> LexicalFixity -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> LexicalFixity -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity Source #
Outputable LexicalFixity # |
Instance details Defined in BasicTypes Methods ppr :: LexicalFixity -> SDoc # pprPrec :: Rational -> LexicalFixity -> SDoc #

data FixityDirection #

Constructors

InfixL |
InfixR |
InfixN |

Instances

Eq FixityDirection # |
Instance details Defined in BasicTypes Methods (==) :: FixityDirection -> FixityDirection -> Bool # (/=) :: FixityDirection -> FixityDirection -> Bool #
Data FixityDirection # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FixityDirection -> c FixityDirection Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FixityDirection Source # toConstr :: FixityDirection -> Constr Source # dataTypeOf :: FixityDirection -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FixityDirection) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FixityDirection) Source # gmapT :: (forall b. Data b => b -> b) -> FixityDirection -> FixityDirection Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r Source # gmapQ :: (forall d. Data d => d -> u) -> FixityDirection -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> FixityDirection -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection Source #
Outputable FixityDirection # |
Instance details Defined in BasicTypes Methods ppr :: FixityDirection -> SDoc # pprPrec :: Rational -> FixityDirection -> SDoc #
Binary FixityDirection # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FixityDirection -> IO () # put :: BinHandle -> FixityDirection -> IO (Bin FixityDirection) # get :: BinHandle -> IO FixityDirection #

data Fixity #

Constructors

Fixity SourceText Int FixityDirection |

Instances

Eq Fixity # |
Instance details Defined in BasicTypes Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #
Data Fixity # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Fixity -> c Fixity Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity Source # toConstr :: Fixity -> Constr Source # dataTypeOf :: Fixity -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) Source # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity Source #
Outputable Fixity # |
Instance details Defined in BasicTypes Methods ppr :: Fixity -> SDoc # pprPrec :: Rational -> Fixity -> SDoc #
Binary Fixity # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Fixity -> IO () # put :: BinHandle -> Fixity -> IO (Bin Fixity) # get :: BinHandle -> IO Fixity #

type RuleName = FastString #

data WarningTxt #

Warning Text

reason/explanation from a WARNING or DEPRECATED pragma

Constructors

WarningTxt (Located SourceText) [Located StringLiteral] |
DeprecatedTxt (Located SourceText) [Located StringLiteral] |

Instances

Eq WarningTxt # |
Instance details Defined in BasicTypes Methods (==) :: WarningTxt -> WarningTxt -> Bool # (/=) :: WarningTxt -> WarningTxt -> Bool #
Data WarningTxt # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WarningTxt -> c WarningTxt Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c WarningTxt Source # toConstr :: WarningTxt -> Constr Source # dataTypeOf :: WarningTxt -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c WarningTxt) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c WarningTxt) Source # gmapT :: (forall b. Data b => b -> b) -> WarningTxt -> WarningTxt Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WarningTxt -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WarningTxt -> r Source # gmapQ :: (forall d. Data d => d -> u) -> WarningTxt -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> WarningTxt -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WarningTxt -> m WarningTxt Source #
Outputable WarningTxt # |
Instance details Defined in BasicTypes Methods ppr :: WarningTxt -> SDoc # pprPrec :: Rational -> WarningTxt -> SDoc #
Binary WarningTxt # |
Instance details Defined in Binary Methods put_ :: BinHandle -> WarningTxt -> IO () # put :: BinHandle -> WarningTxt -> IO (Bin WarningTxt) # get :: BinHandle -> IO WarningTxt #

data StringLiteral #

A String Literal in the source, including its original raw format for use by source to source manipulation tools.

Constructors

StringLiteral |
Fields sl_st :: SourceText sl_fs :: FastString

Instances

Eq StringLiteral # |
Instance details Defined in BasicTypes Methods (==) :: StringLiteral -> StringLiteral -> Bool # (/=) :: StringLiteral -> StringLiteral -> Bool #
Data StringLiteral # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> StringLiteral -> c StringLiteral Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c StringLiteral Source # toConstr :: StringLiteral -> Constr Source # dataTypeOf :: StringLiteral -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c StringLiteral) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c StringLiteral) Source # gmapT :: (forall b. Data b => b -> b) -> StringLiteral -> StringLiteral Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> StringLiteral -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> StringLiteral -> r Source # gmapQ :: (forall d. Data d => d -> u) -> StringLiteral -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> StringLiteral -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> StringLiteral -> m StringLiteral Source #
Outputable StringLiteral # |
Instance details Defined in BasicTypes Methods ppr :: StringLiteral -> SDoc # pprPrec :: Rational -> StringLiteral -> SDoc #
Binary StringLiteral # |
Instance details Defined in Binary Methods put_ :: BinHandle -> StringLiteral -> IO () # put :: BinHandle -> StringLiteral -> IO (Bin StringLiteral) # get :: BinHandle -> IO StringLiteral #

data FunctionOrData #

Constructors

IsFunction |
IsData |

Instances

Eq FunctionOrData # |
Instance details Defined in BasicTypes Methods (==) :: FunctionOrData -> FunctionOrData -> Bool # (/=) :: FunctionOrData -> FunctionOrData -> Bool #
Data FunctionOrData # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunctionOrData -> c FunctionOrData Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunctionOrData Source # toConstr :: FunctionOrData -> Constr Source # dataTypeOf :: FunctionOrData -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunctionOrData) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunctionOrData) Source # gmapT :: (forall b. Data b => b -> b) -> FunctionOrData -> FunctionOrData Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunctionOrData -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunctionOrData -> r Source # gmapQ :: (forall d. Data d => d -> u) -> FunctionOrData -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> FunctionOrData -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunctionOrData -> m FunctionOrData Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunctionOrData -> m FunctionOrData Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunctionOrData -> m FunctionOrData Source #
Ord FunctionOrData # |
Instance details Defined in BasicTypes Methods compare :: FunctionOrData -> FunctionOrData -> Ordering # (<) :: FunctionOrData -> FunctionOrData -> Bool # (<=) :: FunctionOrData -> FunctionOrData -> Bool # (>) :: FunctionOrData -> FunctionOrData -> Bool # (>=) :: FunctionOrData -> FunctionOrData -> Bool # max :: FunctionOrData -> FunctionOrData -> FunctionOrData # min :: FunctionOrData -> FunctionOrData -> FunctionOrData #
Outputable FunctionOrData # |
Instance details Defined in BasicTypes Methods ppr :: FunctionOrData -> SDoc # pprPrec :: Rational -> FunctionOrData -> SDoc #
Binary FunctionOrData # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FunctionOrData -> IO () # put :: BinHandle -> FunctionOrData -> IO (Bin FunctionOrData) # get :: BinHandle -> IO FunctionOrData #

data SwapFlag #

Constructors

NotSwapped |
IsSwapped |

Instances

Outputable SwapFlag # |
Instance details Defined in BasicTypes Methods ppr :: SwapFlag -> SDoc # pprPrec :: Rational -> SwapFlag -> SDoc #

data OneShotInfo #

If the `Id` is a lambda-bound variable then it may have lambda-bound variable info. Sometimes we know whether the lambda binding this variable is a "one-shot" lambda; that is, whether it is applied at most once.

This information may be useful in optimisation, as computations may safely be floated inside such a lambda without risk of duplicating work.

Constructors

NoOneShotInfo | No information
OneShotLam | The lambda is applied at most once.

Instances

Eq OneShotInfo # |
Instance details Defined in BasicTypes Methods (==) :: OneShotInfo -> OneShotInfo -> Bool # (/=) :: OneShotInfo -> OneShotInfo -> Bool #
Outputable OneShotInfo # |
Instance details Defined in BasicTypes Methods ppr :: OneShotInfo -> SDoc # pprPrec :: Rational -> OneShotInfo -> SDoc #

type Alignment = Int #

type ConTagZ = Int #

A *zero-indexed* constructor tag

type ConTag = Int #

Constructor Tag

Type of the tags associated with each constructor possibility or superclass selector

type JoinArity = Int #

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.

type RepArity = Int #

Representation Arity

The number of represented arguments that can be applied to a value before it does "real work". So: fib 100 has representation arity 0 x -> fib x has representation arity 1 () -> fib (x + y) has representation arity 2

type Arity = Int #

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 #

Constructors

CLeft |
CRight |

Instances

Eq LeftOrRight # |
Instance details Defined in BasicTypes Methods (==) :: LeftOrRight -> LeftOrRight -> Bool # (/=) :: LeftOrRight -> LeftOrRight -> Bool #
Data LeftOrRight # |
Instance details Defined in BasicTypes Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> LeftOrRight -> c LeftOrRight Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LeftOrRight Source # toConstr :: LeftOrRight -> Constr Source # dataTypeOf :: LeftOrRight -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LeftOrRight) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LeftOrRight) Source # gmapT :: (forall b. Data b => b -> b) -> LeftOrRight -> LeftOrRight Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftOrRight -> r Source # gmapQ :: (forall d. Data d => d -> u) -> LeftOrRight -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftOrRight -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftOrRight -> m LeftOrRight Source #
Outputable LeftOrRight # |
Instance details Defined in BasicTypes Methods ppr :: LeftOrRight -> SDoc # pprPrec :: Rational -> LeftOrRight -> SDoc #
Binary LeftOrRight # |
Instance details Defined in Binary Methods put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight #

pickLR :: LeftOrRight -> (a, a) -> a #

fIRST_TAG :: ConTag #

Tags are allocated from here for real constructors or for superclass selectors

noOneShotInfo :: OneShotInfo #

It is always safe to assume that an `Id` has no lambda-bound variable information

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 #

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 #

maybeParen :: TyPrec -> TyPrec -> SDoc -> SDoc #

tupleSortBoxity :: TupleSort -> Boxity #

boxityTupleSort :: Boxity -> TupleSort #

tupleParens :: TupleSort -> SDoc -> SDoc #

sumParens :: SDoc -> SDoc #

pprAlternative #

Arguments

:: (a -> SDoc) | The pretty printing function to use
-> a | The things to be pretty printed
-> ConTag | Alternative (one-based)
-> Arity | Arity
-> SDoc | `SDoc` where the alternative havs been pretty printed and finally packed into a paragraph.

Pretty print an alternative in an unboxed sum e.g. "| a | |".

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 #

Special combinator for showing string literals.

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 #

A representation of infinity

intGtLimit :: Int -> IntWithInf -> Bool #

treatZeroAsInf :: Int -> IntWithInf #

Turn a positive number into an `IntWithInf`, where 0 represents infinity

mkIntWithInf :: Int -> IntWithInf #

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 #

Class of things that we can obtain a `Unique` from

Minimal complete definition

getUnique

Methods

getUnique :: a -> Unique #

Instances

Uniquable Int # |
Instance details Defined in Unique Methods getUnique :: Int -> Unique #
Uniquable Name # |
Instance details Defined in Name Methods getUnique :: Name -> Unique #
Uniquable OccName # |
Instance details Defined in OccName Methods getUnique :: OccName -> Unique #
Uniquable TyCon # |
Instance details Defined in TyCon Methods getUnique :: TyCon -> Unique #
Uniquable FastString # |
Instance details Defined in Unique Methods getUnique :: FastString -> Unique #
Uniquable ComponentId # |
Instance details Defined in Module Methods getUnique :: ComponentId -> Unique #
Uniquable InstalledUnitId # |
Instance details Defined in Module Methods getUnique :: InstalledUnitId -> Unique #
Uniquable UnitId # |
Instance details Defined in Module Methods getUnique :: UnitId -> Unique #
Uniquable ModuleName # |
Instance details Defined in Module Methods getUnique :: ModuleName -> Unique #
Uniquable Module # |
Instance details Defined in Module Methods getUnique :: Module -> Unique #
Uniquable Unique # |
Instance details Defined in Unique Methods getUnique :: Unique -> Unique #
Uniquable RegClass # |
Instance details Defined in RegClass Methods getUnique :: RegClass -> Unique #
Uniquable Reg # | so we can put regs in UniqSets
Instance details Defined in RegAlloc.Graph.ArchBase Methods getUnique :: Reg -> Unique #
Uniquable Reg # |
Instance details Defined in Reg Methods getUnique :: Reg -> Unique #
Uniquable RealReg # |
Instance details Defined in Reg Methods getUnique :: RealReg -> Unique #
Uniquable VirtualReg # |
Instance details Defined in Reg Methods getUnique :: VirtualReg -> Unique #
Uniquable Label # |
Instance details Defined in Hoopl.Label Methods getUnique :: Label -> Unique #
Uniquable PackageName # |
Instance details Defined in PackageConfig Methods getUnique :: PackageName -> Unique #
Uniquable SourcePackageId # |
Instance details Defined in PackageConfig Methods getUnique :: SourcePackageId -> Unique #
Uniquable Var # |
Instance details Defined in Var Methods getUnique :: Var -> Unique #
Uniquable PatSyn # |
Instance details Defined in PatSyn Methods getUnique :: PatSyn -> Unique #
Uniquable DataCon # |
Instance details Defined in DataCon Methods getUnique :: DataCon -> Unique #
Uniquable ConLike # |
Instance details Defined in ConLike Methods getUnique :: ConLike -> Unique #
Uniquable CoAxiomRule # |
Instance details Defined in CoAxiom Methods getUnique :: CoAxiomRule -> Unique #
Uniquable Class # |
Instance details Defined in Class Methods getUnique :: Class -> Unique #
Uniquable LocalReg # |
Instance details Defined in CmmExpr Methods getUnique :: LocalReg -> Unique #
Uniquable EvBindsVar # |
Instance details Defined in TcEvidence Methods getUnique :: EvBindsVar -> Unique #
Uniquable name => Uniquable (AnnTarget name) # |
Instance details Defined in Annotations Methods getUnique :: AnnTarget name -> Unique #
Uniquable (CoAxiom br) # |
Instance details Defined in CoAxiom Methods getUnique :: CoAxiom br -> Unique #

data Unique #

Unique identifier.

The type of unique identifiers that are used in many places in GHC for fast ordering and equality tests. You should generate these with the functions from the `UniqSupply` module

These are sometimes also referred to as "keys" in comments in GHC.

Instances

Eq Unique # |
Instance details Defined in Unique Methods (==) :: Unique -> Unique -> Bool # (/=) :: Unique -> Unique -> Bool #
Show Unique # |
Instance details Defined in Unique Methods showsPrec :: Int -> Unique -> ShowS Source # show :: Unique -> String Source # showList :: [Unique] -> ShowS Source #
Outputable Unique # |
Instance details Defined in Unique Methods ppr :: Unique -> SDoc # pprPrec :: Rational -> Unique -> SDoc #
Uniquable Unique # |
Instance details Defined in Unique Methods getUnique :: Unique -> Unique #

module FastString