ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Tc.Utils.Zonk

Contents

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

Description

Specialisations of the `HsSyn` syntax for the typechecker

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

Synopsis

- 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 :: (Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcAnn NoEpAnns, 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))
- shortCutLit :: Platform -> OverLitVal -> TcType -> Maybe (HsExpr GhcTc)
- hsOverLitName :: OverLitVal -> Name
- conLikeResTy :: ConLike -> [Type] -> Type
- type TcId = Id
- type TcIdSet = IdSet
- zonkTopDecls :: Bag EvBind -> LHsBinds GhcTc -> [LRuleDecl GhcTc] -> [LTcSpecPrag] -> [LForeignDecl GhcTc] -> TcM (TypeEnv, Bag EvBind, LHsBinds GhcTc, [LForeignDecl GhcTc], [LTcSpecPrag], [LRuleDecl GhcTc])
- zonkTopExpr :: HsExpr GhcTc -> TcM (HsExpr GhcTc)
- zonkTopLExpr :: LHsExpr GhcTc -> TcM (LHsExpr GhcTc)
- zonkTopBndrs :: [TcId] -> TcM [Id]
- data ZonkEnv
- data ZonkFlexi
  - = DefaultFlexi
  - | SkolemiseFlexi
  - | RuntimeUnkFlexi
  - | NoFlexi
- emptyZonkEnv :: TcM ZonkEnv
- mkEmptyZonkEnv :: ZonkFlexi -> TcM ZonkEnv
- initZonkEnv :: (ZonkEnv -> TcM b) -> TcM b
- 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
- zonkTcTypesToTypesX :: ZonkEnv -> [TcType] -> TcM [Type]
- zonkScaledTcTypesToTypesX :: ZonkEnv -> [Scaled TcType] -> TcM [Scaled Type]
- zonkTyVarOcc :: HasDebugCallStack => ZonkEnv -> TcTyVar -> TcM Type
- zonkCoToCo :: ZonkEnv -> Coercion -> TcM Coercion
- zonkEvBinds :: ZonkEnv -> Bag EvBind -> TcM (ZonkEnv, Bag EvBind)
- zonkTcEvBinds :: ZonkEnv -> TcEvBinds -> TcM (ZonkEnv, TcEvBinds)
- zonkTcMethInfoToMethInfoX :: ZonkEnv -> TcMethInfo -> TcM MethInfo
- lookupTyVarX :: ZonkEnv -> TcTyVar -> TyVar

# Other HsSyn functions

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

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

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

mkHsCaseAlt :: (Anno (GRHS (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcAnn NoEpAnns, Anno (Match (GhcPass p) (LocatedA (body (GhcPass p)))) ~ SrcSpanAnnA) => LPat (GhcPass p) -> LocatedA (body (GhcPass p)) -> LMatch (GhcPass p) (LocatedA (body (GhcPass p))) Source #

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

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

Returns the type of the whole pattern

# re-exported from TcMonad

type TcId = Id Source #

type TcIdSet = IdSet Source #

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

data ZonkFlexi Source #

Constructors

DefaultFlexi |
SkolemiseFlexi |
RuntimeUnkFlexi |
NoFlexi |

emptyZonkEnv :: TcM ZonkEnv Source #

mkEmptyZonkEnv :: ZonkFlexi -> TcM ZonkEnv Source #

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 #

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

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

zonkTcTypeToType :: TcType -> TcM Type Source #

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

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

zonkScaledTcTypesToTypesX :: ZonkEnv -> [Scaled TcType] -> TcM [Scaled Type] Source #

zonkTyVarOcc :: HasDebugCallStack => ZonkEnv -> TcTyVar -> TcM Type Source #

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

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

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

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

lookupTyVarX :: ZonkEnv -> TcTyVar -> TyVar Source #