ghc-lib-0.20210331: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Utils.Zonk

Description

Specialisations of the HsSyn syntax for the typechecker

This module is an extension of HsSyn syntax, for use in the type checker.

Synopsis

Extracting types from HsSyn

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

hsPatType :: Pat GhcTc -> Type Source #

hsLPatType :: LPat GhcTc -> Type Source #

Other HsSyn functions

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

mkHsApp :: forall (id :: Pass). LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) -> LHsExpr (GhcPass id) #

mkHsAppTy :: forall (p :: Pass). LHsType (GhcPass p) -> LHsType (GhcPass p) -> LHsType (GhcPass p) #

mkHsCaseAlt :: forall (p :: Pass) body. (Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpan, Anno (Match (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpanAnnA) => LPat (GhcPass p) -> LocatedA (body (GhcPass p)) -> LMatch (GhcPass p) (LocatedA (body (GhcPass p))) #

tcShortCutLit :: HsOverLit GhcRn -> ExpRhoType -> TcM (Maybe (HsOverLit GhcTc)) Source #

shortCutLit :: Platform -> OverLitVal -> TcType -> Maybe (HsExpr GhcTc) Source #

hsOverLitName :: OverLitVal -> Name Source #

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

re-exported from TcMonad

type TcId = Id #

type TcIdSet = IdSet #

Zonking

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

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

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

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

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

data ZonkEnv Source #

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

Instances

Instances details
Outputable ZonkEnv Source # 
Instance details

Defined in GHC.Tc.Utils.Zonk

Methods

ppr :: ZonkEnv -> SDoc

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

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

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

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

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