haskell-debugger
Safe HaskellNone
LanguageGHC2021

GHC.Debugger.Runtime.Term.Key

Synopsis

Documentation

data TermKey where Source #

A TermKey serves to fetch a Term in a Debugger session. Note: A TermKey is only valid in the stopped context it was created in.

Constructors

FromId :: Id -> TermKey

Obtain a term from an Id.

FromPath :: TermKey -> PathFragment 'False -> TermKey

Append a PathFragment to the current Term Key. Used to construct keys for indexed and labeled fields.

FromCustomTerm :: TermKey -> String -> Term -> TermKey

Use a custom term, by custom name, along a TermKey path, rather than reconstructing one from the FromId root.

Instances

Instances details
Outputable TermKey Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Key

Methods

ppr :: TermKey -> SDoc #

data PathFragment (b :: Bool) where Source #

A term may be identified by an Id (such as a local variable) plus a list of PathFragments to an arbitrarily nested field.

Constructors

PositionalIndex :: forall (b :: Bool). Int -> PathFragment b

A positional index is an index from 1 to inf

LabeledField :: forall (b :: Bool). Int -> Name -> PathFragment b

A labeled field indexes a datacon fields by name The position is given by the Int The name is cosmetic.