ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Tc.Types.CtLoc

Contents

- CtLoc
- CtLocEnv
- SubGoalDepth

Synopsis

- data CtLoc = CtLoc {
  - ctl_origin :: CtOrigin
  - ctl_env :: CtLocEnv
  - ctl_t_or_k :: Maybe TypeOrKind
  - ctl_depth :: !SubGoalDepth
  }
- ctLocSpan :: CtLoc -> RealSrcSpan
- ctLocEnv :: CtLoc -> CtLocEnv
- ctLocLevel :: CtLoc -> TcLevel
- ctLocOrigin :: CtLoc -> CtOrigin
- ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind
- toInvisibleLoc :: CtLoc -> CtLoc
- ctLocDepth :: CtLoc -> SubGoalDepth
- bumpCtLocDepth :: CtLoc -> CtLoc
- isGivenLoc :: CtLoc -> Bool
- mkGivenLoc :: TcLevel -> SkolemInfoAnon -> CtLocEnv -> CtLoc
- mkKindEqLoc :: TcType -> TcType -> CtLoc -> CtLoc
- setCtLocOrigin :: CtLoc -> CtOrigin -> CtLoc
- updateCtLocOrigin :: CtLoc -> (CtOrigin -> CtOrigin) -> CtLoc
- setCtLocEnv :: CtLoc -> CtLocEnv -> CtLoc
- setCtLocSpan :: CtLoc -> RealSrcSpan -> CtLoc
- pprCtLoc :: CtLoc -> SDoc
- adjustCtLoc :: Bool -> Bool -> CtLoc -> CtLoc
- adjustCtLocTyConBinder :: TyConBinder -> CtLoc -> CtLoc
- data CtLocEnv = CtLocEnv {
  - ctl_ctxt :: ![ErrCtxt]
  - ctl_loc :: !RealSrcSpan
  - ctl_bndrs :: !TcBinderStack
  - ctl_tclvl :: !TcLevel
  - ctl_in_gen_code :: !Bool
  - ctl_rdr :: !LocalRdrEnv
  }
- getCtLocEnvLoc :: CtLocEnv -> RealSrcSpan
- setCtLocEnvLoc :: CtLocEnv -> SrcSpan -> CtLocEnv
- setCtLocRealLoc :: CtLocEnv -> RealSrcSpan -> CtLocEnv
- getCtLocEnvLvl :: CtLocEnv -> TcLevel
- setCtLocEnvLvl :: CtLocEnv -> TcLevel -> CtLocEnv
- ctLocEnvInGeneratedCode :: CtLocEnv -> Bool
- data SubGoalDepth
- initialSubGoalDepth :: SubGoalDepth
- maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth
- bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth
- subGoalDepthExceeded :: IntWithInf -> SubGoalDepth -> Bool

# CtLoc

data CtLoc Source #

Constructors

CtLoc |

Fields

- ctl_origin :: CtOrigin
- ctl_env :: CtLocEnv
- ctl_t_or_k :: Maybe TypeOrKind
- ctl_depth :: !SubGoalDepth

ctLocSpan :: CtLoc -> RealSrcSpan Source #

ctLocEnv :: CtLoc -> CtLocEnv Source #

ctLocLevel :: CtLoc -> TcLevel Source #

ctLocOrigin :: CtLoc -> CtOrigin Source #

ctLocTypeOrKind_maybe :: CtLoc -> Maybe TypeOrKind Source #

toInvisibleLoc :: CtLoc -> CtLoc Source #

ctLocDepth :: CtLoc -> SubGoalDepth Source #

bumpCtLocDepth :: CtLoc -> CtLoc Source #

isGivenLoc :: CtLoc -> Bool Source #

mkGivenLoc :: TcLevel -> SkolemInfoAnon -> CtLocEnv -> CtLoc Source #

mkKindEqLoc :: TcType -> TcType -> CtLoc -> CtLoc Source #

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

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

setCtLocEnv :: CtLoc -> CtLocEnv -> CtLoc Source #

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

pprCtLoc :: CtLoc -> SDoc Source #

adjustCtLoc :: Bool -> Bool -> CtLoc -> CtLoc Source #

adjustCtLocTyConBinder :: TyConBinder -> CtLoc -> CtLoc Source #

# 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`.

Constructors

CtLocEnv |

Fields

- ctl_ctxt :: ![ErrCtxt]
- ctl_loc :: !RealSrcSpan
- ctl_bndrs :: !TcBinderStack
- ctl_tclvl :: !TcLevel
- ctl_in_gen_code :: !Bool
- ctl_rdr :: !LocalRdrEnv

getCtLocEnvLoc :: CtLocEnv -> RealSrcSpan Source #

setCtLocEnvLoc :: CtLocEnv -> SrcSpan -> CtLocEnv Source #

setCtLocRealLoc :: CtLocEnv -> RealSrcSpan -> CtLocEnv Source #

getCtLocEnvLvl :: CtLocEnv -> TcLevel Source #

setCtLocEnvLvl :: CtLocEnv -> TcLevel -> CtLocEnv Source #

ctLocEnvInGeneratedCode :: CtLocEnv -> Bool Source #

# SubGoalDepth

data SubGoalDepth Source #

See Note [SubGoalDepth]

#### Instances

Instances details

Outputable SubGoalDepth Source # |
Instance details Defined in GHC.Tc.Types.CtLoc Methods ppr :: SubGoalDepth -> SDoc Source #
Eq SubGoalDepth Source # |
Instance details Defined in GHC.Tc.Types.CtLoc Methods (==) :: SubGoalDepth -> SubGoalDepth -> Bool Source # (/=) :: SubGoalDepth -> SubGoalDepth -> Bool Source #
Ord SubGoalDepth Source # |

Instance details

Defined in GHC.Tc.Types.CtLoc

Methods

compare :: SubGoalDepth -> SubGoalDepth -> Ordering Source #

(<) :: SubGoalDepth -> SubGoalDepth -> Bool Source #

(<=) :: SubGoalDepth -> SubGoalDepth -> Bool Source #

(>) :: SubGoalDepth -> SubGoalDepth -> Bool Source #

(>=) :: SubGoalDepth -> SubGoalDepth -> Bool Source #

max :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth Source #

min :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth Source #

initialSubGoalDepth :: SubGoalDepth Source #

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

bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth Source #

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