ghc-9.0.0.20201227: The GHC API
Safe HaskellNone
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

tcSkolemiseScoped Source #

Arguments

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

The wrapper has type: spec_ty ~> expected_ty

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 (HsExpr GhcRn)

If present, 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

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

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

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.