Instances1Outputable
Outputable SrcInfoDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.Types
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11
Moduleghc-lib-parser-9.14.1.20251220GHC2021
Types used through-out pattern match checking. This module is mostly there
to be imported from GHC.HsToCore.Types. The exposed API is that of
GHC.HsToCore.Pmc.
These types model the paper Lower Your Guards: A Compositional Pattern-Match Coverage Checker".
Outputable SrcInfoDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesA very simple language for pattern guards. Let bindings, bang patterns, and matching variables against flat constructor patterns. The LYG guard language.
PmConPmCon x K dicts args corresponds to a K dicts args <- x guard.
The args are bound in this construct, the x is just a use.
For the arguments' meaning see GHC.Hs.Pat.ConPatOut.
pm_id :: !Idpm_con_con :: !PmAltConpm_con_tvs :: ![TyVar]pm_con_dicts :: ![EvVar]pm_con_args :: ![Id]PmBangPmBang x corresponds to a seq x True guard.
If the extra SrcInfo is present, the bang guard came from a source
bang pattern, in which case we might want to report it as redundant.
See Note [Dead bang patterns] in GHC.HsToCore.Pmc.Check.
PmLetPmLet x expr corresponds to a let x = expr guard. This actually
binds x.
pm_id :: !Id_pm_let_expr :: !CoreExprOutputable PmGrdDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesShould not be user-facing.
A series-parallel graph of PmGrds, so very nearly a guard tree, if it weren't for or-patterns/GdAlt! The implicit "source" corresponds to "before the match" and the implicit "sink" corresponds to "after a successful match".
GdSeq g1 g2 corresponds to matching guards g1 and then g2
if matching g1 succeeded.
Example: The Haskell guard | x > 1, x < 10 = ... will test x > 1
before x < 10, failing if either test fails.
GdAlt g1 g2 is far less common than GdSeq and corresponds to
matching an or-pattern (LT; EQ), succeeding if the
match variable matches either LT or EQ.
See Note [Implementation of OrPatterns] for a larger example.
Outputable GrdDagDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesFormat LYG guards as | True <- x, let x = 42, !z
Sequentially compose a list of GrdDags.
A guard tree denoting MatchGroup.
PmMatchGroup (NonEmpty (PmMatch p))Outputable p => Outputable (PmMatchGroup p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesA guard tree denoting Match: A payload describing the pats and a bunch of
GRHS.
Outputable p => Outputable (PmMatch p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesA guard tree denoting GRHSs: A bunch of PmLet guards for local
bindings from the GRHSss where clauses and the actual list of GRHS.
See Note [Long-distance information for HsLocalBinds] in
GHC.HsToCore.Pmc.Desugar.
Outputable p => Outputable (PmGRHSs p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesA guard tree denoting GRHS: A payload describing the grds and a SrcInfo
useful for printing out in warnings messages.
Outputable p => Outputable (PmGRHS p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesOutputable p => Outputable (PmPatBind p)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesA guard tree denoting an -XEmptyCase.
Outputable PmEmptyCaseDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesRedundancy sets, used to determine redundancy of RHSs and bang patterns
(later digested into a CIRB).
RedSetsrs_cov :: !NablasThe Covered set; the set of values reaching a particular program point.
rs_div :: !NablasThe Diverging set; empty if no match can lead to divergence. If it wasn't empty, we have to turn redundancy warnings into inaccessibility warnings for any subclauses.
rs_bangs :: !OrdList (Nablas, SrcInfo)Outputable RedSetsDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesEq PrecisionDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesShow PrecisionDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesSemigroup PrecisionDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesMonoid PrecisionDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesOutputable PrecisionDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesPattern-match coverage check result
CheckResultcr_ret :: !aA hole for redundancy info and covered sets.
cr_uncov :: !NablasThe set of uncovered values falling out at the bottom. (for -Wincomplete-patterns, but also important state for the algorithm)
cr_approx :: !PrecisionA flag saying whether we ran into the maxPmCheckModels limit for the
purpose of suggesting to crank it up in the warning message. Writer state.
Functor CheckResultDefined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesOutputable a => Outputable (CheckResult a)Defined in ghc-lib-parser-9.14.1.20251220 · GHC.HsToCore.Pmc.TypesUsed as tree payload pre-checking. The LYG guards to check.
Used as tree payload post-checking. The redundancy info we elaborated.