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

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Moduleghc-lib-parser-9.14.1.20251220GHC2021

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, …
  • Enum AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • Eq AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • Data AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • Ord AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • Show AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • Generic AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • NFData AOpDefined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
  • type Rep AOp = D1 ('MetaData "AOp" "GHC.JS.JStg.Syntax" "ghc-lib-parser-9.14.1.20251220-2HxJziFvlvq9nNTVQhN5nL" 'False) (C1 ('MetaCons "AssignOp" 'PrefixI 'False) U1 :+: (C1 ('MetaCons "AddAssignOp" 'PrefixI 'False) U1 :+: C1 ('MetaCons "SubAssignOp" 'PrefixI 'False) U1))Defined in ghc-lib-parser-9.14.1.20251220 · GHC.JS.JStg.Syntax
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
  • Eq SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble
  • Fractional SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble
  • Num SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble
  • Ord SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble
  • Show SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble
  • Binary SaneDoubleDefined in ghc-lib-parser-9.14.1.20251220 · GHC.Types.SaneDouble