ghc-9.15: The GHC API
Safe HaskellNone
LanguageGHC2024

GHC.Tc.Types.CtLoc

Synopsis

CtLoc

data CtLoc Source #

CtLoc gives information about where a constraint came from.

This is important for decent error message reporting, because dictionaries don't appear in the original source code.

See Note [CtLoc].

Constructors

CtLoc 

Fields

CtLocEnv

data CtLocEnv Source #

Local typechecker environment for a constraint.

Used to restore the environment of a constraint when reporting errors, see setCtLocM.

See also TcLclCtxt.

SubGoalDepth

Explanations

data CtExplanations Source #

Explanations that can be presented to the user about why the solver might have failed to solve a constraint. See Note [CtExplanations].

For example: couldn't solve a representational equality because a newtype constructor was out of scope.

Constructors

CtExplanations 

Fields

RoleExplanation

data RoleExplanation Source #

Information about why a representational equality gave rise to a nominal equality.

Constructors

TyConArg

The TyCon has the given role this argument.

Fields

  • TyCon
     
  • Int

    argument position (starting from 1); may be greater than the arity of the TyCon in the case of an over-saturated application

  • Role
     
NominalAppTy Type

The role of the argument in an AppTy is nominal.

Store the function type in the AppTy.

Instances

Instances details
Outputable RoleExplanation Source # 
Instance details

Defined in GHC.Tc.Types.CtLoc

tyConAppRoleExplanation :: Role -> TyCon -> (Int, Role) -> Maybe RoleExplanation Source #

Add a role explanation when decomposing 'T a ~r1 T b' for some role r1 into 'a ~r2 b' with stronger role r2 (e.g. turning a representational equality into a nominal equality).