HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

GHC.JS.Ident

  • Domain and Purpose

    GHC.JS.Ident defines identifiers for the JS backend. We keep this module separate to prevent coupling between GHC and the backend and between unrelated modules is the JS backend.

  • Consumers

    The entire JavaScript Backend consumes this module including modules in GHC.JS.* and modules in GHC.StgToJS.*

  • Additional Notes

    This module should be kept as small as possible. Anything added to it will be coupled to the JS backend EDSL and the JS Backend including the linker and rts. You have been warned.

  • 1 type
  • 1 value
newtypenewtype Ident
#

A newtype wrapper around FastString for JS identifiers.

Constructors

Instances8Eq, Show, Uniquable, Outputable, Binary, JVarMagic, …
  • Eq IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Ident
  • Show IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Ident
  • Uniquable IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Ident
  • Outputable IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Ident
  • Binary IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.StgToJS.Object · orphan
  • JVarMagic IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Make
  • ToJExpr IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Make
  • JsToDoc IdentDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.Ppr
valuename :: FastString -> Ident
#

To give a thing a name is to have power over it. This smart constructor serves two purposes: first, it isolates the JS backend from the rest of GHC. The backend should not explicitly use types provided by GHC but instead should wrap them such as we do here. Second it creates a symbol in the JS backend, but it does not yet give that symbols meaning. Giving the symbol meaning only occurs once it is used with a combinator from GHC.JS.Make.