ghc-8.10.1: The GHC API
Safe HaskellNone
LanguageHaskell2010

Constraint

Synopsis

Documentation

data QCInst #

Constructors

QCI 

Instances

Instances details
Outputable QCInst # 
Instance details

Defined in Constraint

Methods

ppr :: QCInst -> SDoc #

pprPrec :: Rational -> QCInst -> SDoc #

type Xi = Type #

data Ct #

Instances

Instances details
Outputable Ct # 
Instance details

Defined in Constraint

Methods

ppr :: Ct -> SDoc #

pprPrec :: Rational -> Ct -> SDoc #

type Cts = Bag Ct #

andCts :: Cts -> Cts -> Cts #

listToCts :: [Ct] -> Cts #

ctsElts :: Cts -> [Ct] #

consCts :: Ct -> Cts -> Cts #

snocCts :: Cts -> Ct -> Cts #

extendCtsList :: Cts -> [Ct] -> Cts #

superClassesMightHelp :: WantedConstraints -> Bool #

True if taking superclasses of givens, or of wanteds (to perhaps expose more equalities or functional dependencies) might help to solve this constraint. See Note [When superclasses help]

getUserTypeErrorMsg :: Ct -> Maybe Type #

A constraint is considered to be a custom type error, if it contains custom type errors anywhere in it. See Note [Custom type errors in constraints]

ctLoc :: Ct -> CtLoc #

setCtLoc :: Ct -> CtLoc -> Ct #

ctFlavour :: Ct -> CtFlavour #

Get the flavour of the given Ct

ctEqRel :: Ct -> EqRel #

Get the equality relation for the given Ct

mkTcEqPredLikeEv :: CtEvidence -> TcType -> TcType -> TcType #

Makes a new equality predicate with the same role as the given evidence.

mkGivens :: CtLoc -> [EvId] -> [Ct] #

ctEvEqRel :: CtEvidence -> EqRel #

Get the equality relation relevant for a CtEvidence

tyCoVarsOfCt :: Ct -> TcTyCoVarSet #

Returns free variables of constraints as a non-deterministic set

tyCoVarsOfCts :: Cts -> TcTyCoVarSet #

Returns free variables of a bag of constraints as a non-deterministic set. See Note [Deterministic FV] in FV.

tyCoVarsOfCtList :: Ct -> [TcTyCoVar] #

Returns free variables of constraints as a deterministically ordered. list. See Note [Deterministic FV] in FV.

tyCoVarsOfCtsList :: Cts -> [TcTyCoVar] #

Returns free variables of a bag of constraints as a deterministically odered list. See Note [Deterministic FV] in FV.

data WantedConstraints #

Constructors

WC 

Instances

Instances details
Outputable WantedConstraints # 
Instance details

Defined in Constraint

isSolvedWC :: WantedConstraints -> Bool #

Checks whether a the given wanted constraints are solved, i.e. that there are no simple constraints left and all the implications are solved.

tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet #

Returns free variables of WantedConstraints as a non-deterministic set. See Note [Deterministic FV] in FV.

tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar] #

Returns free variables of WantedConstraints as a deterministically ordered list. See Note [Deterministic FV] in FV.

data ImplicStatus #

Instances

Instances details
Outputable ImplicStatus # 
Instance details

Defined in Constraint

data SubGoalDepth #

See Note [SubGoalDepth]

data CtEvidence #

Instances

Instances details
Outputable CtEvidence # 
Instance details

Defined in Constraint

data TcEvDest #

A place for type-checking evidence to go after it is generated. Wanted equalities are always HoleDest; other wanteds are always EvVarDest.

Constructors

EvVarDest EvVar

bind this var to the evidence EvVarDest is always used for non-type-equalities e.g. class constraints

HoleDest CoercionHole

fill in this hole with the evidence HoleDest is always used for type-equalities See Note [Coercion holes] in TyCoRep

Instances

Instances details
Outputable TcEvDest # 
Instance details

Defined in Constraint

toKindLoc :: CtLoc -> CtLoc #

Take a CtLoc and moves it to the kind level

ctEvRole :: CtEvidence -> Role #

Get the role relevant for a CtEvidence

wrapType :: Type -> [TyVar] -> [PredType] -> Type #

wrapTypeWithImplication :: Type -> Implication -> Type #

Wraps the given type with the constraints (via ic_given) in the given implication, according to the variables mentioned (via ic_skols) in the implication, but taking care to only wrap those variables that are mentioned in the type or the implication.

data CtFlavour #

Constructors

Given 
Wanted ShadowInfo 
Derived 

Instances

Instances details
Eq CtFlavour # 
Instance details

Defined in Constraint

Outputable CtFlavour # 
Instance details

Defined in Constraint

data ShadowInfo #

Constructors

WDeriv 
WOnly 

Instances

Instances details
Eq ShadowInfo # 
Instance details

Defined in Constraint

type CtFlavourRole = (CtFlavour, EqRel) #

Whether or not one Ct can rewrite another is determined by its flavour and its equality relation. See also Note [Flavours with roles] in TcSMonad

ctEvFlavourRole :: CtEvidence -> CtFlavourRole #

Extract the flavour, role, and boxity from a CtEvidence

ctFlavourRole :: Ct -> CtFlavourRole #

Extract the flavour and role from a Ct

data Hole #

An expression or type hole

Constructors

ExprHole UnboundVar

Either an out-of-scope variable or a "true" hole in an expression (TypedHoles)

TypeHole OccName

A hole in a type (PartialTypeSignatures)

Instances

Instances details
Outputable Hole # 
Instance details

Defined in Constraint

Methods

ppr :: Hole -> SDoc #

pprPrec :: Rational -> Hole -> SDoc #