diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,145 @@
 
 ---
 
+## [0.17.1] - unreleased
+
+Development version. Opens the 0.17.x line — the first release built entirely against
+published 0.17.0 hosts (Hackage / PyPI / Maven Central), with the `hostOverrides` shims
+that were needed while 0.16.1 lacked the effect type and I/O primitives removed.
+
+### New features
+
+- **Generated term-reference DSLs** ([#467](https://github.com/CategoricalData/hydra/issues/467)):
+  kernel *term* modules now project generated DSL surfaces, completing the story begun with
+  type-module DSLs and the generated primitive wrappers (`hydra.dsl.lib.*`, 0.17.0). A
+  signature read-back in the DSL pass reuses the main pass's inference, and a demand-curated
+  set of 19 kernel term modules (plus the json/test/extract modules) emits one typed,
+  rename-safe reference per definition into every target language — e.g. Haskell
+  `Hydra.Dsl.Strip.deannotateType`, Java `hydra.dsl.Strip.deannotateType(...)`, Python
+  `hydra.dsl.strip.deannotate_type(...)`. The Java and Python coder sources were pivoted onto
+  the generated references, retiring ~700 stringly-typed inline `var("hydra....")` references
+  and shrinking Python's hand registry to the non-generatable remainder (byte-identical
+  generated output before and after). Follow-ups:
+  [#555](https://github.com/CategoricalData/hydra/issues/555) (typed references to derived
+  encode/decode/show functions via `TypedName`),
+  [#556](https://github.com/CategoricalData/hydra/issues/556) (non-kernel packages).
+- **Package validation** ([#574](https://github.com/CategoricalData/hydra/issues/574),
+  [#575](https://github.com/CategoricalData/hydra/issues/575)): a translingual `hydra.validate.*`
+  framework carries per-package `ValidationProfile`s (error/warning rules, error/warning caps) and a
+  catalog of checks — undeclared-package-dependency detection (now a fatal gate, #574),
+  definition-name convention (PascalCase), definition ordering, documentation completeness, and
+  conflicting-variant-name detection — layered on the existing core term/type well-formedness rules.
+  A kernel-strict / others-relaxed policy keeps `/sync` green fleet-wide while the documentation
+  backlog drains. See the new [Validation](https://github.com/CategoricalData/hydra/wiki/Validation)
+  wiki page for the full per-package constraint specification.
+- **DSL-authoring registration guards** ([#554](https://github.com/CategoricalData/hydra/issues/554)):
+  fail-fast authoring-time validation for the host-native DSL sources — every DSL-authoring module in
+  Java/`hydra-jvm`, Python, and Scala now asserts its definitions are fully registered
+  (`Defs.checkComplete` / `check_complete`), backed by a Haskell kernel-source registration-completeness
+  scanner, so a definition added to a source file but omitted from its `definitions` list fails loudly
+  instead of silently vanishing from the generated output.
+- **`hydra-build` package** ([#546](https://github.com/CategoricalData/hydra/issues/546),
+  [#529](https://github.com/CategoricalData/hydra/issues/529),
+  [#530](https://github.com/CategoricalData/hydra/issues/530)): the build-orchestration logic that had
+  lived only in host scripts is now translingual Hydra. Pure module-list utilities became
+  `hydra.build.modules` (#529) and the orphan-reconcile decision became `hydra.build.reconcile` (#530),
+  each with a translingual test suite; the `hydra.build.*` modules were then extracted into a dedicated
+  `hydra-build` package (#546), separate from the kernel.
+- **Metadata sidecar + content/version-addressed freshness**
+  ([#415](https://github.com/CategoricalData/hydra/issues/415)): dist manifests now carry a
+  `moduleFormatVersion` field, and the generator's freshness basis is content/version-addressed — the
+  groundwork for reproducible, cache-correct incremental generation.
+- **Structured generation-provenance record**
+  ([#523](https://github.com/CategoricalData/hydra/issues/523)): each generation run now records a
+  structured `Generation` provenance entry (digest v2), replacing the ad-hoc shell threading of
+  generation metadata.
+- **Worker + issue hierarchy** ([#557](https://github.com/CategoricalData/hydra/issues/557)): a
+  principled agent/worker framework — roles and parentage mirroring the GitHub issue tree, a
+  cross-worktree message transport with a verify-after-copy protocol, a blocking-aware design-question
+  (`decisions/`) channel, an issue-proposal queue with the `/issues` command, an autonomy-dial banner,
+  and cross-machine staging coordination. Contributor-facing process only; no change to generated code.
+
+### API and usability
+
+- **DSL usability passes** ([#430](https://github.com/CategoricalData/hydra/issues/430),
+  [#553](https://github.com/CategoricalData/hydra/issues/553)): reviewed the host-native Java, Python,
+  and Scala DSL surfaces for ergonomics and cross-host parity (documented def shapes, added a Scala
+  projection helper), bringing the three authoring dialects into closer alignment.
+
+### Fixed
+
+Bug fixes landed this cycle, grouped by area (see each issue for detail):
+
+- **TypeScript** — reactivated `hydra.lib.*` primitive tests surfaced encoder gaps: lazy show-calling
+  let bindings and compact bare-string `LiteralType` expansion in the test converter
+  ([#564](https://github.com/CategoricalData/hydra/issues/564)),
+  `binaryToBytes` registration + base64 binary decode in `decodeUtf8`
+  ([#561](https://github.com/CategoricalData/hydra/issues/561)),
+  `hydra.test.build.*` emission after the #546 split
+  ([#570](https://github.com/CategoricalData/hydra/issues/570)), and `HYDRA_DEFAULT_IMPLS` support in
+  the test runner ([#536](https://github.com/CategoricalData/hydra/issues/536)).
+- **Tests and CI** — restored the default-primitive-implementation testing solution
+  ([#388](https://github.com/CategoricalData/hydra/issues/388),
+  [#549](https://github.com/CategoricalData/hydra/issues/549)), reactivated previously-ignored kernel
+  test cases ([#513](https://github.com/CategoricalData/hydra/issues/513),
+  [#550](https://github.com/CategoricalData/hydra/issues/550)), wired the regression harnesses into CI
+  and split them out of the monolithic Haskell job for timeout headroom
+  ([#535](https://github.com/CategoricalData/hydra/issues/535),
+  [#563](https://github.com/CategoricalData/hydra/issues/563)), added Scala/Go/Lisp
+  self-containment gates to `verify-distribution.sh`
+  ([#537](https://github.com/CategoricalData/hydra/issues/537)), a manifest-JSON-tracked CI check
+  ([#541](https://github.com/CategoricalData/hydra/issues/541)), a per-package test-digest freshness
+  fix ([#551](https://github.com/CategoricalData/hydra/issues/551)), overlay-file restoration in
+  `test-stale-output-prune.sh` ([#558](https://github.com/CategoricalData/hydra/issues/558)), and a
+  sync-freshness fingerprint that now sees host-native DSL sources
+  ([#562](https://github.com/CategoricalData/hydra/issues/562)).
+- **Kernel and coders** — Java binary-literal signed-byte emission
+  ([#528](https://github.com/CategoricalData/hydra/issues/528)), `hydra.json.Decode.fromJson`
+  parametric-type (Application/Forall) support
+  ([#531](https://github.com/CategoricalData/hydra/issues/531)), stale 2-param `Coder` shape in
+  Java/Scala test bootstrap ([#552](https://github.com/CategoricalData/hydra/issues/552)), and a
+  kernel dead-code/TODO cleanup ([#538](https://github.com/CategoricalData/hydra/issues/538)).
+- **Lib and build** — `hydra.lib.files` copy/removeDirectory/status overlays across all nine hosts
+  ([#525](https://github.com/CategoricalData/hydra/issues/525)), `hydra.build.*` regeneration into the
+  Lisp dialects ([#544](https://github.com/CategoricalData/hydra/issues/544)), Scheme maps
+  last-writer-wins in `union` ([#545](https://github.com/CategoricalData/hydra/issues/545)),
+  standalone-kernel SHA dependency ([#542](https://github.com/CategoricalData/hydra/issues/542)),
+  the lexicon's empty Types section ([#539](https://github.com/CategoricalData/hydra/issues/539)), and
+  a duplicated generated-file header in `generate-head-haskell-build.py`
+  ([#540](https://github.com/CategoricalData/hydra/issues/540)).
+
+- **TypeScript overlay-import rewrite** ([#565](https://github.com/CategoricalData/hydra/issues/565)):
+  the TypeScript coder's lib overlay-import rewrite no longer captures `hydra.lib.defaults`, which is a
+  generated (not overlaid) module; excluding it fixes spurious import references in generated TypeScript.
+
+- **Lexicon generation** (`bin/regenerate-lexicon.sh`): the generator had been failing
+  silently since the encoder/decoder modules moved to in-memory synthesis
+  ([#448](https://github.com/CategoricalData/hydra/issues/448)) — the script masked the
+  failure and left a stale `docs/hydra-lexicon.txt` missing the four effectful primitive
+  libraries (`hydra.lib.{effects,files,system,text}`). The synthesized coder modules are
+  now included in the lexicon universe, the script fails loudly, and the regenerated
+  lexicon covers all 267 primitives across 17 library modules.
+- **`bin/prepare-release.sh`**: the non-blocking Java quality check invoked Gradle
+  subprojects (`:hydra-rdf4j:test` etc.) that were removed in
+  [#511](https://github.com/CategoricalData/hydra/issues/511), so it always warned without
+  checking anything; it now runs the `dist/java/hydra-pg` package tests (the current home
+  of the former binding tests).
+- **`.gitignore`**: the ignore rules for the overlaid hand-written Haskell runtime still
+  named pre-[#501](https://github.com/CategoricalData/hydra/issues/501) paths, so 41
+  duplicate copies under `dist/haskell/` had become tracked; the rules now match the
+  `Hydra/Overlay/` location and the duplicates are untracked.
+
+### Documentation
+
+- Corrected the 0.17.0 Maven coordinates throughout (Java artifacts publish under group
+  `net.fortytwo.hydra.java`, Scala under `net.fortytwo.hydra.scala`,
+  [#519](https://github.com/CategoricalData/hydra/issues/519)); added the npm and Scala
+  release channels to the README; added TypeScript/Scala/Lisp sections to Getting started;
+  repointed stale pre-#418/#501 DSL paths in the architecture docs; added GitHub issue and
+  PR templates.
+
+---
+
 ## [0.17.0] - 2026-07-01
 
 Major themes: first-class support for effects and I/O in the kernel, TypeScript and
diff --git a/hydra-typescript.cabal b/hydra-typescript.cabal
--- a/hydra-typescript.cabal
+++ b/hydra-typescript.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.39.1.
+-- This file has been generated from package.yaml by hpack version 0.38.1.
 --
 -- see: https://github.com/sol/hpack
 
 name:           hydra-typescript
-version:        0.17.0
+version:        0.17.1
 synopsis:       Hydra's TypeScript coder: emit TypeScript source from Hydra modules
 description:    Hydra is an implementation of the LambdaGraph data model, which takes advantage of an isomorphism between labeled hypergraphs and typed lambda calculus: in Hydra, "graphs are programs, and programs are graphs". TypeScript support for Hydra
 category:       Data
@@ -28,6 +28,7 @@
 library
   exposed-modules:
       Hydra.Dsl.TypeScript.Syntax
+      Hydra.Overlay.Haskell.Dsl.TypeScript.Helpers
       Hydra.TypeScript.Coder
       Hydra.TypeScript.Language
       Hydra.TypeScript.Operators
@@ -40,6 +41,6 @@
   build-depends:
       base >=4.19.0 && <4.22
     , containers >=0.6.7 && <0.8
-    , hydra-kernel ==0.17.0
+    , hydra-kernel ==0.17.1
     , scientific >=0.3.7 && <0.4
   default-language: Haskell2010
diff --git a/src/main/haskell/Hydra/Dsl/TypeScript/Syntax.hs b/src/main/haskell/Hydra/Dsl/TypeScript/Syntax.hs
--- a/src/main/haskell/Hydra/Dsl/TypeScript/Syntax.hs
+++ b/src/main/haskell/Hydra/Dsl/TypeScript/Syntax.hs
@@ -12,6 +12,10 @@
 import qualified Data.Scientific as Sci
 import qualified Data.Int as I
 
+-- | DSL name token for hydra.typeScript.syntax.ArrayElement
+arrayElementArrayElement :: Typed.TypedName Syntax.ArrayElement
+arrayElementArrayElement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ArrayElement")
+
 -- | DSL injection for the expression variant of hydra.typeScript.syntax.ArrayElement
 arrayElementExpression :: Typed.TypedTerm Syntax.Expression -> Typed.TypedTerm Syntax.ArrayElement
 arrayElementExpression x =
@@ -46,6 +50,14 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.ArrayTypeExpression"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ArrayTypeExpression
+arrayTypeExpressionArrayTypeExpression :: Typed.TypedName Syntax.ArrayTypeExpression
+arrayTypeExpressionArrayTypeExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ArrayTypeExpression")
+
+-- | DSL name token for hydra.typeScript.syntax.ArrowFunctionBody
+arrowFunctionBodyArrowFunctionBody :: Typed.TypedName Syntax.ArrowFunctionBody
+arrowFunctionBodyArrowFunctionBody = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ArrowFunctionBody")
+
 -- | DSL injection for the block variant of hydra.typeScript.syntax.ArrowFunctionBody
 arrowFunctionBodyBlock :: Typed.TypedTerm Syntax.BlockStatement -> Typed.TypedTerm Syntax.ArrowFunctionBody
 arrowFunctionBodyBlock x =
@@ -80,6 +92,11 @@
           Core.fieldName = (Core.Name "async"),
           Core.fieldTerm = (Typed.unTypedTerm async)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ArrowFunctionExpression
+arrowFunctionExpressionArrowFunctionExpression :: Typed.TypedName Syntax.ArrowFunctionExpression
+arrowFunctionExpressionArrowFunctionExpression =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ArrowFunctionExpression")
+
 -- | DSL accessor for the async field of hydra.typeScript.syntax.ArrowFunctionExpression
 arrowFunctionExpressionAsync :: Typed.TypedTerm Syntax.ArrowFunctionExpression -> Typed.TypedTerm Bool
 arrowFunctionExpressionAsync x =
@@ -192,6 +209,10 @@
           Core.fieldName = (Core.Name "type"),
           Core.fieldTerm = (Typed.unTypedTerm type_)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.AsExpression
+asExpressionAsExpression :: Typed.TypedName Syntax.AsExpression
+asExpressionAsExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.AsExpression")
+
 -- | DSL accessor for the expression field of hydra.typeScript.syntax.AsExpression
 asExpressionExpression :: Typed.TypedTerm Syntax.AsExpression -> Typed.TypedTerm Syntax.Expression
 asExpressionExpression x =
@@ -260,6 +281,10 @@
           Core.fieldName = (Core.Name "right"),
           Core.fieldTerm = (Typed.unTypedTerm right)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.AssignmentExpression
+assignmentExpressionAssignmentExpression :: Typed.TypedName Syntax.AssignmentExpression
+assignmentExpressionAssignmentExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.AssignmentExpression")
+
 -- | DSL accessor for the left field of hydra.typeScript.syntax.AssignmentExpression
 assignmentExpressionLeft :: Typed.TypedTerm Syntax.AssignmentExpression -> Typed.TypedTerm Syntax.Pattern
 assignmentExpressionLeft x =
@@ -386,6 +411,10 @@
         Core.fieldName = (Core.Name "assign"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.AssignmentOperator
+assignmentOperatorAssignmentOperator :: Typed.TypedName Syntax.AssignmentOperator
+assignmentOperatorAssignmentOperator = Typed.TypedName (Core.Name "hydra.typeScript.syntax.AssignmentOperator")
+
 -- | DSL injection for the bitwiseAndAssign variant of hydra.typeScript.syntax.AssignmentOperator
 assignmentOperatorBitwiseAndAssign :: Typed.TypedTerm Syntax.AssignmentOperator
 assignmentOperatorBitwiseAndAssign =
@@ -516,6 +545,10 @@
           Core.fieldName = (Core.Name "right"),
           Core.fieldTerm = (Typed.unTypedTerm right)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.AssignmentPattern
+assignmentPatternAssignmentPattern :: Typed.TypedName Syntax.AssignmentPattern
+assignmentPatternAssignmentPattern = Typed.TypedName (Core.Name "hydra.typeScript.syntax.AssignmentPattern")
+
 -- | DSL accessor for the left field of hydra.typeScript.syntax.AssignmentPattern
 assignmentPatternLeft :: Typed.TypedTerm Syntax.AssignmentPattern -> Typed.TypedTerm Syntax.Pattern
 assignmentPatternLeft x =
@@ -584,6 +617,10 @@
           Core.fieldName = (Core.Name "right"),
           Core.fieldTerm = (Typed.unTypedTerm right)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.BinaryExpression
+binaryExpressionBinaryExpression :: Typed.TypedName Syntax.BinaryExpression
+binaryExpressionBinaryExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.BinaryExpression")
+
 -- | DSL accessor for the left field of hydra.typeScript.syntax.BinaryExpression
 binaryExpressionLeft :: Typed.TypedTerm Syntax.BinaryExpression -> Typed.TypedTerm Syntax.Expression
 binaryExpressionLeft x =
@@ -701,6 +738,10 @@
         Core.fieldName = (Core.Name "and"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.BinaryOperator
+binaryOperatorBinaryOperator :: Typed.TypedName Syntax.BinaryOperator
+binaryOperatorBinaryOperator = Typed.TypedName (Core.Name "hydra.typeScript.syntax.BinaryOperator")
+
 -- | DSL injection for the bitwiseAnd variant of hydra.typeScript.syntax.BinaryOperator
 binaryOperatorBitwiseAnd :: Typed.TypedTerm Syntax.BinaryOperator
 binaryOperatorBitwiseAnd =
@@ -933,6 +974,10 @@
         Core.projectionFieldName = (Core.Name "arguments")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.CallExpression
+callExpressionCallExpression :: Typed.TypedName Syntax.CallExpression
+callExpressionCallExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.CallExpression")
+
 -- | DSL accessor for the callee field of hydra.typeScript.syntax.CallExpression
 callExpressionCallee :: Typed.TypedTerm Syntax.CallExpression -> Typed.TypedTerm Syntax.Expression
 callExpressionCallee x =
@@ -1045,6 +1090,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.CatchClause
+catchClauseCatchClause :: Typed.TypedName Syntax.CatchClause
+catchClauseCatchClause = Typed.TypedName (Core.Name "hydra.typeScript.syntax.CatchClause")
+
 -- | DSL accessor for the param field of hydra.typeScript.syntax.CatchClause
 catchClauseParam :: Typed.TypedTerm Syntax.CatchClause -> Typed.TypedTerm (Maybe Syntax.Pattern)
 catchClauseParam x =
@@ -1113,6 +1162,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ClassDeclaration
+classDeclarationClassDeclaration :: Typed.TypedName Syntax.ClassDeclaration
+classDeclarationClassDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ClassDeclaration")
+
 -- | DSL accessor for the id field of hydra.typeScript.syntax.ClassDeclaration
 classDeclarationId :: Typed.TypedTerm Syntax.ClassDeclaration -> Typed.TypedTerm Syntax.Identifier
 classDeclarationId x =
@@ -1177,6 +1230,11 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ClassDeclarationWithComments
+classDeclarationWithCommentsClassDeclarationWithComments :: Typed.TypedName Syntax.ClassDeclarationWithComments
+classDeclarationWithCommentsClassDeclarationWithComments =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ClassDeclarationWithComments")
+
 -- | DSL accessor for the comments field of hydra.typeScript.syntax.ClassDeclarationWithComments
 classDeclarationWithCommentsComments :: Typed.TypedTerm Syntax.ClassDeclarationWithComments -> Typed.TypedTerm (Maybe Syntax.DocumentationComment)
 classDeclarationWithCommentsComments x =
@@ -1277,6 +1335,10 @@
         Core.fieldName = (Core.Name "block"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Comment
+commentComment :: Typed.TypedName Syntax.Comment
+commentComment = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Comment")
+
 -- | DSL injection for the documentation variant of hydra.typeScript.syntax.Comment
 commentDocumentation :: Typed.TypedTerm Syntax.DocumentationComment -> Typed.TypedTerm Syntax.Comment
 commentDocumentation x =
@@ -1320,6 +1382,10 @@
         Core.projectionFieldName = (Core.Name "alternate")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ConditionalExpression
+conditionalExpressionConditionalExpression :: Typed.TypedName Syntax.ConditionalExpression
+conditionalExpressionConditionalExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ConditionalExpression")
+
 -- | DSL accessor for the consequent field of hydra.typeScript.syntax.ConditionalExpression
 conditionalExpressionConsequent :: Typed.TypedTerm Syntax.ConditionalExpression -> Typed.TypedTerm Syntax.Expression
 conditionalExpressionConsequent x =
@@ -1432,6 +1498,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.DoWhileStatement
+doWhileStatementDoWhileStatement :: Typed.TypedName Syntax.DoWhileStatement
+doWhileStatementDoWhileStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.DoWhileStatement")
+
 -- | DSL accessor for the test field of hydra.typeScript.syntax.DoWhileStatement
 doWhileStatementTest :: Typed.TypedTerm Syntax.DoWhileStatement -> Typed.TypedTerm Syntax.Expression
 doWhileStatementTest x =
@@ -1497,6 +1567,10 @@
         Core.projectionFieldName = (Core.Name "description")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.DocumentationComment
+documentationCommentDocumentationComment :: Typed.TypedName Syntax.DocumentationComment
+documentationCommentDocumentationComment = Typed.TypedName (Core.Name "hydra.typeScript.syntax.DocumentationComment")
+
 -- | DSL accessor for the tags field of hydra.typeScript.syntax.DocumentationComment
 documentationCommentTags :: Typed.TypedTerm Syntax.DocumentationComment -> Typed.TypedTerm [Syntax.DocumentationTag]
 documentationCommentTags x =
@@ -1568,6 +1642,10 @@
         Core.projectionFieldName = (Core.Name "description")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.DocumentationTag
+documentationTagDocumentationTag :: Typed.TypedName Syntax.DocumentationTag
+documentationTagDocumentationTag = Typed.TypedName (Core.Name "hydra.typeScript.syntax.DocumentationTag")
+
 -- | DSL accessor for the name field of hydra.typeScript.syntax.DocumentationTag
 documentationTagName :: Typed.TypedTerm Syntax.DocumentationTag -> Typed.TypedTerm String
 documentationTagName x =
@@ -1732,6 +1810,10 @@
           Core.fieldName = (Core.Name "source"),
           Core.fieldTerm = (Typed.unTypedTerm source)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ExportAllDeclaration
+exportAllDeclarationExportAllDeclaration :: Typed.TypedName Syntax.ExportAllDeclaration
+exportAllDeclarationExportAllDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ExportAllDeclaration")
+
 -- | DSL accessor for the exported field of hydra.typeScript.syntax.ExportAllDeclaration
 exportAllDeclarationExported :: Typed.TypedTerm Syntax.ExportAllDeclaration -> Typed.TypedTerm (Maybe Syntax.Identifier)
 exportAllDeclarationExported x =
@@ -1811,6 +1893,10 @@
         Core.fieldName = (Core.Name "default"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.ExportDeclaration
+exportDeclarationExportDeclaration :: Typed.TypedName Syntax.ExportDeclaration
+exportDeclarationExportDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ExportDeclaration")
+
 -- | DSL injection for the named variant of hydra.typeScript.syntax.ExportDeclaration
 exportDeclarationNamed :: Typed.TypedTerm Syntax.NamedExport -> Typed.TypedTerm Syntax.ExportDeclaration
 exportDeclarationNamed x =
@@ -1833,6 +1919,10 @@
           Core.fieldName = (Core.Name "exported"),
           Core.fieldTerm = (Typed.unTypedTerm exported)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ExportSpecifier
+exportSpecifierExportSpecifier :: Typed.TypedName Syntax.ExportSpecifier
+exportSpecifierExportSpecifier = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ExportSpecifier")
+
 -- | DSL accessor for the exported field of hydra.typeScript.syntax.ExportSpecifier
 exportSpecifierExported :: Typed.TypedTerm Syntax.ExportSpecifier -> Typed.TypedTerm Syntax.Identifier
 exportSpecifierExported x =
@@ -1957,6 +2047,10 @@
         Core.fieldName = (Core.Name "conditional"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Expression
+expressionExpression :: Typed.TypedName Syntax.Expression
+expressionExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Expression")
+
 -- | DSL injection for the function variant of hydra.typeScript.syntax.Expression
 expressionFunction :: Typed.TypedTerm Syntax.FunctionExpression -> Typed.TypedTerm Syntax.Expression
 expressionFunction x =
@@ -2065,6 +2159,10 @@
         Core.fieldName = (Core.Name "yield"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.ForInLeft
+forInLeftForInLeft :: Typed.TypedName Syntax.ForInLeft
+forInLeftForInLeft = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ForInLeft")
+
 -- | DSL injection for the pattern variant of hydra.typeScript.syntax.ForInLeft
 forInLeftPattern :: Typed.TypedTerm Syntax.Pattern -> Typed.TypedTerm Syntax.ForInLeft
 forInLeftPattern x =
@@ -2108,6 +2206,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ForInStatement
+forInStatementForInStatement :: Typed.TypedName Syntax.ForInStatement
+forInStatementForInStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ForInStatement")
+
 -- | DSL accessor for the left field of hydra.typeScript.syntax.ForInStatement
 forInStatementLeft :: Typed.TypedTerm Syntax.ForInStatement -> Typed.TypedTerm Syntax.ForInLeft
 forInStatementLeft x =
@@ -2207,6 +2309,10 @@
         Core.fieldName = (Core.Name "expression"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.ForInit
+forInitForInit :: Typed.TypedName Syntax.ForInit
+forInitForInit = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ForInit")
+
 -- | DSL injection for the variable variant of hydra.typeScript.syntax.ForInit
 forInitVariable :: Typed.TypedTerm Syntax.VariableDeclaration -> Typed.TypedTerm Syntax.ForInit
 forInitVariable x =
@@ -2253,6 +2359,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ForOfStatement
+forOfStatementForOfStatement :: Typed.TypedName Syntax.ForOfStatement
+forOfStatementForOfStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ForOfStatement")
+
 -- | DSL accessor for the left field of hydra.typeScript.syntax.ForOfStatement
 forOfStatementLeft :: Typed.TypedTerm Syntax.ForOfStatement -> Typed.TypedTerm Syntax.ForInLeft
 forOfStatementLeft x =
@@ -2423,6 +2533,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ForStatement
+forStatementForStatement :: Typed.TypedName Syntax.ForStatement
+forStatementForStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ForStatement")
+
 -- | DSL accessor for the init field of hydra.typeScript.syntax.ForStatement
 forStatementInit :: Typed.TypedTerm Syntax.ForStatement -> Typed.TypedTerm (Maybe Syntax.ForInit)
 forStatementInit x =
@@ -2614,6 +2728,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.FunctionDeclaration
+functionDeclarationFunctionDeclaration :: Typed.TypedName Syntax.FunctionDeclaration
+functionDeclarationFunctionDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.FunctionDeclaration")
+
 -- | DSL accessor for the generator field of hydra.typeScript.syntax.FunctionDeclaration
 functionDeclarationGenerator :: Typed.TypedTerm Syntax.FunctionDeclaration -> Typed.TypedTerm Bool
 functionDeclarationGenerator x =
@@ -2748,6 +2866,11 @@
         Core.projectionFieldName = (Core.Name "comments")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.FunctionDeclarationWithComments
+functionDeclarationWithCommentsFunctionDeclarationWithComments :: Typed.TypedName Syntax.FunctionDeclarationWithComments
+functionDeclarationWithCommentsFunctionDeclarationWithComments =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.FunctionDeclarationWithComments")
+
 -- | DSL updater for the body field of hydra.typeScript.syntax.FunctionDeclarationWithComments
 functionDeclarationWithCommentsWithBody :: Typed.TypedTerm Syntax.FunctionDeclarationWithComments -> Typed.TypedTerm Syntax.FunctionDeclaration -> Typed.TypedTerm Syntax.FunctionDeclarationWithComments
 functionDeclarationWithCommentsWithBody original newVal =
@@ -2936,6 +3059,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.FunctionExpression
+functionExpressionFunctionExpression :: Typed.TypedName Syntax.FunctionExpression
+functionExpressionFunctionExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.FunctionExpression")
+
 -- | DSL accessor for the generator field of hydra.typeScript.syntax.FunctionExpression
 functionExpressionGenerator :: Typed.TypedTerm Syntax.FunctionExpression -> Typed.TypedTerm Bool
 functionExpressionGenerator x =
@@ -3169,6 +3296,11 @@
           Core.fieldName = (Core.Name "returnType"),
           Core.fieldTerm = (Typed.unTypedTerm returnType)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.FunctionTypeExpression
+functionTypeExpressionFunctionTypeExpression :: Typed.TypedName Syntax.FunctionTypeExpression
+functionTypeExpressionFunctionTypeExpression =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.FunctionTypeExpression")
+
 -- | DSL accessor for the parameters field of hydra.typeScript.syntax.FunctionTypeExpression
 functionTypeExpressionParameters :: Typed.TypedTerm Syntax.FunctionTypeExpression -> Typed.TypedTerm [Syntax.TypeExpression]
 functionTypeExpressionParameters x =
@@ -3275,6 +3407,10 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.Identifier"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.Identifier
+identifierIdentifier :: Typed.TypedName Syntax.Identifier
+identifierIdentifier = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Identifier")
+
 -- | DSL constructor for hydra.typeScript.syntax.IfStatement
 ifStatement :: Typed.TypedTerm Syntax.Expression -> Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm (Maybe Syntax.Statement) -> Typed.TypedTerm Syntax.IfStatement
 ifStatement test consequent alternate =
@@ -3309,6 +3445,10 @@
         Core.projectionFieldName = (Core.Name "consequent")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.IfStatement
+ifStatementIfStatement :: Typed.TypedName Syntax.IfStatement
+ifStatementIfStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.IfStatement")
+
 -- | DSL accessor for the test field of hydra.typeScript.syntax.IfStatement
 ifStatementTest :: Typed.TypedTerm Syntax.IfStatement -> Typed.TypedTerm Syntax.Expression
 ifStatementTest x =
@@ -3399,6 +3539,10 @@
         Core.fieldName = (Core.Name "default"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.ImportClause
+importClauseImportClause :: Typed.TypedName Syntax.ImportClause
+importClauseImportClause = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ImportClause")
+
 -- | DSL injection for the named variant of hydra.typeScript.syntax.ImportClause
 importClauseNamed :: Typed.TypedTerm Syntax.ImportSpecifier -> Typed.TypedTerm Syntax.ImportClause
 importClauseNamed x =
@@ -3430,6 +3574,10 @@
           Core.fieldName = (Core.Name "source"),
           Core.fieldTerm = (Typed.unTypedTerm source)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ImportDeclaration
+importDeclarationImportDeclaration :: Typed.TypedName Syntax.ImportDeclaration
+importDeclarationImportDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ImportDeclaration")
+
 -- | DSL accessor for the source field of hydra.typeScript.syntax.ImportDeclaration
 importDeclarationSource :: Typed.TypedTerm Syntax.ImportDeclaration -> Typed.TypedTerm Syntax.StringLiteral
 importDeclarationSource x =
@@ -3489,6 +3637,11 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.ImportDefaultSpecifier"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ImportDefaultSpecifier
+importDefaultSpecifierImportDefaultSpecifier :: Typed.TypedName Syntax.ImportDefaultSpecifier
+importDefaultSpecifierImportDefaultSpecifier =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ImportDefaultSpecifier")
+
 -- | DSL constructor for the hydra.typeScript.syntax.ImportNamespaceSpecifier wrapper
 importNamespaceSpecifier :: Typed.TypedTerm Syntax.Identifier -> Typed.TypedTerm Syntax.ImportNamespaceSpecifier
 importNamespaceSpecifier x =
@@ -3496,6 +3649,11 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.ImportNamespaceSpecifier"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ImportNamespaceSpecifier
+importNamespaceSpecifierImportNamespaceSpecifier :: Typed.TypedName Syntax.ImportNamespaceSpecifier
+importNamespaceSpecifierImportNamespaceSpecifier =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ImportNamespaceSpecifier")
+
 -- | DSL constructor for hydra.typeScript.syntax.ImportSpecifier
 importSpecifier :: Typed.TypedTerm Syntax.Identifier -> Typed.TypedTerm Syntax.Identifier -> Typed.TypedTerm Syntax.ImportSpecifier
 importSpecifier imported local =
@@ -3509,6 +3667,10 @@
           Core.fieldName = (Core.Name "local"),
           Core.fieldTerm = (Typed.unTypedTerm local)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ImportSpecifier
+importSpecifierImportSpecifier :: Typed.TypedName Syntax.ImportSpecifier
+importSpecifierImportSpecifier = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ImportSpecifier")
+
 -- | DSL accessor for the imported field of hydra.typeScript.syntax.ImportSpecifier
 importSpecifierImported :: Typed.TypedTerm Syntax.ImportSpecifier -> Typed.TypedTerm Syntax.Identifier
 importSpecifierImported x =
@@ -3589,6 +3751,10 @@
         Core.projectionFieldName = (Core.Name "extends")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.InterfaceDeclaration
+interfaceDeclarationInterfaceDeclaration :: Typed.TypedName Syntax.InterfaceDeclaration
+interfaceDeclarationInterfaceDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.InterfaceDeclaration")
+
 -- | DSL accessor for the members field of hydra.typeScript.syntax.InterfaceDeclaration
 interfaceDeclarationMembers :: Typed.TypedTerm Syntax.InterfaceDeclaration -> Typed.TypedTerm [Syntax.PropertySignature]
 interfaceDeclarationMembers x =
@@ -3771,6 +3937,10 @@
         Core.projectionFieldName = (Core.Name "label")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.LabeledStatement
+labeledStatementLabeledStatement :: Typed.TypedName Syntax.LabeledStatement
+labeledStatementLabeledStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.LabeledStatement")
+
 -- | DSL updater for the body field of hydra.typeScript.syntax.LabeledStatement
 labeledStatementWithBody :: Typed.TypedTerm Syntax.LabeledStatement -> Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm Syntax.LabeledStatement
 labeledStatementWithBody original newVal =
@@ -3823,6 +3993,10 @@
         Core.fieldName = (Core.Name "boolean"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Literal
+literalLiteral :: Typed.TypedName Syntax.Literal
+literalLiteral = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Literal")
+
 -- | DSL injection for the null variant of hydra.typeScript.syntax.Literal
 literalNull :: Typed.TypedTerm Syntax.Literal
 literalNull =
@@ -3896,6 +4070,10 @@
         Core.projectionFieldName = (Core.Name "computed")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.MemberExpression
+memberExpressionMemberExpression :: Typed.TypedName Syntax.MemberExpression
+memberExpressionMemberExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.MemberExpression")
+
 -- | DSL accessor for the object field of hydra.typeScript.syntax.MemberExpression
 memberExpressionObject :: Typed.TypedTerm Syntax.MemberExpression -> Typed.TypedTerm Syntax.Expression
 memberExpressionObject x =
@@ -4096,6 +4274,10 @@
         Core.projectionFieldName = (Core.Name "kind")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.MethodDefinition
+methodDefinitionMethodDefinition :: Typed.TypedName Syntax.MethodDefinition
+methodDefinitionMethodDefinition = Typed.TypedName (Core.Name "hydra.typeScript.syntax.MethodDefinition")
+
 -- | DSL accessor for the static field of hydra.typeScript.syntax.MethodDefinition
 methodDefinitionStatic :: Typed.TypedTerm Syntax.MethodDefinition -> Typed.TypedTerm Bool
 methodDefinitionStatic x =
@@ -4331,6 +4513,10 @@
         Core.fieldName = (Core.Name "method"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.MethodKind
+methodKindMethodKind :: Typed.TypedName Syntax.MethodKind
+methodKindMethodKind = Typed.TypedName (Core.Name "hydra.typeScript.syntax.MethodKind")
+
 -- | DSL injection for the set variant of hydra.typeScript.syntax.MethodKind
 methodKindSet :: Typed.TypedTerm Syntax.MethodKind
 methodKindSet =
@@ -4367,6 +4553,10 @@
         Core.fieldName = (Core.Name "interface"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.ModuleItem
+moduleItemModuleItem :: Typed.TypedName Syntax.ModuleItem
+moduleItemModuleItem = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ModuleItem")
+
 -- | DSL injection for the statement variant of hydra.typeScript.syntax.ModuleItem
 moduleItemStatement :: Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm Syntax.ModuleItem
 moduleItemStatement x =
@@ -4416,6 +4606,11 @@
         Core.projectionFieldName = (Core.Name "comments")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ModuleItemWithComments
+moduleItemWithCommentsModuleItemWithComments :: Typed.TypedName Syntax.ModuleItemWithComments
+moduleItemWithCommentsModuleItemWithComments =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ModuleItemWithComments")
+
 -- | DSL updater for the body field of hydra.typeScript.syntax.ModuleItemWithComments
 moduleItemWithCommentsWithBody :: Typed.TypedTerm Syntax.ModuleItemWithComments -> Typed.TypedTerm Syntax.ModuleItem -> Typed.TypedTerm Syntax.ModuleItemWithComments
 moduleItemWithCommentsWithBody original newVal =
@@ -4463,6 +4658,10 @@
           Core.fieldName = (Core.Name "source"),
           Core.fieldTerm = (Typed.unTypedTerm source)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.NamedExport
+namedExportNamedExport :: Typed.TypedName Syntax.NamedExport
+namedExportNamedExport = Typed.TypedName (Core.Name "hydra.typeScript.syntax.NamedExport")
+
 -- | DSL accessor for the source field of hydra.typeScript.syntax.NamedExport
 namedExportSource :: Typed.TypedTerm Syntax.NamedExport -> Typed.TypedTerm (Maybe Syntax.StringLiteral)
 namedExportSource x =
@@ -4533,6 +4732,10 @@
         Core.fieldName = (Core.Name "integer"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.NumericLiteral
+numericLiteralNumericLiteral :: Typed.TypedName Syntax.NumericLiteral
+numericLiteralNumericLiteral = Typed.TypedName (Core.Name "hydra.typeScript.syntax.NumericLiteral")
+
 -- | DSL constructor for hydra.typeScript.syntax.ObjectPattern
 objectPattern :: Typed.TypedTerm [Syntax.ObjectPatternProperty] -> Typed.TypedTerm Syntax.ObjectPattern
 objectPattern properties =
@@ -4543,6 +4746,10 @@
           Core.fieldName = (Core.Name "properties"),
           Core.fieldTerm = (Typed.unTypedTerm properties)}]}))
 
+-- | DSL name token for hydra.typeScript.syntax.ObjectPattern
+objectPatternObjectPattern :: Typed.TypedName Syntax.ObjectPattern
+objectPatternObjectPattern = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ObjectPattern")
+
 -- | DSL accessor for the properties field of hydra.typeScript.syntax.ObjectPattern
 objectPatternProperties :: Typed.TypedTerm Syntax.ObjectPattern -> Typed.TypedTerm [Syntax.ObjectPatternProperty]
 objectPatternProperties x =
@@ -4552,6 +4759,10 @@
         Core.projectionFieldName = (Core.Name "properties")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ObjectPatternProperty
+objectPatternPropertyObjectPatternProperty :: Typed.TypedName Syntax.ObjectPatternProperty
+objectPatternPropertyObjectPatternProperty = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ObjectPatternProperty")
+
 -- | DSL injection for the property variant of hydra.typeScript.syntax.ObjectPatternProperty
 objectPatternPropertyProperty :: Typed.TypedTerm Syntax.Property -> Typed.TypedTerm Syntax.ObjectPatternProperty
 objectPatternPropertyProperty x =
@@ -4611,6 +4822,11 @@
         Core.projectionFieldName = (Core.Name "base")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ParameterizedTypeExpression
+parameterizedTypeExpressionParameterizedTypeExpression :: Typed.TypedName Syntax.ParameterizedTypeExpression
+parameterizedTypeExpressionParameterizedTypeExpression =
+    Typed.TypedName (Core.Name "hydra.typeScript.syntax.ParameterizedTypeExpression")
+
 -- | DSL updater for the arguments field of hydra.typeScript.syntax.ParameterizedTypeExpression
 parameterizedTypeExpressionWithArguments :: Typed.TypedTerm Syntax.ParameterizedTypeExpression -> Typed.TypedTerm [Syntax.TypeExpression] -> Typed.TypedTerm Syntax.ParameterizedTypeExpression
 parameterizedTypeExpressionWithArguments original newVal =
@@ -4681,6 +4897,10 @@
         Core.fieldName = (Core.Name "object"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Pattern
+patternPattern :: Typed.TypedName Syntax.Pattern
+patternPattern = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Pattern")
+
 -- | DSL injection for the rest variant of hydra.typeScript.syntax.Pattern
 patternRest :: Typed.TypedTerm Syntax.RestElement -> Typed.TypedTerm Syntax.Pattern
 patternRest x =
@@ -4721,6 +4941,10 @@
         Core.projectionFieldName = (Core.Name "body")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.Program
+programProgram :: Typed.TypedName Syntax.Program
+programProgram = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Program")
+
 -- | DSL accessor for the sourceType field of hydra.typeScript.syntax.Program
 programSourceType :: Typed.TypedTerm Syntax.Program -> Typed.TypedTerm Syntax.SourceType
 programSourceType x =
@@ -4831,6 +5055,10 @@
         Core.fieldName = (Core.Name "init"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.PropertyKind
+propertyKindPropertyKind :: Typed.TypedName Syntax.PropertyKind
+propertyKindPropertyKind = Typed.TypedName (Core.Name "hydra.typeScript.syntax.PropertyKind")
+
 -- | DSL injection for the set variant of hydra.typeScript.syntax.PropertyKind
 propertyKindSet :: Typed.TypedTerm Syntax.PropertyKind
 propertyKindSet =
@@ -4840,6 +5068,10 @@
         Core.fieldName = (Core.Name "set"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Property
+propertyProperty :: Typed.TypedName Syntax.Property
+propertyProperty = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Property")
+
 -- | DSL accessor for the shorthand field of hydra.typeScript.syntax.Property
 propertyShorthand :: Typed.TypedTerm Syntax.Property -> Typed.TypedTerm Bool
 propertyShorthand x =
@@ -4898,6 +5130,10 @@
         Core.projectionFieldName = (Core.Name "optional")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.PropertySignature
+propertySignaturePropertySignature :: Typed.TypedName Syntax.PropertySignature
+propertySignaturePropertySignature = Typed.TypedName (Core.Name "hydra.typeScript.syntax.PropertySignature")
+
 -- | DSL accessor for the readonly field of hydra.typeScript.syntax.PropertySignature
 propertySignatureReadonly :: Typed.TypedTerm Syntax.PropertySignature -> Typed.TypedTerm Bool
 propertySignatureReadonly x =
@@ -5312,6 +5548,10 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.RestElement"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.RestElement
+restElementRestElement :: Typed.TypedName Syntax.RestElement
+restElementRestElement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.RestElement")
+
 -- | DSL injection for the module variant of hydra.typeScript.syntax.SourceType
 sourceTypeModule :: Typed.TypedTerm Syntax.SourceType
 sourceTypeModule =
@@ -5330,6 +5570,10 @@
         Core.fieldName = (Core.Name "script"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.SourceType
+sourceTypeSourceType :: Typed.TypedName Syntax.SourceType
+sourceTypeSourceType = Typed.TypedName (Core.Name "hydra.typeScript.syntax.SourceType")
+
 -- | DSL constructor for the hydra.typeScript.syntax.SpreadElement wrapper
 spreadElement :: Typed.TypedTerm Syntax.Expression -> Typed.TypedTerm Syntax.SpreadElement
 spreadElement x =
@@ -5337,6 +5581,10 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.SpreadElement"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.SpreadElement
+spreadElementSpreadElement :: Typed.TypedName Syntax.SpreadElement
+spreadElementSpreadElement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.SpreadElement")
+
 -- | DSL injection for the block variant of hydra.typeScript.syntax.Statement
 statementBlock :: Typed.TypedTerm Syntax.BlockStatement -> Typed.TypedTerm Syntax.Statement
 statementBlock x =
@@ -5472,6 +5720,10 @@
         Core.fieldName = (Core.Name "return"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.Statement
+statementStatement :: Typed.TypedName Syntax.Statement
+statementStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.Statement")
+
 -- | DSL injection for the switch variant of hydra.typeScript.syntax.Statement
 statementSwitch :: Typed.TypedTerm Syntax.SwitchStatement -> Typed.TypedTerm Syntax.Statement
 statementSwitch x =
@@ -5548,6 +5800,10 @@
         Core.projectionFieldName = (Core.Name "comments")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.StatementWithComments
+statementWithCommentsStatementWithComments :: Typed.TypedName Syntax.StatementWithComments
+statementWithCommentsStatementWithComments = Typed.TypedName (Core.Name "hydra.typeScript.syntax.StatementWithComments")
+
 -- | DSL updater for the body field of hydra.typeScript.syntax.StatementWithComments
 statementWithCommentsWithBody :: Typed.TypedTerm Syntax.StatementWithComments -> Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm Syntax.StatementWithComments
 statementWithCommentsWithBody original newVal =
@@ -5604,6 +5860,10 @@
         Core.projectionFieldName = (Core.Name "singleQuote")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.StringLiteral
+stringLiteralStringLiteral :: Typed.TypedName Syntax.StringLiteral
+stringLiteralStringLiteral = Typed.TypedName (Core.Name "hydra.typeScript.syntax.StringLiteral")
+
 -- | DSL accessor for the value field of hydra.typeScript.syntax.StringLiteral
 stringLiteralValue :: Typed.TypedTerm Syntax.StringLiteral -> Typed.TypedTerm String
 stringLiteralValue x =
@@ -5669,6 +5929,10 @@
         Core.projectionFieldName = (Core.Name "consequent")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.SwitchCase
+switchCaseSwitchCase :: Typed.TypedName Syntax.SwitchCase
+switchCaseSwitchCase = Typed.TypedName (Core.Name "hydra.typeScript.syntax.SwitchCase")
+
 -- | DSL accessor for the test field of hydra.typeScript.syntax.SwitchCase
 switchCaseTest :: Typed.TypedTerm Syntax.SwitchCase -> Typed.TypedTerm (Maybe Syntax.Expression)
 switchCaseTest x =
@@ -5743,6 +6007,10 @@
         Core.projectionFieldName = (Core.Name "discriminant")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.SwitchStatement
+switchStatementSwitchStatement :: Typed.TypedName Syntax.SwitchStatement
+switchStatementSwitchStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.SwitchStatement")
+
 -- | DSL updater for the cases field of hydra.typeScript.syntax.SwitchStatement
 switchStatementWithCases :: Typed.TypedTerm Syntax.SwitchStatement -> Typed.TypedTerm [Syntax.SwitchCase] -> Typed.TypedTerm Syntax.SwitchStatement
 switchStatementWithCases original newVal =
@@ -5799,6 +6067,10 @@
         Core.projectionFieldName = (Core.Name "tail")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TemplateElement
+templateElementTemplateElement :: Typed.TypedName Syntax.TemplateElement
+templateElementTemplateElement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TemplateElement")
+
 -- | DSL accessor for the value field of hydra.typeScript.syntax.TemplateElement
 templateElementValue :: Typed.TypedTerm Syntax.TemplateElement -> Typed.TypedTerm String
 templateElementValue x =
@@ -5873,6 +6145,10 @@
         Core.projectionFieldName = (Core.Name "quasis")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TemplateLiteral
+templateLiteralTemplateLiteral :: Typed.TypedName Syntax.TemplateLiteral
+templateLiteralTemplateLiteral = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TemplateLiteral")
+
 -- | DSL updater for the expressions field of hydra.typeScript.syntax.TemplateLiteral
 templateLiteralWithExpressions :: Typed.TypedTerm Syntax.TemplateLiteral -> Typed.TypedTerm [Syntax.Expression] -> Typed.TypedTerm Syntax.TemplateLiteral
 templateLiteralWithExpressions original newVal =
@@ -5914,6 +6190,10 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.ThrowStatement"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.ThrowStatement
+throwStatementThrowStatement :: Typed.TypedName Syntax.ThrowStatement
+throwStatementThrowStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.ThrowStatement")
+
 -- | DSL constructor for hydra.typeScript.syntax.TryStatement
 tryStatement :: Typed.TypedTerm Syntax.BlockStatement -> Typed.TypedTerm (Maybe Syntax.CatchClause) -> Typed.TypedTerm (Maybe Syntax.BlockStatement) -> Typed.TypedTerm Syntax.TryStatement
 tryStatement block handler finalizer =
@@ -5957,6 +6237,10 @@
         Core.projectionFieldName = (Core.Name "handler")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TryStatement
+tryStatementTryStatement :: Typed.TypedName Syntax.TryStatement
+tryStatementTryStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TryStatement")
+
 -- | DSL updater for the block field of hydra.typeScript.syntax.TryStatement
 tryStatementWithBlock :: Typed.TypedTerm Syntax.TryStatement -> Typed.TypedTerm Syntax.BlockStatement -> Typed.TypedTerm Syntax.TryStatement
 tryStatementWithBlock original newVal =
@@ -6063,6 +6347,10 @@
         Core.projectionFieldName = (Core.Name "type")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TypeAliasDeclaration
+typeAliasDeclarationTypeAliasDeclaration :: Typed.TypedName Syntax.TypeAliasDeclaration
+typeAliasDeclarationTypeAliasDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TypeAliasDeclaration")
+
 -- | DSL accessor for the typeParameters field of hydra.typeScript.syntax.TypeAliasDeclaration
 typeAliasDeclarationTypeParameters :: Typed.TypedTerm Syntax.TypeAliasDeclaration -> Typed.TypedTerm [Syntax.TypeParameter]
 typeAliasDeclarationTypeParameters x =
@@ -6151,6 +6439,10 @@
       Core.wrappedTermTypeName = (Core.Name "hydra.typeScript.syntax.TypeAnnotation"),
       Core.wrappedTermBody = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TypeAnnotation
+typeAnnotationTypeAnnotation :: Typed.TypedName Syntax.TypeAnnotation
+typeAnnotationTypeAnnotation = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TypeAnnotation")
+
 -- | DSL injection for the any variant of hydra.typeScript.syntax.TypeExpression
 typeExpressionAny :: Typed.TypedTerm Syntax.TypeExpression
 typeExpressionAny =
@@ -6259,6 +6551,10 @@
         Core.fieldName = (Core.Name "tuple"),
         Core.fieldTerm = (Typed.unTypedTerm x)}}))
 
+-- | DSL name token for hydra.typeScript.syntax.TypeExpression
+typeExpressionTypeExpression :: Typed.TypedName Syntax.TypeExpression
+typeExpressionTypeExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TypeExpression")
+
 -- | DSL injection for the union variant of hydra.typeScript.syntax.TypeExpression
 typeExpressionUnion :: Typed.TypedTerm Syntax.UnionTypeExpression -> Typed.TypedTerm Syntax.TypeExpression
 typeExpressionUnion x =
@@ -6329,6 +6625,10 @@
         Core.projectionFieldName = (Core.Name "name")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TypeParameter
+typeParameterTypeParameter :: Typed.TypedName Syntax.TypeParameter
+typeParameterTypeParameter = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TypeParameter")
+
 -- | DSL updater for the constraint field of hydra.typeScript.syntax.TypeParameter
 typeParameterWithConstraint :: Typed.TypedTerm Syntax.TypeParameter -> Typed.TypedTerm (Maybe Syntax.TypeExpression) -> Typed.TypedTerm Syntax.TypeParameter
 typeParameterWithConstraint original newVal =
@@ -6432,6 +6732,10 @@
         Core.projectionFieldName = (Core.Name "type")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.TypedPattern
+typedPatternTypedPattern :: Typed.TypedName Syntax.TypedPattern
+typedPatternTypedPattern = Typed.TypedName (Core.Name "hydra.typeScript.syntax.TypedPattern")
+
 -- | DSL updater for the pattern field of hydra.typeScript.syntax.TypedPattern
 typedPatternWithPattern :: Typed.TypedTerm Syntax.TypedPattern -> Typed.TypedTerm Syntax.Pattern -> Typed.TypedTerm Syntax.TypedPattern
 typedPatternWithPattern original newVal =
@@ -6565,6 +6869,10 @@
         Core.projectionFieldName = (Core.Name "prefix")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.UnaryExpression
+unaryExpressionUnaryExpression :: Typed.TypedName Syntax.UnaryExpression
+unaryExpressionUnaryExpression = Typed.TypedName (Core.Name "hydra.typeScript.syntax.UnaryExpression")
+
 -- | DSL updater for the argument field of hydra.typeScript.syntax.UnaryExpression
 unaryExpressionWithArgument :: Typed.TypedTerm Syntax.UnaryExpression -> Typed.TypedTerm Syntax.Expression -> Typed.TypedTerm Syntax.UnaryExpression
 unaryExpressionWithArgument original newVal =
@@ -6709,6 +7017,10 @@
         Core.fieldName = (Core.Name "typeof"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.UnaryOperator
+unaryOperatorUnaryOperator :: Typed.TypedName Syntax.UnaryOperator
+unaryOperatorUnaryOperator = Typed.TypedName (Core.Name "hydra.typeScript.syntax.UnaryOperator")
+
 -- | DSL injection for the void variant of hydra.typeScript.syntax.UnaryOperator
 unaryOperatorVoid :: Typed.TypedTerm Syntax.UnaryOperator
 unaryOperatorVoid =
@@ -6749,6 +7061,10 @@
         Core.projectionFieldName = (Core.Name "kind")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.VariableDeclaration
+variableDeclarationVariableDeclaration :: Typed.TypedName Syntax.VariableDeclaration
+variableDeclarationVariableDeclaration = Typed.TypedName (Core.Name "hydra.typeScript.syntax.VariableDeclaration")
+
 -- | DSL updater for the declarations field of hydra.typeScript.syntax.VariableDeclaration
 variableDeclarationWithDeclarations :: Typed.TypedTerm Syntax.VariableDeclaration -> Typed.TypedTerm [Syntax.VariableDeclarator] -> Typed.TypedTerm Syntax.VariableDeclaration
 variableDeclarationWithDeclarations original newVal =
@@ -6814,6 +7130,10 @@
         Core.projectionFieldName = (Core.Name "init")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
 
+-- | DSL name token for hydra.typeScript.syntax.VariableDeclarator
+variableDeclaratorVariableDeclarator :: Typed.TypedName Syntax.VariableDeclarator
+variableDeclaratorVariableDeclarator = Typed.TypedName (Core.Name "hydra.typeScript.syntax.VariableDeclarator")
+
 -- | DSL updater for the id field of hydra.typeScript.syntax.VariableDeclarator
 variableDeclaratorWithId :: Typed.TypedTerm Syntax.VariableDeclarator -> Typed.TypedTerm Syntax.Pattern -> Typed.TypedTerm Syntax.VariableDeclarator
 variableDeclaratorWithId original newVal =
@@ -6875,6 +7195,10 @@
         Core.fieldName = (Core.Name "var"),
         Core.fieldTerm = Core.TermUnit}}))
 
+-- | DSL name token for hydra.typeScript.syntax.VariableKind
+variableKindVariableKind :: Typed.TypedName Syntax.VariableKind
+variableKindVariableKind = Typed.TypedName (Core.Name "hydra.typeScript.syntax.VariableKind")
+
 -- | DSL constructor for hydra.typeScript.syntax.WhileStatement
 whileStatement :: Typed.TypedTerm Syntax.Expression -> Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm Syntax.WhileStatement
 whileStatement test body =
@@ -6905,6 +7229,10 @@
         Core.projectionTypeName = (Core.Name "hydra.typeScript.syntax.WhileStatement"),
         Core.projectionFieldName = (Core.Name "test")})),
       Core.applicationArgument = (Typed.unTypedTerm x)}))
+
+-- | DSL name token for hydra.typeScript.syntax.WhileStatement
+whileStatementWhileStatement :: Typed.TypedName Syntax.WhileStatement
+whileStatementWhileStatement = Typed.TypedName (Core.Name "hydra.typeScript.syntax.WhileStatement")
 
 -- | DSL updater for the body field of hydra.typeScript.syntax.WhileStatement
 whileStatementWithBody :: Typed.TypedTerm Syntax.WhileStatement -> Typed.TypedTerm Syntax.Statement -> Typed.TypedTerm Syntax.WhileStatement
diff --git a/src/main/haskell/Hydra/Overlay/Haskell/Dsl/TypeScript/Helpers.hs b/src/main/haskell/Hydra/Overlay/Haskell/Dsl/TypeScript/Helpers.hs
new file mode 100644
--- /dev/null
+++ b/src/main/haskell/Hydra/Overlay/Haskell/Dsl/TypeScript/Helpers.hs
@@ -0,0 +1,623 @@
+-- | A DSL for constructing TypeScript syntax trees in Haskell.
+module Hydra.Overlay.Haskell.Dsl.TypeScript.Helpers where
+
+import Hydra.TypeScript.Syntax
+import qualified Data.Int as I
+
+
+-- * Identifiers
+
+-- | Create an identifier
+-- Example: ident "foo"
+ident :: String -> Identifier
+ident = Identifier
+
+-- | Create a qualified name from a list of strings
+-- Example: qualifiedName ["module", "submodule", "name"]
+qualifiedName :: [String] -> QualifiedName
+qualifiedName = fmap Identifier
+
+
+-- * Literals
+
+-- | Create a string literal with double quotes
+-- Example: stringLit "hello"
+stringLit :: String -> Literal
+stringLit s = LiteralString $ StringLiteral s False
+
+-- | Create a string literal with single quotes
+-- Example: stringLitSingle "hello"
+stringLitSingle :: String -> Literal
+stringLitSingle s = LiteralString $ StringLiteral s True
+
+-- | Create an integer literal
+-- Example: intLit 42
+intLit :: I.Int64 -> Literal
+intLit = LiteralNumber . NumericLiteralInteger
+
+-- | Create a floating-point literal
+-- Example: floatLit 3.14
+floatLit :: Double -> Literal
+floatLit = LiteralNumber . NumericLiteralFloat
+
+-- | Create a boolean literal
+-- Example: boolLit True
+boolLit :: Bool -> Literal
+boolLit = LiteralBoolean
+
+-- | The null literal
+nullLit :: Literal
+nullLit = LiteralNull
+
+-- | The undefined literal
+undefinedLit :: Literal
+undefinedLit = LiteralUndefined
+
+-- | Create a BigInt literal
+-- Example: bigIntLit 123
+bigIntLit :: Integer -> Literal
+bigIntLit = LiteralBigInt
+
+
+-- * Expressions
+
+-- | Create an identifier expression
+-- Example: identExpr "foo"
+identExpr :: String -> Expression
+identExpr = ExpressionIdentifier . ident
+
+-- | Create a literal expression
+-- Example: litExpr (stringLit "hello")
+litExpr :: Literal -> Expression
+litExpr = ExpressionLiteral
+
+-- | Create a string expression
+-- Example: stringExpr "hello"
+stringExpr :: String -> Expression
+stringExpr = litExpr . stringLit
+
+-- | Create an integer expression
+-- Example: intExpr 42
+intExpr :: I.Int64 -> Expression
+intExpr = litExpr . intLit
+
+-- | Create a floating-point expression
+-- Example: floatExpr 3.14
+floatExpr :: Double -> Expression
+floatExpr = litExpr . floatLit
+
+-- | Create a boolean expression
+-- Example: boolExpr True
+boolExpr :: Bool -> Expression
+boolExpr = litExpr . boolLit
+
+-- | The null expression
+nullExpr :: Expression
+nullExpr = litExpr nullLit
+
+-- | The undefined expression
+undefinedExpr :: Expression
+undefinedExpr = litExpr undefinedLit
+
+-- | Create an array expression
+-- Example: arrayExpr [intExpr 1, intExpr 2, intExpr 3]
+arrayExpr :: [Expression] -> Expression
+arrayExpr = ExpressionArray . fmap ArrayElementExpression
+
+-- | Create an object expression from key-value pairs
+-- Example: objectExpr [("name", stringExpr "John"), ("age", intExpr 30)]
+objectExpr :: [(String, Expression)] -> Expression
+objectExpr pairs = ExpressionObject $ fmap toProperty pairs
+  where
+    toProperty (k, v) = Property (identExpr k) v PropertyKindInit False False
+
+-- | Create a function call expression
+-- Example: callExpr (identExpr "foo") [intExpr 1, intExpr 2]
+callExpr :: Expression -> [Expression] -> Expression
+callExpr callee args = ExpressionCall $ CallExpression callee args False
+
+-- | Create an optional chaining call expression
+-- Example: optionalCallExpr (identExpr "foo") [intExpr 1]
+optionalCallExpr :: Expression -> [Expression] -> Expression
+optionalCallExpr callee args = ExpressionCall $ CallExpression callee args True
+
+-- | Create a member access expression (obj.prop)
+-- Example: memberExpr (identExpr "obj") "prop"
+memberExpr :: Expression -> String -> Expression
+memberExpr obj prop = ExpressionMember $ MemberExpression obj (identExpr prop) False False
+
+-- | Create a computed member access expression (obj[expr])
+-- Example: computedMemberExpr (identExpr "arr") (intExpr 0)
+computedMemberExpr :: Expression -> Expression -> Expression
+computedMemberExpr obj prop = ExpressionMember $ MemberExpression obj prop True False
+
+-- | Create an optional chaining member expression (obj?.prop)
+-- Example: optionalMemberExpr (identExpr "obj") "prop"
+optionalMemberExpr :: Expression -> String -> Expression
+optionalMemberExpr obj prop = ExpressionMember $ MemberExpression obj (identExpr prop) False True
+
+-- | Create a conditional (ternary) expression
+-- Example: condExpr (identExpr "x") (intExpr 1) (intExpr 0)
+condExpr :: Expression -> Expression -> Expression -> Expression
+condExpr test consequent alternate = ExpressionConditional $
+  ConditionalExpression test consequent alternate
+
+-- | Create a binary expression
+-- Example: binaryExpr BinaryOperatorAdd (intExpr 1) (intExpr 2)
+binaryExpr :: BinaryOperator -> Expression -> Expression -> Expression
+binaryExpr op left right = ExpressionBinary $ BinaryExpression op left right
+
+-- | Create an addition expression
+-- Example: addExpr (intExpr 1) (intExpr 2)
+addExpr :: Expression -> Expression -> Expression
+addExpr = binaryExpr BinaryOperatorAdd
+
+-- | Create a subtraction expression
+-- Example: subExpr (intExpr 5) (intExpr 3)
+subExpr :: Expression -> Expression -> Expression
+subExpr = binaryExpr BinaryOperatorSubtract
+
+-- | Create a multiplication expression
+-- Example: mulExpr (intExpr 3) (intExpr 4)
+mulExpr :: Expression -> Expression -> Expression
+mulExpr = binaryExpr BinaryOperatorMultiply
+
+-- | Create a division expression
+-- Example: divExpr (intExpr 10) (intExpr 2)
+divExpr :: Expression -> Expression -> Expression
+divExpr = binaryExpr BinaryOperatorDivide
+
+-- | Create a strict equality expression (===)
+-- Example: eqExpr (identExpr "x") (intExpr 1)
+eqExpr :: Expression -> Expression -> Expression
+eqExpr = binaryExpr BinaryOperatorStrictEqual
+
+-- | Create a strict inequality expression (!==)
+-- Example: neqExpr (identExpr "x") (intExpr 1)
+neqExpr :: Expression -> Expression -> Expression
+neqExpr = binaryExpr BinaryOperatorStrictNotEqual
+
+-- | Create a logical AND expression
+-- Example: andExpr (identExpr "a") (identExpr "b")
+andExpr :: Expression -> Expression -> Expression
+andExpr = binaryExpr BinaryOperatorAnd
+
+-- | Create a logical OR expression
+-- Example: orExpr (identExpr "a") (identExpr "b")
+orExpr :: Expression -> Expression -> Expression
+orExpr = binaryExpr BinaryOperatorOr
+
+-- | Create a unary expression
+-- Example: unaryExpr UnaryOperatorNot (identExpr "x")
+unaryExpr :: UnaryOperator -> Expression -> Expression
+unaryExpr op arg = ExpressionUnary $ UnaryExpression op arg True
+
+-- | Create a logical NOT expression
+-- Example: notExpr (identExpr "x")
+notExpr :: Expression -> Expression
+notExpr = unaryExpr UnaryOperatorNot
+
+-- | Create a negation expression
+-- Example: negateExpr (identExpr "x")
+negateExpr :: Expression -> Expression
+negateExpr = unaryExpr UnaryOperatorNegate
+
+-- | Create an assignment expression
+-- Example: assignExpr (identPattern "x") (intExpr 42)
+assignExpr :: Pattern -> Expression -> Expression
+assignExpr left right = ExpressionAssignment $
+  AssignmentExpression AssignmentOperatorAssign left right
+
+-- | The 'this' expression
+thisExpr :: Expression
+thisExpr = ExpressionThis
+
+-- | Create a 'new' expression
+-- Example: newExpr (identExpr "Date") []
+newExpr :: Expression -> [Expression] -> Expression
+newExpr callee args = ExpressionNew $ CallExpression callee args False
+
+-- | Create an await expression
+-- Example: awaitExpr (callExpr (identExpr "fetch") [stringExpr "url"])
+awaitExpr :: Expression -> Expression
+awaitExpr = ExpressionAwait
+
+-- | Create a yield expression
+-- Example: yieldExpr (Just (intExpr 1))
+yieldExpr :: Maybe Expression -> Expression
+yieldExpr = ExpressionYield
+
+-- | Create a spread expression
+-- Example: spreadExpr (identExpr "arr")
+spreadExpr :: Expression -> Expression
+spreadExpr = ExpressionSpread . SpreadElement
+
+-- | Create a parenthesized expression
+-- Example: parenExpr (addExpr (intExpr 1) (intExpr 2))
+parenExpr :: Expression -> Expression
+parenExpr = ExpressionParenthesized
+
+
+-- * Arrow Functions
+
+-- | Create an arrow function with an expression body
+-- Example: arrowExpr ["x", "y"] (addExpr (identExpr "x") (identExpr "y"))
+arrowExpr :: [String] -> Expression -> Expression
+arrowExpr params body = ExpressionArrow $ ArrowFunctionExpression
+  (fmap identPattern params)
+  (ArrowFunctionBodyExpression body)
+  False
+
+-- | Create an async arrow function with an expression body
+-- Example: asyncArrowExpr ["x"] (awaitExpr (callExpr (identExpr "fetch") [identExpr "x"]))
+asyncArrowExpr :: [String] -> Expression -> Expression
+asyncArrowExpr params body = ExpressionArrow $ ArrowFunctionExpression
+  (fmap identPattern params)
+  (ArrowFunctionBodyExpression body)
+  True
+
+-- | Create an arrow function with a block body
+-- Example: arrowBlockExpr ["x"] [returnStmt (Just (identExpr "x"))]
+arrowBlockExpr :: [String] -> [Statement] -> Expression
+arrowBlockExpr params body = ExpressionArrow $ ArrowFunctionExpression
+  (fmap identPattern params)
+  (ArrowFunctionBodyBlock body)
+  False
+
+
+-- * Patterns
+
+-- | Create an identifier pattern
+-- Example: identPattern "x"
+identPattern :: String -> Pattern
+identPattern = PatternIdentifier . ident
+
+-- | Create an object destructuring pattern
+-- Example: objectPattern [identPattern "a", identPattern "b"]
+objectPattern :: [Pattern] -> Pattern
+objectPattern ps = PatternObject $ ObjectPattern $ fmap toProperty ps
+  where
+    toProperty p = case p of
+      PatternIdentifier i -> ObjectPatternPropertyProperty $
+        Property (ExpressionIdentifier i) (ExpressionIdentifier i) PropertyKindInit False True
+      _ -> ObjectPatternPropertyProperty $
+        Property nullExpr (patternToExpr p) PropertyKindInit False False
+    patternToExpr (PatternIdentifier i) = ExpressionIdentifier i
+    patternToExpr _ = nullExpr
+
+-- | Create an array destructuring pattern
+-- Example: arrayPattern [Just (identPattern "a"), Nothing, Just (identPattern "b")]
+arrayPattern :: [Maybe Pattern] -> Pattern
+arrayPattern = PatternArray
+
+-- | Create a rest pattern
+-- Example: restPattern "args"
+restPattern :: String -> Pattern
+restPattern = PatternRest . RestElement . identPattern
+
+-- | Create a pattern with a default value
+-- Example: defaultPattern "x" (intExpr 0)
+defaultPattern :: String -> Expression -> Pattern
+defaultPattern name def = PatternAssignment $
+  AssignmentPattern (identPattern name) def
+
+
+-- * Statements
+
+-- | Create an expression statement
+-- Example: exprStmt (callExpr (identExpr "console.log") [stringExpr "hello"])
+exprStmt :: Expression -> Statement
+exprStmt = StatementExpression
+
+-- | Create a block statement
+-- Example: blockStmt [exprStmt (intExpr 1), exprStmt (intExpr 2)]
+blockStmt :: [Statement] -> Statement
+blockStmt = StatementBlock
+
+-- | Create a return statement
+-- Example: returnStmt (Just (intExpr 42))
+returnStmt :: Maybe Expression -> Statement
+returnStmt = StatementReturn
+
+-- | Create a throw statement
+-- Example: throwStmt (newExpr (identExpr "Error") [stringExpr "oops"])
+throwStmt :: Expression -> Statement
+throwStmt = StatementThrow . ThrowStatement
+
+-- | Create a break statement
+-- Example: breakStmt Nothing
+breakStmt :: Maybe String -> Statement
+breakStmt = StatementBreak . fmap ident
+
+-- | Create a continue statement
+-- Example: continueStmt Nothing
+continueStmt :: Maybe String -> Statement
+continueStmt = StatementContinue . fmap ident
+
+-- | Create an if statement
+-- Example: ifStmt (identExpr "x") (returnStmt (Just (intExpr 1))) Nothing
+ifStmt :: Expression -> Statement -> Maybe Statement -> Statement
+ifStmt test consequent alternate = StatementIf $ IfStatement test consequent alternate
+
+-- | Create a while statement
+-- Example: whileStmt (boolExpr True) (blockStmt [breakStmt Nothing])
+whileStmt :: Expression -> Statement -> Statement
+whileStmt test body = StatementWhile $ WhileStatement test body
+
+-- | Create a for statement
+-- Example: forStmt (Just (ForInitVariable (constDecl "i" (intExpr 0)))) (Just (binaryExpr BinaryOperatorLessThan (identExpr "i") (intExpr 10))) (Just (unaryExpr UnaryOperatorIncrement (identExpr "i"))) (blockStmt [])
+forStmt :: Maybe ForInit -> Maybe Expression -> Maybe Expression -> Statement -> Statement
+forStmt init test update body = StatementFor $ ForStatement init test update body
+
+-- | Create a for-of statement
+-- Example: forOfStmt False (ForInLeftVariable (constDecl "item" Nothing)) (identExpr "items") (blockStmt [])
+forOfStmt :: Bool -> ForInLeft -> Expression -> Statement -> Statement
+forOfStmt await left right body = StatementForOf $ ForOfStatement await left right body
+
+-- | Create a try statement
+-- Example: tryStmt [exprStmt (callExpr (identExpr "riskyOp") [])] (Just (catchClause (Just (identPattern "e")) [throwStmt (identExpr "e")])) Nothing
+tryStmt :: [Statement] -> Maybe CatchClause -> Maybe [Statement] -> Statement
+tryStmt block handler finalizer = StatementTry $ TryStatement block handler finalizer
+
+-- | Create a catch clause
+-- Example: catchClause (Just (identPattern "e")) [throwStmt (identExpr "e")]
+catchClause :: Maybe Pattern -> [Statement] -> CatchClause
+catchClause = CatchClause
+
+-- | Create a switch statement
+-- Example: switchStmt (identExpr "x") [switchCase (Just (intExpr 1)) [returnStmt (Just (stringExpr "one"))], switchCase Nothing [returnStmt (Just (stringExpr "default"))]]
+switchStmt :: Expression -> [SwitchCase] -> Statement
+switchStmt discriminant cases = StatementSwitch $ SwitchStatement discriminant cases
+
+-- | Create a switch case
+-- Example: switchCase (Just (intExpr 1)) [returnStmt (Just (stringExpr "one"))]
+switchCase :: Maybe Expression -> [Statement] -> SwitchCase
+switchCase = SwitchCase
+
+-- | An empty statement
+emptyStmt :: Statement
+emptyStmt = StatementEmpty
+
+-- | A debugger statement
+debuggerStmt :: Statement
+debuggerStmt = StatementDebugger
+
+
+-- * Variable Declarations
+
+-- | Create a const declaration
+-- Example: constDecl "x" (Just (intExpr 42))
+constDecl :: String -> Maybe Expression -> VariableDeclaration
+constDecl name init = VariableDeclaration VariableKindConst
+  [VariableDeclarator (identPattern name) init]
+
+-- | Create a let declaration
+-- Example: letDecl "x" (Just (intExpr 42))
+letDecl :: String -> Maybe Expression -> VariableDeclaration
+letDecl name init = VariableDeclaration VariableKindLet
+  [VariableDeclarator (identPattern name) init]
+
+-- | Create a var declaration
+-- Example: varDecl "x" (Just (intExpr 42))
+varDecl :: String -> Maybe Expression -> VariableDeclaration
+varDecl name init = VariableDeclaration VariableKindVar
+  [VariableDeclarator (identPattern name) init]
+
+-- | Create a variable declaration statement
+-- Example: varDeclStmt (constDecl "x" (Just (intExpr 42)))
+varDeclStmt :: VariableDeclaration -> Statement
+varDeclStmt = StatementVariableDeclaration
+
+
+-- * Function Declarations
+
+-- | Create a function declaration
+-- Example: funcDecl "add" ["x", "y"] [returnStmt (Just (addExpr (identExpr "x") (identExpr "y")))]
+funcDecl :: String -> [String] -> [Statement] -> FunctionDeclaration
+funcDecl name params body = FunctionDeclaration
+  (ident name)
+  (fmap identPattern params)
+  body
+  False
+  False
+
+-- | Create an async function declaration
+-- Example: asyncFuncDecl "fetchData" ["url"] [returnStmt (Just (awaitExpr (callExpr (identExpr "fetch") [identExpr "url"])))]
+asyncFuncDecl :: String -> [String] -> [Statement] -> FunctionDeclaration
+asyncFuncDecl name params body = FunctionDeclaration
+  (ident name)
+  (fmap identPattern params)
+  body
+  True
+  False
+
+-- | Create a function declaration statement
+-- Example: funcDeclStmt (funcDecl "add" ["x", "y"] [returnStmt (Just (addExpr (identExpr "x") (identExpr "y")))])
+funcDeclStmt :: FunctionDeclaration -> Statement
+funcDeclStmt = StatementFunctionDeclaration
+
+
+-- * Class Declarations
+
+-- | Create a class declaration
+-- Example: classDecl "Person" Nothing [methodDef "greet" [] [returnStmt (Just (stringExpr "hello"))]]
+classDecl :: String -> Maybe Expression -> [MethodDefinition] -> ClassDeclaration
+classDecl name superClass body = ClassDeclaration (ident name) superClass body
+
+-- | Create a method definition
+-- Example: methodDef "greet" [] [returnStmt (Just (stringExpr "hello"))]
+methodDef :: String -> [String] -> [Statement] -> MethodDefinition
+methodDef name params body = MethodDefinition
+  (identExpr name)
+  (FunctionExpression Nothing (fmap identPattern params) body False False)
+  MethodKindMethod
+  False
+  False
+
+-- | Create a constructor definition
+-- Example: constructorDef ["name"] [exprStmt (assignExpr (PatternIdentifier (ident "this.name")) (identExpr "name"))]
+constructorDef :: [String] -> [Statement] -> MethodDefinition
+constructorDef params body = MethodDefinition
+  (identExpr "constructor")
+  (FunctionExpression Nothing (fmap identPattern params) body False False)
+  MethodKindConstructor
+  False
+  False
+
+-- | Create a static method definition
+-- Example: staticMethodDef "create" [] [returnStmt (Just (newExpr (identExpr "Person") []))]
+staticMethodDef :: String -> [String] -> [Statement] -> MethodDefinition
+staticMethodDef name params body = MethodDefinition
+  (identExpr name)
+  (FunctionExpression Nothing (fmap identPattern params) body False False)
+  MethodKindMethod
+  False
+  True
+
+-- | Create a class declaration statement
+-- Example: classDeclStmt (classDecl "Person" Nothing [])
+classDeclStmt :: ClassDeclaration -> Statement
+classDeclStmt = StatementClassDeclaration
+
+
+-- * Module Items
+
+-- | Create a statement module item
+-- Example: stmtItem (varDeclStmt (constDecl "x" (Just (intExpr 42))))
+stmtItem :: Statement -> ModuleItem
+stmtItem = ModuleItemStatement
+
+-- | Create an import declaration
+-- Example: importDecl [importNamed "foo" "foo"] "./module.js"
+importDecl :: [ImportClause] -> String -> ImportDeclaration
+importDecl specifiers source = ImportDeclaration specifiers (StringLiteral source False)
+
+-- | Create a named import
+-- Example: importNamed "foo" "bar"  -- import { foo as bar }
+importNamed :: String -> String -> ImportClause
+importNamed imported local = ImportClauseNamed $
+  ImportSpecifier (ident imported) (ident local)
+
+-- | Create a default import
+-- Example: importDefault "foo"  -- import foo from ...
+importDefault :: String -> ImportClause
+importDefault = ImportClauseDefault . ImportDefaultSpecifier . ident
+
+-- | Create a namespace import
+-- Example: importNamespace "foo"  -- import * as foo from ...
+importNamespace :: String -> ImportClause
+importNamespace = ImportClauseNamespace . ImportNamespaceSpecifier . ident
+
+-- | Create an import module item
+-- Example: importItem (importDecl [importDefault "React"] "react")
+importItem :: ImportDeclaration -> ModuleItem
+importItem = ModuleItemImport
+
+-- | Create a named export declaration
+-- Example: namedExportDecl [("foo", "foo")] Nothing
+namedExportDecl :: [(String, String)] -> Maybe String -> ExportDeclaration
+namedExportDecl specifiers source = ExportDeclarationNamed $ NamedExport
+  (fmap (\(local, exported) -> ExportSpecifier (ident local) (ident exported)) specifiers)
+  (fmap (\s -> StringLiteral s False) source)
+
+-- | Create a default export declaration
+-- Example: defaultExportDecl (identExpr "foo")
+defaultExportDecl :: Expression -> ExportDeclaration
+defaultExportDecl = ExportDeclarationDefault
+
+-- | Create an export declaration for a statement
+-- Example: exportDeclStmt (varDeclStmt (constDecl "x" (Just (intExpr 42))))
+exportDeclStmt :: Statement -> ExportDeclaration
+exportDeclStmt = ExportDeclarationDeclaration
+
+-- | Create an export module item
+-- Example: exportItem (defaultExportDecl (identExpr "foo"))
+exportItem :: ExportDeclaration -> ModuleItem
+exportItem = ModuleItemExport
+
+
+-- * Programs
+
+-- | Create a module program
+-- Example: moduleProgram [importItem (importDecl [importDefault "foo"] "./foo.js"), stmtItem (varDeclStmt (constDecl "x" (Just (intExpr 42))))]
+moduleProgram :: [ModuleItem] -> Program
+moduleProgram body = Program body SourceTypeModule
+
+-- | Create a script program
+-- Example: scriptProgram [stmtItem (varDeclStmt (constDecl "x" (Just (intExpr 42))))]
+scriptProgram :: [ModuleItem] -> Program
+scriptProgram body = Program body SourceTypeScript
+
+
+-- * Type Expressions
+
+-- | Create an identifier type expression
+-- Example: identType "string"
+identType :: String -> TypeExpression
+identType = TypeExpressionIdentifier . ident
+
+-- | Create an array type expression
+-- Example: arrayType (identType "number")
+arrayType :: TypeExpression -> TypeExpression
+arrayType = TypeExpressionArray . ArrayTypeExpression
+
+-- | Create a union type expression
+-- Example: unionType [identType "string", identType "number"]
+unionType :: [TypeExpression] -> TypeExpression
+unionType = TypeExpressionUnion
+
+-- | Create an optional type expression
+-- Example: optionalType (identType "string")
+optionalType :: TypeExpression -> TypeExpression
+optionalType = TypeExpressionOptional
+
+-- | Create a parameterized type expression
+-- Example: paramType (identType "Array") [identType "string"]
+paramType :: TypeExpression -> [TypeExpression] -> TypeExpression
+paramType base args = TypeExpressionParameterized $
+  ParameterizedTypeExpression base args
+
+-- | The 'any' type
+anyType :: TypeExpression
+anyType = TypeExpressionAny
+
+-- | The 'void' type
+voidType :: TypeExpression
+voidType = TypeExpressionVoid
+
+-- | The 'never' type
+neverType :: TypeExpression
+neverType = TypeExpressionNever
+
+
+-- * Comments and Documentation
+
+-- | Create a line comment
+-- Example: lineComment "This is a comment"
+lineComment :: String -> Comment
+lineComment = CommentLine
+
+-- | Create a block comment
+-- Example: blockComment "This is a\nmultiline comment"
+blockComment :: String -> Comment
+blockComment = CommentBlock
+
+-- | Create a documentation comment
+-- Example: docComment "Description of the function" [paramTag "x" (Just (identType "number")) "The input value"]
+docComment :: String -> [DocumentationTag] -> Comment
+docComment desc tags = CommentDocumentation $ DocumentationComment desc tags
+
+-- | Create a @param documentation tag
+-- Example: paramTag "x" (Just (identType "number")) "The input value"
+paramTag :: String -> Maybe TypeExpression -> String -> DocumentationTag
+paramTag name typ desc = DocumentationTag "param" typ (Just $ ident name) desc
+
+-- | Create a @returns documentation tag
+-- Example: returnsTag (Just (identType "number")) "The result"
+returnsTag :: Maybe TypeExpression -> String -> DocumentationTag
+returnsTag typ desc = DocumentationTag "returns" typ Nothing desc
+
+-- | Create a @type documentation tag
+-- Example: typeTag (identType "number")
+typeTag :: TypeExpression -> DocumentationTag
+typeTag typ = DocumentationTag "type" (Just typ) Nothing ""
diff --git a/src/main/haskell/Hydra/TypeScript/Coder.hs b/src/main/haskell/Hydra/TypeScript/Coder.hs
--- a/src/main/haskell/Hydra/TypeScript/Coder.hs
+++ b/src/main/haskell/Hydra/TypeScript/Coder.hs
@@ -68,6 +68,7 @@
 analyzeTypeScriptFunction :: Typing.InferenceContext -> Graph.Graph -> Core.Term -> Either t0 (Typing.FunctionStructure Graph.Graph)
 analyzeTypeScriptFunction cx g term = Analysis.analyzeFunctionTerm cx tsEnvGetGraph tsEnvSetGraph g term
 
+-- | Collect the bound parameter names from a chain of nested foralls, in outer-to-inner order; stops at the first non-forall type
 collectForallParams :: Core.Type -> [Core.Name]
 collectForallParams t =
 
@@ -76,12 +77,14 @@
         Core.TypeForall v0 -> Lists.cons (Core.forallTypeParameter v0) (collectForallParams (Core.forallTypeBody v0))
         _ -> []
 
+-- | Collect the names of every type referenced in a type tree that belongs to a different namespace than the current module, for computing the imports needed at the top of the emitted .ts file
 collectImports :: Packaging.ModuleName -> Core.Type -> S.Set Core.Name
 collectImports currentNs t =
 
       let vars = Variables.freeVariablesInType t
       in (filterNonLocalNames currentNs vars)
 
+-- | Collect type imports referenced inside a term tree (lambda bodies, type applications, let-binding schemes), supplementing the top-level typeScheme walk
 collectInnerTypeImports :: Packaging.ModuleName -> Core.Term -> S.Set Core.Name
 collectInnerTypeImports currentNs term =
 
@@ -96,6 +99,7 @@
           childVars = Lists.foldl (\acc -> \s -> Sets.union acc (collectInnerTypeImports currentNs s)) Sets.empty subs
       in (filterNonLocalNames currentNs (Sets.union ownVars childVars))
 
+-- | Like collectImports but walks a Term, gathering free term-level variables that resolve to a different module
 collectTermImports :: Packaging.ModuleName -> Core.Term -> S.Set Core.Name
 collectTermImports currentNs t =
 
@@ -322,8 +326,9 @@
       Core.TermWrap v0 -> tsObject [
         ("value", (encodeTerm cx g currentNs (Core.wrappedTermBody v0)))]
       Core.TermLet v0 ->
-        let bindings = sortBindingsTopologically (Core.letBindings v0)
-            body = Core.letBody v0
+        let lt2 = thunkLazyLet v0
+            bindings = sortBindingsTopologically (Core.letBindings lt2)
+            body = Core.letBody lt2
             encodedBody = encodeTerm cx g currentNs body
             bindingStmts = Lists.map (\b -> encodeBindingAsStatement cx g currentNs b) bindings
             returnStmt = Syntax.StatementReturn (Just encodedBody)
@@ -580,6 +585,21 @@
           in (head_, (Lists.concat2 prevArgs (Lists.singleton (Core.applicationArgument v0))))
         _ -> (t, [])
 
+forceLazyRefs :: S.Set Core.Name -> Core.Term -> Core.Term
+forceLazyRefs targets0 term0 =
+    Rewriting.rewriteTermWithContext (\recurse0 -> \targets -> \term -> case term of
+      Core.TermVariable v0 -> Logic.ifElse (Sets.member v0 targets) (Core.TermApplication (Core.Application {
+        Core.applicationFunction = (Core.TermVariable v0),
+        Core.applicationArgument = Core.TermUnit})) term
+      Core.TermLambda v0 ->
+        let innerTargets = Sets.delete (Core.lambdaParameter v0) targets
+        in (recurse0 innerTargets term)
+      Core.TermLet v0 ->
+        let boundNames = Sets.fromList (Lists.map Core.bindingName (Core.letBindings v0))
+            innerTargets = Sets.difference targets boundNames
+        in (recurse0 innerTargets term)
+      _ -> recurse0 targets term) targets0 term0
+
 functionDeclarationFromTerm :: Typing.InferenceContext -> Graph.Graph -> Packaging.ModuleName -> String -> Core.Term -> Maybe Core.Type -> Syntax.FunctionDeclaration
 functionDeclarationFromTerm cx g currentNs lname term _mScheme =
 
@@ -595,8 +615,11 @@
                     Typing.functionStructureEnvironment = g}) (\ok -> ok) fsE
           fsParams = Typing.functionStructureParams fs
           fsDoms = Typing.functionStructureDomains fs
-          fsBindings = Typing.functionStructureBindings fs
-          fsBody = Typing.functionStructureBody fs
+          fsBindings0 = Typing.functionStructureBindings fs
+          fsBody0 = Typing.functionStructureBody fs
+          thunked = thunkLazyBindings fsBindings0 fsBody0
+          fsBindings = Pairs.first thunked
+          fsBody = Pairs.second thunked
           fsEnv = Typing.functionStructureEnvironment fs
           domPad = Core.TypeVariable (Core.Name "_")
           fsDomsPadded = Lists.concat2 fsDoms (Lists.replicate (Math.sub (Lists.length fsParams) (Lists.length fsDoms)) domPad)
@@ -643,7 +666,7 @@
                         targetIsTest =
                                 Logic.and (Logic.not (Lists.null targetSegs)) (Equality.equal (Optionals.fromOptional "" (Lists.maybeHead targetSegs)) "test")
                         targetPathSegs =
-                                Logic.ifElse (Equality.equal (Optionals.fromOptional "" (Lists.maybeHead targetSegs)) "lib") (Lists.concat2 [
+                                Logic.ifElse (Logic.and (Equality.equal (Optionals.fromOptional "" (Lists.maybeHead targetSegs)) "lib") (Logic.not (Equality.equal (Packaging.unModuleName ns) "hydra.lib.defaults"))) (Lists.concat2 [
                                   "overlay",
                                   "typescript"] targetSegs) targetSegs
                         targetPath = Strings.intercalate "/" targetPathSegs
@@ -665,6 +688,21 @@
 lazyFlagsForPrimitive g name =
     Optionals.cases (Maps.lookup name (Graph.graphPrimitives g)) [] (\prim -> Lists.map (\p -> Typing.parameterIsLazy p) (Typing.termSignatureParameters (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim))))
 
+letBindingIsThunkCandidate :: Core.Binding -> Bool
+letBindingIsThunkCandidate b =
+
+      let dterm = Strip.deannotateAndDetypeTerm (Core.bindingTerm b)
+          isLambda =
+                  case dterm of
+                    Core.TermLambda _ -> True
+                    _ -> False
+          freeVars = Variables.freeVariablesInTerm (Core.bindingTerm b)
+          callsShow =
+                  Lists.foldl (\acc -> \n -> Logic.or acc (Optionals.cases (Names.moduleNameOf n) False (\mn -> Equality.equal (Lists.take 2 (Strings.splitOn "." (Packaging.unModuleName mn))) [
+                    "hydra",
+                    "show"]))) False (Sets.toList freeVars)
+      in (Logic.and (Logic.not isLambda) callsShow)
+
 mkDocComment :: Maybe String -> Maybe Syntax.DocumentationComment
 mkDocComment mdesc =
     Optionals.cases mdesc Nothing (\d -> Logic.ifElse (Equality.equal d "") Nothing (Just (Syntax.DocumentationComment {
@@ -887,6 +925,33 @@
         Core.TermVariable v0 -> Just v0
         Core.TermTypeApplication v0 -> termHeadVariable (Core.typeApplicationTermBody v0)
         _ -> Nothing
+
+thunkLazyBindings :: [Core.Binding] -> Core.Term -> ([Core.Binding], Core.Term)
+thunkLazyBindings bindings body =
+
+      let candidates = Lists.filter (\b -> letBindingIsThunkCandidate b) bindings
+      in (Logic.ifElse (Lists.null candidates) (bindings, body) (
+        let targets = Sets.fromList (Lists.map Core.bindingName candidates)
+            wrapCandidate =
+                    \b -> Logic.ifElse (letBindingIsThunkCandidate b) (Core.Binding {
+                      Core.bindingName = (Core.bindingName b),
+                      Core.bindingTerm = (Core.TermLambda (Core.Lambda {
+                        Core.lambdaParameter = (Core.Name "_"),
+                        Core.lambdaDomain = Nothing,
+                        Core.lambdaBody = (forceLazyRefs targets (Core.bindingTerm b))})),
+                      Core.bindingTypeScheme = (Core.bindingTypeScheme b)}) (Core.Binding {
+                      Core.bindingName = (Core.bindingName b),
+                      Core.bindingTerm = (forceLazyRefs targets (Core.bindingTerm b)),
+                      Core.bindingTypeScheme = (Core.bindingTypeScheme b)})
+        in (Lists.map wrapCandidate bindings, (forceLazyRefs targets body))))
+
+thunkLazyLet :: Core.Let -> Core.Let
+thunkLazyLet lt =
+
+      let result = thunkLazyBindings (Core.letBindings lt) (Core.letBody lt)
+      in Core.Let {
+        Core.letBindings = (Pairs.first result),
+        Core.letBody = (Pairs.second result)}
 
 tsArray :: [Syntax.Expression] -> Syntax.Expression
 tsArray elems = Syntax.ExpressionArray (Lists.map (\e -> Syntax.ArrayElementExpression e) elems)
