ghc-debugger
Safe HaskellNone
LanguageHaskell2010

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 -> TermKey

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

Instances

Instances details
Outputable TermKey Source # 
Instance details

Defined in GHC.Debugger.Runtime.Term.Key

Methods

ppr :: TermKey -> SDoc #

data PathFragment 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 Int

A positional index is an index from 1 to inf

LabeledField Name

A labeled field indexes a datacon fields by name

unconsTermKey :: TermKey -> (Id, [PathFragment]) Source #

>>> unconsTermKey (FromPath (FromPath (FromId hi) (Pos 1)) (Pos 2))
(hi, [1, 2])