HORIZON HASKELLDocslts/ghc-10.0.x04404a62026-10-19Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 04404a6 · 2026-10-19

Moduleghc-10.0.0.20260917GHC2024

GHC.Tc.Solver.Monad

Monadic definitions for the constraint solver

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

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