Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .changeset/cypher-math-arithmetic-inference.md

This file was deleted.

17 changes: 17 additions & 0 deletions packages/cypher-codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @evryg/effect-cypher-codegen

## 0.4.3

### Patch Changes

- [#95](https://github.com/evryg-org/effect-contrib/pull/95) [`2c84a48`](https://github.com/evryg-org/effect-contrib/commit/2c84a48c79ea89463ec9ecf621a7e30c01e6d9ca) Thanks @jbmusso! - Improve numeric type inference in the Cypher type checker.
- Recognize Neo4j scalar math functions. `log`, `log10`, `exp`, `sqrt`, the trigonometric
functions, `ceil`, `floor`, `round`, `e()`, `pi()`, `rand()` and friends now infer `Double`;
`sign` infers `Long`; and `abs` preserves its argument's numeric type. Previously any of these
threw `Unrecognized function`, failing codegen for queries that projected a bare math call such as
`RETURN log(x) AS weight`.
- Unify numeric operand types in arithmetic. Expressions previously took only the first operand's
type, so `Long * Double` (or `priceLong * 1.5`) inferred `Long` — emitting `Neo4jInt` and risking
a runtime decode failure on floats. Numeric arithmetic now unifies operands by the numeric join
(`Long ⊔ Double = Double`), a `Double` anywhere widens the result, and exponentiation (`^`) yields
`Double`. Numeric literals also carry their int/float distinction (`1.5`/`1e3` → `Double`). String
and list concatenation are unaffected.

## 0.4.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cypher-codegen/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@evryg/effect-cypher-codegen",
"version": "0.4.2",
"version": "0.4.3",
"type": "module",
"license": "MIT",
"description": "Cypher type checker and code generator: parses .cypher files, infers types, and generates typed Effect modules",
Expand Down
Loading