ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.StgToJS.Symbols

Description

JS symbol generation

Synopsis

- moduleGlobalSymbol :: Module -> FastString
- moduleExportsSymbol :: Module -> FastString
- mkJsSymbol :: Bool -> Module -> FastString -> FastString
- mkJsSymbolBS :: Bool -> Module -> FastString -> ByteString
- mkFreshJsSymbol :: Module -> Int -> FastString
- mkRawSymbol :: Bool -> FastString -> FastString
- intBS :: Int -> ByteString

# Documentation

moduleGlobalSymbol :: Module -> FastString Source #

the global linkable unit of a module exports this symbol, depend on it to include that unit (used for cost centres)

moduleExportsSymbol :: Module -> FastString Source #

mkJsSymbol :: Bool -> Module -> FastString -> FastString Source #

Make JS symbol corresponding to the given Haskell symbol in the given module

mkJsSymbolBS :: Bool -> Module -> FastString -> ByteString Source #

Make JS symbol corresponding to the given Haskell symbol in the given module

mkFreshJsSymbol :: Module -> Int -> FastString Source #

Make JS symbol for given module and unique.

mkRawSymbol :: Bool -> FastString -> FastString Source #

Make symbol "h$XYZ" or "h$$XYZ"

intBS :: Int -> ByteString Source #

Hexadecimal representation of an int

Used for uniques. We could use base-62 as GHC usually does but this is likely faster.