packages feed

hydra-lisp 0.17.1 → 0.17.2

raw patch · 6 files changed

+1423/−1287 lines, 6 filesdep ~hydra-kernelPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hydra-kernel

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -15,142 +15,197 @@  --- -## [0.17.1] - unreleased+## [0.17.2] - 2026-07-28 -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.+Point release on the 0.17.x line. Themes: promotion of the generator's routing and manifest+logic into Hydra (`hydra.build.*`), per-package API-doc publishing across Java/Scala/Python,+constraint-polymorphic arithmetic, and new effectful stream/file primitives. Includes the base64+binary-literal rename `literals.binaryToString`/`stringToBinary` → `binaryToBase64`/`base64ToBinary`,+a step toward [#417](https://github.com/CategoricalData/hydra/issues/417) (which remains in progress). +### Highlights++- **Build system promoted into Hydra**: the three generator drivers now consume `hydra.build.routing`+  ([#560](https://github.com/CategoricalData/hydra/issues/560)) and `hydra.build.manifest`+  ([#607](https://github.com/CategoricalData/hydra/issues/607)), retiring the legacy static prefix+  tables; the cold-seeder oil-and-water violation is fixed+  ([#608](https://github.com/CategoricalData/hydra/issues/608)) and guarded+  ([#617](https://github.com/CategoricalData/hydra/issues/617)).+- **Per-package API docs** for all doc-bearing hosts: JavaDoc restructured with cross-links and a fixed+  tag→CI→Pages chain ([#616](https://github.com/CategoricalData/hydra/issues/616)), plus mirrored+  Scaladoc ([#619](https://github.com/CategoricalData/hydra/issues/619)) and Python API docs+  ([#620](https://github.com/CategoricalData/hydra/issues/620)).+- **Constraint-polymorphic arithmetic**: a `numeric` type class with enforcement and value-level dispatch+  ([#566](https://github.com/CategoricalData/hydra/issues/566)), reflected on the target hosts+  ([#618](https://github.com/CategoricalData/hydra/issues/618)).+ ### New features +- Standard-stream primitives: `stdin`/`stdout`/`stderr` ([#526](https://github.com/CategoricalData/hydra/issues/526)).+- Recursive flag for `hydra.lib.files.listDirectory` ([#527](https://github.com/CategoricalData/hydra/issues/527)).+- Hydra-specific regex syntax with per-target translation (`hydra.read.regex` / `hydra.show.regex`)+  ([#567](https://github.com/CategoricalData/hydra/issues/567)).+- Constraint-polymorphic arithmetic: `numeric` type class + value-level dispatch+  ([#566](https://github.com/CategoricalData/hydra/issues/566)).+- Aggregated Java + Scala Maven publishing into a single Central Portal deployment+  ([#591](https://github.com/CategoricalData/hydra/issues/591)).++### Improvements++- Generator drivers consume `hydra.build.routing` ([#560](https://github.com/CategoricalData/hydra/issues/560))+  and `hydra.build.manifest` ([#607](https://github.com/CategoricalData/hydra/issues/607)).+- Fixed the cold-seeder oil-and-water violation ([#608](https://github.com/CategoricalData/hydra/issues/608))+  and extended `check-oil-and-water.py` to catch cold-seeder imports of unpublished `Hydra.Build.*`+  ([#617](https://github.com/CategoricalData/hydra/issues/617)).+- Moved non-kernel packages to strict validation, clearing the #575 backlog+  ([#580](https://github.com/CategoricalData/hydra/issues/580)).+- Decoupled `Hydra.Sources.Test.All` from `Hydra.Sources.All`'s re-export list+  ([#601](https://github.com/CategoricalData/hydra/issues/601)).+- Renamed `hydra.json.schema` to resolve the module-vs-namespace-prefix conflict that broke+  file-per-module hosts ([#532](https://github.com/CategoricalData/hydra/issues/532)).+- Coders route `hydra.lib.*` overlay imports by overlay-module existence, not name-matching+  `hydra.lib.defaults` ([#568](https://github.com/CategoricalData/hydra/issues/568)).+- Per-package JavaDoc/Scaladoc/Python-doc publishing+  ([#616](https://github.com/CategoricalData/hydra/issues/616),+  [#619](https://github.com/CategoricalData/hydra/issues/619),+  [#620](https://github.com/CategoricalData/hydra/issues/620)).+- Aligned Java-host Scala/TypeScript generation with Haskell on expression layout (line-wrapping,+  declaration order) ([#612](https://github.com/CategoricalData/hydra/issues/612)).++### Bug fixes++- **TypeScript** — added the missing CI job (zero prior coverage)+  ([#571](https://github.com/CategoricalData/hydra/issues/571)); fixed the+  `verify-distribution.sh` smoke-test import so the gate actually gates+  ([#578](https://github.com/CategoricalData/hydra/issues/578)); emit `hydra.parse.regex`'s+  `regexSequence` before its alternation use (TS2448)+  ([#604](https://github.com/CategoricalData/hydra/issues/604)).+- **Build and sync** — `sync.sh` Phase 3 digest-cache now sees cross-package deps on moved kernel+  symbols, fixing stale downstream output ([#606](https://github.com/CategoricalData/hydra/issues/606)).+- **Numeric constraints** — `#566` polymorphism now reflected on the target hosts (targets were+  monomorphizing `int32->int32->int32`) ([#618](https://github.com/CategoricalData/hydra/issues/618)).++---++## [0.17.1] - 2026-07-18++Consolidation release on the 0.17.x line, built against published 0.17.0 hosts. Themes:+generated term-reference DSLs, a translingual package-validation framework, promotion of the+build system into Hydra (`hydra-build`), and broad TypeScript-host and cross-host hardening.++### Highlights+ - **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).+  kernel term modules now emit one typed, rename-safe reference per definition into every target+  language; the Java and Python coder sources were pivoted onto them, retiring ~700 stringly-typed+  inline references. - **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.+  framework with per-package `ValidationProfile`s (undeclared-dependency gate, naming/ordering/docs+  checks). See the [Validation](https://github.com/CategoricalData/hydra/wiki/Validation) wiki page.+- **`hydra-build` package** ([#546](https://github.com/CategoricalData/hydra/issues/546)):+  build-orchestration logic that lived only in host scripts is now translingual Hydra+  (`hydra.build.*`), extracted into a dedicated package. -### API and usability+### New features -- **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.+- Generated term-reference DSLs ([#467](https://github.com/CategoricalData/hydra/issues/467));+  follow-ups: `TypedName` refs to derived encode/decode/show+  ([#555](https://github.com/CategoricalData/hydra/issues/555)), non-kernel packages+  ([#556](https://github.com/CategoricalData/hydra/issues/556)).+- Translingual package-validation framework ([#574](https://github.com/CategoricalData/hydra/issues/574),+  [#575](https://github.com/CategoricalData/hydra/issues/575)).+- DSL-authoring registration guards: fail-fast completeness checks for the Java/Python/Scala DSL sources+  ([#554](https://github.com/CategoricalData/hydra/issues/554)).+- `hydra-build` package: `hydra.build.modules`+  ([#529](https://github.com/CategoricalData/hydra/issues/529)), `hydra.build.reconcile`+  ([#530](https://github.com/CategoricalData/hydra/issues/530)), extracted from the kernel+  ([#546](https://github.com/CategoricalData/hydra/issues/546)).+- Effectful `hydra.lib.system` primitive library ([#498](https://github.com/CategoricalData/hydra/issues/498)).+- SHA-256 cryptographic hash primitive in `hydra.lib` ([#524](https://github.com/CategoricalData/hydra/issues/524)).+- `hydra-jvm` package: shared JVM serde helpers relocated out of `hydra.java.serde`+  ([#505](https://github.com/CategoricalData/hydra/issues/505)).+- Internalized the Hydra-TinkerPop bindings (formerly HydraPop)+  ([#442](https://github.com/CategoricalData/hydra/issues/442)).+- Compact unit-valued variants in the JSON encoding ([#520](https://github.com/CategoricalData/hydra/issues/520)).+- Structured generation-provenance record (digest v2) ([#413](https://github.com/CategoricalData/hydra/issues/413),+  [#523](https://github.com/CategoricalData/hydra/issues/523)).+- Metadata sidecar + content/version-addressed freshness (`moduleFormatVersion`)+  ([#415](https://github.com/CategoricalData/hydra/issues/415)).+- Worker + issue hierarchy: agent/worker framework, cross-worktree messaging, issue-proposal queue+  (contributor process only) ([#557](https://github.com/CategoricalData/hydra/issues/557)). -### Fixed+### Improvements -Bug fixes landed this cycle, grouped by area (see each issue for detail):+- Type inference for annotations ([#229](https://github.com/CategoricalData/hydra/issues/229)).+- Fixed the signature / definition split in primitive definitions+  ([#502](https://github.com/CategoricalData/hydra/issues/502)).+- DSL usability passes across the host-native Java/Python/Scala surfaces+  ([#430](https://github.com/CategoricalData/hydra/issues/430),+  [#553](https://github.com/CategoricalData/hydra/issues/553)).+- Audited the Scala and Lisp-family coders for the unconditional `hydra.lib.*` overlay-import rewrite+  ([#569](https://github.com/CategoricalData/hydra/issues/569)). -- **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)),+### Bug fixes++- **TypeScript host** — V8 stack budget on ts→Java ([#390](https://github.com/CategoricalData/hydra/issues/390));+  effectful libs not generated / 484 tsc errors ([#503](https://github.com/CategoricalData/hydra/issues/503));+  15 effect/file inference cases ([#504](https://github.com/CategoricalData/hydra/issues/504));+  ts→ts self-host regression ([#507](https://github.com/CategoricalData/hydra/issues/507)); npm packages+  bundling a duplicate kernel ([#584](https://github.com/CategoricalData/hydra/issues/584)); broken npm+  entry points ([#587](https://github.com/CategoricalData/hydra/issues/587));+  `hydra.test.build.modules.allTests` gen-universe gap ([#588](https://github.com/CategoricalData/hydra/issues/588)).+- **TypeScript coder** — reactivated `hydra.lib.*` tests: lazy show-calling let bindings + compact+  `LiteralType` expansion ([#564](https://github.com/CategoricalData/hydra/issues/564)); `binaryToBytes`+  registration + base64 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)).+  ([#570](https://github.com/CategoricalData/hydra/issues/570)); `HYDRA_DEFAULT_IMPLS` in the test runner+  ([#536](https://github.com/CategoricalData/hydra/issues/536)); overlay-import rewrite no longer captures+  `hydra.lib.defaults` ([#565](https://github.com/CategoricalData/hydra/issues/565)).+- **Lisp family** — clj→clj bootstrap hang in `generate_source_files`+  ([#479](https://github.com/CategoricalData/hydra/issues/479)); Common Lisp `test_graph.lisp` loader+  forward-reference ([#496](https://github.com/CategoricalData/hydra/issues/496)); Scheme maps+  last-writer-wins in `union` ([#545](https://github.com/CategoricalData/hydra/issues/545)); Emacs Lisp+  bootstrap `wrong-type-argument (listp :string)` ([#586](https://github.com/CategoricalData/hydra/issues/586));+  `hydra.build.*` regeneration into the Lisp dialects ([#544](https://github.com/CategoricalData/hydra/issues/544)). - **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)).+  ([#528](https://github.com/CategoricalData/hydra/issues/528)); `hydra.json.Decode.fromJson`+  parametric-type 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));+  Java Javadoc ampersand escaping ([#493](https://github.com/CategoricalData/hydra/issues/493)); Scala+  coder over-generalizing `Schema[S,T,V,E]` args, breaking `hydra-pg`+  ([#589](https://github.com/CategoricalData/hydra/issues/589)); kernel dead-code/TODO cleanup+  ([#538](https://github.com/CategoricalData/hydra/issues/538)).+- **Publishing and packaging** — self-broken 0.16.0 `hydra-kernel`/`hydra-python` wheels+  ([#472](https://github.com/CategoricalData/hydra/issues/472)). - **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.+  ([#525](https://github.com/CategoricalData/hydra/issues/525)); standalone-kernel SHA dependency+  ([#542](https://github.com/CategoricalData/hydra/issues/542)); lexicon's empty Types section+  ([#539](https://github.com/CategoricalData/hydra/issues/539)); silent lexicon-generation failure since+  the coders moved to in-memory synthesis ([#448](https://github.com/CategoricalData/hydra/issues/448));+  duplicated generated-file header in `generate-head-haskell-build.py`+  ([#540](https://github.com/CategoricalData/hydra/issues/540)); `.gitignore` untracking 41 duplicate+  overlaid-runtime copies under `dist/haskell/` ([#501](https://github.com/CategoricalData/hydra/issues/501));+  `bin/prepare-release.sh` Java quality check repointed to `dist/java/hydra-pg` tests after+  ([#511](https://github.com/CategoricalData/hydra/issues/511)).+- **Tests and CI** — restored default-primitive-implementation testing+  ([#388](https://github.com/CategoricalData/hydra/issues/388),+  [#549](https://github.com/CategoricalData/hydra/issues/549)); reactivated ignored kernel test cases+  ([#513](https://github.com/CategoricalData/hydra/issues/513),+  [#550](https://github.com/CategoricalData/hydra/issues/550)); wired + split out the regression harnesses+  ([#535](https://github.com/CategoricalData/hydra/issues/535),+  [#563](https://github.com/CategoricalData/hydra/issues/563)); Scala/Go/Lisp self-containment gates+  ([#537](https://github.com/CategoricalData/hydra/issues/537)); manifest-JSON-tracked CI check+  ([#541](https://github.com/CategoricalData/hydra/issues/541)); per-package test-digest freshness+  ([#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)); DSL-aware+  sync-freshness fingerprint ([#562](https://github.com/CategoricalData/hydra/issues/562)).  ### 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.+- Corrected 0.17.0 Maven coordinates and added npm/Scala release channels, TypeScript/Scala/Lisp+  Getting-started sections, and issue/PR templates+  ([#519](https://github.com/CategoricalData/hydra/issues/519)).  --- 
hydra-lisp.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.38.1.+-- This file has been generated from package.yaml by hpack version 0.39.1. -- -- see: https://github.com/sol/hpack  name:           hydra-lisp-version:        0.17.1+version:        0.17.2 synopsis:       Hydra's Lisp coder: emit Clojure/Scheme/Common-Lisp/Emacs-Lisp source 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". Lisp support for Hydra (shared across Clojure, Scheme, Common Lisp, and Emacs Lisp) category:       Data@@ -39,6 +39,6 @@   build-depends:       base >=4.19.0 && <4.22     , containers >=0.6.7 && <0.8-    , hydra-kernel ==0.17.1+    , hydra-kernel ==0.17.2     , scientific >=0.3.7 && <0.4   default-language: Haskell2010
src/main/haskell/Hydra/Lisp/Coder.hs view
@@ -38,9 +38,10 @@ import qualified Hydra.Parsing as Parsing import qualified Hydra.Paths as Paths import qualified Hydra.Predicates as Predicates+import qualified Hydra.Print.Core as PrintCore import qualified Hydra.Query as Query+import qualified Hydra.Regex as Regex import qualified Hydra.Relational as Relational-import qualified Hydra.Show.Core as ShowCore import qualified Hydra.Sorting as Sorting import qualified Hydra.Strip as Strip import qualified Hydra.System as System@@ -129,6 +130,7 @@             _ -> normal ()))         _ -> normal () +-- | Encode a Hydra field type as a Lisp field definition encodeFieldDef :: Core.FieldType -> Syntax.FieldDefinition encodeFieldDef ft = @@ -137,6 +139,7 @@         Syntax.fieldDefinitionName = (Syntax.Symbol (Formatting.convertCaseCamelToLowerSnake fname)),         Syntax.fieldDefinitionDefaultValue = Nothing} +-- | Encode a Hydra lambda as a Lisp expression encodeLambdaTerm :: Syntax.Dialect -> t0 -> Graph.Graph -> Core.Lambda -> Either t1 Syntax.Expression encodeLambdaTerm dialect cx g lam = @@ -145,6 +148,7 @@       in (Eithers.bind (encodeTerm dialect cx g (Core.lambdaBody lam)) (\body -> Right (lispLambdaExpr [         param] body))) +-- | Encode let bindings as nested ((lambda (x) body) init) applications, for self-referential non-lambda bindings encodeLetAsLambdaApp :: Syntax.Dialect -> t0 -> Graph.Graph -> [Core.Binding] -> Core.Term -> Either t1 Syntax.Expression encodeLetAsLambdaApp dialect cx g bindings body =     Eithers.bind (encodeTerm dialect cx g body) (\bodyExpr -> Eithers.foldl (\acc -> \b ->@@ -154,6 +158,7 @@         bname] acc) [         bval])))) bodyExpr (Lists.reverse bindings)) +-- | Encode let bindings as native let, let*, or letrec expressions depending on self-reference and binding count encodeLetAsNative :: Syntax.Dialect -> t0 -> Graph.Graph -> [Core.Binding] -> Core.Term -> Either t1 Syntax.Expression encodeLetAsNative dialect cx g bindings body =     Eithers.bind (encodeTerm dialect cx g body) (\bodyExpr ->@@ -203,6 +208,7 @@           Syntax.letExpressionBody = [             bodyExpr]})))))) +-- | Encode a Hydra literal as a Lisp expression encodeLiteral :: Core.Literal -> Syntax.Expression encodeLiteral lit =     case lit of@@ -253,6 +259,7 @@             Syntax.integerLiteralValue = (Literals.int32ToBigint bv),             Syntax.integerLiteralBigint = False}))) byteValues)})) +-- | Encode a Hydra record projection as a Lisp expression, with an optional argument for applied projections encodeProjectionElim :: Syntax.Dialect -> t0 -> Graph.Graph -> Core.Projection -> Maybe Core.Term -> Either t1 Syntax.Expression encodeProjectionElim dialect cx g proj marg = @@ -267,6 +274,7 @@         Syntax.fieldAccessField = (Syntax.Symbol fname),         Syntax.fieldAccessTarget = sarg}))))) +-- | Encode a Hydra term as a Lisp expression encodeTerm :: Syntax.Dialect -> t0 -> Graph.Graph -> Core.Term -> Either t1 Syntax.Expression encodeTerm dialect cx g term =     case term of@@ -331,6 +339,7 @@       Core.TermTypeLambda v0 -> encodeTerm dialect cx g (Core.typeLambdaBody v0)       Core.TermWrap v0 -> encodeTerm dialect cx g (Core.wrappedTermBody v0) +-- | Encode a Hydra term definition as a Lisp top-level form encodeTermDefinition :: Syntax.Dialect -> t0 -> Graph.Graph -> Packaging.TermDefinition -> Either t1 Syntax.TopLevelFormWithComments encodeTermDefinition dialect cx g tdef = @@ -348,6 +357,7 @@           Syntax.variableDefinitionValue = sterm,           Syntax.variableDefinitionDoc = Nothing})))) +-- | Encode a Hydra type as a Lisp type specifier, used for type annotations encodeType :: t0 -> t1 -> Core.Type -> Either t2 Syntax.TypeSpecifier encodeType cx g t = @@ -378,6 +388,7 @@         Core.TypeForall v0 -> encodeType cx g (Core.forallTypeBody v0)         _ -> Right (Syntax.TypeSpecifierNamed (Syntax.Symbol "Any")) +-- | Encode a type body, after stripping annotations and foralls, as a Lisp top-level form encodeTypeBody :: String -> Core.Type -> Core.Type -> Either t0 Syntax.TopLevelFormWithComments encodeTypeBody lname origTyp typ =     case typ of@@ -408,9 +419,10 @@         Syntax.topLevelFormWithCommentsDoc = Nothing,         Syntax.topLevelFormWithCommentsComment = (Just (Syntax.Comment {           Syntax.commentStyle = Syntax.CommentStyleLine,-          Syntax.commentText = (Strings.cat2 (Strings.cat2 lname " = ") (ShowCore.type_ origTyp))})),+          Syntax.commentText = (Strings.cat2 (Strings.cat2 lname " = ") (PrintCore.type_ origTyp))})),         Syntax.topLevelFormWithCommentsForm = (Syntax.TopLevelFormExpression (Syntax.ExpressionLiteral Syntax.LiteralNil))}) +-- | Encode a Hydra type definition as a Lisp top-level form encodeTypeDefinition :: t0 -> t1 -> Packaging.TypeDefinition -> Either t2 Syntax.TopLevelFormWithComments encodeTypeDefinition cx g tdef = @@ -420,6 +432,7 @@           dtyp = Strip.deannotateType typ       in (encodeTypeBody lname typ dtyp) +-- | Encode a Hydra case statement (union elimination) as a Lisp expression, with an optional argument for applied case statements encodeUnionElim :: Syntax.Dialect -> t0 -> Graph.Graph -> Core.CaseStatement -> Maybe Core.Term -> Either t1 Syntax.Expression encodeUnionElim dialect cx g cs marg = @@ -453,11 +466,13 @@           "match_target"] innerExpr) [           sarg]))))))) +-- | Encode a Hydra wrap elimination (unwrap) as a Lisp expression, with an optional argument for applied unwraps encodeUnwrapElim :: Syntax.Dialect -> t0 -> Graph.Graph -> Core.Name -> Maybe Core.Term -> Either t1 Syntax.Expression encodeUnwrapElim dialect cx g name marg =     Optionals.cases marg (Right (lispLambdaExpr [       "__rec"] (lispVar "__rec"))) (\arg -> encodeTerm dialect cx g arg) +-- | Check whether a term is a reference to a specific primitive, stripping type applications, type lambdas, and annotations isPrimitiveRef :: String -> Core.Term -> Bool isPrimitiveRef primName term =     case term of@@ -467,22 +482,26 @@       Core.TermTypeLambda v0 -> isPrimitiveRef primName (Core.typeLambdaBody v0)       _ -> False +-- | The per-parameter isLazy flags of the primitive a head term refers to, in order; empty if the head is not a registered primitive lazyFlagsForPrimitiveTerm :: Graph.Graph -> Core.Term -> [Bool] lazyFlagsForPrimitiveTerm g headTerm =     Optionals.cases (primHeadName headTerm) [] (\name -> Optionals.cases (Maps.lookup name (Graph.graphPrimitives g)) [] (\prim -> Lists.map (\p -> Typing.parameterIsLazy p) (Typing.termSignatureParameters (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim))))) +-- | A Lisp function application expression lispApp :: Syntax.Expression -> [Syntax.Expression] -> Syntax.Expression lispApp fun args =     Syntax.ExpressionApplication (Syntax.Application {       Syntax.applicationFunction = fun,       Syntax.applicationArguments = args}) +-- | Construct a Lisp keyword expression from a string lispKeyword :: String -> Syntax.Expression lispKeyword name =     Syntax.ExpressionLiteral (Syntax.LiteralKeyword (Syntax.Keyword {       Syntax.keywordName = name,       Syntax.keywordNamespace = Nothing})) +-- | An unnamed Lisp lambda expression lispLambdaExpr :: [String] -> Syntax.Expression -> Syntax.Expression lispLambdaExpr params body =     Syntax.ExpressionLambda (Syntax.Lambda {@@ -492,15 +511,18 @@       Syntax.lambdaBody = [         body]}) +-- | Construct a Lisp list expression lispListExpr :: [Syntax.Expression] -> Syntax.Expression lispListExpr elements =     Syntax.ExpressionList (Syntax.ListLiteral {       Syntax.listLiteralElements = elements,       Syntax.listLiteralQuoted = False}) +-- | Wrap a Lisp literal as an expression lispLitExpr :: Syntax.Literal -> Syntax.Expression lispLitExpr lit = Syntax.ExpressionLiteral lit +-- | A named Lisp lambda expression, for Clojure self-referential fn forms lispNamedLambdaExpr :: String -> [String] -> Syntax.Expression -> Syntax.Expression lispNamedLambdaExpr name params body =     Syntax.ExpressionLambda (Syntax.Lambda {@@ -510,12 +532,15 @@       Syntax.lambdaBody = [         body]}) +-- | The Lisp nil expression lispNilExpr :: Syntax.Expression lispNilExpr = Syntax.ExpressionLiteral Syntax.LiteralNil +-- | Construct a Lisp symbol expression from a string lispSymbol :: String -> Syntax.Symbol lispSymbol name = Syntax.Symbol name +-- | Wrap a Lisp top-level form with no doc comment lispTopForm :: Syntax.TopLevelForm -> Syntax.TopLevelFormWithComments lispTopForm form =     Syntax.TopLevelFormWithComments {@@ -523,6 +548,7 @@       Syntax.topLevelFormWithCommentsComment = Nothing,       Syntax.topLevelFormWithCommentsForm = form} +-- | Wrap a Lisp top-level form with an optional docstring lispTopFormWithComments :: Maybe String -> Syntax.TopLevelForm -> Syntax.TopLevelFormWithComments lispTopFormWithComments mdoc form =     Syntax.TopLevelFormWithComments {@@ -530,12 +556,14 @@       Syntax.topLevelFormWithCommentsComment = Nothing,       Syntax.topLevelFormWithCommentsForm = form} +-- | A Lisp variable-reference expression (Lisp-1 style, no separate function namespace) lispVar :: String -> Syntax.Expression lispVar name =     Syntax.ExpressionVariable (Syntax.VariableReference {       Syntax.variableReferenceName = (Syntax.Symbol name),       Syntax.variableReferenceFunctionNamespace = False}) +-- | Generate export declarations for all symbols defined in a module moduleExports :: [Syntax.TopLevelFormWithComments] -> [Syntax.ExportDeclaration] moduleExports forms = @@ -565,6 +593,7 @@         Syntax.ExportDeclaration {           Syntax.exportDeclarationSymbols = symbols}]) +-- | Generate import declarations from the dependency namespaces of a module's definitions moduleImports :: Packaging.ModuleName -> [Packaging.Definition] -> [Syntax.ImportDeclaration] moduleImports focusNs defs = @@ -573,6 +602,7 @@         Syntax.importDeclarationModule = (Syntax.NamespaceName (Packaging.unModuleName ns)),         Syntax.importDeclarationSpec = Syntax.ImportSpecAll}) depNss) +-- | Convert a Hydra module to a Lisp program moduleToLisp :: Syntax.Dialect -> Packaging.Module -> [Packaging.Definition] -> t0 -> Graph.Graph -> Either t1 Syntax.Program moduleToLisp dialect mod defs0 cx g = @@ -597,6 +627,7 @@           Syntax.programExports = exports,           Syntax.programForms = allItems}))))) +-- | Extract the primitive or variable name a head term refers to, or nothing if the head is not a plain reference primHeadName :: Core.Term -> Maybe Core.Name primHeadName term =     case term of@@ -606,9 +637,11 @@       Core.TermTypeLambda v0 -> primHeadName (Core.typeLambdaBody v0)       _ -> Nothing +-- | Whether the primitive referenced by a head term is lazy in the parameter at the given zero-based position primIsLazyAt :: Graph.Graph -> Core.Term -> Int -> Bool primIsLazyAt g headTerm i = Optionals.fromOptional False (Lists.maybeAt i (lazyFlagsForPrimitiveTerm g headTerm)) +-- | Convert a fully-qualified Hydra Name to a snake_case identifier string qualifiedSnakeName :: Core.Name -> String qualifiedSnakeName name = @@ -618,9 +651,11 @@           joined = Strings.intercalate "_" snakeParts       in (Formatting.sanitizeWithUnderscores Language.lispReservedWords joined) +-- | Convert a fully-qualified Hydra Name to a PascalCase type identifier string qualifiedTypeName :: Core.Name -> String qualifiedTypeName name = Formatting.capitalize (Names.localNameOf name) +-- | Wrap an expression in a zero-argument lambda for lazy evaluation wrapInThunk :: Syntax.Expression -> Syntax.Expression wrapInThunk expr =     Syntax.ExpressionLambda (Syntax.Lambda {
src/main/haskell/Hydra/Lisp/Language.hs view
@@ -24,6 +24,7 @@ import qualified Hydra.Parsing as Parsing import qualified Hydra.Paths as Paths import qualified Hydra.Query as Query+import qualified Hydra.Regex as Regex import qualified Hydra.Relational as Relational import qualified Hydra.System as System import qualified Hydra.Tabular as Tabular
src/main/haskell/Hydra/Lisp/Serde.hs view
@@ -31,6 +31,7 @@ import qualified Hydra.Parsing as Parsing import qualified Hydra.Paths as Paths import qualified Hydra.Query as Query+import qualified Hydra.Regex as Regex import qualified Hydra.Relational as Relational import qualified Hydra.Serialization as Serialization import qualified Hydra.System as System@@ -46,11 +47,13 @@ import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci +-- | Serialize an and expression: (and expr1 expr2 ...) andExpressionToExpr :: Syntax.Dialect -> Syntax.AndExpression -> Ast.Expr andExpressionToExpr d andExpr =     Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [       Serialization.cst "and"] (Lists.map (expressionToExpr d) (Syntax.andExpressionExpressions andExpr)))) +-- | Serialize a function application, using funcall for computed function positions in Lisp-2 dialects applicationToExpr :: Syntax.Dialect -> Syntax.Application -> Ast.Expr applicationToExpr d app = @@ -73,6 +76,7 @@                     fun] args)       in (Serialization.parens (Serialization.spaceSepAdaptive allParts)) +-- | Serialize a case expression caseExpressionToExpr :: Syntax.Dialect -> Syntax.CaseExpression -> Ast.Expr caseExpressionToExpr d caseExpr = @@ -95,12 +99,14 @@         clauseExprs,         defaultPart]))) +-- | Serialize a comment commentToExpr :: Syntax.Comment -> Ast.Expr commentToExpr c =        let text = Syntax.commentText c       in (Serialization.cst (Logic.ifElse (Equality.equal text "") ";" (Strings.cat2 "; " text))) +-- | Serialize a cond expression condExpressionToExpr :: Syntax.Dialect -> Syntax.CondExpression -> Ast.Expr condExpressionToExpr d condExpr = @@ -167,6 +173,7 @@             clauseExprs,             defaultPart]))) +-- | Serialize a constant definition constantDefinitionToExpr :: Syntax.Dialect -> Syntax.ConstantDefinition -> Ast.Expr constantDefinitionToExpr d cdef = @@ -177,6 +184,7 @@         name,         value])) +-- | The keyword for variable definitions defKeyword :: Syntax.Dialect -> String defKeyword d =     case d of@@ -185,6 +193,7 @@       Syntax.DialectCommonLisp -> "cl:defvar"       Syntax.DialectScheme -> "define" +-- | The keyword for constant definitions defconstKeyword :: Syntax.Dialect -> String defconstKeyword d =     case d of@@ -193,6 +202,7 @@       Syntax.DialectCommonLisp -> "cl:defconstant"       Syntax.DialectScheme -> "define" +-- | The keyword for named function definitions defnKeyword :: Syntax.Dialect -> String defnKeyword d =     case d of@@ -201,6 +211,7 @@       Syntax.DialectCommonLisp -> "cl:defun"       Syntax.DialectScheme -> "define" +-- | The keyword for record/struct definitions defrecordKeyword :: Syntax.Dialect -> String defrecordKeyword d =     case d of@@ -209,6 +220,7 @@       Syntax.DialectCommonLisp -> "cl:defstruct"       Syntax.DialectScheme -> "define-record-type" +-- | Serialize a do/progn/begin expression doExpressionToExpr :: Syntax.Dialect -> Syntax.DoExpression -> Ast.Expr doExpressionToExpr d doExpr = @@ -221,6 +233,7 @@       in (Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [         Serialization.cst kw] (Lists.map (expressionToExpr d) (Syntax.doExpressionExpressions doExpr))))) +-- | Serialize a docstring as a comment docstringToExpr :: Syntax.Docstring -> Ast.Expr docstringToExpr ds = @@ -229,6 +242,7 @@         ";; ",         text]))) +-- | Serialize an export declaration exportDeclarationToExpr :: Syntax.Dialect -> Syntax.ExportDeclaration -> Ast.Expr exportDeclarationToExpr d edecl = @@ -247,6 +261,7 @@         Syntax.DialectScheme -> Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [           Serialization.cst "export"] syms)) +-- | Serialize a Lisp expression expressionToExpr :: Syntax.Dialect -> Syntax.Expression -> Ast.Expr expressionToExpr d expr =     case expr of@@ -312,6 +327,7 @@           (expressionToExpr d (Syntax.splicingUnquoteExpressionBody v0))]       Syntax.ExpressionSExpression v0 -> sExpressionToExpr v0 +-- | The boolean false expression falseExpr :: Syntax.Dialect -> Ast.Expr falseExpr d =     case d of@@ -320,6 +336,7 @@       Syntax.DialectCommonLisp -> Serialization.cst "cl:nil"       Syntax.DialectScheme -> Serialization.cst "#f" +-- | Serialize a field access expression fieldAccessToExpr :: Syntax.Dialect -> Syntax.FieldAccess -> Ast.Expr fieldAccessToExpr d fa = @@ -351,6 +368,7 @@             field],           target]) +-- | Format a float64 value as a dialect-specific literal string, including special values like NaN and infinities formatLispFloat :: Syntax.Dialect -> Double -> String formatLispFloat d v = @@ -369,6 +387,7 @@         Syntax.DialectCommonLisp -> "+hydra-neg-inf+"         Syntax.DialectEmacsLisp -> "-1.0e+INF") s))) +-- | Serialize a function definition functionDefinitionToExpr :: Syntax.Dialect -> Syntax.FunctionDefinition -> Ast.Expr functionDefinitionToExpr d fdef = @@ -405,6 +424,7 @@               name] params))],           body])) +-- | Serialize an if expression: (if test then else) ifExpressionToExpr :: Syntax.Dialect -> Syntax.IfExpression -> Ast.Expr ifExpressionToExpr d ifExpr = @@ -420,6 +440,7 @@           then_],         elsePart]))) +-- | Serialize an import declaration importDeclarationToExpr :: Syntax.Dialect -> Syntax.ImportDeclaration -> Ast.Expr importDeclarationToExpr d idecl = @@ -441,6 +462,7 @@           Serialization.cst "import",           (Serialization.parens (Serialization.cst modName))]) +-- | Serialize a keyword keywordToExpr :: Syntax.Dialect -> Syntax.Keyword -> Ast.Expr keywordToExpr d k = @@ -455,6 +477,7 @@           "/:",           name])) +-- | The keyword for anonymous functions lambdaKeyword :: Syntax.Dialect -> String lambdaKeyword d =     case d of@@ -463,6 +486,7 @@       Syntax.DialectCommonLisp -> "cl:lambda"       Syntax.DialectScheme -> "lambda" +-- | Serialize a lambda expression lambdaToExpr :: Syntax.Dialect -> Syntax.Lambda -> Ast.Expr lambdaToExpr d lam = @@ -502,6 +526,7 @@             Serialization.parens (Serialization.spaceSepAdaptive params)],           body])) +-- | Serialize a let expression letExpressionToExpr :: Syntax.Dialect -> Syntax.LetExpression -> Ast.Expr letExpressionToExpr d letExpr = @@ -605,6 +630,7 @@               Serialization.parens (Serialization.spaceSepAdaptive bindingExprs)],             body]))) +-- | The keyword for list construction listKeyword :: Syntax.Dialect -> String listKeyword d =     case d of@@ -613,6 +639,7 @@       Syntax.DialectCommonLisp -> "cl:list"       Syntax.DialectScheme -> "list" +-- | Serialize a list literal listLiteralToExpr :: Syntax.Dialect -> Syntax.ListLiteral -> Ast.Expr listLiteralToExpr d ll = @@ -623,6 +650,7 @@         (Serialization.parens (Serialization.spaceSepAdaptive elems))]) (Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [         Serialization.cst (listKeyword d)] elems)))) +-- | Serialize a literal value literalToExpr :: Syntax.Dialect -> Syntax.Literal -> Ast.Expr literalToExpr d lit =     case lit of@@ -687,6 +715,7 @@         Serialization.cst "'",         (symbolToExpr v0)] +-- | Serialize a macro definition macroDefinitionToExpr :: Syntax.Dialect -> Syntax.MacroDefinition -> Ast.Expr macroDefinitionToExpr d mdef = @@ -721,6 +750,7 @@             name],           body])) +-- | Serialize a map literal mapLiteralToExpr :: Syntax.Dialect -> Syntax.MapLiteral -> Ast.Expr mapLiteralToExpr d ml = @@ -747,6 +777,7 @@           (expressionToExpr d (Syntax.mapEntryKey e)),           (expressionToExpr d (Syntax.mapEntryValue e))])) entries))) +-- | Serialize a module declaration moduleDeclarationToExpr :: Syntax.Dialect -> Syntax.ModuleDeclaration -> Ast.Expr moduleDeclarationToExpr d mdecl = @@ -777,6 +808,7 @@           Serialization.cst "define-library",           (Serialization.parens (Serialization.cst name))]) +-- | The nil expression nilExpr :: Syntax.Dialect -> Ast.Expr nilExpr d =     case d of@@ -785,17 +817,20 @@       Syntax.DialectCommonLisp -> Serialization.cst "cl:nil"       Syntax.DialectScheme -> Serialization.cst "'()" +-- | Serialize a not expression: (not expr) notExpressionToExpr :: Syntax.Dialect -> Syntax.NotExpression -> Ast.Expr notExpressionToExpr d notExpr =     Serialization.parens (Serialization.spaceSepAdaptive [       Serialization.cst "not",       (expressionToExpr d (Syntax.notExpressionExpression notExpr))]) +-- | Serialize an or expression: (or expr1 expr2 ...) orExpressionToExpr :: Syntax.Dialect -> Syntax.OrExpression -> Ast.Expr orExpressionToExpr d orExpr =     Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [       Serialization.cst "or"] (Lists.map (expressionToExpr d) (Syntax.orExpressionExpressions orExpr)))) +-- | Serialize a full Lisp program programToExpr :: Syntax.Program -> Ast.Expr programToExpr prog = @@ -946,6 +981,7 @@           in (Serialization.doubleNewlineSep (Lists.concat2 warning [             libraryExpr]))) +-- | Serialize a record type definition recordTypeDefinitionToExpr :: Syntax.Dialect -> Syntax.RecordTypeDefinition -> Ast.Expr recordTypeDefinitionToExpr d rdef = @@ -1005,12 +1041,14 @@               predicate],             accessors]))) +-- | Serialize an S-expression escape hatch sExpressionToExpr :: Syntax.SExpression -> Ast.Expr sExpressionToExpr sexpr =     case sexpr of       Syntax.SExpressionAtom v0 -> Serialization.cst v0       Syntax.SExpressionList v0 -> Serialization.parens (Serialization.spaceSepAdaptive (Lists.map sExpressionToExpr v0)) +-- | Serialize a set literal setLiteralToExpr :: Syntax.Dialect -> Syntax.SetLiteral -> Ast.Expr setLiteralToExpr d sl = @@ -1026,9 +1064,11 @@         Syntax.DialectScheme -> Serialization.parens (Serialization.spaceSepAdaptive (Lists.concat2 [           Serialization.cst "list"] elems)) +-- | Serialize a symbol symbolToExpr :: Syntax.Symbol -> Ast.Expr symbolToExpr s = Serialization.cst (Syntax.unSymbol s) +-- | Serialize a top-level form topLevelFormToExpr :: Syntax.Dialect -> Syntax.TopLevelForm -> Ast.Expr topLevelFormToExpr d form =     case form of@@ -1039,6 +1079,7 @@       Syntax.TopLevelFormMacro v0 -> macroDefinitionToExpr d v0       Syntax.TopLevelFormExpression v0 -> expressionToExpr d v0 +-- | Serialize a top-level form together with its comments topLevelFormWithCommentsToExpr :: Syntax.Dialect -> Syntax.TopLevelFormWithComments -> Ast.Expr topLevelFormWithCommentsToExpr d fwc = @@ -1056,6 +1097,7 @@         [           formExpr]])) +-- | The boolean true expression trueExpr :: Syntax.Dialect -> Ast.Expr trueExpr d =     case d of@@ -1064,6 +1106,7 @@       Syntax.DialectCommonLisp -> Serialization.cst "cl:t"       Syntax.DialectScheme -> Serialization.cst "#t" +-- | Serialize a variable definition variableDefinitionToExpr :: Syntax.Dialect -> Syntax.VariableDefinition -> Ast.Expr variableDefinitionToExpr d vdef = @@ -1074,6 +1117,7 @@         name,         value])) +-- | Serialize a variable reference variableReferenceToExpr :: Syntax.Dialect -> Syntax.VariableReference -> Ast.Expr variableReferenceToExpr d vref = @@ -1087,6 +1131,7 @@         Syntax.DialectEmacsLisp -> name         Syntax.DialectScheme -> name) name) +-- | Serialize a vector literal vectorLiteralToExpr :: Syntax.Dialect -> Syntax.VectorLiteral -> Ast.Expr vectorLiteralToExpr d vl = 
src/main/haskell/Hydra/Lisp/Syntax.hs view
@@ -8,1167 +8,1167 @@ import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci --- | A Lisp program, consisting of a sequence of top-level forms-data Program =-  Program {-    -- | The target Lisp dialect-    programDialect :: Dialect,-    -- | Optional module/namespace declaration-    programModule :: (Maybe ModuleDeclaration),-    -- | Import/require declarations-    programImports :: [ImportDeclaration],-    -- | Export/provide declarations-    programExports :: [ExportDeclaration],-    -- | The top-level forms in the program-    programForms :: [TopLevelFormWithComments]}-  deriving (Eq, Ord, Read, Show)--_Program = Core.Name "hydra.lisp.syntax.Program"--_Program_dialect = Core.Name "dialect"--_Program_module = Core.Name "module"--_Program_imports = Core.Name "imports"--_Program_exports = Core.Name "exports"--_Program_forms = Core.Name "forms"---- | A top-level form in a Lisp program-data TopLevelForm =-  -- | A named function definition-  TopLevelFormFunction FunctionDefinition |-  -- | A global variable definition-  TopLevelFormVariable VariableDefinition |-  -- | A constant definition-  TopLevelFormConstant ConstantDefinition |-  -- | A record/struct type definition-  TopLevelFormRecordType RecordTypeDefinition |-  -- | A macro definition-  TopLevelFormMacro MacroDefinition |-  -- | A bare expression at the top level-  TopLevelFormExpression Expression-  deriving (Eq, Ord, Read, Show)--_TopLevelForm = Core.Name "hydra.lisp.syntax.TopLevelForm"--_TopLevelForm_function = Core.Name "function"--_TopLevelForm_variable = Core.Name "variable"--_TopLevelForm_constant = Core.Name "constant"--_TopLevelForm_recordType = Core.Name "recordType"--_TopLevelForm_macro = Core.Name "macro"--_TopLevelForm_expression = Core.Name "expression"---- | A top-level form together with optional documentation-data TopLevelFormWithComments =-  TopLevelFormWithComments {-    -- | Optional documentation string-    topLevelFormWithCommentsDoc :: (Maybe Docstring),-    -- | Optional comment-    topLevelFormWithCommentsComment :: (Maybe Comment),-    -- | The form itself-    topLevelFormWithCommentsForm :: TopLevelForm}-  deriving (Eq, Ord, Read, Show)--_TopLevelFormWithComments = Core.Name "hydra.lisp.syntax.TopLevelFormWithComments"--_TopLevelFormWithComments_doc = Core.Name "doc"--_TopLevelFormWithComments_comment = Core.Name "comment"--_TopLevelFormWithComments_form = Core.Name "form"---- | A named function definition. Serializes as (defn name [params] body) in Clojure, (defun name (params) body) in Emacs Lisp and Common Lisp, (define (name params) body) in Scheme-data FunctionDefinition =-  FunctionDefinition {-    -- | The function name-    functionDefinitionName :: Symbol,-    -- | The parameter list-    functionDefinitionParams :: [Symbol],-    -- | Optional rest/variadic parameter-    functionDefinitionRestParam :: (Maybe Symbol),-    -- | Optional docstring-    functionDefinitionDoc :: (Maybe Docstring),-    -- | Optional type hints for parameters and return type-    functionDefinitionTypeHints :: [TypeHint],-    -- | The function body (one or more expressions)-    functionDefinitionBody :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_FunctionDefinition = Core.Name "hydra.lisp.syntax.FunctionDefinition"--_FunctionDefinition_name = Core.Name "name"--_FunctionDefinition_params = Core.Name "params"--_FunctionDefinition_restParam = Core.Name "restParam"--_FunctionDefinition_doc = Core.Name "doc"--_FunctionDefinition_typeHints = Core.Name "typeHints"--_FunctionDefinition_body = Core.Name "body"---- | A global variable definition. Serializes as (def name value) in Clojure, (defvar name value) in Emacs Lisp and Common Lisp, (define name value) in Scheme-data VariableDefinition =-  VariableDefinition {-    -- | The variable name-    variableDefinitionName :: Symbol,-    -- | The initial value-    variableDefinitionValue :: Expression,-    -- | Optional docstring-    variableDefinitionDoc :: (Maybe Docstring)}-  deriving (Eq, Ord, Read, Show)--_VariableDefinition = Core.Name "hydra.lisp.syntax.VariableDefinition"--_VariableDefinition_name = Core.Name "name"--_VariableDefinition_value = Core.Name "value"--_VariableDefinition_doc = Core.Name "doc"---- | A constant definition. Serializes as (def ^:const name value) in Clojure, (defconst name value) in Emacs Lisp, (defconstant name value) in Common Lisp. Scheme has no dedicated constant form; uses define.-data ConstantDefinition =-  ConstantDefinition {-    -- | The constant name-    constantDefinitionName :: Symbol,-    -- | The constant value-    constantDefinitionValue :: Expression,-    -- | Optional docstring-    constantDefinitionDoc :: (Maybe Docstring)}-  deriving (Eq, Ord, Read, Show)--_ConstantDefinition = Core.Name "hydra.lisp.syntax.ConstantDefinition"--_ConstantDefinition_name = Core.Name "name"--_ConstantDefinition_value = Core.Name "value"--_ConstantDefinition_doc = Core.Name "doc"---- | A record/struct type definition. Serializes as (defrecord Name [fields]) in Clojure, (cl-defstruct name fields) in Emacs Lisp, (defstruct name fields) in Common Lisp, (define-record-type <Name> ...) in Scheme-data RecordTypeDefinition =-  RecordTypeDefinition {-    -- | The record type name-    recordTypeDefinitionName :: Symbol,-    -- | The field definitions-    recordTypeDefinitionFields :: [FieldDefinition],-    -- | Optional docstring-    recordTypeDefinitionDoc :: (Maybe Docstring)}-  deriving (Eq, Ord, Read, Show)--_RecordTypeDefinition = Core.Name "hydra.lisp.syntax.RecordTypeDefinition"--_RecordTypeDefinition_name = Core.Name "name"--_RecordTypeDefinition_fields = Core.Name "fields"--_RecordTypeDefinition_doc = Core.Name "doc"---- | A field in a record type definition-data FieldDefinition =-  FieldDefinition {-    -- | The field name-    fieldDefinitionName :: Symbol,-    -- | Optional default value-    fieldDefinitionDefaultValue :: (Maybe Expression)}-  deriving (Eq, Ord, Read, Show)--_FieldDefinition = Core.Name "hydra.lisp.syntax.FieldDefinition"--_FieldDefinition_name = Core.Name "name"--_FieldDefinition_defaultValue = Core.Name "defaultValue"---- | A macro definition. Serializes as (defmacro name [params] body) in Clojure, (defmacro name (params) body) in Emacs Lisp and Common Lisp, (define-syntax name ...) in Scheme-data MacroDefinition =-  MacroDefinition {-    -- | The macro name-    macroDefinitionName :: Symbol,-    -- | The parameter list-    macroDefinitionParams :: [Symbol],-    -- | Optional rest parameter-    macroDefinitionRestParam :: (Maybe Symbol),-    -- | The macro body-    macroDefinitionBody :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_MacroDefinition = Core.Name "hydra.lisp.syntax.MacroDefinition"--_MacroDefinition_name = Core.Name "name"--_MacroDefinition_params = Core.Name "params"--_MacroDefinition_restParam = Core.Name "restParam"--_MacroDefinition_body = Core.Name "body"---- | A Lisp expression-data Expression =-  -- | Function application: (f arg1 arg2 ...)-  ExpressionApplication Application |-  -- | Anonymous function-  ExpressionLambda Lambda |-  -- | Local variable binding-  ExpressionLet LetExpression |-  -- | Conditional expression-  ExpressionIf IfExpression |-  -- | Multi-branch conditional-  ExpressionCond CondExpression |-  -- | Case/match dispatch-  ExpressionCase CaseExpression |-  -- | Logical and (short-circuiting)-  ExpressionAnd AndExpression |-  -- | Logical or (short-circuiting)-  ExpressionOr OrExpression |-  -- | Logical negation-  ExpressionNot NotExpression |-  -- | Sequential evaluation (progn/do/begin)-  ExpressionDo DoExpression |-  -- | Sequential evaluation (explicit begin block)-  ExpressionBegin BeginExpression |-  -- | Variable reference-  ExpressionVariable VariableReference |-  -- | A literal value-  ExpressionLiteral Literal |-  -- | A list literal-  ExpressionList ListLiteral |-  -- | A vector literal-  ExpressionVector VectorLiteral |-  -- | A map/association literal-  ExpressionMap MapLiteral |-  -- | A set literal-  ExpressionSet SetLiteral |-  -- | A cons expression-  ExpressionCons ConsExpression |-  -- | A dotted pair literal-  ExpressionDottedPair DottedPair |-  -- | Field access on a record/struct-  ExpressionFieldAccess FieldAccess |-  -- | A type-annotated expression-  ExpressionTypeAnnotation TypeAnnotation |-  -- | A quoted expression-  ExpressionQuote QuoteExpression |-  -- | A quasiquoted expression-  ExpressionQuasiquote QuasiquoteExpression |-  -- | An unquoted expression within a quasiquote-  ExpressionUnquote UnquoteExpression |-  -- | A splicing unquote within a quasiquote-  ExpressionSplicingUnquote SplicingUnquoteExpression |-  -- | An arbitrary S-expression (escape hatch for dialect-specific forms)-  ExpressionSExpression SExpression-  deriving (Eq, Ord, Read, Show)--_Expression = Core.Name "hydra.lisp.syntax.Expression"--_Expression_application = Core.Name "application"--_Expression_lambda = Core.Name "lambda"--_Expression_let = Core.Name "let"--_Expression_if = Core.Name "if"--_Expression_cond = Core.Name "cond"--_Expression_case = Core.Name "case"--_Expression_and = Core.Name "and"--_Expression_or = Core.Name "or"--_Expression_not = Core.Name "not"--_Expression_do = Core.Name "do"--_Expression_begin = Core.Name "begin"--_Expression_variable = Core.Name "variable"--_Expression_literal = Core.Name "literal"--_Expression_list = Core.Name "list"--_Expression_vector = Core.Name "vector"--_Expression_map = Core.Name "map"--_Expression_set = Core.Name "set"--_Expression_cons = Core.Name "cons"--_Expression_dottedPair = Core.Name "dottedPair"--_Expression_fieldAccess = Core.Name "fieldAccess"--_Expression_typeAnnotation = Core.Name "typeAnnotation"--_Expression_quote = Core.Name "quote"--_Expression_quasiquote = Core.Name "quasiquote"--_Expression_unquote = Core.Name "unquote"--_Expression_splicingUnquote = Core.Name "splicingUnquote"--_Expression_sExpression = Core.Name "sExpression"---- | Function application: (function arg1 arg2 ...)-data Application =-  Application {-    -- | The function being applied-    applicationFunction :: Expression,-    -- | The arguments-    applicationArguments :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_Application = Core.Name "hydra.lisp.syntax.Application"--_Application_function = Core.Name "function"--_Application_arguments = Core.Name "arguments"---- | An anonymous function. Serializes as (fn [params] body) in Clojure, (lambda (params) body) in Emacs Lisp, Common Lisp, and Scheme. If name is provided, emits (fn name [params] body) in Clojure for self-reference.-data Lambda =-  Lambda {-    -- | Optional name for self-referential lambdas (Clojure named fn)-    lambdaName :: (Maybe Symbol),-    -- | The parameter list-    lambdaParams :: [Symbol],-    -- | Optional rest parameter-    lambdaRestParam :: (Maybe Symbol),-    -- | The lambda body-    lambdaBody :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_Lambda = Core.Name "hydra.lisp.syntax.Lambda"--_Lambda_name = Core.Name "name"--_Lambda_params = Core.Name "params"--_Lambda_restParam = Core.Name "restParam"--_Lambda_body = Core.Name "body"---- | A reference to a variable by name-data VariableReference =-  VariableReference {-    -- | The variable name-    variableReferenceName :: Symbol,-    -- | Whether to reference from the function namespace. In Lisp-2 dialects (Common Lisp), this emits #'name. In Lisp-1 dialects, this has no effect.-    variableReferenceFunctionNamespace :: Bool}-  deriving (Eq, Ord, Read, Show)--_VariableReference = Core.Name "hydra.lisp.syntax.VariableReference"--_VariableReference_name = Core.Name "name"--_VariableReference_functionNamespace = Core.Name "functionNamespace"---- | Field access on a record/struct. Serializes as (:field record) in Clojure, (struct-field record) in Emacs Lisp and Common Lisp, (record-field record) in Scheme-data FieldAccess =-  FieldAccess {-    -- | The record type name (used to form accessor name)-    fieldAccessRecordType :: Symbol,-    -- | The field name-    fieldAccessField :: Symbol,-    -- | The expression being accessed-    fieldAccessTarget :: Expression}-  deriving (Eq, Ord, Read, Show)--_FieldAccess = Core.Name "hydra.lisp.syntax.FieldAccess"--_FieldAccess_recordType = Core.Name "recordType"--_FieldAccess_field = Core.Name "field"--_FieldAccess_target = Core.Name "target"---- | An expression with a type annotation-data TypeAnnotation =-  TypeAnnotation {-    -- | The annotated expression-    typeAnnotationExpression :: Expression,-    -- | The type specifier-    typeAnnotationType :: TypeSpecifier}-  deriving (Eq, Ord, Read, Show)--_TypeAnnotation = Core.Name "hydra.lisp.syntax.TypeAnnotation"--_TypeAnnotation_expression = Core.Name "expression"--_TypeAnnotation_type = Core.Name "type"---- | Conditional: (if test then else)-data IfExpression =-  IfExpression {-    -- | The test expression-    ifExpressionCondition :: Expression,-    -- | The then branch-    ifExpressionThen :: Expression,-    -- | Optional else branch-    ifExpressionElse :: (Maybe Expression)}-  deriving (Eq, Ord, Read, Show)--_IfExpression = Core.Name "hydra.lisp.syntax.IfExpression"--_IfExpression_condition = Core.Name "condition"--_IfExpression_then = Core.Name "then"--_IfExpression_else = Core.Name "else"---- | Multi-branch conditional. Serializes as (cond test1 expr1 test2 expr2 :else default) in Clojure, (cond (test1 expr1) (test2 expr2) (t default)) in Emacs Lisp and Common Lisp, (cond (test1 expr1) (test2 expr2) (else default)) in Scheme-data CondExpression =-  CondExpression {-    -- | The condition-expression pairs-    condExpressionClauses :: [CondClause],-    -- | Optional default expression-    condExpressionDefault :: (Maybe Expression)}-  deriving (Eq, Ord, Read, Show)--_CondExpression = Core.Name "hydra.lisp.syntax.CondExpression"--_CondExpression_clauses = Core.Name "clauses"--_CondExpression_default = Core.Name "default"---- | A clause in a cond expression-data CondClause =-  CondClause {-    -- | The test condition-    condClauseCondition :: Expression,-    -- | The result expression-    condClauseBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_CondClause = Core.Name "hydra.lisp.syntax.CondClause"--_CondClause_condition = Core.Name "condition"--_CondClause_body = Core.Name "body"---- | Case dispatch on a value. Serializes as (case x key1 expr1 key2 expr2 default) in Clojure, (case x (key1 expr1) (key2 expr2) (otherwise default)) in Common Lisp, (case x ((key1) expr1) ((key2) expr2) (else default)) in Scheme-data CaseExpression =-  CaseExpression {-    -- | The expression being dispatched on-    caseExpressionScrutinee :: Expression,-    -- | The case clauses-    caseExpressionClauses :: [CaseClause],-    -- | Optional default clause-    caseExpressionDefault :: (Maybe Expression)}-  deriving (Eq, Ord, Read, Show)--_CaseExpression = Core.Name "hydra.lisp.syntax.CaseExpression"--_CaseExpression_scrutinee = Core.Name "scrutinee"--_CaseExpression_clauses = Core.Name "clauses"--_CaseExpression_default = Core.Name "default"---- | A clause in a case expression-data CaseClause =-  CaseClause {-    -- | The matching keys (one or more datum values)-    caseClauseKeys :: [Expression],-    -- | The result expression-    caseClauseBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_CaseClause = Core.Name "hydra.lisp.syntax.CaseClause"--_CaseClause_keys = Core.Name "keys"--_CaseClause_body = Core.Name "body"---- | Logical and: (and expr1 expr2 ...)-data AndExpression =-  AndExpression {-    -- | The operand expressions-    andExpressionExpressions :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_AndExpression = Core.Name "hydra.lisp.syntax.AndExpression"--_AndExpression_expressions = Core.Name "expressions"---- | Logical or: (or expr1 expr2 ...)-data OrExpression =-  OrExpression {-    -- | The operand expressions-    orExpressionExpressions :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_OrExpression = Core.Name "hydra.lisp.syntax.OrExpression"--_OrExpression_expressions = Core.Name "expressions"---- | Logical negation: (not expr)-data NotExpression =-  NotExpression {-    -- | The operand expression-    notExpressionExpression :: Expression}-  deriving (Eq, Ord, Read, Show)--_NotExpression = Core.Name "hydra.lisp.syntax.NotExpression"--_NotExpression_expression = Core.Name "expression"---- | Sequential evaluation of expressions, returning the last. Serializes as (do expr1 expr2 ...) in Clojure, (progn expr1 expr2 ...) in Emacs Lisp and Common Lisp, (begin expr1 expr2 ...) in Scheme-data DoExpression =-  DoExpression {-    -- | The expressions to evaluate in sequence-    doExpressionExpressions :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_DoExpression = Core.Name "hydra.lisp.syntax.DoExpression"--_DoExpression_expressions = Core.Name "expressions"---- | An explicit begin block (distinct from do for Scheme compatibility)-data BeginExpression =-  BeginExpression {-    -- | The expressions to evaluate in sequence-    beginExpressionExpressions :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_BeginExpression = Core.Name "hydra.lisp.syntax.BeginExpression"--_BeginExpression_expressions = Core.Name "expressions"---- | A quoted form: 'expr or (quote expr)-data QuoteExpression =-  QuoteExpression {-    -- | The quoted form-    quoteExpressionBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_QuoteExpression = Core.Name "hydra.lisp.syntax.QuoteExpression"--_QuoteExpression_body = Core.Name "body"---- | A quasiquoted form: `expr-data QuasiquoteExpression =-  QuasiquoteExpression {-    -- | The quasiquoted form-    quasiquoteExpressionBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_QuasiquoteExpression = Core.Name "hydra.lisp.syntax.QuasiquoteExpression"--_QuasiquoteExpression_body = Core.Name "body"---- | An unquoted form within a quasiquote: ~expr or ,expr-data UnquoteExpression =-  UnquoteExpression {-    -- | The unquoted form-    unquoteExpressionBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_UnquoteExpression = Core.Name "hydra.lisp.syntax.UnquoteExpression"--_UnquoteExpression_body = Core.Name "body"---- | A splicing unquote within a quasiquote: ~@expr or ,@expr-data SplicingUnquoteExpression =-  SplicingUnquoteExpression {-    -- | The spliced form-    splicingUnquoteExpressionBody :: Expression}-  deriving (Eq, Ord, Read, Show)--_SplicingUnquoteExpression = Core.Name "hydra.lisp.syntax.SplicingUnquoteExpression"--_SplicingUnquoteExpression_body = Core.Name "body"---- | Local variable bindings. Serializes as (let [x 1 y 2] body) in Clojure (always sequential), (let ((x 1) (y 2)) body) or (let* ...) in other dialects-data LetExpression =-  LetExpression {-    -- | The kind of let (parallel or sequential)-    letExpressionKind :: LetKind,-    -- | The variable bindings-    letExpressionBindings :: [LetBinding],-    -- | The body expressions-    letExpressionBody :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_LetExpression = Core.Name "hydra.lisp.syntax.LetExpression"--_LetExpression_kind = Core.Name "kind"--_LetExpression_bindings = Core.Name "bindings"--_LetExpression_body = Core.Name "body"---- | The kind of let binding-data LetKind =-  LetKindParallel |-  LetKindSequential |-  LetKindRecursive-  deriving (Eq, Ord, Read, Show)--_LetKind = Core.Name "hydra.lisp.syntax.LetKind"--_LetKind_parallel = Core.Name "parallel"--_LetKind_sequential = Core.Name "sequential"--_LetKind_recursive = Core.Name "recursive"---- | A single binding in a let expression-data LetBinding =-  -- | A simple name-value binding-  LetBindingSimple SimpleBinding |-  -- | A destructuring binding-  LetBindingDestructuring DestructuringBinding-  deriving (Eq, Ord, Read, Show)--_LetBinding = Core.Name "hydra.lisp.syntax.LetBinding"--_LetBinding_simple = Core.Name "simple"--_LetBinding_destructuring = Core.Name "destructuring"---- | A simple name-value binding in a let expression-data SimpleBinding =-  SimpleBinding {-    -- | The bound variable-    simpleBindingName :: Symbol,-    -- | The value expression-    simpleBindingValue :: Expression}-  deriving (Eq, Ord, Read, Show)--_SimpleBinding = Core.Name "hydra.lisp.syntax.SimpleBinding"--_SimpleBinding_name = Core.Name "name"--_SimpleBinding_value = Core.Name "value"---- | A destructuring binding in a let expression-data DestructuringBinding =-  DestructuringBinding {-    -- | The destructuring pattern-    destructuringBindingPattern :: DestructuringPattern,-    -- | The value to destructure-    destructuringBindingValue :: Expression}-  deriving (Eq, Ord, Read, Show)--_DestructuringBinding = Core.Name "hydra.lisp.syntax.DestructuringBinding"--_DestructuringBinding_pattern = Core.Name "pattern"--_DestructuringBinding_value = Core.Name "value"---- | A destructuring pattern-data DestructuringPattern =-  -- | Sequential destructuring: [a b c] in Clojure, (a b c) in others-  DestructuringPatternSequential [Symbol] |-  -- | Associative/map destructuring: {:keys [a b]} in Clojure-  DestructuringPatternAssociative [Symbol] |-  -- | Destructuring with a rest element: [a b & rest] (leading symbols + rest symbol)-  DestructuringPatternRest [Symbol]-  deriving (Eq, Ord, Read, Show)--_DestructuringPattern = Core.Name "hydra.lisp.syntax.DestructuringPattern"--_DestructuringPattern_sequential = Core.Name "sequential"--_DestructuringPattern_associative = Core.Name "associative"--_DestructuringPattern_rest = Core.Name "rest"---- | A pattern for use in case expressions or match forms-data Pattern =-  -- | A constructor pattern (for union/sum type matching)-  PatternConstructor ConstructorPattern |-  -- | A literal pattern-  PatternLiteral LiteralPattern |-  -- | A wildcard pattern matching anything-  PatternWildcard WildcardPattern |-  -- | A variable pattern that binds the matched value-  PatternVariable Symbol-  deriving (Eq, Ord, Read, Show)--_Pattern = Core.Name "hydra.lisp.syntax.Pattern"--_Pattern_constructor = Core.Name "constructor"--_Pattern_literal = Core.Name "literal"--_Pattern_wildcard = Core.Name "wildcard"--_Pattern_variable = Core.Name "variable"---- | A constructor pattern matching a tagged value-data ConstructorPattern =-  ConstructorPattern {-    -- | The constructor/tag name-    constructorPatternConstructor :: Symbol,-    -- | The sub-patterns for constructor arguments-    constructorPatternArguments :: [Pattern]}-  deriving (Eq, Ord, Read, Show)--_ConstructorPattern = Core.Name "hydra.lisp.syntax.ConstructorPattern"--_ConstructorPattern_constructor = Core.Name "constructor"--_ConstructorPattern_arguments = Core.Name "arguments"---- | A pattern matching a literal value-data LiteralPattern =-  LiteralPattern {-    -- | The literal to match-    literalPatternValue :: Literal}-  deriving (Eq, Ord, Read, Show)--_LiteralPattern = Core.Name "hydra.lisp.syntax.LiteralPattern"--_LiteralPattern_value = Core.Name "value"---- | A wildcard pattern that matches any value-type WildcardPattern = ()--_WildcardPattern = Core.Name "hydra.lisp.syntax.WildcardPattern"---- | A Lisp literal value-data Literal =-  -- | An integer literal-  LiteralInteger IntegerLiteral |-  -- | A floating-point literal-  LiteralFloat FloatLiteral |-  -- | A string literal-  LiteralString String |-  -- | A character literal-  LiteralCharacter CharacterLiteral |-  -- | A boolean literal (dialect-specific rendering)-  LiteralBoolean Bool |-  -- | Nil/null/empty list (dialect-specific rendering)-  LiteralNil |-  -- | A keyword literal-  LiteralKeyword Keyword |-  -- | A quoted symbol literal-  LiteralSymbol Symbol-  deriving (Eq, Ord, Read, Show)--_Literal = Core.Name "hydra.lisp.syntax.Literal"--_Literal_integer = Core.Name "integer"--_Literal_float = Core.Name "float"--_Literal_string = Core.Name "string"--_Literal_character = Core.Name "character"--_Literal_boolean = Core.Name "boolean"--_Literal_nil = Core.Name "nil"--_Literal_keyword = Core.Name "keyword"--_Literal_symbol = Core.Name "symbol"---- | An integer literal-data IntegerLiteral =-  IntegerLiteral {-    -- | The integer value-    integerLiteralValue :: Integer,-    -- | Whether this is explicitly a big integer (e.g. 42N in Clojure)-    integerLiteralBigint :: Bool}-  deriving (Eq, Ord, Read, Show)--_IntegerLiteral = Core.Name "hydra.lisp.syntax.IntegerLiteral"--_IntegerLiteral_value = Core.Name "value"--_IntegerLiteral_bigint = Core.Name "bigint"---- | A floating-point literal-data FloatLiteral =-  FloatLiteral {-    -- | The float value-    floatLiteralValue :: Double,-    -- | Optional precision hint (e.g. 3.14d0 vs 3.14f0 in Common Lisp)-    floatLiteralPrecision :: (Maybe String)}-  deriving (Eq, Ord, Read, Show)--_FloatLiteral = Core.Name "hydra.lisp.syntax.FloatLiteral"--_FloatLiteral_value = Core.Name "value"--_FloatLiteral_precision = Core.Name "precision"---- | A character literal. Concrete syntax varies: \a (Clojure), ?a (Emacs Lisp), #\a (Common Lisp, Scheme)-data CharacterLiteral =-  CharacterLiteral {-    -- | The character value-    characterLiteralValue :: String}-  deriving (Eq, Ord, Read, Show)--_CharacterLiteral = Core.Name "hydra.lisp.syntax.CharacterLiteral"--_CharacterLiteral_value = Core.Name "value"---- | The style of boolean literals in a dialect-data BooleanStyle =-  BooleanStyleTrueFalse |-  BooleanStyleTNil |-  BooleanStyleHashTF-  deriving (Eq, Ord, Read, Show)--_BooleanStyle = Core.Name "hydra.lisp.syntax.BooleanStyle"--_BooleanStyle_trueFalse = Core.Name "trueFalse"--_BooleanStyle_tNil = Core.Name "tNil"--_BooleanStyle_hashTF = Core.Name "hashTF"---- | The style of nil/null in a dialect-data NilStyle =-  NilStyleNil |-  NilStyleEmptyList-  deriving (Eq, Ord, Read, Show)--_NilStyle = Core.Name "hydra.lisp.syntax.NilStyle"--_NilStyle_nil = Core.Name "nil"--_NilStyle_emptyList = Core.Name "emptyList"---- | A Lisp symbol (identifier)-newtype Symbol =-  Symbol {-    unSymbol :: String}-  deriving (Eq, Ord, Read, Show)--_Symbol = Core.Name "hydra.lisp.syntax.Symbol"---- | A keyword (self-evaluating symbol). Serializes as :name in Clojure, Emacs Lisp, and Common Lisp-data Keyword =-  Keyword {-    -- | The keyword name (without the leading colon)-    keywordName :: String,-    -- | Optional namespace (e.g. my.ns/foo in Clojure)-    keywordNamespace :: (Maybe String)}-  deriving (Eq, Ord, Read, Show)--_Keyword = Core.Name "hydra.lisp.syntax.Keyword"--_Keyword_name = Core.Name "name"--_Keyword_namespace = Core.Name "namespace"---- | A namespace-qualified symbol. Serializes as ns/name in Clojure, pkg:name or pkg::name in Common Lisp-data QualifiedSymbol =-  QualifiedSymbol {-    -- | The namespace or package-    qualifiedSymbolNamespace :: String,-    -- | The local name-    qualifiedSymbolName :: String}-  deriving (Eq, Ord, Read, Show)--_QualifiedSymbol = Core.Name "hydra.lisp.syntax.QualifiedSymbol"--_QualifiedSymbol_namespace = Core.Name "namespace"--_QualifiedSymbol_name = Core.Name "name"---- | A namespace or package name-newtype NamespaceName =-  NamespaceName {-    unNamespaceName :: String}-  deriving (Eq, Ord, Read, Show)--_NamespaceName = Core.Name "hydra.lisp.syntax.NamespaceName"---- | A list literal: '(1 2 3) or (list 1 2 3)-data ListLiteral =-  ListLiteral {-    -- | The list elements-    listLiteralElements :: [Expression],-    -- | Whether to use quote syntax vs constructor syntax-    listLiteralQuoted :: Bool}-  deriving (Eq, Ord, Read, Show)--_ListLiteral = Core.Name "hydra.lisp.syntax.ListLiteral"--_ListLiteral_elements = Core.Name "elements"--_ListLiteral_quoted = Core.Name "quoted"---- | A vector literal. Serializes as [1 2 3] in Clojure and Emacs Lisp, #(1 2 3) in Common Lisp and Scheme-data VectorLiteral =-  VectorLiteral {-    -- | The vector elements-    vectorLiteralElements :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_VectorLiteral = Core.Name "hydra.lisp.syntax.VectorLiteral"--_VectorLiteral_elements = Core.Name "elements"---- | A map/dictionary literal. Serializes as {:a 1 :b 2} in Clojure, as an alist '((a . 1) (b . 2)) in other dialects-data MapLiteral =-  MapLiteral {-    -- | The key-value pairs-    mapLiteralEntries :: [MapEntry]}-  deriving (Eq, Ord, Read, Show)--_MapLiteral = Core.Name "hydra.lisp.syntax.MapLiteral"--_MapLiteral_entries = Core.Name "entries"---- | A key-value pair in a map literal-data MapEntry =-  MapEntry {-    -- | The key expression-    mapEntryKey :: Expression,-    -- | The value expression-    mapEntryValue :: Expression}-  deriving (Eq, Ord, Read, Show)--_MapEntry = Core.Name "hydra.lisp.syntax.MapEntry"--_MapEntry_key = Core.Name "key"--_MapEntry_value = Core.Name "value"---- | A set literal. Serializes as #{1 2 3} in Clojure. Other dialects use a list-based construction.-data SetLiteral =-  SetLiteral {-    -- | The set elements-    setLiteralElements :: [Expression]}-  deriving (Eq, Ord, Read, Show)--_SetLiteral = Core.Name "hydra.lisp.syntax.SetLiteral"--_SetLiteral_elements = Core.Name "elements"---- | A cons expression: (cons head tail)-data ConsExpression =-  ConsExpression {-    -- | The head element-    consExpressionHead :: Expression,-    -- | The tail (typically a list or another cons)-    consExpressionTail :: Expression}-  deriving (Eq, Ord, Read, Show)--_ConsExpression = Core.Name "hydra.lisp.syntax.ConsExpression"--_ConsExpression_head = Core.Name "head"--_ConsExpression_tail = Core.Name "tail"---- | A dotted pair literal: '(a . b). Not available in Clojure.-data DottedPair =-  DottedPair {-    -- | The first element-    dottedPairCar :: Expression,-    -- | The second element-    dottedPairCdr :: Expression}-  deriving (Eq, Ord, Read, Show)--_DottedPair = Core.Name "hydra.lisp.syntax.DottedPair"--_DottedPair_car = Core.Name "car"--_DottedPair_cdr = Core.Name "cdr"---- | A type hint or annotation. In Clojure: ^Type name. In Common Lisp: (declare (type Type name)). In Scheme and Emacs Lisp: typically unused.-data TypeHint =-  TypeHint {-    -- | The annotated symbol-    typeHintName :: Symbol,-    -- | The type specifier-    typeHintType :: TypeSpecifier}-  deriving (Eq, Ord, Read, Show)--_TypeHint = Core.Name "hydra.lisp.syntax.TypeHint"--_TypeHint_name = Core.Name "name"--_TypeHint_type = Core.Name "type"---- | A type specifier-data TypeSpecifier =-  -- | A named type reference-  TypeSpecifierNamed Symbol |-  -- | A list type-  TypeSpecifierList TypeSpecifier |-  -- | A function type (params and return)-  TypeSpecifierFunction [TypeSpecifier] |-  -- | An optional type-  TypeSpecifierMaybe TypeSpecifier |-  -- | A map type (key and value type specifiers)-  TypeSpecifierMap [TypeSpecifier] |-  -- | A set type-  TypeSpecifierSet TypeSpecifier |-  -- | A pair/tuple type (two type specifiers)-  TypeSpecifierPair [TypeSpecifier] |-  -- | An either/union type (two type specifiers)-  TypeSpecifierEither [TypeSpecifier] |-  -- | The unit type-  TypeSpecifierUnit-  deriving (Eq, Ord, Read, Show)--_TypeSpecifier = Core.Name "hydra.lisp.syntax.TypeSpecifier"--_TypeSpecifier_named = Core.Name "named"--_TypeSpecifier_list = Core.Name "list"--_TypeSpecifier_function = Core.Name "function"--_TypeSpecifier_maybe = Core.Name "maybe"--_TypeSpecifier_map = Core.Name "map"--_TypeSpecifier_set = Core.Name "set"--_TypeSpecifier_pair = Core.Name "pair"--_TypeSpecifier_either = Core.Name "either"--_TypeSpecifier_unit = Core.Name "unit"---- | A module/namespace declaration. Serializes as (ns name ...) in Clojure, (provide 'name) in Emacs Lisp, (defpackage :name ... ) (in-package :name) in Common Lisp, (define-library (name) ...) in Scheme-data ModuleDeclaration =-  ModuleDeclaration {-    -- | The module/namespace name-    moduleDeclarationName :: NamespaceName,-    -- | Optional module documentation-    moduleDeclarationDoc :: (Maybe Docstring)}-  deriving (Eq, Ord, Read, Show)--_ModuleDeclaration = Core.Name "hydra.lisp.syntax.ModuleDeclaration"--_ModuleDeclaration_name = Core.Name "name"--_ModuleDeclaration_doc = Core.Name "doc"---- | An import/require declaration. Serializes as (:require [name ...]) in Clojure, (require 'name) in Emacs Lisp, (:use :name) or (:import-from :name ...) in Common Lisp, (import (name)) in Scheme-data ImportDeclaration =-  ImportDeclaration {-    -- | The module being imported-    importDeclarationModule :: NamespaceName,-    -- | Import specification-    importDeclarationSpec :: ImportSpec}-  deriving (Eq, Ord, Read, Show)--_ImportDeclaration = Core.Name "hydra.lisp.syntax.ImportDeclaration"--_ImportDeclaration_module = Core.Name "module"--_ImportDeclaration_spec = Core.Name "spec"---- | An import specification describing how to import symbols-data ImportSpec =-  -- | Import everything-  ImportSpecAll |-  -- | Import with an alias: (:require [name :as alias]) in Clojure-  ImportSpecAlias Symbol |-  -- | Import specific symbols: (:require [name :refer [sym1 sym2]]) in Clojure-  ImportSpecOnly [Symbol] |-  -- | Import with renaming: list of (from, to) symbol pairs-  ImportSpecRename [[Symbol]]-  deriving (Eq, Ord, Read, Show)--_ImportSpec = Core.Name "hydra.lisp.syntax.ImportSpec"--_ImportSpec_all = Core.Name "all"--_ImportSpec_alias = Core.Name "alias"--_ImportSpec_only = Core.Name "only"--_ImportSpec_rename = Core.Name "rename"---- | An export/provide declaration. Serializes as (provide 'name) in Emacs Lisp, (:export :sym1 :sym2) in Common Lisp, (export sym1 sym2) in Scheme. In Clojure, symbols are public by default.-data ExportDeclaration =-  ExportDeclaration {-    -- | The symbols to export-    exportDeclarationSymbols :: [Symbol]}-  deriving (Eq, Ord, Read, Show)--_ExportDeclaration = Core.Name "hydra.lisp.syntax.ExportDeclaration"--_ExportDeclaration_symbols = Core.Name "symbols"---- | A comment-data Comment =-  Comment {-    -- | The comment style-    commentStyle :: CommentStyle,-    -- | The comment text-    commentText :: String}-  deriving (Eq, Ord, Read, Show)--_Comment = Core.Name "hydra.lisp.syntax.Comment"--_Comment_style = Core.Name "style"--_Comment_text = Core.Name "text"---- | The style of a comment-data CommentStyle =-  CommentStyleLine |-  CommentStyleBlock |-  CommentStyleDatum-  deriving (Eq, Ord, Read, Show)--_CommentStyle = Core.Name "hydra.lisp.syntax.CommentStyle"--_CommentStyle_line = Core.Name "line"--_CommentStyle_block = Core.Name "block"--_CommentStyle_datum = Core.Name "datum"---- | A documentation string-newtype Docstring =-  Docstring {-    unDocstring :: String}-  deriving (Eq, Ord, Read, Show)--_Docstring = Core.Name "hydra.lisp.syntax.Docstring"---- | A Lisp dialect-data Dialect =-  DialectClojure |-  DialectEmacsLisp |-  DialectCommonLisp |-  DialectScheme-  deriving (Eq, Ord, Read, Show)--_Dialect = Core.Name "hydra.lisp.syntax.Dialect"--_Dialect_clojure = Core.Name "clojure"--_Dialect_emacsLisp = Core.Name "emacsLisp"--_Dialect_commonLisp = Core.Name "commonLisp"--_Dialect_scheme = Core.Name "scheme"---- | A raw S-expression. This is an escape hatch for expressing arbitrary Lisp forms that do not fit into the structured AST above.-data SExpression =-  -- | An atomic value-  SExpressionAtom String |-  -- | A list of S-expressions-  SExpressionList [SExpression]-  deriving (Eq, Ord, Read, Show)--_SExpression = Core.Name "hydra.lisp.syntax.SExpression"--_SExpression_atom = Core.Name "atom"--_SExpression_list = Core.Name "list"+-- | Logical and: (and expr1 expr2 ...)+data AndExpression =+  AndExpression {+    -- | The operand expressions+    andExpressionExpressions :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_AndExpression = Core.Name "hydra.lisp.syntax.AndExpression"++_AndExpression_expressions = Core.Name "expressions"++-- | Function application: (function arg1 arg2 ...)+data Application =+  Application {+    -- | The function being applied+    applicationFunction :: Expression,+    -- | The arguments+    applicationArguments :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_Application = Core.Name "hydra.lisp.syntax.Application"++_Application_function = Core.Name "function"++_Application_arguments = Core.Name "arguments"++-- | An explicit begin block (distinct from do for Scheme compatibility)+data BeginExpression =+  BeginExpression {+    -- | The expressions to evaluate in sequence+    beginExpressionExpressions :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_BeginExpression = Core.Name "hydra.lisp.syntax.BeginExpression"++_BeginExpression_expressions = Core.Name "expressions"++-- | The style of boolean literals in a dialect+data BooleanStyle =+  BooleanStyleTrueFalse |+  BooleanStyleTNil |+  BooleanStyleHashTF+  deriving (Eq, Ord, Read, Show)++_BooleanStyle = Core.Name "hydra.lisp.syntax.BooleanStyle"++_BooleanStyle_trueFalse = Core.Name "trueFalse"++_BooleanStyle_tNil = Core.Name "tNil"++_BooleanStyle_hashTF = Core.Name "hashTF"++-- | A clause in a case expression+data CaseClause =+  CaseClause {+    -- | The matching keys (one or more datum values)+    caseClauseKeys :: [Expression],+    -- | The result expression+    caseClauseBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_CaseClause = Core.Name "hydra.lisp.syntax.CaseClause"++_CaseClause_keys = Core.Name "keys"++_CaseClause_body = Core.Name "body"++-- | Case dispatch on a value. Serializes as (case x key1 expr1 key2 expr2 default) in Clojure, (case x (key1 expr1) (key2 expr2) (otherwise default)) in Common Lisp, (case x ((key1) expr1) ((key2) expr2) (else default)) in Scheme+data CaseExpression =+  CaseExpression {+    -- | The expression being dispatched on+    caseExpressionScrutinee :: Expression,+    -- | The case clauses+    caseExpressionClauses :: [CaseClause],+    -- | Optional default clause+    caseExpressionDefault :: (Maybe Expression)}+  deriving (Eq, Ord, Read, Show)++_CaseExpression = Core.Name "hydra.lisp.syntax.CaseExpression"++_CaseExpression_scrutinee = Core.Name "scrutinee"++_CaseExpression_clauses = Core.Name "clauses"++_CaseExpression_default = Core.Name "default"++-- | A character literal. Concrete syntax varies: \a (Clojure), ?a (Emacs Lisp), #\a (Common Lisp, Scheme)+data CharacterLiteral =+  CharacterLiteral {+    -- | The character value+    characterLiteralValue :: String}+  deriving (Eq, Ord, Read, Show)++_CharacterLiteral = Core.Name "hydra.lisp.syntax.CharacterLiteral"++_CharacterLiteral_value = Core.Name "value"++-- | A comment+data Comment =+  Comment {+    -- | The comment style+    commentStyle :: CommentStyle,+    -- | The comment text+    commentText :: String}+  deriving (Eq, Ord, Read, Show)++_Comment = Core.Name "hydra.lisp.syntax.Comment"++_Comment_style = Core.Name "style"++_Comment_text = Core.Name "text"++-- | The style of a comment+data CommentStyle =+  CommentStyleLine |+  CommentStyleBlock |+  CommentStyleDatum+  deriving (Eq, Ord, Read, Show)++_CommentStyle = Core.Name "hydra.lisp.syntax.CommentStyle"++_CommentStyle_line = Core.Name "line"++_CommentStyle_block = Core.Name "block"++_CommentStyle_datum = Core.Name "datum"++-- | A clause in a cond expression+data CondClause =+  CondClause {+    -- | The test condition+    condClauseCondition :: Expression,+    -- | The result expression+    condClauseBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_CondClause = Core.Name "hydra.lisp.syntax.CondClause"++_CondClause_condition = Core.Name "condition"++_CondClause_body = Core.Name "body"++-- | Multi-branch conditional. Serializes as (cond test1 expr1 test2 expr2 :else default) in Clojure, (cond (test1 expr1) (test2 expr2) (t default)) in Emacs Lisp and Common Lisp, (cond (test1 expr1) (test2 expr2) (else default)) in Scheme+data CondExpression =+  CondExpression {+    -- | The condition-expression pairs+    condExpressionClauses :: [CondClause],+    -- | Optional default expression+    condExpressionDefault :: (Maybe Expression)}+  deriving (Eq, Ord, Read, Show)++_CondExpression = Core.Name "hydra.lisp.syntax.CondExpression"++_CondExpression_clauses = Core.Name "clauses"++_CondExpression_default = Core.Name "default"++-- | A cons expression: (cons head tail)+data ConsExpression =+  ConsExpression {+    -- | The head element+    consExpressionHead :: Expression,+    -- | The tail (typically a list or another cons)+    consExpressionTail :: Expression}+  deriving (Eq, Ord, Read, Show)++_ConsExpression = Core.Name "hydra.lisp.syntax.ConsExpression"++_ConsExpression_head = Core.Name "head"++_ConsExpression_tail = Core.Name "tail"++-- | A constant definition. Serializes as (def ^:const name value) in Clojure, (defconst name value) in Emacs Lisp, (defconstant name value) in Common Lisp. Scheme has no dedicated constant form; uses define.+data ConstantDefinition =+  ConstantDefinition {+    -- | The constant name+    constantDefinitionName :: Symbol,+    -- | The constant value+    constantDefinitionValue :: Expression,+    -- | Optional docstring+    constantDefinitionDoc :: (Maybe Docstring)}+  deriving (Eq, Ord, Read, Show)++_ConstantDefinition = Core.Name "hydra.lisp.syntax.ConstantDefinition"++_ConstantDefinition_name = Core.Name "name"++_ConstantDefinition_value = Core.Name "value"++_ConstantDefinition_doc = Core.Name "doc"++-- | A constructor pattern matching a tagged value+data ConstructorPattern =+  ConstructorPattern {+    -- | The constructor/tag name+    constructorPatternConstructor :: Symbol,+    -- | The sub-patterns for constructor arguments+    constructorPatternArguments :: [Pattern]}+  deriving (Eq, Ord, Read, Show)++_ConstructorPattern = Core.Name "hydra.lisp.syntax.ConstructorPattern"++_ConstructorPattern_constructor = Core.Name "constructor"++_ConstructorPattern_arguments = Core.Name "arguments"++-- | A destructuring binding in a let expression+data DestructuringBinding =+  DestructuringBinding {+    -- | The destructuring pattern+    destructuringBindingPattern :: DestructuringPattern,+    -- | The value to destructure+    destructuringBindingValue :: Expression}+  deriving (Eq, Ord, Read, Show)++_DestructuringBinding = Core.Name "hydra.lisp.syntax.DestructuringBinding"++_DestructuringBinding_pattern = Core.Name "pattern"++_DestructuringBinding_value = Core.Name "value"++-- | A destructuring pattern+data DestructuringPattern =+  -- | Sequential destructuring: [a b c] in Clojure, (a b c) in others+  DestructuringPatternSequential [Symbol] |+  -- | Associative/map destructuring: {:keys [a b]} in Clojure+  DestructuringPatternAssociative [Symbol] |+  -- | Destructuring with a rest element: [a b & rest] (leading symbols + rest symbol)+  DestructuringPatternRest [Symbol]+  deriving (Eq, Ord, Read, Show)++_DestructuringPattern = Core.Name "hydra.lisp.syntax.DestructuringPattern"++_DestructuringPattern_sequential = Core.Name "sequential"++_DestructuringPattern_associative = Core.Name "associative"++_DestructuringPattern_rest = Core.Name "rest"++-- | A Lisp dialect+data Dialect =+  DialectClojure |+  DialectEmacsLisp |+  DialectCommonLisp |+  DialectScheme+  deriving (Eq, Ord, Read, Show)++_Dialect = Core.Name "hydra.lisp.syntax.Dialect"++_Dialect_clojure = Core.Name "clojure"++_Dialect_emacsLisp = Core.Name "emacsLisp"++_Dialect_commonLisp = Core.Name "commonLisp"++_Dialect_scheme = Core.Name "scheme"++-- | Sequential evaluation of expressions, returning the last. Serializes as (do expr1 expr2 ...) in Clojure, (progn expr1 expr2 ...) in Emacs Lisp and Common Lisp, (begin expr1 expr2 ...) in Scheme+data DoExpression =+  DoExpression {+    -- | The expressions to evaluate in sequence+    doExpressionExpressions :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_DoExpression = Core.Name "hydra.lisp.syntax.DoExpression"++_DoExpression_expressions = Core.Name "expressions"++-- | A documentation string+newtype Docstring =+  Docstring {+    unDocstring :: String}+  deriving (Eq, Ord, Read, Show)++_Docstring = Core.Name "hydra.lisp.syntax.Docstring"++-- | A dotted pair literal: '(a . b). Not available in Clojure.+data DottedPair =+  DottedPair {+    -- | The first element+    dottedPairCar :: Expression,+    -- | The second element+    dottedPairCdr :: Expression}+  deriving (Eq, Ord, Read, Show)++_DottedPair = Core.Name "hydra.lisp.syntax.DottedPair"++_DottedPair_car = Core.Name "car"++_DottedPair_cdr = Core.Name "cdr"++-- | An export/provide declaration. Serializes as (provide 'name) in Emacs Lisp, (:export :sym1 :sym2) in Common Lisp, (export sym1 sym2) in Scheme. In Clojure, symbols are public by default.+data ExportDeclaration =+  ExportDeclaration {+    -- | The symbols to export+    exportDeclarationSymbols :: [Symbol]}+  deriving (Eq, Ord, Read, Show)++_ExportDeclaration = Core.Name "hydra.lisp.syntax.ExportDeclaration"++_ExportDeclaration_symbols = Core.Name "symbols"++-- | A Lisp expression+data Expression =+  -- | Function application: (f arg1 arg2 ...)+  ExpressionApplication Application |+  -- | Anonymous function+  ExpressionLambda Lambda |+  -- | Local variable binding+  ExpressionLet LetExpression |+  -- | Conditional expression+  ExpressionIf IfExpression |+  -- | Multi-branch conditional+  ExpressionCond CondExpression |+  -- | Case/match dispatch+  ExpressionCase CaseExpression |+  -- | Logical and (short-circuiting)+  ExpressionAnd AndExpression |+  -- | Logical or (short-circuiting)+  ExpressionOr OrExpression |+  -- | Logical negation+  ExpressionNot NotExpression |+  -- | Sequential evaluation (progn/do/begin)+  ExpressionDo DoExpression |+  -- | Sequential evaluation (explicit begin block)+  ExpressionBegin BeginExpression |+  -- | Variable reference+  ExpressionVariable VariableReference |+  -- | A literal value+  ExpressionLiteral Literal |+  -- | A list literal+  ExpressionList ListLiteral |+  -- | A vector literal+  ExpressionVector VectorLiteral |+  -- | A map/association literal+  ExpressionMap MapLiteral |+  -- | A set literal+  ExpressionSet SetLiteral |+  -- | A cons expression+  ExpressionCons ConsExpression |+  -- | A dotted pair literal+  ExpressionDottedPair DottedPair |+  -- | Field access on a record/struct+  ExpressionFieldAccess FieldAccess |+  -- | A type-annotated expression+  ExpressionTypeAnnotation TypeAnnotation |+  -- | A quoted expression+  ExpressionQuote QuoteExpression |+  -- | A quasiquoted expression+  ExpressionQuasiquote QuasiquoteExpression |+  -- | An unquoted expression within a quasiquote+  ExpressionUnquote UnquoteExpression |+  -- | A splicing unquote within a quasiquote+  ExpressionSplicingUnquote SplicingUnquoteExpression |+  -- | An arbitrary S-expression (escape hatch for dialect-specific forms)+  ExpressionSExpression SExpression+  deriving (Eq, Ord, Read, Show)++_Expression = Core.Name "hydra.lisp.syntax.Expression"++_Expression_application = Core.Name "application"++_Expression_lambda = Core.Name "lambda"++_Expression_let = Core.Name "let"++_Expression_if = Core.Name "if"++_Expression_cond = Core.Name "cond"++_Expression_case = Core.Name "case"++_Expression_and = Core.Name "and"++_Expression_or = Core.Name "or"++_Expression_not = Core.Name "not"++_Expression_do = Core.Name "do"++_Expression_begin = Core.Name "begin"++_Expression_variable = Core.Name "variable"++_Expression_literal = Core.Name "literal"++_Expression_list = Core.Name "list"++_Expression_vector = Core.Name "vector"++_Expression_map = Core.Name "map"++_Expression_set = Core.Name "set"++_Expression_cons = Core.Name "cons"++_Expression_dottedPair = Core.Name "dottedPair"++_Expression_fieldAccess = Core.Name "fieldAccess"++_Expression_typeAnnotation = Core.Name "typeAnnotation"++_Expression_quote = Core.Name "quote"++_Expression_quasiquote = Core.Name "quasiquote"++_Expression_unquote = Core.Name "unquote"++_Expression_splicingUnquote = Core.Name "splicingUnquote"++_Expression_sExpression = Core.Name "sExpression"++-- | Field access on a record/struct. Serializes as (:field record) in Clojure, (struct-field record) in Emacs Lisp and Common Lisp, (record-field record) in Scheme+data FieldAccess =+  FieldAccess {+    -- | The record type name (used to form accessor name)+    fieldAccessRecordType :: Symbol,+    -- | The field name+    fieldAccessField :: Symbol,+    -- | The expression being accessed+    fieldAccessTarget :: Expression}+  deriving (Eq, Ord, Read, Show)++_FieldAccess = Core.Name "hydra.lisp.syntax.FieldAccess"++_FieldAccess_recordType = Core.Name "recordType"++_FieldAccess_field = Core.Name "field"++_FieldAccess_target = Core.Name "target"++-- | A field in a record type definition+data FieldDefinition =+  FieldDefinition {+    -- | The field name+    fieldDefinitionName :: Symbol,+    -- | Optional default value+    fieldDefinitionDefaultValue :: (Maybe Expression)}+  deriving (Eq, Ord, Read, Show)++_FieldDefinition = Core.Name "hydra.lisp.syntax.FieldDefinition"++_FieldDefinition_name = Core.Name "name"++_FieldDefinition_defaultValue = Core.Name "defaultValue"++-- | A floating-point literal+data FloatLiteral =+  FloatLiteral {+    -- | The float value+    floatLiteralValue :: Double,+    -- | Optional precision hint (e.g. 3.14d0 vs 3.14f0 in Common Lisp)+    floatLiteralPrecision :: (Maybe String)}+  deriving (Eq, Ord, Read, Show)++_FloatLiteral = Core.Name "hydra.lisp.syntax.FloatLiteral"++_FloatLiteral_value = Core.Name "value"++_FloatLiteral_precision = Core.Name "precision"++-- | A named function definition. Serializes as (defn name [params] body) in Clojure, (defun name (params) body) in Emacs Lisp and Common Lisp, (define (name params) body) in Scheme+data FunctionDefinition =+  FunctionDefinition {+    -- | The function name+    functionDefinitionName :: Symbol,+    -- | The parameter list+    functionDefinitionParams :: [Symbol],+    -- | Optional rest/variadic parameter+    functionDefinitionRestParam :: (Maybe Symbol),+    -- | Optional docstring+    functionDefinitionDoc :: (Maybe Docstring),+    -- | Optional type hints for parameters and return type+    functionDefinitionTypeHints :: [TypeHint],+    -- | The function body (one or more expressions)+    functionDefinitionBody :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_FunctionDefinition = Core.Name "hydra.lisp.syntax.FunctionDefinition"++_FunctionDefinition_name = Core.Name "name"++_FunctionDefinition_params = Core.Name "params"++_FunctionDefinition_restParam = Core.Name "restParam"++_FunctionDefinition_doc = Core.Name "doc"++_FunctionDefinition_typeHints = Core.Name "typeHints"++_FunctionDefinition_body = Core.Name "body"++-- | Conditional: (if test then else)+data IfExpression =+  IfExpression {+    -- | The test expression+    ifExpressionCondition :: Expression,+    -- | The then branch+    ifExpressionThen :: Expression,+    -- | Optional else branch+    ifExpressionElse :: (Maybe Expression)}+  deriving (Eq, Ord, Read, Show)++_IfExpression = Core.Name "hydra.lisp.syntax.IfExpression"++_IfExpression_condition = Core.Name "condition"++_IfExpression_then = Core.Name "then"++_IfExpression_else = Core.Name "else"++-- | An import/require declaration. Serializes as (:require [name ...]) in Clojure, (require 'name) in Emacs Lisp, (:use :name) or (:import-from :name ...) in Common Lisp, (import (name)) in Scheme+data ImportDeclaration =+  ImportDeclaration {+    -- | The module being imported+    importDeclarationModule :: NamespaceName,+    -- | Import specification+    importDeclarationSpec :: ImportSpec}+  deriving (Eq, Ord, Read, Show)++_ImportDeclaration = Core.Name "hydra.lisp.syntax.ImportDeclaration"++_ImportDeclaration_module = Core.Name "module"++_ImportDeclaration_spec = Core.Name "spec"++-- | An import specification describing how to import symbols+data ImportSpec =+  -- | Import everything+  ImportSpecAll |+  -- | Import with an alias: (:require [name :as alias]) in Clojure+  ImportSpecAlias Symbol |+  -- | Import specific symbols: (:require [name :refer [sym1 sym2]]) in Clojure+  ImportSpecOnly [Symbol] |+  -- | Import with renaming: list of (from, to) symbol pairs+  ImportSpecRename [[Symbol]]+  deriving (Eq, Ord, Read, Show)++_ImportSpec = Core.Name "hydra.lisp.syntax.ImportSpec"++_ImportSpec_all = Core.Name "all"++_ImportSpec_alias = Core.Name "alias"++_ImportSpec_only = Core.Name "only"++_ImportSpec_rename = Core.Name "rename"++-- | An integer literal+data IntegerLiteral =+  IntegerLiteral {+    -- | The integer value+    integerLiteralValue :: Integer,+    -- | Whether this is explicitly a big integer (e.g. 42N in Clojure)+    integerLiteralBigint :: Bool}+  deriving (Eq, Ord, Read, Show)++_IntegerLiteral = Core.Name "hydra.lisp.syntax.IntegerLiteral"++_IntegerLiteral_value = Core.Name "value"++_IntegerLiteral_bigint = Core.Name "bigint"++-- | A keyword (self-evaluating symbol). Serializes as :name in Clojure, Emacs Lisp, and Common Lisp+data Keyword =+  Keyword {+    -- | The keyword name (without the leading colon)+    keywordName :: String,+    -- | Optional namespace (e.g. my.ns/foo in Clojure)+    keywordNamespace :: (Maybe String)}+  deriving (Eq, Ord, Read, Show)++_Keyword = Core.Name "hydra.lisp.syntax.Keyword"++_Keyword_name = Core.Name "name"++_Keyword_namespace = Core.Name "namespace"++-- | An anonymous function. Serializes as (fn [params] body) in Clojure, (lambda (params) body) in Emacs Lisp, Common Lisp, and Scheme. If name is provided, emits (fn name [params] body) in Clojure for self-reference.+data Lambda =+  Lambda {+    -- | Optional name for self-referential lambdas (Clojure named fn)+    lambdaName :: (Maybe Symbol),+    -- | The parameter list+    lambdaParams :: [Symbol],+    -- | Optional rest parameter+    lambdaRestParam :: (Maybe Symbol),+    -- | The lambda body+    lambdaBody :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_Lambda = Core.Name "hydra.lisp.syntax.Lambda"++_Lambda_name = Core.Name "name"++_Lambda_params = Core.Name "params"++_Lambda_restParam = Core.Name "restParam"++_Lambda_body = Core.Name "body"++-- | A single binding in a let expression+data LetBinding =+  -- | A simple name-value binding+  LetBindingSimple SimpleBinding |+  -- | A destructuring binding+  LetBindingDestructuring DestructuringBinding+  deriving (Eq, Ord, Read, Show)++_LetBinding = Core.Name "hydra.lisp.syntax.LetBinding"++_LetBinding_simple = Core.Name "simple"++_LetBinding_destructuring = Core.Name "destructuring"++-- | Local variable bindings. Serializes as (let [x 1 y 2] body) in Clojure (always sequential), (let ((x 1) (y 2)) body) or (let* ...) in other dialects+data LetExpression =+  LetExpression {+    -- | The kind of let (parallel or sequential)+    letExpressionKind :: LetKind,+    -- | The variable bindings+    letExpressionBindings :: [LetBinding],+    -- | The body expressions+    letExpressionBody :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_LetExpression = Core.Name "hydra.lisp.syntax.LetExpression"++_LetExpression_kind = Core.Name "kind"++_LetExpression_bindings = Core.Name "bindings"++_LetExpression_body = Core.Name "body"++-- | The kind of let binding+data LetKind =+  LetKindParallel |+  LetKindSequential |+  LetKindRecursive+  deriving (Eq, Ord, Read, Show)++_LetKind = Core.Name "hydra.lisp.syntax.LetKind"++_LetKind_parallel = Core.Name "parallel"++_LetKind_sequential = Core.Name "sequential"++_LetKind_recursive = Core.Name "recursive"++-- | A list literal: '(1 2 3) or (list 1 2 3)+data ListLiteral =+  ListLiteral {+    -- | The list elements+    listLiteralElements :: [Expression],+    -- | Whether to use quote syntax vs constructor syntax+    listLiteralQuoted :: Bool}+  deriving (Eq, Ord, Read, Show)++_ListLiteral = Core.Name "hydra.lisp.syntax.ListLiteral"++_ListLiteral_elements = Core.Name "elements"++_ListLiteral_quoted = Core.Name "quoted"++-- | A Lisp literal value+data Literal =+  -- | An integer literal+  LiteralInteger IntegerLiteral |+  -- | A floating-point literal+  LiteralFloat FloatLiteral |+  -- | A string literal+  LiteralString String |+  -- | A character literal+  LiteralCharacter CharacterLiteral |+  -- | A boolean literal (dialect-specific rendering)+  LiteralBoolean Bool |+  -- | Nil/null/empty list (dialect-specific rendering)+  LiteralNil |+  -- | A keyword literal+  LiteralKeyword Keyword |+  -- | A quoted symbol literal+  LiteralSymbol Symbol+  deriving (Eq, Ord, Read, Show)++_Literal = Core.Name "hydra.lisp.syntax.Literal"++_Literal_integer = Core.Name "integer"++_Literal_float = Core.Name "float"++_Literal_string = Core.Name "string"++_Literal_character = Core.Name "character"++_Literal_boolean = Core.Name "boolean"++_Literal_nil = Core.Name "nil"++_Literal_keyword = Core.Name "keyword"++_Literal_symbol = Core.Name "symbol"++-- | A pattern matching a literal value+data LiteralPattern =+  LiteralPattern {+    -- | The literal to match+    literalPatternValue :: Literal}+  deriving (Eq, Ord, Read, Show)++_LiteralPattern = Core.Name "hydra.lisp.syntax.LiteralPattern"++_LiteralPattern_value = Core.Name "value"++-- | A macro definition. Serializes as (defmacro name [params] body) in Clojure, (defmacro name (params) body) in Emacs Lisp and Common Lisp, (define-syntax name ...) in Scheme+data MacroDefinition =+  MacroDefinition {+    -- | The macro name+    macroDefinitionName :: Symbol,+    -- | The parameter list+    macroDefinitionParams :: [Symbol],+    -- | Optional rest parameter+    macroDefinitionRestParam :: (Maybe Symbol),+    -- | The macro body+    macroDefinitionBody :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_MacroDefinition = Core.Name "hydra.lisp.syntax.MacroDefinition"++_MacroDefinition_name = Core.Name "name"++_MacroDefinition_params = Core.Name "params"++_MacroDefinition_restParam = Core.Name "restParam"++_MacroDefinition_body = Core.Name "body"++-- | A key-value pair in a map literal+data MapEntry =+  MapEntry {+    -- | The key expression+    mapEntryKey :: Expression,+    -- | The value expression+    mapEntryValue :: Expression}+  deriving (Eq, Ord, Read, Show)++_MapEntry = Core.Name "hydra.lisp.syntax.MapEntry"++_MapEntry_key = Core.Name "key"++_MapEntry_value = Core.Name "value"++-- | A map/dictionary literal. Serializes as {:a 1 :b 2} in Clojure, as an alist '((a . 1) (b . 2)) in other dialects+data MapLiteral =+  MapLiteral {+    -- | The key-value pairs+    mapLiteralEntries :: [MapEntry]}+  deriving (Eq, Ord, Read, Show)++_MapLiteral = Core.Name "hydra.lisp.syntax.MapLiteral"++_MapLiteral_entries = Core.Name "entries"++-- | A module/namespace declaration. Serializes as (ns name ...) in Clojure, (provide 'name) in Emacs Lisp, (defpackage :name ... ) (in-package :name) in Common Lisp, (define-library (name) ...) in Scheme+data ModuleDeclaration =+  ModuleDeclaration {+    -- | The module/namespace name+    moduleDeclarationName :: NamespaceName,+    -- | Optional module documentation+    moduleDeclarationDoc :: (Maybe Docstring)}+  deriving (Eq, Ord, Read, Show)++_ModuleDeclaration = Core.Name "hydra.lisp.syntax.ModuleDeclaration"++_ModuleDeclaration_name = Core.Name "name"++_ModuleDeclaration_doc = Core.Name "doc"++-- | A namespace or package name+newtype NamespaceName =+  NamespaceName {+    unNamespaceName :: String}+  deriving (Eq, Ord, Read, Show)++_NamespaceName = Core.Name "hydra.lisp.syntax.NamespaceName"++-- | The style of nil/null in a dialect+data NilStyle =+  NilStyleNil |+  NilStyleEmptyList+  deriving (Eq, Ord, Read, Show)++_NilStyle = Core.Name "hydra.lisp.syntax.NilStyle"++_NilStyle_nil = Core.Name "nil"++_NilStyle_emptyList = Core.Name "emptyList"++-- | Logical negation: (not expr)+data NotExpression =+  NotExpression {+    -- | The operand expression+    notExpressionExpression :: Expression}+  deriving (Eq, Ord, Read, Show)++_NotExpression = Core.Name "hydra.lisp.syntax.NotExpression"++_NotExpression_expression = Core.Name "expression"++-- | Logical or: (or expr1 expr2 ...)+data OrExpression =+  OrExpression {+    -- | The operand expressions+    orExpressionExpressions :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_OrExpression = Core.Name "hydra.lisp.syntax.OrExpression"++_OrExpression_expressions = Core.Name "expressions"++-- | A pattern for use in case expressions or match forms+data Pattern =+  -- | A constructor pattern (for union/sum type matching)+  PatternConstructor ConstructorPattern |+  -- | A literal pattern+  PatternLiteral LiteralPattern |+  -- | A wildcard pattern matching anything+  PatternWildcard WildcardPattern |+  -- | A variable pattern that binds the matched value+  PatternVariable Symbol+  deriving (Eq, Ord, Read, Show)++_Pattern = Core.Name "hydra.lisp.syntax.Pattern"++_Pattern_constructor = Core.Name "constructor"++_Pattern_literal = Core.Name "literal"++_Pattern_wildcard = Core.Name "wildcard"++_Pattern_variable = Core.Name "variable"++-- | A Lisp program, consisting of a sequence of top-level forms+data Program =+  Program {+    -- | The target Lisp dialect+    programDialect :: Dialect,+    -- | Optional module/namespace declaration+    programModule :: (Maybe ModuleDeclaration),+    -- | Import/require declarations+    programImports :: [ImportDeclaration],+    -- | Export/provide declarations+    programExports :: [ExportDeclaration],+    -- | The top-level forms in the program+    programForms :: [TopLevelFormWithComments]}+  deriving (Eq, Ord, Read, Show)++_Program = Core.Name "hydra.lisp.syntax.Program"++_Program_dialect = Core.Name "dialect"++_Program_module = Core.Name "module"++_Program_imports = Core.Name "imports"++_Program_exports = Core.Name "exports"++_Program_forms = Core.Name "forms"++-- | A namespace-qualified symbol. Serializes as ns/name in Clojure, pkg:name or pkg::name in Common Lisp+data QualifiedSymbol =+  QualifiedSymbol {+    -- | The namespace or package+    qualifiedSymbolNamespace :: String,+    -- | The local name+    qualifiedSymbolName :: String}+  deriving (Eq, Ord, Read, Show)++_QualifiedSymbol = Core.Name "hydra.lisp.syntax.QualifiedSymbol"++_QualifiedSymbol_namespace = Core.Name "namespace"++_QualifiedSymbol_name = Core.Name "name"++-- | A quasiquoted form: `expr+data QuasiquoteExpression =+  QuasiquoteExpression {+    -- | The quasiquoted form+    quasiquoteExpressionBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_QuasiquoteExpression = Core.Name "hydra.lisp.syntax.QuasiquoteExpression"++_QuasiquoteExpression_body = Core.Name "body"++-- | A quoted form: 'expr or (quote expr)+data QuoteExpression =+  QuoteExpression {+    -- | The quoted form+    quoteExpressionBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_QuoteExpression = Core.Name "hydra.lisp.syntax.QuoteExpression"++_QuoteExpression_body = Core.Name "body"++-- | A record/struct type definition. Serializes as (defrecord Name [fields]) in Clojure, (cl-defstruct name fields) in Emacs Lisp, (defstruct name fields) in Common Lisp, (define-record-type <Name> ...) in Scheme+data RecordTypeDefinition =+  RecordTypeDefinition {+    -- | The record type name+    recordTypeDefinitionName :: Symbol,+    -- | The field definitions+    recordTypeDefinitionFields :: [FieldDefinition],+    -- | Optional docstring+    recordTypeDefinitionDoc :: (Maybe Docstring)}+  deriving (Eq, Ord, Read, Show)++_RecordTypeDefinition = Core.Name "hydra.lisp.syntax.RecordTypeDefinition"++_RecordTypeDefinition_name = Core.Name "name"++_RecordTypeDefinition_fields = Core.Name "fields"++_RecordTypeDefinition_doc = Core.Name "doc"++-- | A raw S-expression. This is an escape hatch for expressing arbitrary Lisp forms that do not fit into the structured AST above.+data SExpression =+  -- | An atomic value+  SExpressionAtom String |+  -- | A list of S-expressions+  SExpressionList [SExpression]+  deriving (Eq, Ord, Read, Show)++_SExpression = Core.Name "hydra.lisp.syntax.SExpression"++_SExpression_atom = Core.Name "atom"++_SExpression_list = Core.Name "list"++-- | A set literal. Serializes as #{1 2 3} in Clojure. Other dialects use a list-based construction.+data SetLiteral =+  SetLiteral {+    -- | The set elements+    setLiteralElements :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_SetLiteral = Core.Name "hydra.lisp.syntax.SetLiteral"++_SetLiteral_elements = Core.Name "elements"++-- | A simple name-value binding in a let expression+data SimpleBinding =+  SimpleBinding {+    -- | The bound variable+    simpleBindingName :: Symbol,+    -- | The value expression+    simpleBindingValue :: Expression}+  deriving (Eq, Ord, Read, Show)++_SimpleBinding = Core.Name "hydra.lisp.syntax.SimpleBinding"++_SimpleBinding_name = Core.Name "name"++_SimpleBinding_value = Core.Name "value"++-- | A splicing unquote within a quasiquote: ~@expr or ,@expr+data SplicingUnquoteExpression =+  SplicingUnquoteExpression {+    -- | The spliced form+    splicingUnquoteExpressionBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_SplicingUnquoteExpression = Core.Name "hydra.lisp.syntax.SplicingUnquoteExpression"++_SplicingUnquoteExpression_body = Core.Name "body"++-- | A Lisp symbol (identifier)+newtype Symbol =+  Symbol {+    unSymbol :: String}+  deriving (Eq, Ord, Read, Show)++_Symbol = Core.Name "hydra.lisp.syntax.Symbol"++-- | A top-level form in a Lisp program+data TopLevelForm =+  -- | A named function definition+  TopLevelFormFunction FunctionDefinition |+  -- | A global variable definition+  TopLevelFormVariable VariableDefinition |+  -- | A constant definition+  TopLevelFormConstant ConstantDefinition |+  -- | A record/struct type definition+  TopLevelFormRecordType RecordTypeDefinition |+  -- | A macro definition+  TopLevelFormMacro MacroDefinition |+  -- | A bare expression at the top level+  TopLevelFormExpression Expression+  deriving (Eq, Ord, Read, Show)++_TopLevelForm = Core.Name "hydra.lisp.syntax.TopLevelForm"++_TopLevelForm_function = Core.Name "function"++_TopLevelForm_variable = Core.Name "variable"++_TopLevelForm_constant = Core.Name "constant"++_TopLevelForm_recordType = Core.Name "recordType"++_TopLevelForm_macro = Core.Name "macro"++_TopLevelForm_expression = Core.Name "expression"++-- | A top-level form together with optional documentation+data TopLevelFormWithComments =+  TopLevelFormWithComments {+    -- | Optional documentation string+    topLevelFormWithCommentsDoc :: (Maybe Docstring),+    -- | Optional comment+    topLevelFormWithCommentsComment :: (Maybe Comment),+    -- | The form itself+    topLevelFormWithCommentsForm :: TopLevelForm}+  deriving (Eq, Ord, Read, Show)++_TopLevelFormWithComments = Core.Name "hydra.lisp.syntax.TopLevelFormWithComments"++_TopLevelFormWithComments_doc = Core.Name "doc"++_TopLevelFormWithComments_comment = Core.Name "comment"++_TopLevelFormWithComments_form = Core.Name "form"++-- | An expression with a type annotation+data TypeAnnotation =+  TypeAnnotation {+    -- | The annotated expression+    typeAnnotationExpression :: Expression,+    -- | The type specifier+    typeAnnotationType :: TypeSpecifier}+  deriving (Eq, Ord, Read, Show)++_TypeAnnotation = Core.Name "hydra.lisp.syntax.TypeAnnotation"++_TypeAnnotation_expression = Core.Name "expression"++_TypeAnnotation_type = Core.Name "type"++-- | A type hint or annotation. In Clojure: ^Type name. In Common Lisp: (declare (type Type name)). In Scheme and Emacs Lisp: typically unused.+data TypeHint =+  TypeHint {+    -- | The annotated symbol+    typeHintName :: Symbol,+    -- | The type specifier+    typeHintType :: TypeSpecifier}+  deriving (Eq, Ord, Read, Show)++_TypeHint = Core.Name "hydra.lisp.syntax.TypeHint"++_TypeHint_name = Core.Name "name"++_TypeHint_type = Core.Name "type"++-- | A type specifier+data TypeSpecifier =+  -- | A named type reference+  TypeSpecifierNamed Symbol |+  -- | A list type+  TypeSpecifierList TypeSpecifier |+  -- | A function type (params and return)+  TypeSpecifierFunction [TypeSpecifier] |+  -- | An optional type+  TypeSpecifierMaybe TypeSpecifier |+  -- | A map type (key and value type specifiers)+  TypeSpecifierMap [TypeSpecifier] |+  -- | A set type+  TypeSpecifierSet TypeSpecifier |+  -- | A pair/tuple type (two type specifiers)+  TypeSpecifierPair [TypeSpecifier] |+  -- | An either/union type (two type specifiers)+  TypeSpecifierEither [TypeSpecifier] |+  -- | The unit type+  TypeSpecifierUnit+  deriving (Eq, Ord, Read, Show)++_TypeSpecifier = Core.Name "hydra.lisp.syntax.TypeSpecifier"++_TypeSpecifier_named = Core.Name "named"++_TypeSpecifier_list = Core.Name "list"++_TypeSpecifier_function = Core.Name "function"++_TypeSpecifier_maybe = Core.Name "maybe"++_TypeSpecifier_map = Core.Name "map"++_TypeSpecifier_set = Core.Name "set"++_TypeSpecifier_pair = Core.Name "pair"++_TypeSpecifier_either = Core.Name "either"++_TypeSpecifier_unit = Core.Name "unit"++-- | An unquoted form within a quasiquote: ~expr or ,expr+data UnquoteExpression =+  UnquoteExpression {+    -- | The unquoted form+    unquoteExpressionBody :: Expression}+  deriving (Eq, Ord, Read, Show)++_UnquoteExpression = Core.Name "hydra.lisp.syntax.UnquoteExpression"++_UnquoteExpression_body = Core.Name "body"++-- | A global variable definition. Serializes as (def name value) in Clojure, (defvar name value) in Emacs Lisp and Common Lisp, (define name value) in Scheme+data VariableDefinition =+  VariableDefinition {+    -- | The variable name+    variableDefinitionName :: Symbol,+    -- | The initial value+    variableDefinitionValue :: Expression,+    -- | Optional docstring+    variableDefinitionDoc :: (Maybe Docstring)}+  deriving (Eq, Ord, Read, Show)++_VariableDefinition = Core.Name "hydra.lisp.syntax.VariableDefinition"++_VariableDefinition_name = Core.Name "name"++_VariableDefinition_value = Core.Name "value"++_VariableDefinition_doc = Core.Name "doc"++-- | A reference to a variable by name+data VariableReference =+  VariableReference {+    -- | The variable name+    variableReferenceName :: Symbol,+    -- | Whether to reference from the function namespace. In Lisp-2 dialects (Common Lisp), this emits #'name. In Lisp-1 dialects, this has no effect.+    variableReferenceFunctionNamespace :: Bool}+  deriving (Eq, Ord, Read, Show)++_VariableReference = Core.Name "hydra.lisp.syntax.VariableReference"++_VariableReference_name = Core.Name "name"++_VariableReference_functionNamespace = Core.Name "functionNamespace"++-- | A vector literal. Serializes as [1 2 3] in Clojure and Emacs Lisp, #(1 2 3) in Common Lisp and Scheme+data VectorLiteral =+  VectorLiteral {+    -- | The vector elements+    vectorLiteralElements :: [Expression]}+  deriving (Eq, Ord, Read, Show)++_VectorLiteral = Core.Name "hydra.lisp.syntax.VectorLiteral"++_VectorLiteral_elements = Core.Name "elements"++-- | A wildcard pattern that matches any value+type WildcardPattern = ()++_WildcardPattern = Core.Name "hydra.lisp.syntax.WildcardPattern"