HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleghc-10.0.0.20260917GHC2024

GHC.Tc.Solver.Monad

Monadic definitions for the constraint solver

  • 10 types
  • 147 values
newtypenewtype TcS a
#

Constructors

Instances10Monad, Functor, MonadFix, MonadFail, Applicative, MonadIO, …
  • Monad TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • Functor TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • MonadFix TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • MonadFail TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • Applicative TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • MonadIO TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • HasModule TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • MonadUnique TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • MonadThings TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
  • HasDynFlags TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.Monad
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.

datadata QCInst
#

A quantified constraint, also called a "local instance" (a simplified version of ClsInst).

See Note [Quantified constraints] in GHC.Tc.Solver.Solve

Constructors

Instances1Outputable

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.

valuebumpReductionDepth
  1. :: CtLoc
  2. -> TcType

    type or constraint being reduced

  3. -> TcS CtLoc
#

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 custom type errors, of the form TypeError msg or Maybe (TypeError msg), but not constraints such as F x (TypeError msg) in which the type error is nested under a type family application,

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