HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.StgToJS.Ids

Module to deal with JS identifiers

  • 17 values
  • Packageghc-9.10.3
  • Exports17
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceIds.hs
valuefreshIdent :: G Ident
#

Get fresh module-local Ident of the form: h$$unit:module_uniq

valuemakeIdentForId :: Id -> Maybe Int -> IdType -> Module -> Ident
#

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.

Helpers for Idents

6 declarations
valueidentForIdN :: Id -> Int -> G Ident
#

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.

Helpers for variables

7 declarations