| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
GHC.Tc.Gen.Pat
Description
Typechecking patterns
Synopsis
- tcLetPat :: (Name -> Maybe TcId) -> LetBndrSpec -> LPat GhcRn -> Scaled ExpSigmaTypeFRR -> TcM a -> TcM (LPat GhcTc, a)
- newLetBndr :: LetBndrSpec -> Name -> Mult -> TcType -> TcM TcId
- data LetBndrSpec
- tcCheckPat :: HsMatchContextRn -> LPat GhcRn -> Scaled TcSigmaTypeFRR -> TcM a -> TcM (LPat GhcTc, a)
- tcCheckPat_O :: HsMatchContextRn -> CtOrigin -> LPat GhcRn -> Scaled TcSigmaTypeFRR -> TcM a -> TcM (LPat GhcTc, a)
- tcInferPat :: FixedRuntimeRepContext -> HsMatchContextRn -> LPat GhcRn -> TcM a -> TcM ((LPat GhcTc, a), TcSigmaTypeFRR)
- tcMatchPats :: HsMatchContextRn -> [LPat GhcRn] -> [ExpPatType] -> TcM a -> TcM ([LPat GhcTc], a)
- addDataConStupidTheta :: DataCon -> [TcType] -> TcM ()
- zipPatsBndrs :: [LPat GhcRn] -> [TyVarBinder] -> TcM ([(HsTyPat GhcRn, TyVar)], [LPat GhcRn])
Documentation
tcLetPat :: (Name -> Maybe TcId) -> LetBndrSpec -> LPat GhcRn -> Scaled ExpSigmaTypeFRR -> TcM a -> TcM (LPat GhcTc, a) Source #
newLetBndr :: LetBndrSpec -> Name -> Mult -> TcType -> TcM TcId Source #
data LetBndrSpec Source #
Constructors
| LetLclBndr | |
| LetGblBndr TcPragEnv |
Instances
| Outputable LetBndrSpec Source # | |
Defined in GHC.Tc.Gen.Pat Methods ppr :: LetBndrSpec -> SDoc Source # | |
tcCheckPat :: HsMatchContextRn -> LPat GhcRn -> Scaled TcSigmaTypeFRR -> TcM a -> TcM (LPat GhcTc, a) Source #
Arguments
| :: HsMatchContextRn | |
| -> CtOrigin | origin to use if the type needs inst'ing |
| -> LPat GhcRn | |
| -> Scaled TcSigmaTypeFRR | |
| -> TcM a | |
| -> TcM (LPat GhcTc, a) |
A variant of tcPat that takes a custom origin
tcInferPat :: FixedRuntimeRepContext -> HsMatchContextRn -> LPat GhcRn -> TcM a -> TcM ((LPat GhcTc, a), TcSigmaTypeFRR) Source #
Arguments
| :: HsMatchContextRn | |
| -> [LPat GhcRn] | patterns |
| -> [ExpPatType] | types of the patterns |
| -> TcM a | checker for the body |
| -> TcM ([LPat GhcTc], a) |
zipPatsBndrs :: [LPat GhcRn] -> [TyVarBinder] -> TcM ([(HsTyPat GhcRn, TyVar)], [LPat GhcRn]) Source #
Line the arguments of a ConPat up against the TyVarBinders of its
ConLike, returning the type arguments with the binders they instantiate,
and the remaining value arguments.
See Note [Zipping ConPat arguments with TyVarBinders]
Precondition: check_con_pat_arity has passed for these arguments, so that
we never run out of patterns while a required binder remains.