Instances2Eq, Outputable
Eq BotInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable BotInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.Types
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11
Moduleghc-10.0.0.20260917GHC2024
Domain types used in GHC.HsToCore.Pmc.Solver. The ultimate goal is to define Nabla, which models normalised refinement types from the paper Lower Your Guards: A Compositional Pattern-Match Coverage Checker".
Eq BotInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable BotInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable PmAltConAppDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesInformation about an Id. Stores positive (vi_pos) facts, like x ~ Just 42,
and negative (vi_neg) facts, like "x is not (:)".
Also caches the type (vi_ty), the ResidualCompleteMatches of a COMPLETE set
(vi_rcm).
Subject to Note [The Pos/Neg invariant] in GHC.HsToCore.Pmc.Solver.
VIvi_id :: !Idvi_pos :: ![PmAltConApp]Positive info: PmAltCon apps it is (i.e. x ~ [Just y, PatSyn z]), all
at the same time (i.e. conjunctive). We need a list because of nested
pattern matches involving pattern synonym
case x of { Just y -> case x of PatSyn z -> ... }
However, no more than one RealDataCon in the list, otherwise contradiction
because of generativity.
vi_neg :: !PmAltConSetNegative info: A list of PmAltCons that it cannot match. Example, assuming
data T = Leaf Int | Branch T T | Node Int T
then x ≁ [Leaf, Node] means that x cannot match a Leaf or Node,
and hence can only match Branch. Is orthogonal to anything from vi_pos,
in the sense that eqPmAltCon returns PossiblyOverlap for any pairing
between vi_pos and vi_neg.
vi_bot :: BotInfovi_rcm :: !ResidualCompleteMatchesA cache of the associated COMPLETE sets. At any time a superset of possible constructors of each COMPLETE set. So, if it's not in here, we can't possibly match on it. Complementary to vi_neg. We still need it to recognise completion of a COMPLETE set efficiently for large enums.
Outputable VarInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesNot user-facing.
The term oracle state. Stores VarInfo for encountered Ids. These entries are possibly shared when we figure out that two variables must be equal, thus represent the same set of values.
See Note [TmState invariants] in GHC.HsToCore.Pmc.Solver.
TmStts_facts :: !UniqSDFM Id VarInfoFacts about term variables. Deterministic env, so that we generate deterministic error messages.
ts_reps :: !CoreMap IdAn environment for looking up whether we already encountered semantically equivalent expressions that we want to represent by the same Id representative.
ts_dirty :: !DIdSetWhich VarInfo needs to be checked for inhabitants because of new
negative constraints (e.g. x ≁ ⊥ or x ≁ K).
Outputable TmStateDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesNot user-facing.
The type oracle state. An GHC.Tc.Solver.Monad.InertSet that we
incrementally add local type constraints to, together with a sequence
number that counts the number of times we extended it with new facts.
TyStty_st_n :: !Intty_st_inert :: !InertSetOutputable TyStateDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesNot user-facing.
A normalised refinement type ∇ ("nabla"), comprised of an inert set of canonical (i.e. mutually compatible) term and type constraints that form the refinement type's predicate.
MkNablanabla_ty_st :: !TyStateType oracle; things like a~Int
nabla_tm_st :: !TmStateTerm oracle; things like x~Nothing
Outputable NablaDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesGeneric NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSemigroup NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesMonoid NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.Typestype Rep Nablas = D1 ('MetaData "Nablas"
"GHC.HsToCore.Pmc.Solver.Types"
"ghc-10.0.0.20260917-8308"
'True) (C1 ('MetaCons "MkNablas"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Bag Nabla))))Defined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesLike lookupVarInfo ts x, but lookupVarInfo ts x = (y, vi) also looks
through newtype constructors. We have x ~ N1 (... (Nk y)) such that the
returned y doesn't have a positive newtype constructor constraint
associated with it (yet). The VarInfo returned is that of y's
representative.
Careful, this means that idType x might be different to idType y, even
modulo type normalisation!
See also Note [Coverage checking Newtype matches] in GHC.HsToCore.Pmc.Solver.
A data type that caches for the VarInfo of x the results of querying
dsGetCompleteMatches and then striking out all occurrences of K for
which we already know x ≁ K from these sets.
For motivation, see Section 5.3 in Lower Your Guards. See also Note [Implementation of COMPLETE pragmas]
RCMrcm_vanilla :: !Maybe DsCompleteMatchThe residual set for the vanilla COMPLETE set from the data defn. Tracked separately from rcm_pragmas, because it might only be known much later (when we have enough type information to see the TyCon of the match), or not at all even. Until that happens, it is Nothing.
rcm_pragmas :: !Maybe DsCompleteMatchesThe residual sets for all COMPLETE sets from pragmas that are
visible when compiling this module. Querying that set with
dsGetCompleteMatches requires DsM, so we initialise it with Nothing
until first needed in a DsM context.
Outputable ResidualCompleteMatchesDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesLiterals (simple and overloaded ones) for pattern match checking.
See Note [Undecidable Equality for PmAltCons]
Eq PmLitDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSyntactic equality. We want (Ord PmLit) so that we can use (Set PmLit) in PmAltConSet
Ord PmLitDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable PmLitDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable PmLitValueDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesEq PmAltConDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSyntactic equality.
Outputable PmAltConDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesType of a PmLit
Type of a PmAltCon
Is a match on this constructor forcing the match variable? True of data constructors, literals and pattern synonyms (#17357), but not of newtypes. See Note [Coverage checking Newtype matches] in GHC.HsToCore.Pmc.Solver.
Outputable PmAltConSetDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesWhether there is a PmAltCon in the PmAltConSet that compares Equal to the given PmAltCon according to eqPmAltCon.
Undecidable semantic equality result. See Note [Undecidable Equality for PmAltCons]
Eq PmEqualityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesShow PmEqualityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOutputable PmEqualityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesWe can't in general decide whether two PmAltCons match the same set of
values. In addition to the reasons in eqPmLit and eqConLike, a
PmAltConLike might or might not represent the same value as a PmAltLit.
See Note [Undecidable Equality for PmAltCons].
Just True ==> Surely equal
Just False ==> Surely different (non-overlapping, even!)
Nothing ==> Equality relation undecidable
Examples (omitting some constructor wrapping):
eqPmAltCon (LitInt 42) (LitInt 1) == Just False: Lit equality is
decidable
eqPmAltCon (DataCon A) (DataCon B) == Just False: DataCon equality is
decidable
eqPmAltCon (LitOverInt 42) (LitOverInt 1) == Nothing: OverLit equality
is undecidable
eqPmAltCon (PatSyn PA) (PatSyn PB) == Nothing: PatSyn equality is
undecidable
eqPmAltCon (DataCon I#) (LitInt 1) == Nothing: DataCon to Lit
comparisons are undecidable without reasoning about the wrapped Int#
eqPmAltCon (LitOverInt 1) (LitOverInt 1) == Just True: We assume
reflexivity for overloaded literals
eqPmAltCon (PatSyn PA) (PatSyn PA) == Just True: We assume reflexivity
for Pattern Synonyms