Constraint

ghc-8.10.4: The GHC API

Safe Haskell | None
Language | Haskell2010

Constraint

Synopsis

- data QCInst = QCI {
  - qci_ev :: CtEvidence
  - qci_tvs :: [TcTyVar]
  - qci_pred :: TcPredType
  - qci_pend_sc :: Bool
  }
- isPendingScInst :: QCInst -> Maybe QCInst
- type Xi = Type
- data Ct
  - = CDictCan {
    - cc_ev :: CtEvidence
    - cc_class :: Class
    - cc_tyargs :: [Xi]
    - cc_pend_sc :: Bool
    }
  - | CIrredCan {
    - cc_ev :: CtEvidence
    - cc_insol :: Bool
    }
  - | CTyEqCan {
    - cc_ev :: CtEvidence
    - cc_tyvar :: TcTyVar
    - cc_rhs :: TcType
    - cc_eq_rel :: EqRel
    }
  - | CFunEqCan {
    - cc_ev :: CtEvidence
    - cc_fun :: TyCon
    - cc_tyargs :: [Xi]
    - cc_fsk :: TcTyVar
    }
  - | CNonCanonical {
    - cc_ev :: CtEvidence
    }
  - | CHoleCan {
    - cc_ev :: CtEvidence
    - cc_hole :: Hole
    }
  - | CQuantCan QCInst
- type Cts = Bag Ct
- emptyCts :: Cts
- andCts :: Cts -> Cts -> Cts
- andManyCts :: [Cts] -> Cts
- pprCts :: Cts -> SDoc
- singleCt :: Ct -> Cts
- listToCts :: [Ct] -> Cts
- ctsElts :: Cts -> [Ct]
- consCts :: Ct -> Cts -> Cts
- snocCts :: Cts -> Ct -> Cts
- extendCtsList :: Cts -> [Ct] -> Cts
- isEmptyCts :: Cts -> Bool
- isCTyEqCan :: Ct -> Bool
- isCFunEqCan :: Ct -> Bool
- isPendingScDict :: Ct -> Maybe Ct
- superClassesMightHelp :: WantedConstraints -> Bool
- getPendingWantedScs :: Cts -> ([Ct], Cts)
- isCDictCan_Maybe :: Ct -> Maybe Class
- isCFunEqCan_maybe :: Ct -> Maybe (TyCon, [Type])
- isCNonCanonical :: Ct -> Bool
- isWantedCt :: Ct -> Bool
- isDerivedCt :: Ct -> Bool
- isGivenCt :: Ct -> Bool
- isHoleCt :: Ct -> Bool
- isOutOfScopeCt :: Ct -> Bool
- isExprHoleCt :: Ct -> Bool
- isTypeHoleCt :: Ct -> Bool
- isUserTypeErrorCt :: Ct -> Bool
- getUserTypeErrorMsg :: Ct -> Maybe Type
- ctEvidence :: Ct -> CtEvidence
- ctLoc :: Ct -> CtLoc
- setCtLoc :: Ct -> CtLoc -> Ct
- ctPred :: Ct -> PredType
- ctFlavour :: Ct -> CtFlavour
- ctEqRel :: Ct -> EqRel
- ctOrigin :: Ct -> CtOrigin
- ctEvId :: Ct -> EvVar
- mkTcEqPredLikeEv :: CtEvidence -> TcType -> TcType -> TcType
- mkNonCanonical :: CtEvidence -> Ct
- mkNonCanonicalCt :: Ct -> Ct
- mkGivens :: CtLoc -> [EvId] -> [Ct]
- mkIrredCt :: CtEvidence -> Ct
- mkInsolubleCt :: CtEvidence -> Ct
- ctEvPred :: CtEvidence -> TcPredType
- ctEvLoc :: CtEvidence -> CtLoc
- ctEvOrigin :: CtEvidence -> CtOrigin
- ctEvEqRel :: CtEvidence -> EqRel
- ctEvExpr :: CtEvidence -> EvExpr
- ctEvTerm :: CtEvidence -> EvTerm
- ctEvCoercion :: HasDebugCallStack => CtEvidence -> TcCoercion
- ctEvEvId :: CtEvidence -> EvVar
- tyCoVarsOfCt :: Ct -> TcTyCoVarSet
- tyCoVarsOfCts :: Cts -> TcTyCoVarSet
- tyCoVarsOfCtList :: Ct -> [TcTyCoVar]
- tyCoVarsOfCtsList :: Cts -> [TcTyCoVar]
- data WantedConstraints = WC {
  - wc_simple :: Cts
  - wc_impl :: Bag Implication
  }
