HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleghc-9.14.1GHC2021

GHC.Tc.Solver.Monad

Monadic definitions for the constraint solver

Synopsis
  • Packageghc-9.14.1
  • Exports156
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceMonad.hs
newtypenewtype TcS a
#

Constructors

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.

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.

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