HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Tc.Solver.Monad

Monadic definitions for the constraint solver

  • 7 types
  • 141 values
  • Packageghc-9.10.3
  • Exports149
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceMonad.hs
newtypenewtype TcS a
#
Instances10Monad, Functor, MonadFix, MonadFail, Applicative, MonadIO, …
valuerunTcSEarlyAbort :: TcS a -> TcM a
#

This variant of runTcS will immediately fail upon encountering an insoluble ct. See Note [Speeding up valid hole-fits]. Its one usage site does not need the ev_binds, so we do not return them.

Create a new Wanted constraint, potentially looking up non-equality constraints in the cache instead of creating a new one from scratch.

Deals with both equality and non-equality constraints.

Create a new Wanted constraint.

Deals with both equality and non-equality constraints.

Does not attempt to re-use non-equality constraints that already exist in the inert set.

valuecheckReductionDepth
  1. :: CtLoc
  2. -> TcType

    type being reduced

  3. -> TcS ()
#

Checks if the depth of the given location is too much. Fails if it's too big, with an appropriate error message.

valuegetInertInsols :: TcS Cts
#

Retrieves all insoluble constraints from the inert set, specifically including Given constraints.

This consists of:

  • insoluble equalities, such as Int ~# Bool;

  • constraints that are top-level custom type errors, of the form TypeError msg, but not constraints such as Eq (TypeError msg) in which the type error is nested;

  • unsatisfiable constraints, of the form Unsatisfiable msg.

The inclusion of Givens is important for pattern match warnings, as we want to consider a pattern match that introduces insoluble Givens to be redundant (see Note [Pattern match warnings with insoluble Givens] in GHC.Tc.Solver).

newtypenewtype TcLevel
#
Instances3Eq, Ord, Outputable