- insolubleWC :: WantedConstraints -> Bool
- emptyWC :: WantedConstraints
- isEmptyWC :: WantedConstraints -> Bool
- isSolvedWC :: WantedConstraints -> Bool
- andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints
- unionsWC :: [WantedConstraints] -> WantedConstraints
- mkSimpleWC :: [CtEvidence] -> WantedConstraints
- mkImplicWC :: Bag Implication -> WantedConstraints
- addInsols :: WantedConstraints -> Bag Ct -> WantedConstraints
- insolublesOnly :: WantedConstraints -> WantedConstraints
- addSimples :: WantedConstraints -> Bag Ct -> WantedConstraints
- addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints
- tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet
- dropDerivedWC :: WantedConstraints -> WantedConstraints
- dropDerivedSimples :: Cts -> Cts
- tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar]
- insolubleCt :: Ct -> Bool
- insolubleEqCt :: Ct -> Bool
- isDroppableCt :: Ct -> Bool
- insolubleImplic :: Implication -> Bool
- arisesFromGivens :: Ct -> Bool
- data Implication = Implic {
  - ic_tclvl :: TcLevel
  - ic_skols :: [TcTyVar]
  - ic_info :: SkolemInfo
  - ic_telescope :: Maybe SDoc
  - ic_given :: [EvVar]
  - ic_no_eqs :: Bool
  - ic_warn_inaccessible :: Bool
  - ic_env :: TcLclEnv
  - ic_wanted :: WantedConstraints
  - ic_binds :: EvBindsVar
  - ic_need_inner :: VarSet
  - ic_need_outer :: VarSet
  - ic_status :: ImplicStatus
  }
- implicationPrototype :: Implication
- data ImplicStatus
  - = IC_Solved {
    - ics_dead :: [EvVar]
    }
  - | IC_Insoluble
  - | IC_BadTelescope
  - | IC_Unsolved
- isInsolubleStatus :: ImplicStatus -> Bool
- isSolvedStatus :: ImplicStatus -> Bool
- data SubGoalDepth
- initialSubGoalDepth :: SubGoalDepth
- maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth
- bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth
- subGoalDepthExceeded :: DynFlags -> SubGoalDepth -> Bool
- data CtLoc = CtLoc {
  - ctl_origin :: CtOrigin
  - ctl_env :: TcLclEnv
  - ctl_t_or_k :: Maybe TypeOrKind
  - ctl_depth :: !SubGoalDepth
  }
- ctLocSpan :: CtLoc -> RealSrcSpan
- ctLocEnv :: CtLoc -> TcLclEnv
- ctLocLevel :: CtLoc -> TcLevel
- ctLocOrigin :: CtLoc -> CtOrigin
- ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind
- ctLocDepth :: CtLoc -> SubGoalDepth
- bumpCtLocDepth :: CtLoc -> CtLoc
- isGivenLoc :: CtLoc -> Bool
- setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
- updateCtLocOrigin :: CtLoc -> (CtOrigin -> CtOrigin) -> CtLoc
- setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc
- setCtLocSpan :: CtLoc -> RealSrcSpan -> CtLoc
- pprCtLoc :: CtLoc -> SDoc
- data CtEvidence
  - = CtGiven {
    - ctev_pred :: TcPredType
    - ctev_evar :: EvVar
    - ctev_loc :: CtLoc
    }
  - | CtWanted {
    - ctev_pred :: TcPredType
    - ctev_dest :: TcEvDest
    - ctev_nosh :: ShadowInfo
    - ctev_loc :: CtLoc
    }
  - | CtDerived {
    - ctev_pred :: TcPredType
    - ctev_loc :: CtLoc
    }
