Safe Haskell | None |
---|---|
Language | Haskell2010 |
- tcWrapResult :: HsExpr Name -> HsExpr TcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr TcId)
- tcWrapResultO :: CtOrigin -> HsExpr TcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr TcId)
- tcSkolemise :: UserTypeCtxt -> TcSigmaType -> ([TcTyVar] -> TcType -> TcM result) -> TcM (HsWrapper, result)
- tcSkolemiseET :: UserTypeCtxt -> ExpSigmaType -> (ExpRhoType -> TcM result) -> TcM (HsWrapper, result)
- tcSubTypeHR :: Outputable a => CtOrigin -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubType :: Outputable a => UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpSigmaType -> TcM HsWrapper
- tcSubTypeO :: CtOrigin -> UserTypeCtxt -> TcSigmaType -> ExpSigmaType -> TcM HsWrapper
- tcSubType_NC :: UserTypeCtxt -> TcSigmaType -> ExpSigmaType -> TcM HsWrapper
- tcSubTypeDS :: Outputable a => UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeDS_O :: Outputable a => CtOrigin -> UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeDS_NC :: Outputable a => UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeDS_NC_O :: Outputable a => CtOrigin -> UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper
- tcSubTypeET :: CtOrigin -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper
- tcSubTypeET_NC :: UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper
- checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result)
- buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds)
- unifyType_ :: Outputable a => Maybe a -> TcTauType -> TcTauType -> TcM ()
- unifyType :: Outputable a => Maybe a -> TcTauType -> TcTauType -> TcM TcCoercionN
- unifyTheta :: TcThetaType -> TcThetaType -> TcM [TcCoercionN]
- unifyKind :: Outputable a => Maybe a -> TcKind -> TcKind -> TcM CoercionN
- noThing :: Maybe (HsExpr Name)
- uType :: CtOrigin -> TypeOrKind -> TcType -> TcType -> TcM Coercion
- unifyExpType :: Outputable a => Maybe a -> TcTauType -> ExpType -> TcM TcCoercionN
- swapOverTyVars :: TcTyVar -> TcTyVar -> Bool
- canSolveByUnification :: TcLevel -> TcTyVar -> TcType -> Bool
- tcInfer :: (ExpRhoType -> TcM a) -> TcM (a, TcType)
- matchExpectedListTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType)
- matchExpectedPArrTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType)
- matchExpectedTyConApp :: TyCon -> TcRhoType -> TcM (TcCoercionN, [TcSigmaType])
- matchExpectedAppTy :: TcRhoType -> TcM (TcCoercion, (TcSigmaType, TcSigmaType))
- matchExpectedFunTys :: SDoc -> Arity -> ExpRhoType -> ([ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (a, HsWrapper)
- matchActualFunTys :: Outputable a => SDoc -> CtOrigin -> Maybe a -> Arity -> TcSigmaType -> TcM (HsWrapper, [TcSigmaType], TcSigmaType)
- matchActualFunTysPart :: Outputable a => SDoc -> CtOrigin -> Maybe a -> Arity -> TcSigmaType -> [TcSigmaType] -> Arity -> TcM (HsWrapper, [TcSigmaType], TcSigmaType)
- matchExpectedFunKind :: Arity -> TcType -> TcKind -> TcM (Coercion, TcKind, TcKind)
- wrapFunResCoercion :: [TcType] -> HsWrapper -> TcM HsWrapper
Documentation
tcWrapResult :: HsExpr Name -> HsExpr TcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr TcId) Source #
tcWrapResultO :: CtOrigin -> HsExpr TcId -> TcSigmaType -> ExpRhoType -> TcM (HsExpr TcId) 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
:: Outputable a | |
=> CtOrigin | of the actual type |
-> Maybe a | 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.
:: Outputable a | |
=> UserTypeCtxt | |
-> Maybe a | If present, it has type ty_actual |
-> TcSigmaType | |
-> ExpSigmaType | |
-> TcM HsWrapper |
:: CtOrigin | of the actual type |
-> UserTypeCtxt | of the expected type |
-> TcSigmaType | |
-> ExpSigmaType | |
-> TcM HsWrapper |
tcSubType_NC :: UserTypeCtxt -> TcSigmaType -> ExpSigmaType -> TcM HsWrapper Source #
:: Outputable a | |
=> UserTypeCtxt | |
-> Maybe a | has type ty_actual |
-> TcSigmaType | |
-> ExpRhoType | |
-> TcM HsWrapper |
tcSubTypeDS_O :: Outputable a => CtOrigin -> UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper Source #
Like tcSubTypeDS
, but takes a CtOrigin
to use when instantiating
the "actual" type
:: Outputable a | |
=> UserTypeCtxt | |
-> Maybe a | If present, this has type ty_actual |
-> TcSigmaType | |
-> ExpRhoType | |
-> TcM HsWrapper |
tcSubTypeDS_NC_O :: Outputable a => CtOrigin -> UserTypeCtxt -> Maybe a -> TcSigmaType -> ExpRhoType -> TcM HsWrapper Source #
tcSubTypeET :: CtOrigin -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper Source #
tcSubTypeET_NC :: UserTypeCtxt -> ExpSigmaType -> TcSigmaType -> TcM HsWrapper Source #
checkConstraints :: SkolemInfo -> [TcTyVar] -> [EvVar] -> TcM result -> TcM (TcEvBinds, result) Source #
buildImplicationFor :: TcLevel -> SkolemInfo -> [TcTyVar] -> [EvVar] -> WantedConstraints -> TcM (Bag Implication, TcEvBinds) Source #
:: Outputable a | |
=> Maybe a | If present, has type |
-> TcTauType | |
-> TcTauType | |
-> TcM () |
Unify two types, discarding a resultant coercion. Any constraints generated will still need to be solved, however.
:: Outputable a | |
=> Maybe a | If present, has type |
-> TcTauType | |
-> TcTauType | |
-> TcM TcCoercionN |
unifyTheta :: TcThetaType -> TcThetaType -> TcM [TcCoercionN] Source #
noThing :: Maybe (HsExpr Name) Source #
Use this instead of Nothing
when calling unifyType
without
a good "thing" (where the "thing" has the "actual" type passed in)
This has an Outputable
instance, avoiding amgiguity problems.
unifyExpType :: Outputable a => Maybe a -> TcTauType -> ExpType -> TcM TcCoercionN Source #
tcInfer :: (ExpRhoType -> TcM a) -> TcM (a, TcType) Source #
Infer a type using a fresh ExpType See also Note [ExpType] in TcMType
matchExpectedListTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType) Source #
matchExpectedPArrTy :: TcRhoType -> TcM (TcCoercionN, TcRhoType) Source #
matchExpectedTyConApp :: TyCon -> TcRhoType -> TcM (TcCoercionN, [TcSigmaType]) Source #
matchExpectedAppTy :: TcRhoType -> TcM (TcCoercion, (TcSigmaType, TcSigmaType)) Source #
matchExpectedFunTys :: SDoc -> Arity -> ExpRhoType -> ([ExpSigmaType] -> ExpRhoType -> TcM a) -> TcM (a, HsWrapper) Source #
matchActualFunTys :: Outputable a => SDoc -> CtOrigin -> Maybe a -> Arity -> TcSigmaType -> TcM (HsWrapper, [TcSigmaType], TcSigmaType) Source #
matchActualFunTysPart :: Outputable a => SDoc -> CtOrigin -> Maybe a -> 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