Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Type subsumption and unification
Synopsis
- tcWrapResult :: HsExpr GhcRn -> HsExpr GhcTc -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTc)
- tcWrapResultO :: CtOrigin -> HsExpr GhcRn -> HsExpr GhcTc -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTc)
- tcWrapResultMono :: HsExpr GhcRn -> HsExpr GhcTc -> TcRhoType -> ExpRhoType -> TcM (HsExpr GhcTc)
- tcSkolemise :: UserTypeCtxt -> TcSigmaType -> (TcType -> TcM result) -> TcM (HsWrapper, result)
- tcSkolemiseScoped :: UserTypeCtxt -> TcSigmaType -> (TcType -> TcM result) -> TcM (HsWrapper, result)
- tcSkolemiseET :: UserTypeCtxt -> ExpSigmaType -> (ExpRhoType -> TcM result) -> TcM (HsWrapper, result)
- tcSubType :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeSigma :: UserTypeCtxt -> TcSigmaType -> TcSigmaType -> TcM HsWrapper
- tcSubTypePat :: CtOrigin -> UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper
- tcSubMult :: CtOrigin -> Mult -> Mult -> TcM HsWrapper
- checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result)
- checkTvConstraints :: SkolemInfo -> [TcTyVar] -> TcM result -> TcM result
- buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds)
- buildTvImplication :: SkolemInfo -> [TcTyVar] -> TcLevel -> WantedConstraints -> TcM Implication
- emitResidualTvConstraint :: SkolemInfo -> [TcTyVar] -> TcLevel -> WantedConstraints -> TcM ()
- unifyType :: Maybe (HsExpr GhcRn) -> TcTauType -> TcTauType -> TcM TcCoercionN
- unifyKind :: Maybe (HsType GhcRn) -> TcKind -> TcKind -> TcM CoercionN
- uType :: TypeOrKind -> CtOrigin -> TcType -> TcType -> TcM CoercionN
- promoteTcType :: TcLevel -> TcType -> TcM (TcCoercionN, TcType)
- swapOverTyVars :: Bool -> TcTyVar -> TcTyVar -> Bool
- canSolveByUnification :: TcLevel -> TcTyVar -> TcType -> Bool
- tcInfer :: (ExpSigmaType -> TcM a) -> TcM (a, TcSigmaType)
- matchExpectedListTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType)
- matchExpectedTyConApp :: TyCon -> TcRhoType -> TcM (TcCoercionN, [TcSigmaType])
- matchExpectedAppTy :: TcRhoType -> TcM (TcCoercion, (TcSigmaType, TcSigmaType))
- matchExpectedFunTys :: forall a. SDoc -> UserTypeCtxt -> Arity -> ExpRhoType -> ([Scaled ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (HsWrapper, a)
- matchActualFunTysRho :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> Arity -> TcSigmaType -> TcM (HsWrapper, [Scaled TcSigmaType], TcRhoType)
- matchActualFunTySigma :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> (Arity, [Scaled TcSigmaType]) -> TcSigmaType -> TcM (HsWrapper, Scaled TcSigmaType, TcSigmaType)
- matchExpectedFunKind :: Outputable fun => fun -> Arity -> TcKind -> TcM Coercion
- metaTyVarUpdateOK :: DynFlags -> TcTyVar -> TcType -> MetaTyVarUpdateResult TcType
- occCheckForErrors :: DynFlags -> TcTyVar -> Type -> MetaTyVarUpdateResult ()
- data MetaTyVarUpdateResult a
Documentation
tcWrapResult :: HsExpr GhcRn -> HsExpr GhcTc -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTc) Source #
tcWrapResultO :: CtOrigin -> HsExpr GhcRn -> HsExpr GhcTc -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTc) Source #
tcWrapResultMono :: HsExpr GhcRn -> HsExpr GhcTc -> TcRhoType -> ExpRhoType -> TcM (HsExpr GhcTc) Source #
:: UserTypeCtxt | |
-> TcSigmaType | |
-> (TcType -> TcM result) | |
-> TcM (HsWrapper, result) | The wrapper has type: spec_ty ~> expected_ty |
:: 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
tcSubType :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpRhoType -> TcM HsWrapper Source #
tcSubTypeSigma :: UserTypeCtxt -> TcSigmaType -> TcSigmaType -> TcM HsWrapper Source #
tcSubTypePat :: CtOrigin -> UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper Source #
checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result) Source #
checkTvConstraints :: SkolemInfo -> [TcTyVar] -> TcM result -> TcM result Source #
buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds) Source #
buildTvImplication :: SkolemInfo -> [TcTyVar] -> TcLevel -> WantedConstraints -> TcM Implication Source #
emitResidualTvConstraint :: SkolemInfo -> [TcTyVar] -> TcLevel -> WantedConstraints -> TcM () Source #
promoteTcType :: TcLevel -> TcType -> TcM (TcCoercionN, TcType) Source #
tcInfer :: (ExpSigmaType -> TcM a) -> TcM (a, TcSigmaType) Source #
Infer a type using a fresh ExpType See also Note [ExpType] in GHC.Tc.Utils.TcMType
matchExpectedListTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType) Source #
matchExpectedTyConApp :: TyCon -> TcRhoType -> TcM (TcCoercionN, [TcSigmaType]) Source #
matchExpectedAppTy :: TcRhoType -> TcM (TcCoercion, (TcSigmaType, TcSigmaType)) Source #
matchExpectedFunTys :: forall a. SDoc -> UserTypeCtxt -> Arity -> ExpRhoType -> ([Scaled ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (HsWrapper, a) Source #
matchActualFunTysRho :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> Arity -> TcSigmaType -> TcM (HsWrapper, [Scaled TcSigmaType], TcRhoType) Source #
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
:: 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.
metaTyVarUpdateOK :: DynFlags -> TcTyVar -> TcType -> MetaTyVarUpdateResult TcType Source #
occCheckForErrors :: DynFlags -> TcTyVar -> Type -> MetaTyVarUpdateResult () Source #
data MetaTyVarUpdateResult a Source #