Get fresh unique number
Moduleghc-10.0.0.20260917GHC2024
GHC.StgToJS.Ids
Module to deal with JS identifiers
Synopsis
- value freshUnique
- value freshIdent
- value makeIdentForId
- value cachedIdentForId
- value identForId
- value identForIdN
- value identsForId
- value identForEntryId
- value identForDataConEntryId
- value identForDataConWorker
- value varForId
- value varForIdN
- value varsForId
- value varForEntryId
- value varForDataConEntryId
- value varForDataConWorker
- value declVarsForId
- Packageghc-10.0.0.20260917
- Exports17
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceIds.hs
Get fresh module-local Ident of the form: h$$unit:module_uniq
Generate unique Ident for the given ID (uncached!)
The ident has the following forms:
global Id: h$unit:module.name[_num][_type_suffix] local Id: h$$unit:module.name[_num][_type_suffix]_uniq
Note that the string is z-encoded except for "_" delimiters.
Optional "_type_suffix" can be: - "_e" for IdEntry - "_con_e" for IdConEntry
Optional "_num" is passed as an argument to this function. It is used for Haskell Ids that require several JS variables: e.g. 64-bit numbers (Word64#, Int64#), Addr#, StablePtr#, unboxed tuples, etc.
Retrieve the cached Ident for the given Id if there is one. Otherwise make a new one with makeIdentForId and cache it.
Helpers for Idents
Retrieve default Ident for the given Id
Retrieve default Ident for the given Id with sub index
Some types, Word64, Addr#, unboxed tuple have more than one corresponding JS var, hence we use the sub index to identify each subpart / JS variable.
Retrieve all the idents for the given Id.
Retrieve entry Ident for the given Id
Retrieve datacon entry Ident for the given Id
Different name than the datacon wrapper.
Retrieve datacon worker entry variable name for the given datacon
Helpers for variables
Retrieve default variable name for the given Id
Retrieve default variable name for the given Id with sub index
Retrieve all the JS vars for the given Id
Retrieve entry variable name for the given Id
Retrieve datacon entry variable name for the given Id
Retrieve datacon worker entry variable name for the given datacon
Declare all js vars for the id