ghc-7.6.3: The GHC API

Safe Haskell | None

TcEnv

Synopsis

- data TyThing
  - = AnId Id
  - | ADataCon DataCon
  - | ATyCon TyCon
  - | ACoAxiom CoAxiom
- data TcTyThing
  - = AGlobal TyThing
  - | ATcId {
    - tct_id :: TcId
    - tct_closed :: TopLevelFlag
    - tct_level :: ThLevel
    }
  - | ATyVar Name TcTyVar
  - | AThing TcKind
  - | APromotionErr PromotionErr
- type TcId = Id
- data InstInfo a = InstInfo {
  - iSpec :: ClsInst
  - iBinds :: InstBindings a
  }
- iDFunId :: InstInfo a -> DFunId
- pprInstInfoDetails :: OutputableBndr a => InstInfo a -> SDoc
- simpleInstInfoClsTy :: InstInfo a -> (Class, Type)
- simpleInstInfoTy :: InstInfo a -> Type
- simpleInstInfoTyCon :: InstInfo a -> TyCon
- data InstBindings a
  - = VanillaInst (LHsBinds a) [LSig a] Bool
  - | NewTypeDerived TcCoercion TyCon
- tcExtendGlobalEnv :: [TyThing] -> TcM r -> TcM r
- tcExtendGlobalEnvImplicit :: [TyThing] -> TcM r -> TcM r
- setGlobalTypeEnv :: TcGblEnv -> TypeEnv -> TcM TcGblEnv
- tcExtendGlobalValEnv :: [Id] -> TcM a -> TcM a
- tcLookupLocatedGlobal :: Located Name -> TcM TyThing
- tcLookupGlobal :: Name -> TcM TyThing
- tcLookupField :: Name -> TcM Id
- tcLookupTyCon :: Name -> TcM TyCon
- tcLookupClass :: Name -> TcM Class
- tcLookupDataCon :: Name -> TcM DataCon
- tcLookupLocatedGlobalId :: Located Name -> TcM Id
- tcLookupLocatedTyCon :: Located Name -> TcM TyCon
- tcLookupLocatedClass :: Located Name -> TcM Class
- tcLookupInstance :: Class -> [Type] -> TcM ClsInst
- tcLookupAxiom :: Name -> TcM CoAxiom
- tcExtendKindEnv :: [(Name, TcKind)] -> TcM r -> TcM r
- tcExtendTcTyThingEnv :: [(Name, TcTyThing)] -> TcM r -> TcM r
- tcExtendTyVarEnv :: [TyVar] -> TcM r -> TcM r
- tcExtendTyVarEnv2 :: [(Name, TcTyVar)] -> TcM r -> TcM r
- tcExtendGhciEnv :: [TcId] -> TcM a -> TcM a
- tcExtendLetEnv :: TopLevelFlag -> [TcId] -> TcM a -> TcM a
- tcExtendIdEnv :: [TcId] -> TcM a -> TcM a
- tcExtendIdEnv1 :: Name -> TcId -> TcM a -> TcM a
- tcExtendIdEnv2 :: [(Name, TcId)] -> TcM a -> TcM a
- tcLookup :: Name -> TcM TcTyThing
- tcLookupLocated :: Located Name -> TcM TcTyThing
- tcLookupLocalIds :: [Name] -> TcM [TcId]
- tcLookupId :: Name -> TcM Id
- tcLookupTyVar :: Name -> TcM TcTyVar
- tcLookupLcl_maybe :: Name -> TcM (Maybe TcTyThing)
- getScopedTyVarBinds :: TcM [(Name, TcTyVar)]
- getInLocalScope :: TcM (Name -> Bool)
- wrongThingErr :: String -> TcTyThing -> Name -> TcM a
- pprBinders :: [Name] -> SDoc
- tcExtendRecEnv :: [(Name, TyThing)] -> TcM r -> TcM r
- tcExtendRules :: [LRuleDecl Id] -> TcM a -> TcM a
- tcGetDefaultTys :: TcM ([Type], (Bool, Bool))
- tcGetGlobalTyVars :: TcM TcTyVarSet
- zapLclTypeEnv :: TcM a -> TcM a
- checkWellStaged :: SDoc -> ThLevel -> ThLevel -> TcM ()
- tcMetaTy :: Name -> TcM Type
- thLevel :: ThStage -> ThLevel
- topIdLvl :: Id -> ThLevel
- thTopLevelId :: Id -> Bool
- thRnBrack :: ThStage
- isBrackStage :: ThStage -> Bool
- newLocalName :: Name -> TcRnIf gbl lcl Name
- newDFunName :: Class -> [Type] -> SrcSpan -> TcM Name
- newFamInstTyConName :: Located Name -> [Type] -> TcM Name
- newFamInstAxiomName :: Located Name -> [Type] -> TcM Name
- mkStableIdFromString :: String -> Type -> SrcSpan -> (OccName -> OccName) -> TcM TcId
- mkStableIdFromName :: Name -> Type -> SrcSpan -> (OccName -> OccName) -> TcM TcId