- data TcEvDest
  - = EvVarDest EvVar
  - | HoleDest CoercionHole
- mkKindLoc :: TcType -> TcType -> CtLoc -> CtLoc
- toKindLoc :: CtLoc -> CtLoc
- mkGivenLoc :: TcLevel -> SkolemInfo -> TcLclEnv -> CtLoc
- isWanted :: CtEvidence -> Bool
- isGiven :: CtEvidence -> Bool
- isDerived :: CtEvidence -> Bool
- isGivenOrWDeriv :: CtFlavour -> Bool
- ctEvRole :: CtEvidence -> Role
- wrapType :: Type -> [TyVar] -> [PredType] -> Type
- wrapTypeWithImplication :: Type -> Implication -> Type
- data CtFlavour
  - = Given
  - | Wanted ShadowInfo
  - | Derived
- data ShadowInfo
  - = WDeriv
  - | WOnly
- ctEvFlavour :: CtEvidence -> CtFlavour
- type CtFlavourRole = (CtFlavour, EqRel)
- ctEvFlavourRole :: CtEvidence -> CtFlavourRole
- ctFlavourRole :: Ct -> CtFlavourRole
- eqCanRewrite :: EqRel -> EqRel -> Bool
- eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
- eqMayRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
- eqCanDischargeFR :: CtFlavourRole -> CtFlavourRole -> Bool
- funEqCanDischarge :: CtEvidence -> CtEvidence -> (SwapFlag, Bool)
- funEqCanDischargeF :: CtFlavour -> CtFlavour -> (SwapFlag, Bool)
- pprEvVarTheta :: [EvVar] -> SDoc
- pprEvVars :: [EvVar] -> SDoc
- pprEvVarWithType :: EvVar -> SDoc
- data Hole
  - = ExprHole UnboundVar
  - | TypeHole OccName
- holeOcc :: Hole -> OccName

# Documentation

data QCInst Source #

Constructors

QCI |
Fields qci_ev :: CtEvidence qci_tvs :: [TcTyVar] qci_pred :: TcPredType qci_pend_sc :: Bool

#### Instances

Instances details

Outputable QCInst # |
Instance details Defined in Constraint Methods ppr :: QCInst -> SDoc Source # pprPrec :: Rational -> QCInst -> SDoc Source #

isPendingScInst :: QCInst -> Maybe QCInst Source #

type Xi = Type Source #

data Ct Source #

Constructors

CDictCan |
Fields cc_ev :: CtEvidence cc_class :: Class cc_tyargs :: [Xi] cc_pend_sc :: Bool
CIrredCan |
Fields cc_ev :: CtEvidence cc_insol :: Bool
CTyEqCan |
Fields cc_ev :: CtEvidence cc_tyvar :: TcTyVar cc_rhs :: TcType cc_eq_rel :: EqRel
CFunEqCan |
Fields cc_ev :: CtEvidence cc_fun :: TyCon cc_tyargs :: [Xi] cc_fsk :: TcTyVar
CNonCanonical |
Fields cc_ev :: CtEvidence
CHoleCan |
Fields cc_ev :: CtEvidence cc_hole :: Hole
CQuantCan QCInst |

#### Instances

Instances details

Outputable Ct # |
Instance details Defined in Constraint Methods ppr :: Ct -> SDoc Source # pprPrec :: Rational -> Ct -> SDoc Source #

type Cts = Bag Ct Source #

emptyCts :: Cts Source #

andCts :: Cts -> Cts -> Cts Source #

andManyCts :: [Cts] -> Cts Source #

pprCts :: Cts -> SDoc Source #

