TcHsSyn

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

TcHsSyn

Contents

- Extracting types from HsSyn
- Other HsSyn functions
- re-exported from TcMonad
- Zonking

Synopsis

- hsLitType :: HsLit p -> TcType
- hsLPatType :: OutPat GhcTc -> Type
- hsPatType :: Pat GhcTc -> Type
- mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
- mkHsApp :: LHsExpr name -> LHsExpr name -> LHsExpr name
- mkHsAppTy :: LHsType pass -> LHsType pass -> LHsType pass
- mkHsCaseAlt :: LPat id -> Located (body id) -> LMatch id (Located (body id))
- shortCutLit :: DynFlags -> OverLitVal -> TcType -> Maybe (HsExpr GhcTcId)
- hsOverLitName :: OverLitVal -> Name
- conLikeResTy :: ConLike -> [Type] -> Type
- type TcId = Id
- type TcIdSet = IdSet
- zonkTopDecls :: Bag EvBind -> LHsBinds GhcTcId -> [LRuleDecl GhcTcId] -> [LVectDecl GhcTcId] -> [LTcSpecPrag] -> [LForeignDecl GhcTcId] -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, [LForeignDecl GhcTc], [LTcSpecPrag], [LRuleDecl GhcTc], [LVectDecl GhcTc])
- zonkTopExpr :: HsExpr GhcTcId -> TcM (HsExpr GhcTc)
- zonkTopLExpr :: LHsExpr GhcTcId -> TcM (LHsExpr GhcTc)
- zonkTopBndrs :: [TcId] -> TcM [Id]
- zonkTyBndrsX :: ZonkEnv -> [TcTyVar] -> TcM (ZonkEnv, [TyVar])
- zonkTyVarBindersX :: ZonkEnv -> [TyVarBndr TcTyVar vis] -> TcM (ZonkEnv, [TyVarBndr TyVar vis])
- zonkTyVarBinderX :: ZonkEnv -> TyVarBndr TcTyVar vis -> TcM (ZonkEnv, TyVarBndr TyVar vis)
- emptyZonkEnv :: ZonkEnv
- mkEmptyZonkEnv :: UnboundTyVarZonker -> ZonkEnv
- zonkTcTypeToType :: ZonkEnv -> TcType -> TcM Type
- zonkTcTypeToTypes :: ZonkEnv -> [TcType] -> TcM [Type]
- zonkTyVarOcc :: ZonkEnv -> TyVar -> TcM TcType
- zonkCoToCo :: ZonkEnv -> Coercion -> TcM Coercion
- zonkSigType :: TcType -> TcM Type
- zonkEvBinds :: ZonkEnv -> Bag EvBind -> TcM (ZonkEnv, Bag EvBind)
- zonkTcEvBinds :: ZonkEnv -> TcEvBinds -> TcM (ZonkEnv, TcEvBinds)

# Extracting types from HsSyn

hsLitType :: HsLit p -> TcType #

hsLPatType :: OutPat GhcTc -> Type #

hsPatType :: Pat GhcTc -> Type #

# Other HsSyn functions

mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc #

mkHsApp :: LHsExpr name -> LHsExpr name -> LHsExpr name #

mkHsAppTy :: LHsType pass -> LHsType pass -> LHsType pass #

mkHsCaseAlt :: LPat id -> Located (body id) -> LMatch id (Located (body id)) #

A simple case alternative with a single pattern, no binds, no guards; pre-typechecking

shortCutLit :: DynFlags -> OverLitVal -> TcType -> Maybe (HsExpr GhcTcId) #

hsOverLitName :: OverLitVal -> Name #

conLikeResTy :: ConLike -> [Type] -> Type #

Returns the type of the whole pattern

# re-exported from TcMonad

type TcId = Id #

type TcIdSet = IdSet #

# Zonking

For a description of "zonking", see Note [What is zonking?] in TcMType

zonkTopDecls :: Bag EvBind -> LHsBinds GhcTcId -> [LRuleDecl GhcTcId] -> [LVectDecl GhcTcId] -> [LTcSpecPrag] -> [LForeignDecl GhcTcId] -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, [LForeignDecl GhcTc], [LTcSpecPrag], [LRuleDecl GhcTc], [LVectDecl GhcTc]) #

zonkTopExpr :: HsExpr GhcTcId -> TcM (HsExpr GhcTc) #

zonkTopLExpr :: LHsExpr GhcTcId -> TcM (LHsExpr GhcTc) #

zonkTopBndrs :: [TcId] -> TcM [Id] #

zonkTyBndrsX :: ZonkEnv -> [TcTyVar] -> TcM (ZonkEnv, [TyVar]) #

zonkTyVarBindersX :: ZonkEnv -> [TyVarBndr TcTyVar vis] -> TcM (ZonkEnv, [TyVarBndr TyVar vis]) #

zonkTyVarBinderX :: ZonkEnv -> TyVarBndr TcTyVar vis -> TcM (ZonkEnv, TyVarBndr TyVar vis) #

emptyZonkEnv :: ZonkEnv #

mkEmptyZonkEnv :: UnboundTyVarZonker -> ZonkEnv #

zonkTcTypeToType :: ZonkEnv -> TcType -> TcM Type #

zonkTcTypeToTypes :: ZonkEnv -> [TcType] -> TcM [Type] #

zonkTyVarOcc :: ZonkEnv -> TyVar -> TcM TcType #

zonkCoToCo :: ZonkEnv -> Coercion -> TcM Coercion #

zonkSigType :: TcType -> TcM Type #

zonkEvBinds :: ZonkEnv -> Bag EvBind -> TcM (ZonkEnv, Bag EvBind) #

zonkTcEvBinds :: ZonkEnv -> TcEvBinds -> TcM (ZonkEnv, TcEvBinds) #