HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

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

Contents
  1. Deeply embedded JS datatypes
  2. pattern synonyms over JS operators
  3. Utility
Synopsis

Deeply embedded JS datatypes

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

Utility

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