ghc-8.8.1: The GHC API
Safe HaskellNone
LanguageHaskell2010

TcUnify

Synopsis

Documentation

tcWrapResultO :: CtOrigin -> HsExpr GhcRn -> HsExpr GhcTcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTcId) Source #

Sometimes we don't have a HsExpr Name to hand, and this is more convenient.

tcSkolemise Source #

Arguments

:: UserTypeCtxt 
-> TcSigmaType 
-> ([TcTyVar] -> TcType -> TcM result)

These are only ever used for scoped type variables.

-> TcM (HsWrapper, result)

The expression has type: spec_ty -> expected_ty

Take an "expected type" and strip off quantifiers to expose the type underneath, binding the new skolems for the thing_inside. The returned HsWrapper has type specific_ty -> expected_ty.

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

Variant of tcSkolemise that takes an ExpType

tcSubTypeHR Source #

Arguments

:: CtOrigin

of the actual type

-> Maybe (HsExpr GhcRn)

If present, it has type ty_actual

-> TcSigmaType 
-> ExpRhoType 
-> TcM HsWrapper 

Call this variant when you are in a higher-rank situation and you know the right-hand type is deeply skolemised.

tcSubTypeO Source #

Arguments

:: CtOrigin

of the actual type

-> UserTypeCtxt

of the expected type

-> TcSigmaType 
-> ExpRhoType 
-> TcM HsWrapper 

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

checkTvConstraints :: SkolemInfo -> Maybe SDoc -> TcM ([TcTyVar], result) -> TcM ([TcTyVar], result) Source #

unifyType Source #

Arguments

:: Maybe (HsExpr GhcRn)

If present, has type ty1

-> TcTauType 
-> TcTauType 
-> TcM TcCoercionN 

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

Infer a type using a fresh ExpType See also Note [ExpType] in TcMType Does not attempt to instantiate the inferred type

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

Variant of matchActualFunTys that works when supplied only part (that is, to the right of some arrows) of the full function type

matchExpectedFunKind Source #

Arguments

:: Outputable fun 
=> fun

type, only for errors

-> TcKind

function kind

-> TcM (Coercion, TcKind, TcKind)

co :: old_kind ~ arg -> res

Breaks apart a function kind into its pieces.

data OccCheckResult a Source #

Constructors

OC_OK a 
OC_Bad 
OC_Occurs 

Instances

Instances details
Monad OccCheckResult Source # 
Instance details

Defined in TcUnify

Functor OccCheckResult Source # 
Instance details

Defined in TcUnify

Methods

fmap :: (a -> b) -> OccCheckResult a -> OccCheckResult b #

(<$) :: a -> OccCheckResult b -> OccCheckResult a #

Applicative OccCheckResult Source # 
Instance details

Defined in TcUnify