HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.JS.JStg.Syntax

  • Domain and Purpose

    GHC.JS.JStg.Syntax defines the eDSL that the JS backend's runtime system is written in. Nothing fancy, its just a straightforward deeply embedded DSL.

  • 8 types
  • 1 value
  • Packageghc-9.10.3
  • Exports31
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceSyntax.hs

Deeply embedded JS datatypes

7 declarations
datadata JStgStat
#

JavaScript statements, see the ECMA262 Reference for details

Constructors

Instances7Eq, Generic, Semigroup, Monoid, ToStat, Rep, …
datadata JStgExpr
#

JavaScript Expressions

Constructors

Instances10Eq, Fractional, Num, Generic, Outputable, JVarMagic, …
datadata JVal
#

JavaScript values

Constructors

Instances5Eq, Generic, JVarMagic, ToJExpr, Rep
datadata Op
#

JS Binary Operators. We do not deeply embed the comma operator and the assignment operators

Constructors

Instances8Enum, Eq, Data, Ord, Show, Generic, …
datadata AOp
#

JS Unary Operators

Constructors

Instances8Enum, Eq, Data, Ord, Show, Generic, …
datadata UOp
#

JS Unary Operators

Constructors

Instances8Enum, Eq, Data, Ord, Show, Generic, …

pattern synonyms over JS operators

21 declarations
patternpattern Var :: Ident -> JStgExpr
#

pattern synonym to create a local variable reference

Utility

3 declarations
newtypenewtype SaneDouble
#

A newtype wrapper around Double to ensure we never generate a Double that becomes a NaN, see instances for details on sanity.

Instances6Eq, Fractional, Num, Ord, Show, Binary