# Documentation

data TyThing

A typecheckable-thing, essentially anything that has a name

Constructors

AnId Id |
ADataCon DataCon |
ATyCon TyCon |
ACoAxiom CoAxiom |

Instances

Eq TyThing |
Ord TyThing |
Outputable TyThing |
NamedThing TyThing |

data TcTyThing

Constructors

AGlobal TyThing |
ATcId |

Fields

tct_id :: TcId
tct_closed :: TopLevelFlag
tct_level :: ThLevel

ATyVar Name TcTyVar |
AThing TcKind |
APromotionErr PromotionErr |

Instances

Outputable TcTyThing |

type TcId = Id

data InstInfo a

Constructors

InstInfo |

Fields

iSpec :: ClsInst
iBinds :: InstBindings a

iDFunId :: InstInfo a -> DFunId

pprInstInfoDetails :: OutputableBndr a => InstInfo a -> SDoc

simpleInstInfoClsTy :: InstInfo a -> (Class, Type)

simpleInstInfoTy :: InstInfo a -> Type

simpleInstInfoTyCon :: InstInfo a -> TyCon

data InstBindings a

Constructors

VanillaInst (LHsBinds a) [LSig a] Bool |
NewTypeDerived TcCoercion TyCon |

tcExtendGlobalEnv :: [TyThing] -> TcM r -> TcM r

tcExtendGlobalEnvImplicit :: [TyThing] -> TcM r -> TcM r

setGlobalTypeEnv :: TcGblEnv -> TypeEnv -> TcM TcGblEnv

tcExtendGlobalValEnv :: [Id] -> TcM a -> TcM a

tcLookupLocatedGlobal :: Located Name -> TcM TyThing

tcLookupGlobal :: Name -> TcM TyThing

tcLookupField :: Name -> TcM Id

tcLookupTyCon :: Name -> TcM TyCon

tcLookupClass :: Name -> TcM Class

tcLookupDataCon :: Name -> TcM DataCon

tcLookupLocatedGlobalId :: Located Name -> TcM Id

tcLookupLocatedTyCon :: Located Name -> TcM TyCon

tcLookupLocatedClass :: Located Name -> TcM Class

tcLookupInstance :: Class -> [Type] -> TcM ClsInst

tcLookupAxiom :: Name -> TcM CoAxiom

tcExtendKindEnv :: [(Name, TcKind)] -> TcM r -> TcM r

tcExtendTcTyThingEnv :: [(Name, TcTyThing)] -> TcM r -> TcM r

tcExtendTyVarEnv :: [TyVar] -> TcM r -> TcM r

tcExtendTyVarEnv2 :: [(Name, TcTyVar)] -> TcM r -> TcM r

tcExtendGhciEnv :: [TcId] -> TcM a -> TcM a

tcExtendLetEnv :: TopLevelFlag -> [TcId] -> TcM a -> TcM a

tcExtendIdEnv :: [TcId] -> TcM a -> TcM a

tcExtendIdEnv1 :: Name -> TcId -> TcM a -> TcM a

tcExtendIdEnv2 :: [(Name, TcId)] -> TcM a -> TcM a

tcLookup :: Name -> TcM TcTyThing

tcLookupLocated :: Located Name -> TcM TcTyThing

tcLookupLocalIds :: [Name] -> TcM [TcId]

tcLookupId :: Name -> TcM Id

tcLookupTyVar :: Name -> TcM TcTyVar

tcLookupLcl_maybe :: Name -> TcM (Maybe TcTyThing)

getScopedTyVarBinds :: TcM [(Name, TcTyVar)]

getInLocalScope :: TcM (Name -> Bool)

wrongThingErr :: String -> TcTyThing -> Name -> TcM a

pprBinders :: [Name] -> SDoc

tcExtendRecEnv :: [(Name, TyThing)] -> TcM r -> TcM r

tcExtendRules :: [LRuleDecl Id] -> TcM a -> TcM a

tcGetDefaultTys :: TcM ([Type], (Bool, Bool))

tcGetGlobalTyVars :: TcM TcTyVarSet

zapLclTypeEnv :: TcM a -> TcM a

checkWellStaged :: SDoc -> ThLevel -> ThLevel -> TcM ()

tcMetaTy :: Name -> TcM Type

thLevel :: ThStage -> ThLevel

topIdLvl :: Id -> ThLevel

thTopLevelId :: Id -> Bool

thRnBrack :: ThStage

isBrackStage :: ThStage -> Bool

newLocalName :: Name -> TcRnIf gbl lcl Name

newDFunName :: Class -> [Type] -> SrcSpan -> TcM Name

newFamInstTyConName :: Located Name -> [Type] -> TcM Name

newFamInstAxiomName :: Located Name -> [Type] -> TcM Name

mkStableIdFromString :: String -> Type -> SrcSpan -> (OccName -> OccName) -> TcM TcId

mkStableIdFromName :: Name -> Type -> SrcSpan -> (OccName -> OccName) -> TcM TcId