singleCt :: Ct -> Cts Source #

listToCts :: [Ct] -> Cts Source #

ctsElts :: Cts -> [Ct] Source #

consCts :: Ct -> Cts -> Cts Source #

snocCts :: Cts -> Ct -> Cts Source #

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

isEmptyCts :: Cts -> Bool Source #

isCTyEqCan :: Ct -> Bool Source #

isCFunEqCan :: Ct -> Bool Source #

isPendingScDict :: Ct -> Maybe Ct Source #

superClassesMightHelp :: WantedConstraints -> Bool Source #

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]

getPendingWantedScs :: Cts -> ([Ct], Cts) Source #

isCDictCan_Maybe :: Ct -> Maybe Class Source #

isCFunEqCan_maybe :: Ct -> Maybe (TyCon, [Type]) Source #

isCNonCanonical :: Ct -> Bool Source #

isWantedCt :: Ct -> Bool Source #

isDerivedCt :: Ct -> Bool Source #

isGivenCt :: Ct -> Bool Source #

isHoleCt :: Ct -> Bool Source #

isOutOfScopeCt :: Ct -> Bool Source #

isExprHoleCt :: Ct -> Bool Source #

isTypeHoleCt :: Ct -> Bool Source #

isUserTypeErrorCt :: Ct -> Bool Source #

getUserTypeErrorMsg :: Ct -> Maybe Type Source #

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]

ctEvidence :: Ct -> CtEvidence Source #

ctLoc :: Ct -> CtLoc Source #

setCtLoc :: Ct -> CtLoc -> Ct Source #

ctPred :: Ct -> PredType Source #

ctFlavour :: Ct -> CtFlavour Source #

Get the flavour of the given `Ct`

ctEqRel :: Ct -> EqRel Source #

Get the equality relation for the given `Ct`

ctOrigin :: Ct -> CtOrigin Source #

ctEvId :: Ct -> EvVar Source #

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

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

mkNonCanonical :: CtEvidence -> Ct Source #

mkNonCanonicalCt :: Ct -> Ct Source #

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

mkIrredCt :: CtEvidence -> Ct Source #

mkInsolubleCt :: CtEvidence -> Ct Source #

ctEvPred :: CtEvidence -> TcPredType Source #

ctEvLoc :: CtEvidence -> CtLoc Source #

ctEvOrigin :: CtEvidence -> CtOrigin Source #

ctEvEqRel :: CtEvidence -> EqRel Source #

Get the equality relation relevant for a `CtEvidence`

ctEvExpr :: CtEvidence -> EvExpr Source #

ctEvTerm :: CtEvidence -> EvTerm Source #

ctEvCoercion :: HasDebugCallStack => CtEvidence -> TcCoercion Source #

ctEvEvId :: CtEvidence -> EvVar Source #

tyCoVarsOfCt :: Ct -> TcTyCoVarSet Source #

Returns free variables of constraints as a non-deterministic set

tyCoVarsOfCts :: Cts -> TcTyCoVarSet Source #

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

tyCoVarsOfCtList :: Ct -> [TcTyCoVar] Source #

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

tyCoVarsOfCtsList :: Cts -> [TcTyCoVar] Source #

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

data WantedConstraints Source #

Constructors

WC |
Fields wc_simple :: Cts wc_impl :: Bag Implication

#### Instances

Instances details

Outputable WantedConstraints # |
Instance details Defined in Constraint Methods ppr :: WantedConstraints -> SDoc Source # pprPrec :: Rational -> WantedConstraints -> SDoc Source #

insolubleWC :: WantedConstraints -> Bool Source #

emptyWC :: WantedConstraints Source #

isEmptyWC :: WantedConstraints -> Bool Source #

isSolvedWC :: WantedConstraints -> Bool Source #

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

andWC :: WantedConstraints -> WantedConstraints -> WantedConstraints Source #

unionsWC :: [WantedConstraints] -> WantedConstraints Source #

