ghc-9.2.1: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Tc.Utils.Unify

Description

Type subsumption and unification

Synopsis

Documentation

tcSkolemise Source #

Arguments

:: UserTypeCtxt 
-> TcSigmaType 
-> (TcType -> TcM result) 
-> TcM (HsWrapper, result)

The wrapper has type: spec_ty ~> expected_ty See Note [Skolemisation] for the differences between tcSkolemiseScoped and tcSkolemise

tcSkolemiseScoped Source #

Arguments

:: UserTypeCtxt 
-> TcSigmaType 
-> (TcType -> TcM result) 
-> TcM (HsWrapper, result)

The wrapper has type: spec_ty ~> expected_ty See Note [Skolemisation] for the differences between tcSkolemiseScoped and tcSkolemise

tcSkolemiseET :: UserTypeCtxt -> ExpSigmaType -> (ExpRhoType -> TcM result) -> TcM (HsWrapper, result) Source #

Variant of tcSkolemise that takes an ExpType

checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result) Source #

checkTvConstraints :: SkolemInfo -> [TcTyVar] -> TcM result -> TcM result Source #

unifyType Source #

Arguments

:: Maybe SDoc

If present, the thing that has type ty1

-> TcTauType 
-> TcTauType 
-> TcM TcCoercionN 

tcInfer :: (ExpSigmaType -> TcM a) -> TcM (a, TcSigmaType) Source #

Infer a type using a fresh ExpType See also Note [ExpType] in GHC.Tc.Utils.TcMType

matchExpectedFunKind Source #

Arguments

:: Outputable fun 
=> fun

type, only for errors

-> Arity

n: number of desired arrows

-> TcKind

fun_ kind

-> TcM Coercion

co :: fun_kind ~ (arg1 -> ... -> argn -> res)

Breaks apart a function kind into its pieces.

matchActualFunTySigma :: SDoc -> Maybe SDoc -> (Arity, [Scaled TcSigmaType]) -> TcRhoType -> TcM (HsWrapper, Scaled TcSigmaType, TcSigmaType) Source #

matchActualFunTySigma does looks for just one function arrow returning an uninstantiated sigma-type