ghc-lib-parser-9.14.1.20251220: 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 #

Constructors

CtLoc |
Fields 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 #

# CtLocEnv

data CtLocEnv #

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 #

setCtLocEnvLoc :: CtLocEnv -> SrcSpan -> CtLocEnv #

setCtLocRealLoc :: CtLocEnv -> RealSrcSpan -> CtLocEnv #

getCtLocEnvLvl :: CtLocEnv -> TcLevel #

setCtLocEnvLvl :: CtLocEnv -> TcLevel -> CtLocEnv #

ctLocEnvInGeneratedCode :: CtLocEnv -> Bool #

# SubGoalDepth

data SubGoalDepth #

See Note [SubGoalDepth]

#### Instances

Instances details

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

initialSubGoalDepth :: SubGoalDepth #

maxSubGoalDepth :: SubGoalDepth -> SubGoalDepth -> SubGoalDepth #

bumpSubGoalDepth :: SubGoalDepth -> SubGoalDepth #

subGoalDepthExceeded :: IntWithInf -> SubGoalDepth -> Bool #