mkSimpleWC :: [CtEvidence] -> WantedConstraints Source #

mkImplicWC :: Bag Implication -> WantedConstraints Source #

addInsols :: WantedConstraints -> Bag Ct -> WantedConstraints Source #

insolublesOnly :: WantedConstraints -> WantedConstraints Source #

addSimples :: WantedConstraints -> Bag Ct -> WantedConstraints Source #

addImplics :: WantedConstraints -> Bag Implication -> WantedConstraints Source #

tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet Source #

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

dropDerivedWC :: WantedConstraints -> WantedConstraints Source #

dropDerivedSimples :: Cts -> Cts Source #

tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar] Source #

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

insolubleCt :: Ct -> Bool Source #

insolubleEqCt :: Ct -> Bool Source #

isDroppableCt :: Ct -> Bool Source #

insolubleImplic :: Implication -> Bool Source #

arisesFromGivens :: Ct -> Bool Source #

data Implication Source #

Constructors

Implic |
Fields ic_tclvl :: TcLevel ic_skols :: [TcTyVar] ic_info :: SkolemInfo ic_telescope :: Maybe SDoc ic_given :: [EvVar] ic_no_eqs :: Bool ic_warn_inaccessible :: Bool ic_env :: TcLclEnv ic_wanted :: WantedConstraints ic_binds :: EvBindsVar ic_need_inner :: VarSet ic_need_outer :: VarSet ic_status :: ImplicStatus

#### Instances

Instances details

Outputable Implication # |
Instance details Defined in Constraint Methods ppr :: Implication -> SDoc Source # pprPrec :: Rational -> Implication -> SDoc Source #

implicationPrototype :: Implication Source #

data ImplicStatus Source #

Constructors

IC_Solved |
Fields ics_dead :: [EvVar]
IC_Insoluble |
IC_BadTelescope |
IC_Unsolved |

#### Instances

Instances details

Outputable ImplicStatus # |
Instance details Defined in Constraint Methods ppr :: ImplicStatus -> SDoc Source # pprPrec :: Rational -> ImplicStatus -> SDoc Source #

isInsolubleStatus :: ImplicStatus -> Bool Source #

isSolvedStatus :: ImplicStatus -> Bool Source #

data SubGoalDepth Source #

See Note [SubGoalDepth]

#### Instances

Instances details

Eq SubGoalDepth # |
Instance details Defined in Constraint Methods (==) :: SubGoalDepth -> SubGoalDepth -> Bool # (/=) :: SubGoalDepth -> SubGoalDepth -> Bool #
Ord SubGoalDepth # |
Instance details Defined in Constraint Methods compare :: SubGoalDepth -> SubGoalDepth -> Ordering # (<) :: SubGoalDepth -> SubGoalDepth -> Bool # (<=) :: SubGoalDepth -> SubGoalDepth -> Bool # (>) :: SubGoalDepth -> SubGoalDepth -> Bool # (>=) :: SubGoalDepth -> SubGoalDepth -> Bool # max :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth # min :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth #
Outputable SubGoalDepth # |
Instance details Defined in Constraint Methods ppr :: SubGoalDepth -> SDoc Source # pprPrec :: Rational -> SubGoalDepth -> SDoc Source #

initialSubGoalDepth :: SubGoalDepth Source #

maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth Source #

bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth Source #

subGoalDepthExceeded :: DynFlags -> SubGoalDepth -> Bool Source #

data CtLoc Source #

Constructors

CtLoc |
Fields ctl_origin :: CtOrigin ctl_env :: TcLclEnv ctl_t_or_k :: Maybe TypeOrKind ctl_depth :: !SubGoalDepth

ctLocSpan :: CtLoc -> RealSrcSpan Source #

ctLocEnv :: CtLoc -> TcLclEnv Source #

ctLocLevel :: CtLoc -> TcLevel Source #

ctLocOrigin :: CtLoc -> CtOrigin Source #

ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind Source #

ctLocDepth :: CtLoc -> SubGoalDepth Source #

