diff --git a/.sampo/changesets/annotated-body-recovery.md b/.sampo/changesets/annotated-body-recovery.md deleted file mode 100644 index f9f60655..00000000 --- a/.sampo/changesets/annotated-body-recovery.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-solve: patch ---- - -Keep checking callers of an annotated definition against its annotation when its body has a type error. Callers now report their own mismatches and no longer receive spurious ambiguity errors. An annotation whose type variables escape still blocks its uses. diff --git a/.sampo/changesets/available-fields-alignment.md b/.sampo/changesets/available-fields-alignment.md deleted file mode 100644 index 78e38a44..00000000 --- a/.sampo/changesets/available-fields-alignment.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-report: patch ---- - -Align the record after "Available fields:" under its opening brace. Its later lines started at the left margin. diff --git a/.sampo/changesets/compile-fuel.md b/.sampo/changesets/compile-fuel.md deleted file mode 100644 index 83635b8f..00000000 --- a/.sampo/changesets/compile-fuel.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -cargo/nash-ast: minor -cargo/nash-can: minor -cargo/nash-cli: minor -cargo/nash-codegen: minor -cargo/nash-constrain: minor -cargo/nash-docs: patch -cargo/nash-driver: minor -cargo/nash-language-server: minor -cargo/nash-report: minor -cargo/nash-solve: minor ---- - -Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. - -Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. diff --git a/.sampo/changesets/contradictory-application-contexts.md b/.sampo/changesets/contradictory-application-contexts.md deleted file mode 100644 index a4f717e4..00000000 --- a/.sampo/changesets/contradictory-application-contexts.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -cargo/nash-ast: minor -cargo/nash-can: patch -cargo/nash-report: patch -cargo/nash-solve: patch ---- - -Reject contradictory representation contexts on type applications, such as `(Big ('f 'a), Little ('f 'a))`, with the existing contradictory-representation error. They used to reach impl selection, where an empty proven set matched every disjoint impl. Export `nash_ast::same_type` for location-free type comparison. diff --git a/.sampo/changesets/field-constraint-test-scope.md b/.sampo/changesets/field-constraint-test-scope.md deleted file mode 100644 index bee584b3..00000000 --- a/.sampo/changesets/field-constraint-test-scope.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -cargo/nash-constrain: minor -cargo/nash-solve: patch ---- - -Record on each record-field constraint whether it comes from a module test, in place of the `Constraint::TestScope` wrapper. `Constraint::Record` and `Constraint::Field` gain a `tests` field, `TestScope` is removed, and `pattern::State` and `pattern::empty_state` take the flag. Field visibility is unchanged: fields that only a tests-block import makes visible are visible in tests and nowhere else. diff --git a/.sampo/changesets/impl-context-superclass-consistency.md b/.sampo/changesets/impl-context-superclass-consistency.md deleted file mode 100644 index d4e8cd17..00000000 --- a/.sampo/changesets/impl-context-superclass-consistency.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-can: patch ---- - -Check every impl context together with its superclasses for contradictory representations. An impl that defines no method, such as `impl (Foo 'a, Little 'a) => Sub 'a` where `Foo` requires `Big`, skipped this check and crashed the superclass entailment check; it now gets the contradictory-representation error. diff --git a/.sampo/changesets/infinite-type-impl-selection.md b/.sampo/changesets/infinite-type-impl-selection.md deleted file mode 100644 index 0424e7cc..00000000 --- a/.sampo/changesets/infinite-type-impl-selection.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-solve: patch ---- - -Do not select an impl for a trait constraint whose argument is an infinite type; the occurs check of the binding reports the type, as in Elm. Two impls that are disjoint on finite types can both match an infinite type, which crashed the compiler, and an impl that matches it at every depth gave a false step-limit error. diff --git a/.sampo/changesets/long-trait-help-lines.md b/.sampo/changesets/long-trait-help-lines.md deleted file mode 100644 index 96487efc..00000000 --- a/.sampo/changesets/long-trait-help-lines.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-report: patch ---- - -Stop `nash check` from crashing with "Doc::text must not contain newlines" when a missing-constraint or missing-impl predicate is wider than 80 columns. The help line is now part of the report layout instead of pre-rendered text. When a sentence with a predicate does not fit the line, the predicate moves to its own line, indented by 4. Sentences that fit render as before. diff --git a/.sampo/changesets/nested-representation-contexts.md b/.sampo/changesets/nested-representation-contexts.md deleted file mode 100644 index 43917fdd..00000000 --- a/.sampo/changesets/nested-representation-contexts.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-solve: patch ---- - -Report a local annotation whose representation constraints contradict an enclosing annotation, such as `Little 'a` inside `Big 'a => ...`, as a contradictory-representation error. The two annotations share `'a`, and their combined constraints used to reach impl selection and crash the compiler. The error no longer lists a requirement that another listed requirement implies, such as `Storable` next to `Big`. diff --git a/.sampo/changesets/open-superclass-types.md b/.sampo/changesets/open-superclass-types.md deleted file mode 100644 index 8c980bf4..00000000 --- a/.sampo/changesets/open-superclass-types.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -cargo/nash-ast: minor -cargo/nash-solve: minor -cargo/nash-codegen: minor ---- - -Resolve superclass evidence when a type variable stays open. A phantom parameter that no use fixes, as in `wrapper : tag 'p -> bool; wrapper t = same t t` with `same : Ord 'a => 'a -> 'a -> bool`, passed type checking but stopped `nash test` with "superclass resolution requires a ground type". `nash_solve::evidence::resolve` now keeps open type variables. An open variable equals only itself. An impl that matches whatever the variable is proves the predicate, and resolution reports `NonGround` only when no impl does and impl selection, a representation test, or the requirements of a type need the variable. The new `nash_ast::head::Open` matches impl heads against open types. Under `SelectPolicy::Exact`, `select_impl` now returns `Deferred` when no impl is selected and a candidate is undecided. `nash_codegen::evidence::Error::NonGround` is removed. diff --git a/.sampo/changesets/report-tuple-record-entries.md b/.sampo/changesets/report-tuple-record-entries.md deleted file mode 100644 index 6e81e4c8..00000000 --- a/.sampo/changesets/report-tuple-record-entries.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-report: minor ---- - -Break a tuple or record type that does not fit the line with one entry per line, as Elm does. The entries were joined without break points, so only the last entries broke and the type drifted to the right. Add `Doc::pcat`, Elm's `D.cat`. diff --git a/.sampo/changesets/representation-coverage.md b/.sampo/changesets/representation-coverage.md deleted file mode 100644 index 2c34cda2..00000000 --- a/.sampo/changesets/representation-coverage.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -cargo/nash-ast: minor -cargo/nash-solve: minor -cargo/nash-codegen: minor ---- - -Add the representation coverage rule. When a rigid type variable keeps impl selection from deciding, because the impls are split by its representation class (for example `Eq (list ('a : Big))` and `Eq 'a => Eq (list ('a : Little))`), inference accepts the predicate if the annotation states the trait at that variable and every admitted representation selects an impl whose context holds. `same : Eq 'a => list 'a -> list 'a -> bool` now compiles. The evidence is the new `Evidence::Specialize`; code generation selects the impl for each use and keeps the selecting types in the specialization key. A missing element constraint is now reported as a missing constraint, such as `Eq 'a`, instead of a missing impl for the container. Superclass proofs do not use the rule: an impl names a split requirement in its context. nash-ast also gains `head::cover_impls` and `ReprTrait::exactly`. diff --git a/.sampo/changesets/restore-constraint-tree.md b/.sampo/changesets/restore-constraint-tree.md deleted file mode 100644 index 3160b270..00000000 --- a/.sampo/changesets/restore-constraint-tree.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -cargo/nash-constrain: minor -cargo/nash-solve: patch ---- - -Restore Elm's constraint tree: `nash-constrain` generates it from the canonical AST and `nash-solve` walks it, in place of direct inference. An annotated definition now publishes its declared type: a call with more arguments in the same module no longer replaces an alias in its annotation, so importers find the impls of that alias. diff --git a/.sampo/changesets/shared-impl-selection.md b/.sampo/changesets/shared-impl-selection.md deleted file mode 100644 index ff057b50..00000000 --- a/.sampo/changesets/shared-impl-selection.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-ast: minor ---- - -Add `select_impl` with `SelectPolicy` and `ImplSelection`, the one impl selection used by inference, superclass entailment, and evidence. Every candidate is matched, and a second match stops the compiler as a coherence bug instead of picking one. diff --git a/.sampo/changesets/solver-indexed-bookkeeping.md b/.sampo/changesets/solver-indexed-bookkeeping.md deleted file mode 100644 index f411c0b8..00000000 --- a/.sampo/changesets/solver-indexed-bookkeeping.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -cargo/nash-constrain: patch -cargo/nash-solve: patch ---- - -Index kind contracts, recovery dependencies, stranded variables, and scheme records so that type checking does not scan every earlier declaration again. diff --git a/.sampo/changesets/stranded-call-constraints.md b/.sampo/changesets/stranded-call-constraints.md deleted file mode 100644 index 8c69eb80..00000000 --- a/.sampo/changesets/stranded-call-constraints.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-solve: patch ---- - -Stop reporting ambiguous or unresolved trait constraints on values passed to a definition whose body failed to type check. Their types are unknown because of that failure; the body error is still reported, and fixing it reveals any remaining ambiguity. diff --git a/.sampo/changesets/transparent-alias-application.md b/.sampo/changesets/transparent-alias-application.md deleted file mode 100644 index 2f0a59e7..00000000 --- a/.sampo/changesets/transparent-alias-application.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -cargo/nash-solve: patch ---- - -Unify a type-variable application such as `'f 'a` with a transparent alias through the alias body when the alias's own parameters cannot supply the applied arguments. `type alias Xs = List Int` now works with `List.length`; record aliases remain nominal. diff --git a/Cargo.lock b/Cargo.lock index 1f37c8b4..599eb4eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1722,7 +1722,7 @@ dependencies = [ [[package]] name = "nash-ast" -version = "0.12.0" +version = "0.13.0" dependencies = [ "bumpalo", "insta", @@ -1732,7 +1732,7 @@ dependencies = [ [[package]] name = "nash-can" -version = "0.13.0" +version = "0.14.0" dependencies = [ "bumpalo", "indoc", @@ -1748,7 +1748,7 @@ dependencies = [ [[package]] name = "nash-cli" -version = "0.9.0" +version = "0.10.0" dependencies = [ "clap", "color-print", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "nash-codegen" -version = "0.7.0" +version = "0.8.0" dependencies = [ "bumpalo", "indoc", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "nash-constrain" -version = "0.9.0" +version = "0.10.0" dependencies = [ "bumpalo", "insta", @@ -1830,7 +1830,7 @@ dependencies = [ [[package]] name = "nash-docs" -version = "0.2.3" +version = "0.2.4" dependencies = [ "bumpalo", "indoc", @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "nash-driver" -version = "0.14.0" +version = "0.15.0" dependencies = [ "async-trait", "bumpalo", @@ -1882,7 +1882,7 @@ dependencies = [ [[package]] name = "nash-fmt" -version = "0.2.1" +version = "0.2.2" dependencies = [ "bumpalo", "indoc", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "nash-ir" -version = "0.5.1" +version = "0.5.2" dependencies = [ "insta", "nash-ast", @@ -1904,7 +1904,7 @@ dependencies = [ [[package]] name = "nash-language-server" -version = "0.4.9" +version = "0.5.0" dependencies = [ "insta", "nash-driver", @@ -1919,7 +1919,7 @@ dependencies = [ [[package]] name = "nash-nitpick" -version = "0.3.3" +version = "0.3.4" dependencies = [ "bumpalo", "hex", @@ -1969,7 +1969,7 @@ version = "0.3.0" [[package]] name = "nash-report" -version = "0.7.0" +version = "0.8.0" dependencies = [ "bumpalo", "indoc", @@ -1991,7 +1991,7 @@ dependencies = [ [[package]] name = "nash-solve" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bumpalo", "indoc", diff --git a/crates/nash-ast/CHANGELOG.md b/crates/nash-ast/CHANGELOG.md index 298a3e66..f813633d 100644 --- a/crates/nash-ast/CHANGELOG.md +++ b/crates/nash-ast/CHANGELOG.md @@ -1,5 +1,17 @@ # nash-ast +## 0.13.0 — 2026-10-24 + +### Minor changes + +- [de1b7097](https://github.com/orbistry/nash/commit/de1b709752b35099baf2503ece7f6e2c86efce6e) Add `select_impl` with `SelectPolicy` and `ImplSelection`, the one impl selection used by inference, superclass entailment, and evidence. Every candidate is matched, and a second match stops the compiler as a coherence bug instead of picking one. — Thanks @MicroProofs! +- [4c4e5155](https://github.com/orbistry/nash/commit/4c4e5155128aba697fcb2181ded80f0de5e03070) Resolve superclass evidence when a type variable stays open. A phantom parameter that no use fixes, as in `wrapper : tag 'p -> bool; wrapper t = same t t` with `same : Ord 'a => 'a -> 'a -> bool`, passed type checking but stopped `nash test` with "superclass resolution requires a ground type". `nash_solve::evidence::resolve` now keeps open type variables. An open variable equals only itself. An impl that matches whatever the variable is proves the predicate, and resolution reports `NonGround` only when no impl does and impl selection, a representation test, or the requirements of a type need the variable. The new `nash_ast::head::Open` matches impl heads against open types. Under `SelectPolicy::Exact`, `select_impl` now returns `Deferred` when no impl is selected and a candidate is undecided. `nash_codegen::evidence::Error::NonGround` is removed. — Thanks @MicroProofs! +- [f205096a](https://github.com/orbistry/nash/commit/f205096a25e5f4e1aedd2ec2ddd5da3d44b48eeb) Reject contradictory representation contexts on type applications, such as `(Big ('f 'a), Little ('f 'a))`, with the existing contradictory-representation error. They used to reach impl selection, where an empty proven set matched every disjoint impl. Export `nash_ast::same_type` for location-free type comparison. — Thanks @MicroProofs! +- [baadec9e](https://github.com/orbistry/nash/commit/baadec9e5b89b384d1433a68849bd85a237b6aea) Add the representation coverage rule. When a rigid type variable keeps impl selection from deciding, because the impls are split by its representation class (for example `Eq (list ('a : Big))` and `Eq 'a => Eq (list ('a : Little))`), inference accepts the predicate if the annotation states the trait at that variable and every admitted representation selects an impl whose context holds. `same : Eq 'a => list 'a -> list 'a -> bool` now compiles. The evidence is the new `Evidence::Specialize`; code generation selects the impl for each use and keeps the selecting types in the specialization key. A missing element constraint is now reported as a missing constraint, such as `Eq 'a`, instead of a missing impl for the container. Superclass proofs do not use the rule: an impl names a split requirement in its context. nash-ast also gains `head::cover_impls` and `ReprTrait::exactly`. — Thanks @MicroProofs! +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + ## 0.12.0 — 2026-09-27 ### Minor changes diff --git a/crates/nash-ast/Cargo.toml b/crates/nash-ast/Cargo.toml index 88c18dd8..5d171687 100644 --- a/crates/nash-ast/Cargo.toml +++ b/crates/nash-ast/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-ast" -version = "0.12.0" +version = "0.13.0" edition.workspace = true description = "Canonical AST for the nash programming language" homepage.workspace = true diff --git a/crates/nash-can/CHANGELOG.md b/crates/nash-can/CHANGELOG.md index 420241c7..9d5dd8b6 100644 --- a/crates/nash-can/CHANGELOG.md +++ b/crates/nash-can/CHANGELOG.md @@ -1,5 +1,19 @@ # nash-can +## 0.14.0 — 2026-10-24 + +### Minor changes + +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- [115db1d2](https://github.com/orbistry/nash/commit/115db1d2d1dd6c5516a14029428c1d2a0447e64f) Check every impl context together with its superclasses for contradictory representations. An impl that defines no method, such as `impl (Foo 'a, Little 'a) => Sub 'a` where `Foo` requires `Big`, skipped this check and crashed the superclass entailment check; it now gets the contradictory-representation error. — Thanks @MicroProofs! +- [f205096a](https://github.com/orbistry/nash/commit/f205096a25e5f4e1aedd2ec2ddd5da3d44b48eeb) Reject contradictory representation contexts on type applications, such as `(Big ('f 'a), Little ('f 'a))`, with the existing contradictory-representation error. They used to reach impl selection, where an empty proven set matched every disjoint impl. Export `nash_ast::same_type` for location-free type comparison. — Thanks @MicroProofs! +- Updated dependencies: nash-ast@0.13.0 + ## 0.13.0 — 2026-09-27 ### Minor changes diff --git a/crates/nash-can/Cargo.toml b/crates/nash-can/Cargo.toml index 55d8cbad..75aeffb7 100644 --- a/crates/nash-can/Cargo.toml +++ b/crates/nash-can/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-can" -version = "0.13.0" +version = "0.14.0" edition.workspace = true description = "Canonicalize a nash source tree, resolving symbols, re-ordering definitions, and preparing a module for type inference." homepage.workspace = true @@ -9,7 +9,7 @@ license.workspace = true [dependencies] bumpalo.workspace = true -nash-ast = { path = "../nash-ast", version = "0.12.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } nash-region = { path = "../nash-region", version = "0.3.0" } nash-source = { path = "../nash-source", version = "0.10.0" } diff --git a/crates/nash-cli/CHANGELOG.md b/crates/nash-cli/CHANGELOG.md index f0431fdb..e4536dad 100644 --- a/crates/nash-cli/CHANGELOG.md +++ b/crates/nash-cli/CHANGELOG.md @@ -1,5 +1,17 @@ # nash-cli +## 0.10.0 — 2026-10-24 + +### Minor changes + +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- Updated dependencies: nash-codegen@0.8.0, nash-docs@0.2.4, nash-driver@0.15.0, nash-fmt@0.2.2, nash-language-server@0.5.0, nash-report@0.8.0 + ## 0.9.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-cli/Cargo.toml b/crates/nash-cli/Cargo.toml index 9a0dcd97..7c53cc1b 100644 --- a/crates/nash-cli/Cargo.toml +++ b/crates/nash-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-cli" -version = "0.9.0" +version = "0.10.0" edition.workspace = true description = "The Nash programming language" homepage.workspace = true @@ -17,9 +17,9 @@ path = "src/main.rs" [dependencies] nash-region = { path = "../nash-region", version = "0.3.0" } -nash-docs = { path = "../nash-docs", version = "0.2.3" } -nash-fmt = { path = "../nash-fmt", version = "0.2.1" } -nash-codegen = { path = "../nash-codegen", version = "0.7.0" } +nash-docs = { path = "../nash-docs", version = "0.2.4" } +nash-fmt = { path = "../nash-fmt", version = "0.2.2" } +nash-codegen = { path = "../nash-codegen", version = "0.8.0" } clap.workspace = true color-print.workspace = true dirs.workspace = true @@ -29,9 +29,9 @@ miette.workspace = true serde_json.workspace = true nash-test = { path = "../nash-test", version = "0.5.0" } nash-config = { path = "../nash-config", version = "0.7.0" } -nash-report = { path = "../nash-report", version = "0.7.0" } -nash-driver = { path = "../nash-driver", version = "0.14.0" } -nash-language-server = { path = "../nash-language-server", version = "0.4.9" } +nash-report = { path = "../nash-report", version = "0.8.0" } +nash-driver = { path = "../nash-driver", version = "0.15.0" } +nash-language-server = { path = "../nash-language-server", version = "0.5.0" } octocrab.workspace = true tar.workspace = true tokio = { workspace = true, features = ["rt-multi-thread", "macros", "io-std", "io-util"] } diff --git a/crates/nash-codegen/CHANGELOG.md b/crates/nash-codegen/CHANGELOG.md index bb5b5813..9ebc4c61 100644 --- a/crates/nash-codegen/CHANGELOG.md +++ b/crates/nash-codegen/CHANGELOG.md @@ -1,5 +1,19 @@ # nash-codegen +## 0.8.0 — 2026-10-24 + +### Minor changes + +- [4c4e5155](https://github.com/orbistry/nash/commit/4c4e5155128aba697fcb2181ded80f0de5e03070) Resolve superclass evidence when a type variable stays open. A phantom parameter that no use fixes, as in `wrapper : tag 'p -> bool; wrapper t = same t t` with `same : Ord 'a => 'a -> 'a -> bool`, passed type checking but stopped `nash test` with "superclass resolution requires a ground type". `nash_solve::evidence::resolve` now keeps open type variables. An open variable equals only itself. An impl that matches whatever the variable is proves the predicate, and resolution reports `NonGround` only when no impl does and impl selection, a representation test, or the requirements of a type need the variable. The new `nash_ast::head::Open` matches impl heads against open types. Under `SelectPolicy::Exact`, `select_impl` now returns `Deferred` when no impl is selected and a candidate is undecided. `nash_codegen::evidence::Error::NonGround` is removed. — Thanks @MicroProofs! +- [baadec9e](https://github.com/orbistry/nash/commit/baadec9e5b89b384d1433a68849bd85a237b6aea) Add the representation coverage rule. When a rigid type variable keeps impl selection from deciding, because the impls are split by its representation class (for example `Eq (list ('a : Big))` and `Eq 'a => Eq (list ('a : Little))`), inference accepts the predicate if the annotation states the trait at that variable and every admitted representation selects an impl whose context holds. `same : Eq 'a => list 'a -> list 'a -> bool` now compiles. The evidence is the new `Evidence::Specialize`; code generation selects the impl for each use and keeps the selecting types in the specialization key. A missing element constraint is now reported as a missing constraint, such as `Eq 'a`, instead of a missing impl for the container. Superclass proofs do not use the rule: an impl names a split requirement in its context. nash-ast also gains `head::cover_impls` and `ReprTrait::exactly`. — Thanks @MicroProofs! +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0, nash-ir@0.5.2, nash-solve@0.11.0 + ## 0.7.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-codegen/Cargo.toml b/crates/nash-codegen/Cargo.toml index 49220bd0..31166510 100644 --- a/crates/nash-codegen/Cargo.toml +++ b/crates/nash-codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-codegen" -version = "0.7.0" +version = "0.8.0" edition.workspace = true description = "Nash specialization and lowering to Untyped Plutus Core" homepage.workspace = true @@ -8,12 +8,12 @@ repository.workspace = true license.workspace = true [dependencies] -nash-ast = { path = "../nash-ast", version = "0.12.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } nash-region = { path = "../nash-region", version = "0.3.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } -nash-solve = { path = "../nash-solve", version = "0.10.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } +nash-solve = { path = "../nash-solve", version = "0.11.0" } bumpalo.workspace = true -nash-ir = { path = "../nash-ir", version = "0.5.1" } +nash-ir = { path = "../nash-ir", version = "0.5.2" } nash-plutus = { path = "../nash-plutus", version = "0.3.5" } nash-test = { path = "../nash-test", version = "0.5.0" } nash-config = { path = "../nash-config", version = "0.7.0" } diff --git a/crates/nash-constrain/CHANGELOG.md b/crates/nash-constrain/CHANGELOG.md index a44eb9f0..11f31103 100644 --- a/crates/nash-constrain/CHANGELOG.md +++ b/crates/nash-constrain/CHANGELOG.md @@ -1,5 +1,20 @@ # nash-constrain +## 0.10.0 — 2026-10-24 + +### Minor changes + +- [ba457678](https://github.com/orbistry/nash/commit/ba4576789b6b8e589e55a74a9fd51b8f6d78337a) Restore Elm's constraint tree: `nash-constrain` generates it from the canonical AST and `nash-solve` walks it, in place of direct inference. An annotated definition now publishes its declared type: a call with more arguments in the same module no longer replaces an alias in its annotation, so importers find the impls of that alias. — Thanks @MicroProofs! +- [5655782b](https://github.com/orbistry/nash/commit/5655782b2686abb979fda1157722dd10c4728b19) Record on each record-field constraint whether it comes from a module test, in place of the `Constraint::TestScope` wrapper. `Constraint::Record` and `Constraint::Field` gain a `tests` field, `TestScope` is removed, and `pattern::State` and `pattern::empty_state` take the flag. Field visibility is unchanged: fields that only a tests-block import makes visible are visible in tests and nowhere else. — Thanks @MicroProofs! +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- [532e437a](https://github.com/orbistry/nash/commit/532e437ad0cdad996feb55548fba7cc3e8703256) Index kind contracts, recovery dependencies, stranded variables, and scheme records so that type checking does not scan every earlier declaration again. — Thanks @MicroProofs! +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0 + ## 0.9.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-constrain/Cargo.toml b/crates/nash-constrain/Cargo.toml index a7c454e3..76c3fc4b 100644 --- a/crates/nash-constrain/Cargo.toml +++ b/crates/nash-constrain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-constrain" -version = "0.9.0" +version = "0.10.0" edition.workspace = true description = """ Responsible for building the set of constraints that are used \ @@ -13,9 +13,9 @@ license.workspace = true [dependencies] bumpalo.workspace = true -nash-ast = { path = "../nash-ast", version = "0.12.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } nash-region = { path = "../nash-region", version = "0.3.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } [dev-dependencies] insta.workspace = true diff --git a/crates/nash-docs/CHANGELOG.md b/crates/nash-docs/CHANGELOG.md index 19e2dd65..5dd2ed7f 100644 --- a/crates/nash-docs/CHANGELOG.md +++ b/crates/nash-docs/CHANGELOG.md @@ -1,5 +1,14 @@ # nash-docs +## 0.2.4 — 2026-10-24 + +### Patch changes + +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0, nash-driver@0.15.0, nash-report@0.8.0 + ## 0.2.3 — 2026-10-10 ### Patch changes diff --git a/crates/nash-docs/Cargo.toml b/crates/nash-docs/Cargo.toml index c226681c..620b8216 100644 --- a/crates/nash-docs/Cargo.toml +++ b/crates/nash-docs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-docs" -version = "0.2.3" +version = "0.2.4" edition.workspace = true description = "Documentation extraction and rendering for Nash" homepage.workspace = true @@ -12,13 +12,13 @@ bumpalo.workspace = true tokio.workspace = true serde_json.workspace = true thiserror.workspace = true -nash-driver = { path = "../nash-driver", version = "0.14.0" } +nash-driver = { path = "../nash-driver", version = "0.15.0" } nash-config = { path = "../nash-config", version = "0.7.0" } nash-parse = { path = "../nash-parse", version = "0.10.0" } -nash-ast = { path = "../nash-ast", version = "0.12.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } nash-source = { path = "../nash-source", version = "0.10.0" } -nash-report = { path = "../nash-report", version = "0.7.0" } +nash-report = { path = "../nash-report", version = "0.8.0" } serde.workspace = true pulldown-cmark = { version = "0.13", default-features = false, features = ["html"] } diff --git a/crates/nash-driver/CHANGELOG.md b/crates/nash-driver/CHANGELOG.md index 7559f053..d2014285 100644 --- a/crates/nash-driver/CHANGELOG.md +++ b/crates/nash-driver/CHANGELOG.md @@ -1,5 +1,17 @@ # nash-driver +## 0.15.0 — 2026-10-24 + +### Minor changes + +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0, nash-codegen@0.8.0, nash-constrain@0.10.0, nash-nitpick@0.3.4, nash-report@0.8.0, nash-solve@0.11.0 + ## 0.14.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-driver/Cargo.toml b/crates/nash-driver/Cargo.toml index 1bd776f0..af05fb33 100644 --- a/crates/nash-driver/Cargo.toml +++ b/crates/nash-driver/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-driver" -version = "0.14.0" +version = "0.15.0" edition.workspace = true description = "Build system and driver for Nash projects" homepage.workspace = true @@ -9,7 +9,7 @@ license.workspace = true [dependencies] nash-test = { path = "../nash-test", version = "0.5.0" } -nash-codegen = { path = "../nash-codegen", version = "0.7.0" } +nash-codegen = { path = "../nash-codegen", version = "0.8.0" } nash-plutus = { path = "../nash-plutus", version = "0.3.5" } async-trait.workspace = true bumpalo.workspace = true @@ -21,14 +21,14 @@ tokio = { workspace = true, features = ["sync", "fs"] } url.workspace = true nash-config = { path = "../nash-config", version = "0.7.0" } -nash-nitpick = { path = "../nash-nitpick", version = "0.3.3" } -nash-ast = { path = "../nash-ast", version = "0.12.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } -nash-constrain = { path = "../nash-constrain", version = "0.9.0" } +nash-nitpick = { path = "../nash-nitpick", version = "0.3.4" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } +nash-constrain = { path = "../nash-constrain", version = "0.10.0" } nash-parse = { path = "../nash-parse", version = "0.10.0" } -nash-report = { path = "../nash-report", version = "0.7.0" } +nash-report = { path = "../nash-report", version = "0.8.0" } nash-region = { path = "../nash-region", version = "0.3.0" } -nash-solve = { path = "../nash-solve", version = "0.10.0" } +nash-solve = { path = "../nash-solve", version = "0.11.0" } nash-source = { path = "../nash-source", version = "0.10.0" } [dev-dependencies] diff --git a/crates/nash-fmt/CHANGELOG.md b/crates/nash-fmt/CHANGELOG.md index 141f8b75..2f11c1bf 100644 --- a/crates/nash-fmt/CHANGELOG.md +++ b/crates/nash-fmt/CHANGELOG.md @@ -1,5 +1,11 @@ # nash-fmt +## 0.2.2 — 2026-10-24 + +### Patch changes + +- Updated dependencies: nash-report@0.8.0 + ## 0.2.1 — 2026-10-10 ### Patch changes diff --git a/crates/nash-fmt/Cargo.toml b/crates/nash-fmt/Cargo.toml index 4b32edb8..83f9b979 100644 --- a/crates/nash-fmt/Cargo.toml +++ b/crates/nash-fmt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-fmt" -version = "0.2.1" +version = "0.2.2" edition.workspace = true description = "Source formatter for Nash" homepage.workspace = true @@ -12,7 +12,7 @@ bumpalo.workspace = true nash-source = { path = "../nash-source", version = "0.10.0" } nash-region = { path = "../nash-region", version = "0.3.0" } nash-parse = { path = "../nash-parse", version = "0.10.0" } -nash-report = { path = "../nash-report", version = "0.7.0" } +nash-report = { path = "../nash-report", version = "0.8.0" } [dev-dependencies] indoc.workspace = true diff --git a/crates/nash-ir/CHANGELOG.md b/crates/nash-ir/CHANGELOG.md index c708d35f..b26e3673 100644 --- a/crates/nash-ir/CHANGELOG.md +++ b/crates/nash-ir/CHANGELOG.md @@ -1,5 +1,11 @@ # nash-ir +## 0.5.2 — 2026-10-24 + +### Patch changes + +- Updated dependencies: nash-ast@0.13.0 + ## 0.5.1 — 2026-10-10 ### Patch changes diff --git a/crates/nash-ir/Cargo.toml b/crates/nash-ir/Cargo.toml index 5be563f1..de3ba405 100644 --- a/crates/nash-ir/Cargo.toml +++ b/crates/nash-ir/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-ir" -version = "0.5.1" +version = "0.5.2" edition.workspace = true description = "Nash Core IR with explicit runtime representations" homepage.workspace = true @@ -8,7 +8,7 @@ repository.workspace = true license.workspace = true [dependencies] -nash-ast = { path = "../nash-ast", version = "0.12.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } nash-plutus = { path = "../nash-plutus", version = "0.3.5" } [dev-dependencies] diff --git a/crates/nash-language-server/CHANGELOG.md b/crates/nash-language-server/CHANGELOG.md index 546e41c0..336beeeb 100644 --- a/crates/nash-language-server/CHANGELOG.md +++ b/crates/nash-language-server/CHANGELOG.md @@ -1,5 +1,17 @@ # nash-language-server +## 0.5.0 — 2026-10-24 + +### Minor changes + +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- Updated dependencies: nash-driver@0.15.0, nash-report@0.8.0 + ## 0.4.9 — 2026-10-10 ### Patch changes diff --git a/crates/nash-language-server/Cargo.toml b/crates/nash-language-server/Cargo.toml index 0f80f0b9..8f947314 100644 --- a/crates/nash-language-server/Cargo.toml +++ b/crates/nash-language-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-language-server" -version = "0.4.9" +version = "0.5.0" edition.workspace = true description = "Language server for the nash programming language" homepage.workspace = true @@ -9,8 +9,8 @@ license.workspace = true [dependencies] tower-lsp-server.workspace = true -nash-driver = { path = "../nash-driver", version = "0.14.0" } -nash-report = { path = "../nash-report", version = "0.7.0" } +nash-driver = { path = "../nash-driver", version = "0.15.0" } +nash-report = { path = "../nash-report", version = "0.8.0" } nash-region = { path = "../nash-region", version = "0.3.0" } serde_json.workspace = true tokio.workspace = true diff --git a/crates/nash-nitpick/CHANGELOG.md b/crates/nash-nitpick/CHANGELOG.md index e60fb258..91d199a7 100644 --- a/crates/nash-nitpick/CHANGELOG.md +++ b/crates/nash-nitpick/CHANGELOG.md @@ -1,5 +1,11 @@ # nash-nitpick +## 0.3.4 — 2026-10-24 + +### Patch changes + +- Updated dependencies: nash-ast@0.13.0 + ## 0.3.3 — 2026-09-27 ### Patch changes diff --git a/crates/nash-nitpick/Cargo.toml b/crates/nash-nitpick/Cargo.toml index 66bf96ad..e8d57def 100644 --- a/crates/nash-nitpick/Cargo.toml +++ b/crates/nash-nitpick/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-nitpick" -version = "0.3.3" +version = "0.3.4" edition.workspace = true description = "Exhaustiveness and redundancy checking for Nash pattern matches" homepage.workspace = true @@ -10,7 +10,7 @@ license.workspace = true [dependencies] bumpalo.workspace = true hex.workspace = true -nash-ast = { path = "../nash-ast", version = "0.12.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } nash-region = { path = "../nash-region", version = "0.3.0" } [dev-dependencies] diff --git a/crates/nash-report/CHANGELOG.md b/crates/nash-report/CHANGELOG.md index 97756c80..143801ed 100644 --- a/crates/nash-report/CHANGELOG.md +++ b/crates/nash-report/CHANGELOG.md @@ -1,5 +1,21 @@ # nash-report +## 0.8.0 — 2026-10-24 + +### Minor changes + +- [4dcd4e98](https://github.com/orbistry/nash/commit/4dcd4e986ad5cb4b15baefdbf159b140fa4e36a8) Break a tuple or record type that does not fit the line with one entry per line, as Elm does. The entries were joined without break points, so only the last entries broke and the type drifted to the right. Add `Doc::pcat`, Elm's `D.cat`. — Thanks @MicroProofs! +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- [3d86f097](https://github.com/orbistry/nash/commit/3d86f0971cba9df677d02296c21c25ed7889b52c) Align the record after "Available fields:" under its opening brace. Its later lines started at the left margin. — Thanks @MicroProofs! +- [f205096a](https://github.com/orbistry/nash/commit/f205096a25e5f4e1aedd2ec2ddd5da3d44b48eeb) Reject contradictory representation contexts on type applications, such as `(Big ('f 'a), Little ('f 'a))`, with the existing contradictory-representation error. They used to reach impl selection, where an empty proven set matched every disjoint impl. Export `nash_ast::same_type` for location-free type comparison. — Thanks @MicroProofs! +- [b613c93b](https://github.com/orbistry/nash/commit/b613c93b077b2c22d13af47904d6e6fffb00d002) Stop `nash check` from crashing with "Doc::text must not contain newlines" when a missing-constraint or missing-impl predicate is wider than 80 columns. The help line is now part of the report layout instead of pre-rendered text. When a sentence with a predicate does not fit the line, the predicate moves to its own line, indented by 4. Sentences that fit render as before. — Thanks @MicroProofs! +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0, nash-constrain@0.10.0, nash-nitpick@0.3.4 + ## 0.7.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-report/Cargo.toml b/crates/nash-report/Cargo.toml index 257637a1..ce3de173 100644 --- a/crates/nash-report/Cargo.toml +++ b/crates/nash-report/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-report" -version = "0.7.0" +version = "0.8.0" edition.workspace = true description = "Error reports for the Nash compiler: Elm's prose rendered with miette" homepage.workspace = true @@ -13,10 +13,10 @@ miette.workspace = true unicode-width = "0.1.14" serde.workspace = true serde_json.workspace = true -nash-ast = { path = "../nash-ast", version = "0.12.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } -nash-constrain = { path = "../nash-constrain", version = "0.9.0" } -nash-nitpick = { path = "../nash-nitpick", version = "0.3.3" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } +nash-constrain = { path = "../nash-constrain", version = "0.10.0" } +nash-nitpick = { path = "../nash-nitpick", version = "0.3.4" } nash-parse = { path = "../nash-parse", version = "0.10.0" } nash-region = { path = "../nash-region", version = "0.3.0" } nash-source = { path = "../nash-source", version = "0.10.0" } diff --git a/crates/nash-solve/CHANGELOG.md b/crates/nash-solve/CHANGELOG.md index 33f9fad9..7eea83f4 100644 --- a/crates/nash-solve/CHANGELOG.md +++ b/crates/nash-solve/CHANGELOG.md @@ -1,5 +1,28 @@ # nash-solve +## 0.11.0 — 2026-10-24 + +### Minor changes + +- [4c4e5155](https://github.com/orbistry/nash/commit/4c4e5155128aba697fcb2181ded80f0de5e03070) Resolve superclass evidence when a type variable stays open. A phantom parameter that no use fixes, as in `wrapper : tag 'p -> bool; wrapper t = same t t` with `same : Ord 'a => 'a -> 'a -> bool`, passed type checking but stopped `nash test` with "superclass resolution requires a ground type". `nash_solve::evidence::resolve` now keeps open type variables. An open variable equals only itself. An impl that matches whatever the variable is proves the predicate, and resolution reports `NonGround` only when no impl does and impl selection, a representation test, or the requirements of a type need the variable. The new `nash_ast::head::Open` matches impl heads against open types. Under `SelectPolicy::Exact`, `select_impl` now returns `Deferred` when no impl is selected and a candidate is undecided. `nash_codegen::evidence::Error::NonGround` is removed. — Thanks @MicroProofs! +- [baadec9e](https://github.com/orbistry/nash/commit/baadec9e5b89b384d1433a68849bd85a237b6aea) Add the representation coverage rule. When a rigid type variable keeps impl selection from deciding, because the impls are split by its representation class (for example `Eq (list ('a : Big))` and `Eq 'a => Eq (list ('a : Little))`), inference accepts the predicate if the annotation states the trait at that variable and every admitted representation selects an impl whose context holds. `same : Eq 'a => list 'a -> list 'a -> bool` now compiles. The evidence is the new `Evidence::Specialize`; code generation selects the impl for each use and keeps the selecting types in the specialization key. A missing element constraint is now reported as a missing constraint, such as `Eq 'a`, instead of a missing impl for the container. Superclass proofs do not use the rule: an impl names a split requirement in its context. nash-ast also gains `head::cover_impls` and `ReprTrait::exactly`. — Thanks @MicroProofs! +- [d47d2775](https://github.com/orbistry/nash/commit/d47d27754abacb94275313da7e8f032c65275307) Replace every separate search budget with one compile fuel counter, `nash_ast::fuel`. Trait resolution, impl overlap checks, superclass entailment, evidence resolution and code generation share it: each search step takes a `tick`, and the driver installs a fresh `Fuel` for each module's compile. `nash check`, `build`, `test` and `docs` run with unlimited fuel, so programs that the old fixed limits rejected now compile, such as an impl context that rewraps its argument used at 200 nested types. The language server runs with 10 million steps per module, so an editor gives up on a looping program after a second or two instead of freezing. + + Running out of fuel is one error kind, `COMPILATION STEP LIMIT` (`nash::type::out_of_fuel`), replacing `ImplResolutionLimit` (`nash::type::impl_resolution_limit`), `ImplPatternLimit` (`nash::names::impl_pattern_limit`), the superclass search limit, and the code generation specialization, evidence and recursion normalization limits. The solver reports it at the use that needed the search, canonicalization at the impl being checked, and code generation as a plain error. `nash_driver::build`, `build_with` and `test_with` take a `Fuel` argument, re-exported as `nash_driver::Fuel`. — Thanks @MicroProofs! + +### Patch changes + +- [aae91168](https://github.com/orbistry/nash/commit/aae9116859153e0339029c7169e7dd1f7a6b4443) Stop reporting ambiguous or unresolved trait constraints on values passed to a definition whose body failed to type check. Their types are unknown because of that failure; the body error is still reported, and fixing it reveals any remaining ambiguity. — Thanks @MicroProofs! +- [ba457678](https://github.com/orbistry/nash/commit/ba4576789b6b8e589e55a74a9fd51b8f6d78337a) Restore Elm's constraint tree: `nash-constrain` generates it from the canonical AST and `nash-solve` walks it, in place of direct inference. An annotated definition now publishes its declared type: a call with more arguments in the same module no longer replaces an alias in its annotation, so importers find the impls of that alias. — Thanks @MicroProofs! +- [532e437a](https://github.com/orbistry/nash/commit/532e437ad0cdad996feb55548fba7cc3e8703256) Index kind contracts, recovery dependencies, stranded variables, and scheme records so that type checking does not scan every earlier declaration again. — Thanks @MicroProofs! +- [f205096a](https://github.com/orbistry/nash/commit/f205096a25e5f4e1aedd2ec2ddd5da3d44b48eeb) Reject contradictory representation contexts on type applications, such as `(Big ('f 'a), Little ('f 'a))`, with the existing contradictory-representation error. They used to reach impl selection, where an empty proven set matched every disjoint impl. Export `nash_ast::same_type` for location-free type comparison. — Thanks @MicroProofs! +- [b7cb3a12](https://github.com/orbistry/nash/commit/b7cb3a1231f89e87faf7b36534a5b1e3176c4141) Do not select an impl for a trait constraint whose argument is an infinite type; the occurs check of the binding reports the type, as in Elm. Two impls that are disjoint on finite types can both match an infinite type, which crashed the compiler, and an impl that matches it at every depth gave a false step-limit error. — Thanks @MicroProofs! +- [5655782b](https://github.com/orbistry/nash/commit/5655782b2686abb979fda1157722dd10c4728b19) Record on each record-field constraint whether it comes from a module test, in place of the `Constraint::TestScope` wrapper. `Constraint::Record` and `Constraint::Field` gain a `tests` field, `TestScope` is removed, and `pattern::State` and `pattern::empty_state` take the flag. Field visibility is unchanged: fields that only a tests-block import makes visible are visible in tests and nowhere else. — Thanks @MicroProofs! +- [37ea4873](https://github.com/orbistry/nash/commit/37ea48736d9dfba9ceeb185f531e26385fa7aedc) Report a local annotation whose representation constraints contradict an enclosing annotation, such as `Little 'a` inside `Big 'a => ...`, as a contradictory-representation error. The two annotations share `'a`, and their combined constraints used to reach impl selection and crash the compiler. The error no longer lists a requirement that another listed requirement implies, such as `Storable` next to `Big`. — Thanks @MicroProofs! +- [cc95d399](https://github.com/orbistry/nash/commit/cc95d39997bc0021aa2796d324ba70b9706b0e32) Keep checking callers of an annotated definition against its annotation when its body has a type error. Callers now report their own mismatches and no longer receive spurious ambiguity errors. An annotation whose type variables escape still blocks its uses. — Thanks @MicroProofs! +- [da4a4d3a](https://github.com/orbistry/nash/commit/da4a4d3a3e4466fcc6af3ab0e2e2fb34e5334b46) Unify a type-variable application such as `'f 'a` with a transparent alias through the alias body when the alias's own parameters cannot supply the applied arguments. `type alias Xs = List Int` now works with `List.length`; record aliases remain nominal. — Thanks @MicroProofs! +- Updated dependencies: nash-ast@0.13.0, nash-can@0.14.0, nash-constrain@0.10.0 + ## 0.10.0 — 2026-10-10 ### Minor changes diff --git a/crates/nash-solve/Cargo.toml b/crates/nash-solve/Cargo.toml index a0f40e30..695302d0 100644 --- a/crates/nash-solve/Cargo.toml +++ b/crates/nash-solve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nash-solve" -version = "0.10.0" +version = "0.11.0" edition.workspace = true description = "The entry point of nash's type inference system. Implements type inference and specialization of traits." homepage.workspace = true @@ -9,9 +9,9 @@ license.workspace = true [dependencies] bumpalo.workspace = true -nash-ast = { path = "../nash-ast", version = "0.12.0" } -nash-can = { path = "../nash-can", version = "0.13.0" } -nash-constrain = { path = "../nash-constrain", version = "0.9.0" } +nash-ast = { path = "../nash-ast", version = "0.13.0" } +nash-can = { path = "../nash-can", version = "0.14.0" } +nash-constrain = { path = "../nash-constrain", version = "0.10.0" } nash-region = { path = "../nash-region", version = "0.3.0" } [dev-dependencies]