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-10.0.0.20260917GHC2024

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.

    In general, one should not use these constructors explicitly in the JS backend. Instead, prefer using the combinators in GHC.JS.Make, if those are suitable then prefer using the patterns exported from this module

  • 8 types
  • 2 values

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

4 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