bumpCtLocDepth :: CtLoc -> CtLoc Source #

isGivenLoc :: CtLoc -> Bool Source #

setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc Source #

updateCtLocOrigin :: CtLoc -> (CtOrigin -> CtOrigin) -> CtLoc Source #

setCtLocEnv :: CtLoc -> TcLclEnv -> CtLoc Source #

setCtLocSpan :: CtLoc -> RealSrcSpan -> CtLoc Source #

pprCtLoc :: CtLoc -> SDoc Source #

data CtEvidence Source #

Constructors

CtGiven |
Fields ctev_pred :: TcPredType ctev_evar :: EvVar ctev_loc :: CtLoc
CtWanted |
Fields ctev_pred :: TcPredType ctev_dest :: TcEvDest ctev_nosh :: ShadowInfo ctev_loc :: CtLoc
CtDerived |
Fields ctev_pred :: TcPredType ctev_loc :: CtLoc

#### Instances

Instances details

Outputable CtEvidence # |
Instance details Defined in Constraint Methods ppr :: CtEvidence -> SDoc Source # pprPrec :: Rational -> CtEvidence -> SDoc Source #

data TcEvDest Source #

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 Methods ppr :: TcEvDest -> SDoc Source # pprPrec :: Rational -> TcEvDest -> SDoc Source #

mkKindLoc :: TcType -> TcType -> CtLoc -> CtLoc Source #

toKindLoc :: CtLoc -> CtLoc Source #

Take a CtLoc and moves it to the kind level

mkGivenLoc :: TcLevel -> SkolemInfo -> TcLclEnv -> CtLoc Source #

isWanted :: CtEvidence -> Bool Source #

isGiven :: CtEvidence -> Bool Source #

isDerived :: CtEvidence -> Bool Source #

isGivenOrWDeriv :: CtFlavour -> Bool Source #

ctEvRole :: CtEvidence -> Role Source #

Get the role relevant for a `CtEvidence`

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

wrapTypeWithImplication :: Type -> Implication -> Type Source #

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 Source #

Constructors

Given |
Wanted ShadowInfo |
Derived |

#### Instances

Instances details

Eq CtFlavour # |
Instance details Defined in Constraint Methods (==) :: CtFlavour -> CtFlavour -> Bool # (/=) :: CtFlavour -> CtFlavour -> Bool #
Outputable CtFlavour # |
Instance details Defined in Constraint Methods ppr :: CtFlavour -> SDoc Source # pprPrec :: Rational -> CtFlavour -> SDoc Source #

data ShadowInfo Source #

Constructors

WDeriv |
WOnly |

#### Instances

Instances details

Eq ShadowInfo # |
Instance details Defined in Constraint Methods (==) :: ShadowInfo -> ShadowInfo -> Bool # (/=) :: ShadowInfo -> ShadowInfo -> Bool #

ctEvFlavour :: CtEvidence -> CtFlavour Source #

type CtFlavourRole = (CtFlavour, EqRel) Source #

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 Source #

Extract the flavour, role, and boxity from a `CtEvidence`

ctFlavourRole :: Ct -> CtFlavourRole Source #

Extract the flavour and role from a `Ct`

eqCanRewrite :: EqRel -> EqRel -> Bool Source #

eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool Source #

eqMayRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool Source #

eqCanDischargeFR :: CtFlavourRole -> CtFlavourRole -> Bool Source #

funEqCanDischarge :: CtEvidence -> CtEvidence -> (SwapFlag, Bool) Source #

funEqCanDischargeF :: CtFlavour -> CtFlavour -> (SwapFlag, Bool) Source #

pprEvVarTheta :: [EvVar] -> SDoc Source #

pprEvVars :: [EvVar] -> SDoc Source #

pprEvVarWithType :: EvVar -> SDoc Source #

data Hole Source #

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 Source # pprPrec :: Rational -> Hole -> SDoc Source #

holeOcc :: Hole -> OccName Source #