Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tcWrapResult :: HsExpr GhcRn -> HsExpr GhcTcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTcId)
- tcWrapResultO :: CtOrigin -> HsExpr GhcRn -> HsExpr GhcTcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTcId)
- tcSkolemise :: UserTypeCtxt -> TcSigmaType -> ([TcTyVar] -> TcType -> TcM result) -> TcM (HsWrapper, result)
- tcSkolemiseET :: UserTypeCtxt -> ExpSigmaType -> (ExpRhoType -> TcM result) -> TcM (HsWrapper, result)
- tcSubTypeHR :: CtOrigin -> Maybe (HsExpr GhcRn) -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeO :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubType_NC :: UserTypeCtxt -> TcSigmaType -> TcSigmaType -> TcM HsWrapper
- tcSubTypeDS :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeDS_NC_O :: CtOrigin -> UserTypeCtxt -> Maybe (HsExpr GhcRn) -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeET :: CtOrigin -> UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper
- checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result)
- checkTvConstraints :: SkolemInfo -> Maybe SDoc -> TcM ([TcTyVar], result) -> TcM ([TcTyVar], result)
- buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds)
- emitResidualTvConstraint :: SkolemInfo -> Maybe SDoc -> [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 (TcCoercion, TcType)
- swapOverTyVars :: TcTyVar -> TcTyVar -> Bool
- canSolveByUnification :: TcLevel -> TcTyVar -> TcType -> Bool
- tcInferInst :: (ExpRhoType -> TcM a) -> TcM (a, TcRhoType)
- tcInferNoInst :: (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 -> Arity -> ExpRhoType -> ([ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (a, HsWrapper)
- matchActualFunTys :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> Arity -> TcSigmaType -> TcM (HsWrapper, [TcSigmaType], TcSigmaType)
- matchActualFunTysPart :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> Arity -> TcSigmaType -> [TcSigmaType] -> Arity -> TcM (HsWrapper, [TcSigmaType], TcSigmaType)
- matchExpectedFunKind :: Outputable fun => fun -> Arity -> TcKind -> TcM Coercion
- metaTyVarUpdateOK :: DynFlags -> TcTyVar -> TcType -> Maybe TcType
- occCheckForErrors :: DynFlags -> TcTyVar -> Type -> MetaTyVarUpdateResult ()
- data MetaTyVarUpdateResult a
- = MTVU_OK a
- | MTVU_Bad
- | MTVU_Occurs
Documentation
tcWrapResult :: HsExpr GhcRn -> HsExpr GhcTcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr GhcTcId) Source #
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.
:: 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
:: 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.
:: CtOrigin | of the actual type |
-> UserTypeCtxt | of the expected type |
-> TcSigmaType | |
-> ExpRhoType | |
-> TcM HsWrapper |
tcSubType_NC :: UserTypeCtxt -> TcSigmaType -> TcSigmaType -> TcM HsWrapper Source #
tcSubTypeDS :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpRhoType -> TcM HsWrapper Source #
tcSubTypeDS_NC_O :: CtOrigin -> UserTypeCtxt -> Maybe (HsExpr GhcRn) -> TcSigmaType -> ExpRhoType -> TcM HsWrapper Source #
tcSubTypeET :: CtOrigin -> UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper Source #
checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result) Source #
checkTvConstraints :: SkolemInfo -> Maybe SDoc -> TcM ([TcTyVar], result) -> TcM ([TcTyVar], result) Source #
buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds) Source #
emitResidualTvConstraint :: SkolemInfo -> Maybe SDoc -> [TcTyVar] -> TcLevel -> WantedConstraints -> TcM () Source #
promoteTcType :: TcLevel -> TcType -> TcM (TcCoercion, TcType) Source #
tcInferInst :: (ExpRhoType -> TcM a) -> TcM (a, TcRhoType) Source #
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
matchExpectedListTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType) Source #
matchExpectedTyConApp :: TyCon -> TcRhoType -> TcM (TcCoercionN, [TcSigmaType]) Source #
matchExpectedAppTy :: TcRhoType -> TcM (TcCoercion, (TcSigmaType, TcSigmaType)) Source #
matchExpectedFunTys :: forall a. SDoc -> Arity -> ExpRhoType -> ([ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (a, HsWrapper) Source #
matchActualFunTys :: SDoc -> CtOrigin -> Maybe (HsExpr GhcRn) -> Arity -> TcSigmaType -> TcM (HsWrapper, [TcSigmaType], TcSigmaType) Source #
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
:: 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.
occCheckForErrors :: DynFlags -> TcTyVar -> Type -> MetaTyVarUpdateResult () Source #
data MetaTyVarUpdateResult a Source #
Instances
Monad MetaTyVarUpdateResult Source # | |
Defined in TcUnify (>>=) :: MetaTyVarUpdateResult a -> (a -> MetaTyVarUpdateResult b) -> MetaTyVarUpdateResult b # (>>) :: MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b -> MetaTyVarUpdateResult b # return :: a -> MetaTyVarUpdateResult a # fail :: String -> MetaTyVarUpdateResult a # | |
Functor MetaTyVarUpdateResult Source # | |
Defined in TcUnify fmap :: (a -> b) -> MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b # (<$) :: a -> MetaTyVarUpdateResult b -> MetaTyVarUpdateResult a # | |
Applicative MetaTyVarUpdateResult Source # | |
Defined in TcUnify pure :: a -> MetaTyVarUpdateResult a # (<*>) :: MetaTyVarUpdateResult (a -> b) -> MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b # liftA2 :: (a -> b -> c) -> MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b -> MetaTyVarUpdateResult c # (*>) :: MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b -> MetaTyVarUpdateResult b # (<*) :: MetaTyVarUpdateResult a -> MetaTyVarUpdateResult b -> MetaTyVarUpdateResult a # |