ghc-9.4.6: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Tc.Solver

Synopsis

Documentation

data InferMode Source #

How should we choose which constraints to quantify over?

Constructors

ApplyMR

Apply the monomorphism restriction, never quantifying over any constraints

EagerDefaulting

See Note [TcRnExprMode] in GHC.Tc.Module, the :type +d case; this mode refuses to quantify over any defaultable constraint

NoRestrictions

Quantify over any constraint that satisfies pickQuantifiablePreds

Instances

Instances details
Outputable InferMode Source # 
Instance details

Defined in GHC.Tc.Solver

Methods

ppr :: InferMode -> SDoc Source #

solveEqualities :: String -> TcM a -> TcM a Source #

Type-check a thing that emits only equality constraints, solving any constraints we can and re-emitting constraints that we can't. Use this variant only when we'll get another crack at it later See Note [Failure in local type signatures]

Panics if we solve any non-equality constraints. (In runTCSEqualities we use an error thunk for the evidence bindings.)

tcCheckGivens :: InertSet -> Bag EvVar -> TcM (Maybe InertSet) Source #

Return (Just new_inerts) if the Givens are satisfiable, Nothing if definitely contradictory.

See Note [Pattern match warnings with insoluble Givens] above.

tcCheckWanteds :: InertSet -> ThetaType -> TcM Bool Source #

Return True if the Wanteds are soluble, False if not

tcNormalise :: InertSet -> Type -> TcM Type Source #

Normalise a type as much as possible using the given constraints. See Note [tcNormalise].

simplifyTopWanteds :: WantedConstraints -> TcS WantedConstraints Source #

Simplify top-level constraints, but without reporting any unsolved constraints nor unsafe overlapping.