ghc-lib-9.10.1.20241103: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Tc.Zonk.TcType

Description

Zonking types within the typechecker.

Distinct from the final zonking pass in GHC.Tc.Zonk.Type; see Note [Module structure for zonking] in GHC.Tc.Zonk.Type.

Synopsis

Zonking (within the typechecker)

The ZonkM monad and ZonkGblEnv

Zonking types

Zonking TyCons

FreeVars

Zonking CoVars and Ids

zonkId :: TcId -> ZonkM TcId Source #

zonkId is used *during* typechecking just to zonk the Id's type

Zonking skolem info

Zonking constraints

Tidying

tcInitOpenTidyEnv :: [TyCoVar] -> ZonkM TidyEnv Source #

Get a TidyEnv that includes mappings for all vars free in the given type. Useful when tidying open types.

Zonk & tidy

Writing to metavariables

writeMetaTyVar Source #

Arguments

:: HasDebugCallStack 
=> TcTyVar

the type varfiable to write to

-> TcType

the type to write into the mutable reference

-> ZonkM () 

Write into a currently-empty MetaTyVar.

Works with both type and kind variables.

writeMetaTyVarRef Source #

Arguments

:: HasDebugCallStack 
=> TcTyVar

for debug assertions only;

-> TcRef MetaDetails

ref cell must be for the same tyvar

-> TcType

the type to write to the mutable reference

-> ZonkM () 

Write into the MetaDetails mutable references of a MetaTv.

Handling coercion holes

checkCoercionHole :: CoVar -> Coercion -> ZonkM Coercion Source #

Check that a coercion is appropriate for filling a hole. (The hole itself is needed only for printing.) Always returns the checked coercion, but this return value is necessary so that the input coercion is forced only when the output is forced.