ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

NameCache

Description

The Name Cache

Synopsis

- lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name
- extendOrigNameCache :: OrigNameCache -> Name -> OrigNameCache
- extendNameCache :: OrigNameCache -> Module -> OccName -> Name -> OrigNameCache
- initNameCache :: UniqSupply -> [Name] -> NameCache
- data NameCache = NameCache {
  - nsUniqs :: !UniqSupply
  - nsNames :: !OrigNameCache
  }
- type OrigNameCache = ModuleEnv (OccEnv Name)

# Documentation

lookupOrigNameCache :: OrigNameCache -> Module -> OccName -> Maybe Name #

extendOrigNameCache :: OrigNameCache -> Name -> OrigNameCache #

extendNameCache :: OrigNameCache -> Module -> OccName -> Name -> OrigNameCache #

initNameCache :: UniqSupply -> [Name] -> NameCache #

Return a function to atomically update the name cache.

data NameCache #

The NameCache makes sure that there is just one Unique assigned for each original name; i.e. (module-name, occ-name) pair and provides something of a lookup mechanism for those names.

Constructors

NameCache |

Fields

- nsUniqs :: !UniqSupply

  Supply of uniques

- nsNames :: !OrigNameCache

  Ensures that one original name gets one unique

type OrigNameCache = ModuleEnv (OccEnv Name) #

Per-module cache of original `OccName`s given `Name`s