ghc-8.10.1: The GHC API

GHC.HsToCore.PmCheck

Synopsis

# Documentation

Check a single pattern binding (let)

checkMatches :: DynFlags -> DsMatchContext -> [Id] -> [LMatch GhcTc (LHsExpr GhcTc)] -> DsM () Source #

Check a matchgroup (case, functions, etc.)

Exhaustive for guard matches, is used for guards in pattern bindings and in MultiIf expressions.

Return True when any of the pattern match warnings (allPmCheckWarnings) are enabled, in which case we need to run the pattern match checker.

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).

addTyCsDs :: Bag EvVar -> 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.
Add equalities to the local DsM environment when checking the RHS of a case expression: case e of x { p1 -> e1; ... pn -> en } When we go deeper to check e.g. e1 we record (x ~ p1).