Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- checkSingle :: DynFlags -> DsMatchContext -> Id -> Pat GhcTc -> DsM ()
- checkMatches :: DynFlags -> DsMatchContext -> [Id] -> [LMatch GhcTc (LHsExpr GhcTc)] -> DsM ()
- checkGuardMatches :: HsMatchContext Name -> GRHSs GhcTc (LHsExpr GhcTc) -> DsM ()
- needToRunPmCheck :: DynFlags -> Origin -> Bool
- isMatchContextPmChecked :: DynFlags -> Origin -> HsMatchContext id -> Bool
- addTyCsDs :: Bag EvVar -> DsM a -> DsM a
- addScrutTmCs :: Maybe (LHsExpr GhcTc) -> [Id] -> DsM a -> DsM a
- addPatTmCs :: [Pat GhcTc] -> [Id] -> DsM a -> DsM a
Documentation
checkSingle :: DynFlags -> DsMatchContext -> Id -> Pat GhcTc -> DsM () Source #
Check a single pattern binding (let)
checkMatches :: DynFlags -> DsMatchContext -> [Id] -> [LMatch GhcTc (LHsExpr GhcTc)] -> DsM () Source #
Check a matchgroup (case, functions, etc.)
checkGuardMatches :: HsMatchContext Name -> GRHSs GhcTc (LHsExpr GhcTc) -> DsM () Source #
Exhaustive for guard matches, is used for guards in pattern bindings and
in MultiIf
expressions.
needToRunPmCheck :: DynFlags -> Origin -> Bool Source #
Return True when any of the pattern match warnings (allPmCheckWarnings
)
are enabled, in which case we need to run the pattern match checker.
isMatchContextPmChecked :: DynFlags -> Origin -> HsMatchContext id -> Bool Source #
Check whether any part of pattern match checking is enabled for this
HsMatchContext
(does not matter whether it is the redundancy check or the
exhaustiveness check).
addScrutTmCs :: Maybe (LHsExpr GhcTc) -> [Id] -> DsM a -> DsM a Source #
Add equalities for the scrutinee to the local DsM
environment when
checking a case expression:
case e of x { matches }
When checking matches we record that (x ~ e) where x is the initial
uncovered. All matches will have to satisfy this equality.