TcHsSyn

ghc-8.10.6: 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 (GhcPass p) -> TcType
- hsPatType :: Pat GhcTc -> Type
- hsLPatType :: LPat GhcTc -> Type
- mkHsDictLet :: TcEvBinds -> LHsExpr GhcTc -> LHsExpr GhcTc
- mkHsApp :: LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id)
- mkHsAppTy :: LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p)
- mkHsCaseAlt :: LPat (GhcPass p) -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p)))
- 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] -> [LTcSpecPrag] -> [LForeignDecl GhcTcId] -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, [LForeignDecl GhcTc], [LTcSpecPrag], [LRuleDecl GhcTc])
- zonkTopExpr :: HsExpr GhcTcId -> TcM (HsExpr GhcTc)
- zonkTopLExpr :: LHsExpr GhcTcId -> TcM (LHsExpr GhcTc)
- zonkTopBndrs :: [TcId] -> TcM [Id]
- data ZonkEnv
- data ZonkFlexi
  - = DefaultFlexi
  - | SkolemiseFlexi
  - | RuntimeUnkFlexi
- emptyZonkEnv :: TcM ZonkEnv
- mkEmptyZonkEnv :: ZonkFlexi -> TcM ZonkEnv
- initZonkEnv :: (ZonkEnv -> TcM b) -> TcM b
- zonkTyVarBinders :: [VarBndr TcTyVar vis] -> TcM (ZonkEnv, [VarBndr TyVar vis])
- zonkTyVarBindersX :: ZonkEnv -> [VarBndr TcTyVar vis] -> TcM (ZonkEnv, [VarBndr TyVar vis])
- zonkTyVarBinderX :: ZonkEnv -> VarBndr TcTyVar vis -> TcM (ZonkEnv, VarBndr TyVar vis)
- zonkTyBndrs :: [TcTyVar] -> TcM (ZonkEnv, [TyVar])
- zonkTyBndrsX :: ZonkEnv -> [TcTyVar] -> TcM (ZonkEnv, [TyVar])
- zonkTcTypeToType :: TcType -> TcM Type
- zonkTcTypeToTypeX :: ZonkEnv -> TcType -> TcM Type
- zonkTcTypesToTypes :: [TcType] -> TcM [Type]
- zonkTcTypesToTypesX :: ZonkEnv -> [TcType] -> TcM [Type]
- zonkTyVarOcc :: ZonkEnv -> TyVar -> TcM TcType
- zonkCoToCo :: ZonkEnv -> Coercion -> TcM Coercion
- zonkEvBinds :: ZonkEnv -> Bag EvBind -> TcM (ZonkEnv, Bag EvBind)
- zonkTcEvBinds :: ZonkEnv -> TcEvBinds -> TcM (ZonkEnv, TcEvBinds)
- zonkTcMethInfoToMethInfoX :: ZonkEnv -> TcMethInfo -> TcM MethInfo
- lookupTyVarOcc :: ZonkEnv -> TcTyVar -> Maybe TyVar

# Extracting types from HsSyn

hsLitType :: HsLit (GhcPass p) -> TcType #

hsPatType :: Pat GhcTc -> Type #

hsLPatType :: LPat GhcTc -> Type #

# Other HsSyn functions

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

mkHsApp :: LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) #

mkHsAppTy :: LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) #

mkHsCaseAlt :: LPat (GhcPass p) -> Located (body (GhcPass p)) -> LMatch (GhcPass p) (Located (body (GhcPass p))) #

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] -> [LTcSpecPrag] -> [LForeignDecl GhcTcId] -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, [LForeignDecl GhcTc], [LTcSpecPrag], [LRuleDecl GhcTc]) #

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

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

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

data ZonkEnv #

See Note [The ZonkEnv] Confused by zonking? See Note [What is zonking?] in TcMType.

#### Instances

Instances details

Outputable ZonkEnv # |
Instance details Defined in TcHsSyn Methods ppr :: ZonkEnv -> SDoc # pprPrec :: Rational -> ZonkEnv -> SDoc #

data ZonkFlexi #

Constructors

DefaultFlexi |
SkolemiseFlexi |
RuntimeUnkFlexi |

emptyZonkEnv :: TcM ZonkEnv #

mkEmptyZonkEnv :: ZonkFlexi -> TcM ZonkEnv #

initZonkEnv :: (ZonkEnv -> TcM b) -> TcM b #

zonkTyVarBinders :: [VarBndr TcTyVar vis] -> TcM (ZonkEnv, [VarBndr TyVar vis]) #

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

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

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

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

zonkTcTypeToType :: TcType -> TcM Type #

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

zonkTcTypesToTypes :: [TcType] -> TcM [Type] #

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

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

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

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

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

zonkTcMethInfoToMethInfoX :: ZonkEnv -> TcMethInfo -> TcM MethInfo #

lookupTyVarOcc :: ZonkEnv -> TcTyVar -> Maybe TyVar #