ghc-debugger
Safe HaskellNone
LanguageHaskell2010

GHC.Debugger.Runtime.Term.Cache

Synopsis

Term Cache

type TermCache = TermKeyMap Term Source #

A term cache maps Names to Terms.

We use the term cache to avoid redundant computation forcing (unique) names we've already forced before.

A kind of trie map from TermKeys. The Map entry for no-path-fragments is the Term of the original Id.

lookupTermCache :: TermKey -> TermCache -> Maybe Term Source #

Lookup a TermKey in a TermCache. Returns Nothing for a cache miss and Just otherwise.

insertTermCache :: TermKey -> Term -> TermCache -> TermCache Source #

Inserts a Term for the given TermKey in the TermCache.

Overwrites existing values.

TermKeyMap

type TermKeyMap a = IdEnv (Map [PathFragment] a) Source #

Mapping from TermKey to a. Backs TermCache, but is more general.

insertTermKeyMap :: TermKey -> a -> TermKeyMap a -> TermKeyMap a Source #

Inserts a Term for the given TermKey in the TermKeyMap.

Overwrites existing values.