on master help sign in
Infer atom constraints and inspect Clay types
commit26554accc122a239ae63de041c99239725da255a authoriko <mail@iko.soy> dateFri 30 Oct 2026, 17:48 (1 day ago) parentbe6d2a5
36 files changed+2527−213
README.md+1−1 docs/compiler.md+2−2 docs/development.md+2−2 docs/open-questions.md+2−2 docs/prelude-inventory.md+3−3 docs/prompts/milestone-2.md+1−1 docs/spec/decisions.md+1−1 docs/spec/grammar.md+1−1 docs/status.md+7−6 jibb-dev/lib/jibb-import.hoon+110−16 jibb-dev/lib/jibb.hoon+125−47 jibb-dev/lib/jibb/prelude.jibb+40 tests/clay-fixtures/import-expected.txt+4 tests/clay-fixtures/import.txt+12 tests/golden/prelude-3g-like/about.txt+4 tests/golden/prelude-3g-like/source.jibb+100 tests/golden/prelude-3g-like/tokens.txt+599 tests/golden/prelude-3g-like/tree.txt+242 tests/golden/prelude-3g-like/types.txt+30 tests/golden/prelude-3g-structural/about.txt+4 tests/golden/prelude-3g-structural/source.jibb+93 tests/golden/prelude-3g-structural/tokens.txt+550 tests/golden/prelude-3g-structural/tree.txt+222 tests/golden/prelude-3g-structural/types.txt+28 tests/golden/types-partial-atom-constraint/about.txt+4 tests/golden/types-partial-atom-constraint/source.jibb+14 tests/golden/types-partial-atom-constraint/tokens.txt+91 tests/golden/types-partial-atom-constraint/tree.txt+42 tests/golden/types-partial-atom-constraint/types.txt+9 tests/golden/types-partial-atom-widening/types.txt+1−1 tests/importer/shadow.txt+1 tests/importer/small.txt+5 tests/importer/tree.txt+6−1 tests/lib/jibb.hoon+145−127 tools/clay-fixtures+25−1 tools/importer-test+1−1
README.md+1−1
@@ -86,7 +86,7 @@ A sync with nothing to commit takes about 2 s. A commit adds 3 to 10 s, and 300
8686
8787`tools/ship check-commit` proves that `|commit` stores `.jibb` files. It syncs `my-app`, reads every `/ui` file back with `%cx`, byte for byte, and converts `%jibb` to `%mime` and `%txt` and back. It commits half-written files, then deletes them. It merges a file that two desks changed on different lines, and checks that changes to the same line conflict. It can be rerun, and it leaves the two scratch desks it merges with (`%jibb-check-ours` and `%jibb-check-theirs`) holding only what `|new-desk` gives, unmounted.
8888
89−`tools/clay-fixtures` syncs `my-app` and checks through Clay that its example `/sur` files and marks build. It compares the result with the golden file under `tests/clay-fixtures/`.
89+`tools/clay-fixtures` syncs `my-app`, builds its example `/sur` files and marks through Clay, and checks selected molds read from the compiled `/sur` type graphs. It compares both results with golden files under `tests/clay-fixtures/`.
9090
9191For anything else:
9292
docs/compiler.md+2−2
@@ -56,9 +56,9 @@ The core is split into chapters, `+| %name`, in this order:
5656| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
5757| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
5858
59−The inference fragment supports fixed auras, unrestricted `@` and one-way widening into it, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. It does not yet check a module, its imports, faces, general patterns, deferred constraints, generalized atom constraints, recursive or generic molds, dependency cycles or errors with both conflicting excerpts. Function compatibility involving nested `@` remains unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
59+The inference fragment supports fixed auras, unrestricted `@` and one-way widening into it, generic variables and gates, unfaced cells, a two-binder cell pattern, a complete two-arm loobean branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. It can infer and generalize one atom constraint arising from an explicit capital, instantiate it independently, and print it. Other atom-constraint cases and defaulting are incomplete. It does not yet check a module, its imports, faces, general patterns, deferred constraints, recursive or generic molds, dependency cycles or errors with both conflicting excerpts. Function compatibility involving nested `@` remains unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
6060
61−The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. Nested `$^`, nested ordered maps, general source-level disjointness, marks and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core, built directly against zuse, and rejects locally shadowed names and subjects with unresolved Ford imports. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and the corresponding ship test compose the importer with the inference fragment and compare a separate golden report.
61+The separate `jibb-dev/lib/jibb-import.hoon` is an unfinished reader for selected Hoon type graphs. It handles named recursion, nested map, set, queue, list, unit, jar and jug arguments, direct ordered maps, and direct `$^` unions whose source branches can be proved disjoint. It also reads ordered map fields in records when the map arguments and all other fields are syntactically fixed atom molds. Nested `$^`, other nested ordered maps, general source-level disjointness, marks and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms and unfaced cells from caller-supplied reader results for declared `/-` imports; other forms remain unsupported. Its disjointness proof is conservative and can reject a valid union it cannot prove disjoint. Collection recognition requires the originating `/sur` core, built directly against zuse, and rejects locally shadowed names and subjects with unresolved Ford imports. Its fixtures include three real Tlon files; `tools/importer-test` compares the internal projection under eval, and the ship test compares the same golden output. `tools/type-import-test` and the corresponding ship test compose the importer with the inference fragment and compare a separate golden report.
6262
6363And the design notes:
6464
docs/development.md+2−2
@@ -61,7 +61,7 @@ git clone https://github.com/urbit/tools /root/src/tools
6161| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
6262| `tools/importer-test` | Compares the partial Hoon importer's diagnostic trees and errors with `tests/importer/tree.txt` under `urbit eval` |
6363| `tools/type-import-test` | Composes the Hoon importer with the partial checker and compares `tests/type-import/expected.txt` under eval |
64−| `tools/clay-fixtures` | Syncs `my-app` and checks that its example `/sur` files and marks build through Clay on the fake ship |
64+| `tools/clay-fixtures` | Syncs `my-app`, builds its example `/sur` files and marks through Clay, and checks selected imported mold projections on the fake ship |
6565| `tools/hoon` | Evaluates Hoon with the library in scope, as `tools/hoon '(golden /a/b/jibb (crip "++ main view"))'`; `--cord name=file` binds a file's text, `-f` reads the expression from a file |
6666| `tools/doc-blocks` | Checks the doc's `jibb` blocks against the `doc-*` golden cases: `tools/doc-blocks docs/spec` |
6767| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
@@ -83,7 +83,7 @@ tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
8383tools/ship test # the cases pass as -test arms on the ship
8484tools/testdata/ship-selftest # when tools/ship changed
8585tools/ship check-commit # when the mark or the desks changed
86−tools/clay-fixtures # when the my-app Hoon fixtures changed
86+tools/clay-fixtures # when the my-app Hoon fixtures or importer changed
8787```
8888
8989`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. A run with `--stub`, `--lib`, or a custom `--golden` isolates its generated golden tests from the repository's other test programs; run the default command afterward to restore and test those programs. It also runs the independent `tests/lib/jibb-import.hoon` test against the same importer fixtures and expected diagnostic projection as `tools/importer-test`. The projection is an internal tree, not the Jibb type printer. `tests/lib/jibb-bridge.hoon` also runs the importer/checker bridge fixture on the ship; `tools/type-import-test` runs the same report under eval.
docs/open-questions.md+2−2
@@ -32,12 +32,12 @@ Found while writing [prompts/milestone-2.md](prompts/milestone-2.md) and checkin
323210. **Settled: navigation commands.** On 2026-10-30, @iko chose separate declarations for application paths and unchecked cords, with `link-unsafe`, `image-unsafe` and `go-unsafe` for the unchecked forms. `image-unsafe` takes a sized URL record. Both navigation declarations produce `[%go url=@t]`; `go` converts the application path to a cord including the app's base path.
333311. **Settled: stores and derived gates.** On 2026-10-30, @iko said a store's `+$ poke` is a declaration, like an API file's, not a mold; a derived name clashes with an import face; and an island watching a request whose case has a separate `scry=` path has a type error. The todo API's request is renamed `todo-by-id` so it does not clash with `/- todo`. The checker must account for the fact that a store's kind is determined by the type of `main`.
343412. **Settled: how to print a union without a name.** On 2026-10-30, @iko said to print its cases separated by spaces, as `%approve %deny`. This is print-only, not Jibb syntax.
35−13. **Settled: how to print type constraints.** On 2026-10-30, @iko chose `$-([A A] A) where A is an atom` for an atom constraint and `$-([A A] ?) where A contains no gates` for a gate-free constraint.
35+13. **Settled: how to print type constraints.** On 2026-10-30, @iko chose `$-([A A] A) where A is an atom` for an atom constraint and `$-([A A] ?) where A contains no gates` for a gate-free constraint. Multiple clauses are comma-separated, as `where A is an atom, B contains no gates`.
363614. **Settled: how the prelude implements foundational operations.** On 2026-10-30, @iko chose private low-level primitives in the internal prelude module, with the public foundational gates implemented in Jibb on top of them.
373715. **Settled: unrestricted atoms and shared auras.** On 2026-10-30, @iko said `@` means any atom, independently at each occurrence, so Hoon `dime` and `pint` keep their bare-`@` fields. A specific atom such as `@ud` fits where `@` is expected; an `@` value needs a check to fit `@ud`. Shared atom types use one capital, with the atom constraint inferred from its body, as for `add` taking `[A A]` and returning `A`.
383816. **Settled: loobeans in union disjointness.** On 2026-10-30, @iko said `?` counts as its two atoms, `%.y` and `%.n`: it is disjoint from any cell and overlaps the constants 0 and 1.
393917. **Settled: empty cases in union disjointness.** On 2026-10-30, @iko said `!!` is disjoint from every case. A cell containing an empty position at any depth is itself empty and is also disjoint from every case.
40−18. **The two uses of Hoon `like`.** Hoon `+like` is a wet mold builder, but the gate it returns is callable and applies its supplied gate to the product. In a verified Hoon 135 example, applying `(like f)` to `[[1 2] [7 8 ~]]` produces an edge whose product is `8` when `f` is identity and `42` when `f` returns `42`; the resulting nail is the original input. Jibb molds are types, not callable values. Should the prelude expose `(like A)` as a generic mold and also expose a value gate under `like`? If so, should the value preserve Hoon's input shape and behavior, or instead map the product of an already constructed edge? @iko is reviewing these alternatives; the exact public signature is not yet decided.
40+18. **The two uses of Hoon `like`.** Hoon `+like` is a wet mold builder, but the gate it returns is callable and applies its supplied gate to the product. In a verified Hoon 135 example, applying `(like f)` to `[[1 2] [7 8 ~]]` produces an edge whose product is `8` when `f` is identity and `42` when `f` returns `42`; the resulting nail is the original input. Jibb molds are types, not callable values. The prelude now declares a generic `(like A)` mold and a `wonk` extractor; both parse, but their full type and backend validation remain outstanding. Should it also expose a value gate under `like`? If so, should the value preserve Hoon's input shape and behavior, or instead map the product of an already constructed edge? @iko is reviewing these alternatives; the exact public signature is not yet decided.
4141
4242## Grammar questions never put to the doc's author
4343
docs/prelude-inventory.md+3−3
@@ -92,14 +92,14 @@ Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`,
9292| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
9393| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
9494| `hair` | `[p=@ud q=@ud]`: a parsing position. |
95−| `like` | A wet mold builder parameterized by a gate `a=$-(* *)`; its generated gate takes a noun, builds an `edge`-shaped result, and applies `a` to the product on success. Its Hoon wet specialization can retain a product type. Its exact Jibb interface and implementation still need to be worked out; do not substitute an unverified fixed signature. |
95+| `like` | A wet mold builder parameterized by a gate `a=$-(* *)`; its generated gate takes a noun, builds an `edge`-shaped result, and applies `a` to the product on success. The prelude declares the generic mold `+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]`. A callable Jibb value form remains open in question 18. |
9696| `nail` | `[p=hair q=tape]`: parsing input. |
9797| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
9898| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
9999| `spot` | `[p=path q=pint]`: a file path and range. |
100100| `tone` | Three cases: `[%0 product=*]`, `[%1 block=*]`, and `[%2 trace=(list [@ta *])]`. Expose this Hoon mold as `tone.hoon`, distinct from Jibb's styling `tone`. How the prelude presents that qualified mold must agree with its eventual group implementation. |
101101| `toon` | Three cases: `[%0 p=*]`, `[%1 p=*]`, and `[%2 p=(list tank)]`. |
102−| `wonk` | A wet gate that extracts `p` from the successful `q` of an `edge` and crashes on an absent result. `$-(edge *)` describes its type-erased input and result, but an exact account of the Hoon gate's wet specialization remains open. |
102+| `wonk` | A wet gate that extracts `p` from the successful `q` of an `edge` and crashes on an absent result. The prelude's Jibb gate takes `(like A)` and returns its product `A`; it has been parsed but not yet type-checked or run through a backend. |
103103
104104The following shapes can be written as Jibb declarations once their referenced prelude molds are present:
105105
@@ -121,7 +121,7 @@ The following shapes can be written as Jibb declarations once their referenced p
121121 [%2 p=(list tank)]
122122```
123123
124−The compiler-result `tone.hoon` has the three cases listed above; the qualified name is a prelude group member, not a `+$` identifier containing a dot. Question 15 in [open-questions.md](open-questions.md) records @iko's decision that `@` is an unrestricted atom, resolving the `dime` and `pint` mismatch. The interfaces of the wet gates still need resolution before the inventory's 3g signatures can be considered complete.
124+The compiler-result `tone.hoon` has the three cases listed above; the qualified name is a prelude group member, not a `+$` identifier containing a dot. Question 15 in [open-questions.md](open-questions.md) records @iko's decision that `@` is an unrestricted atom, resolving the `dime` and `pint` mismatch. The callable value form of `like` remains unresolved. The new `like` mold and `wonk` gate parse, but full type and backend validation remain outstanding.
125125
126126## 4a
127127
docs/prompts/milestone-2.md+1−1
@@ -63,7 +63,7 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
6363- `@` means any atom, independently at each occurrence. A specific atom such as `@ud` fits where `@` is expected; an `@` value needs a check to fit `@ud`. Different specific auras never unify. `add` takes `[A A]` and returns `A`, with an atom constraint inferred for the shared type variable.
6464- Faces are part of record types: `[a=@ b=@]` and `[x=@ y=@]` don't unify. An unnamed position can unify with a faced one and take its face, so `[0 0]` fits `[x=@ud y=@ud]`. A single-item cell `[a]` is `a`; an empty `[]` is an error.
6565- Type variables are capitals, "generalized per `++`". A capital in a local `++` shares the enclosing `++`'s variable of that name; a different type takes a different capital. "A type variable used where an atom is required gains an atom constraint", so `++ clamp |= [lo=A hi=A n=A]`, calling `gth` and `max`, works on any one aura; "It can become nothing more specific: a body that makes `A` a `@ud` or a list is an error." Names "may refer to each other in any order", so infer `++` definitions in dependency order, a group of mutually recursive ones together.
66−- The checker infers a gate-free constraint for `eq` arguments and map and set keys and retains it when a type variable is generalized. The requirement applies recursively to nested values; union-case matching treats gates as opaque. Print a constrained type as `$-([A A] ?) where A contains no gates`.
66+- The checker infers a gate-free constraint for `eq` arguments and map and set keys and retains it when a type variable is generalized. The requirement applies recursively to nested values; union-case matching treats gates as opaque. Print a gate-free constraint as `$-([A A] ?) where A contains no gates` and an atom constraint as `$-([A A] A) where A is an atom`; separate multiple clauses with commas, as `where A is an atom, B contains no gates`.
6767- Gates may call themselves and their siblings; a non-gate value that depends on itself, even through a gate, is an error. Molds may be recursive, and "recursive molds go by name and module".
6868- A sample's mold may be left out: every bare name in a sample binds, at any depth, as in `|=(p title.p)` "when the call fixes the type", `|= [a=@ b]` and `|=(m ~)`.
6969- Generic molds: `+$ result |$ [V E]` with cases below, applied as `(result V E)`; `|$` goes right after a `+$`'s name, and the prelude's `cmd` and `sub` use `|$ [M]`.
docs/spec/decisions.md+1−1
@@ -26,7 +26,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
2626| Definitions | `++` for values, `+$` for molds; no `=/` | Decided |
2727| Unions | No `$?`: a `+$` with its cases on the lines below is a union, so every union written in Jibb has a name; one case is just that mold; a mold that isn't a union counts as a union of one case for tags and `\|=%tag`; a generic's `\|$` comes right after the `+$`'s name; tags anywhere; cases differ as nouns, with `?` treated as the two atoms `%.y` and `%.n`, disjoint from cells and overlapping constants 0 and 1, and `!!` or any cell with an empty position disjoint from every case; a tag literal or `~` waits for its union, and an unresolved one is an error | Decided 2026-10-30 |
2828| Printed unnamed unions | Print the cases separated by spaces, as `%approve %deny`; this is print-only, not Jibb syntax | Decided 2026-10-30 |
29−| Printed type constraints | Print an atom constraint as `$-([A A] A) where A is an atom` and a gate-free constraint as `$-([A A] ?) where A contains no gates` | Decided 2026-10-30 |
29+| Printed type constraints | Print an atom constraint as `$-([A A] A) where A is an atom` and a gate-free constraint as `$-([A A] ?) where A contains no gates`; separate multiple clauses with commas, as `where A is an atom, B contains no gates` | Decided 2026-10-30 |
3030| Branching | `?-` only, loobeans included; exhaustive, with explicit catch-alls; covered arms are errors; failures say `!!` | Decided 2026-10-29 |
3131| Equality and negation | The gates `eq` and `not`, with Hoon's bitwise `not` exposed as `not.bit`; `eq`'s arguments and map and set keys contain no gates, even nested; the checker infers and generalizes that constraint; union matching never inspects a gate to distinguish cases | Decided 2026-10-30 |
3232| Special rules | No built-ins; type-directed rules are welcome, each listed in the Grammar tab | Decided 2026-10-29 |
docs/spec/grammar.md+1−1
@@ -132,7 +132,7 @@ A mold is only a type: never called on a noun, and with no default. Types are in
132132- **Opaque**: `poke`, `ask` and `qath`, built only by derived gates, `pure` and application-path literals. `(facts full diff …)` appears only in an API file's `paths`.
133133- **Identity**: recursive molds go by name and module.
134134
135−`eq`'s arguments and map and set keys must contain no gates, even nested inside another value. The checker infers this gate-free constraint on type variables and retains it when generalizing a `++`, so a generic helper that calls `eq` stays generic over gate-free types. Printed types show the constraint as `$-([A A] ?) where A contains no gates`. An inferred atom constraint prints as `$-([A A] A) where A is an atom`. Union-case matching treats gates as opaque and never inspects a gate to distinguish cases.
135+`eq`'s arguments and map and set keys must contain no gates, even nested inside another value. The checker infers this gate-free constraint on type variables and retains it when generalizing a `++`, so a generic helper that calls `eq` stays generic over gate-free types. Printed types show the constraint as `$-([A A] ?) where A contains no gates`. An inferred atom constraint prints as `$-([A A] A) where A is an atom`. Multiple clauses are comma-separated, as `where A is an atom, B contains no gates`. Union-case matching treats gates as opaque and never inspects a gate to distinguish cases.
136136
137137## Tag resolution
138138
docs/status.md+7−6
@@ -19,7 +19,7 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
1919
2020## Milestone 2: in progress
2121
22−The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; a partial bridge passes selected Hoon atoms and unfaced cells into inference, while the reader and bridge do not cover every supported Hoon type. It reads named recursion, nested collections, direct ordered maps, and direct `$^` unions whose cases can be proved disjoint. Nested `$^`, nested ordered maps, marks and general union disjointness remain unfinished. The inference fragment supports unrestricted `@` and selected one-way widenings; generalized atom constraints still need work. Collection recognition checks the originating core and fails closed on local shadows or unresolved Ford subjects; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
22+The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; a partial bridge passes selected Hoon atoms and unfaced cells into inference, while the reader and bridge do not cover every supported Hoon type. It reads named recursion, nested collections, direct ordered maps, certain ordered-map fields, and direct `$^` unions whose cases can be proved disjoint. Nested `$^`, other nested ordered maps, marks and general union disjointness remain unfinished. The inference fragment supports unrestricted `@`, selected one-way widenings, and one generalized atom constraint arising from an explicit capital; other constraints and defaulting still need work. Collection recognition checks the originating core and fails closed on local shadows or unresolved Ford subjects; its golden fixtures include three real Tlon files. The prelude currently has only a few functions, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
2323
2424## Milestone 1: parser and mark
2525
@@ -37,8 +37,8 @@ What the plan asks for, and where it is:
3737
3838Besides the plan's list:
3939
40−- 398 golden cases: 182 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
41−- The 398-case corpus passed under `urbit eval` in 19.6 s. The fake ship passed all 401 tests, including the importer, importer/checker bridge and unification checks, with 18.2 s for sync and 10.5 s for tests. The importer golden compares 40 projections; `tools/clay-fixtures` also built all seven example Hoon fixtures through Clay.
40+- 401 golden cases: 185 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
41+- The 401-case corpus passed under `urbit eval` in 20.0 s. The fake ship passed all 404 tests, including the importer, importer/checker bridge and unification checks, with 20.0 s for sync and 16.6 s for tests. The importer golden compares 45 projections; `tools/clay-fixtures` built all seven example Hoon fixtures through Clay and read three selected molds from the resulting type graphs.
4242- `tools/testdata/selftest` (19 checks) and `tools/testdata/ship-selftest` test the tools themselves.
4343- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
4444- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
@@ -56,14 +56,15 @@ Besides the plan's list:
5656| aad6ddb | 2026-10-30 | Drop `$?`; `+$` takes union cases below its name |
5757| 1dd92a6 | 2026-10-30 | Begin type inference and Hoon imports |
5858| 51ce4d9 | 2026-10-30 | Extend partial inference and importer, record type and prelude decisions |
59−| This change | 2026-10-30 | Add atom widening, nested collections and case-local Hoon import fixtures |
59+| be6d2a5 | 2026-10-30 | Add atom widening, nested collections and case-local Hoon import fixtures |
60+| This change | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
6061
6162## Checking it
6263
6364On a machine set up as [development.md](development.md) says:
6465
6566```
66−tools/golden # 398 cases under urbit eval
67+tools/golden # 401 cases under urbit eval
6768tools/importer-test # the Hoon importer fixture projection
6869tools/type-import-test # the importer/checker bridge fixture
6970tools/hoon check-spans-test # prints <<>> when the span checker works
@@ -71,7 +72,7 @@ tools/testdata/selftest # the tools themselves
7172tools/doc-blocks docs/spec # the doc's examples are golden cases
7273tools/ship start
7374tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
74−tools/ship test # the same 398 cases as -test arms on the ship
75+tools/ship test # the same 401 cases as -test arms on the ship
7576tools/testdata/ship-selftest
7677tools/ship check-commit # |commit stores .jibb files
7778tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb-import.hoon+110−16
@@ -13,8 +13,10 @@
1313:: A direct $^ is read from its original branches and accepted only when
1414:: their imported shapes prove disjoint. Nested $^ and some valid but
1515:: unprovably disjoint cases remain unsupported. Source-level overlap in
16−:: other unions, nested ordered maps, Ford import provenance, marks and
17−:: full error locations still need work.
16+:: other unions, general nested ordered maps, Ford import provenance,
17+:: marks and full error locations still need work. A nested ordered map
18+:: is recovered only in records whose other fields, keys and values are
19+:: syntactically fixed atom molds; other source shapes fail closed.
1820::
1921:: The checker has a small bridge for successful unfaced atom and cell
2022:: results; it rejects other importer shapes. Failures return %|; no
@@ -188,8 +190,37 @@
188190 ==
189191 ==
190192::
193+:: Replace direct mop expressions in records with a simple placeholder;
194+:: recover-alias restores each from its original source specs afterward.
195+:: Only rewrite a record whose other fields are visibly fixed atom
196+:: molds. A general dependent mold could change when a field changes.
197+++ patchable-mop-record
198+ |= src=hoon
199+ ^- ?
200+ ?^ -.src &($(src -.src) $(src +.src))
201+ ?+ src |
202+ [%note *] $(src q.src)
203+ [%ktts *] $(src q.src)
204+ [%ktls *] ?=([%sand *] p.src)
205+ [%cncl *]
206+ =/ specs (mop-specs src)
207+ ?~ specs |
208+ &(?=([%base [%atom *]] key.u.specs) ?=([%base [%atom *]] value.u.specs))
209+ ==
210+::
211+++ patch-mops
212+ |= src=hoon
213+ ^- hoon
214+ ?^ -.src [$(src -.src) $(src +.src)]
215+ ?+ src src
216+ [%note *] src(q $(src q.src))
217+ [%ktts *] src(q $(src q.src))
218+ [%cncl *] ?: ?=(^ (mop-specs src)) (ream '*@t')
219+ src
220+ ==
221+::
191222++ recover-alias
192− |= [src=hoon out=imported]
223+ |= [src=hoon out=imported subject=type module=term sig=signatures seen=visiting context=(unit type)]
193224 ^- (each imported @t)
194225 ?. (has-hidden-alias src) [%& out]
195226 ?^ -.src
@@ -215,6 +246,17 @@
215246 [%& *] [%& [%face name.out p.child]]
216247 ==
217248 [%cncl *]
249+ =/ mop=(unit [key=spec value=spec]) (mop-specs src)
250+ ?^ mop
251+ =/ attempt=(each [type type] tang)
252+ (mule |.([(~(play ut subject) [%kttr key.u.mop]) (~(play ut subject) [%kttr value.u.mop])]))
253+ ?- attempt
254+ [%| *] [%| 'a nested Hoon mop needs source-aware import']
255+ [%& *]
256+ =/ key (walk module -.p.attempt sig seen context)
257+ =/ val (walk module +.p.attempt sig seen context)
258+ [%& [%apply %mop ~[key val]]]
259+ ==
218260 =/ alias (source-alias src)
219261 ?~ alias [%| 'a nested collection alias needs source-aware import']
220262 =/ original=(each imported @t)
@@ -361,13 +403,9 @@
361403 ?@ src |
362404 |($(src -.src) $(src +.src))
363405::
364−++ mop-arguments-raw
365− |= h=type
366− ^- (unit [key=type value=type])
367− ?. ?=([%hold *] h) ~
368− =/ original=hoon q.h
369− ?. ?=([%tsls [%note * *] *] original) ~
370− =/ body=hoon q.p.original
406+++ mop-specs-raw
407+ |= body=hoon
408+ ^- (unit [key=spec value=spec])
371409 ?. ?=([%cncl *] body) ~
372410 ?. ?=([%tsgr *] p.body) ~
373411 =/ b=hoon q.p.body
@@ -377,7 +415,27 @@
377415 ?. =(p.p.p.b ~[%mop]) ~
378416 =/ specs=(list spec) ;;((list spec) q.p.b)
379417 ?. ?=([* [* ~]] specs) ~
380− [~ [(~(play ut p.h) [%kttr i.specs]) (~(play ut p.h) [%kttr i.t.specs])]]
418+ [~ [i.specs i.t.specs]]
419+::
420+++ mop-specs
421+ |= body=hoon
422+ ^- (unit [key=spec value=spec])
423+ =/ attempt=(each (unit [key=spec value=spec]) tang)
424+ (mule |.((mop-specs-raw body)))
425+ ?- attempt
426+ [%& *] p.attempt
427+ [%| *] ~
428+ ==
429+::
430+++ mop-arguments-raw
431+ |= h=type
432+ ^- (unit [key=type value=type])
433+ ?. ?=([%hold *] h) ~
434+ =/ original=hoon q.h
435+ ?. ?=([%tsls [%note * *] *] original) ~
436+ =/ specs (mop-specs q.p.original)
437+ ?~ specs ~
438+ [~ [(~(play ut p.h) [%kttr key.u.specs]) (~(play ut p.h) [%kttr value.u.specs])]]
381439::
382440++ mop-arguments
383441 |= h=type
@@ -453,7 +511,28 @@
453511 ?^ mop
454512 [%apply %mop ~[$(typ key.u.mop) $(typ value.u.mop)]]
455513 ?: (source-uses q.typ %mop)
456− [%bad 'a nested Hoon mop needs source-aware import']
514+ ?. ?=([%tsls [%note * *] *] q.typ)
515+ [%bad 'a nested Hoon mop needs source-aware import']
516+ =/ original=hoon q.typ
517+ ?> ?=([%tsls [%note * *] *] original)
518+ =/ source=hoon q.p.original
519+ ?. (patchable-mop-record source)
520+ [%bad 'a nested Hoon mop needs source-aware import']
521+ =/ patched=hoon (patch-mops source)
522+ ?: |(=(source patched) (source-uses patched %mop))
523+ [%bad 'a nested Hoon mop needs source-aware import']
524+ =/ replacement=hoon original(q.p patched)
525+ =/ attempt=(each type tang) (mule |.((~(play ut p.typ) replacement)))
526+ ?- attempt
527+ [%| *] [%bad 'a nested Hoon mop needs source-aware import']
528+ [%& *]
529+ =/ projected $(typ p.attempt, seen [[typ nm] seen])
530+ =/ corrected (recover-alias source projected p.typ module sig seen context)
531+ ?- corrected
532+ [%| *] [%bad p.corrected]
533+ [%& *] p.corrected
534+ ==
535+ ==
457536 =/ branches (cell-branches typ)
458537 ?^ branches
459538 =/ first $(typ left.u.branches, seen [[typ nm] seen])
@@ -472,14 +551,14 @@
472551 ?. hidden body
473552 ?. ?=([%tsls [%note * *] *] q.typ)
474553 [%bad 'a nested collection alias needs source-aware import']
475− =/ corrected (recover-alias q.p.q.typ body)
554+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
476555 ?- corrected
477556 [%& *] p.corrected
478557 [%| *] [%bad p.corrected]
479558 ==
480559 ?. ?=([%tsls [%note * *] *] q.typ)
481560 [%bad 'a Hoon collection alias could not be recovered']
482− =/ corrected (recover-alias q.p.q.typ body)
561+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
483562 ?- corrected
484563 [%& *] p.corrected
485564 [%| *] [%bad p.corrected]
@@ -582,8 +661,16 @@
582661 =/ expect-mop=imported [%apply %mop ~[[%atom %ud ~] [%atom %t ~]]]
583662 =/ errors ?: =((sample %mop-test) [%& expect-mop]) errors
584663 ['ordered map name and arguments' errors]
585− =/ errors ?: =((sample %nested-mop) [%| 'a nested Hoon mop needs source-aware import']) errors
586− ['nested ordered map remains unsupported' errors]
664+ =/ expect-nested-mop=imported
665+ [%cell [%face %table expect-mop] [%face %other [%atom %ud ~]]]
666+ =/ errors ?: =((sample %nested-mop) [%& expect-nested-mop]) errors
667+ ['ordered map field is preserved' errors]
668+ =/ errors ?: =((sample %mixed-mop) [%| 'a nested Hoon mop needs source-aware import']) errors
669+ ['non-atom sibling remains unsupported' errors]
670+ =/ errors ?: =((sample %named-mop) [%| 'a nested Hoon mop needs source-aware import']) errors
671+ ['non-atom argument remains unsupported' errors]
672+ =/ errors ?: =((sample %mop-list) [%| 'a nested Hoon mop needs source-aware import']) errors
673+ ['ordered map in a list remains unsupported' errors]
587674 =/ errors ?: =((sample %signed) [%| 'signed and float auras cannot be imported']) errors
588675 ['signed aura rejected' errors]
589676 =/ errors ?: =((sample %float) [%| 'signed and float auras cannot be imported']) errors
@@ -598,6 +685,8 @@
598685 ['disjoint cell union' errors]
599686 =/ errors ?: =((sample %invalid-cell) [%| 'a Hoon $^ union has overlapping cases']) errors
600687 ['overlapping cell union is rejected' errors]
688+ =/ errors ?: =((shad %mn) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
689+ ['local mop shadow in a field is rejected' errors]
601690 =/ errors ?: =((shad %mm) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
602691 ['local mop shadow is rejected' errors]
603692 =/ errors ?: =((shad %aa) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
@@ -695,6 +784,10 @@
695784 (crip "compound-fields: {(show-result (sample %compound-fields))}")
696785 (crip "mop: {(show-result (sample %mop-test))}")
697786 (crip "nested-mop: {(show-result (sample %nested-mop))}")
787+ (crip "two-mops: {(show-result (sample %two-mops))}")
788+ (crip "mixed-mop: {(show-result (sample %mixed-mop))}")
789+ (crip "named-mop: {(show-result (sample %named-mop))}")
790+ (crip "mop-list: {(show-result (sample %mop-list))}")
698791 (crip "signed: {(show-result (sample %signed))}")
699792 (crip "float: {(show-result (sample %float))}")
700793 (crip "gate: {(show-result (sample %gate-test))}")
@@ -708,6 +801,7 @@
708801 (crip "chapter-wrapped-hit: {?:(=((chapter-has [~ chapter-tree] %jar) [~ &]) "yes" "no")}")
709802 (crip "chapter-direct-miss: {?:(=((chapter-has chapter-tree %jug) [~ &]) "yes" "no")}")
710803 (crip "chapter-wrapped-miss: {?:(=((chapter-has [~ chapter-tree] %jug) [~ &]) "yes" "no")}")
804+ (crip "shadow-nested-mop: {(show-result (shad %mn))}")
711805 (crip "shadow-mop: {(show-result (shad %mm))}")
712806 (crip "shadow-jar: {(show-result (shad %aa))}")
713807 (crip "shadow-jug: {(show-result (shad %bb))}")
jibb-dev/lib/jibb.hoon+125−47
@@ -4590,8 +4590,9 @@
45904590:: Each top-level inferred definition generalizes its free variables, and
45914591:: a use instantiates them afresh. Binders inside a gate stay monomorphic;
45924592:: capital variables in molds share one allocation within the definition.
4593−:: Decimal literals have atom-only variables; until their constraints
4594−:: can be printed and generalized, an unresolved one is unsupported.
4593+:: Atom constraints tied to an explicit capital are generalized and
4594+:: printed. Other unresolved aura variables remain unsupported until
4595+:: their defaulting and inferred generalization are implemented.
45954596:: Bare @ is a separate unrestricted atom type. A directional fit check
45964597:: permits concrete atoms to widen to it, never the reverse. A fit that
45974598:: needs a not-yet-implemented constraint remains unsupported. Only
@@ -4601,6 +4602,7 @@
46014602 $~ [%var 0]
46024603 $% [%var id=@ud]
46034604 [%avar id=@ud]
4605+ [%nvar id=@ud]
46044606 [%atom aura=@ta]
46054607 [%any-atom ~]
46064608 [%flag ~]
@@ -4629,6 +4631,10 @@
46294631 =/ found=(unit itype) (itype-lookup id.t sub)
46304632 ?~ found t
46314633 $(t u.found)
4634+ %nvar
4635+ =/ found=(unit itype) (itype-lookup id.t sub)
4636+ ?~ found t
4637+ $(t u.found)
46324638 ==
46334639::
46344640++ itype-occurs
@@ -4638,6 +4644,7 @@
46384644 ?- -.t
46394645 %var =(n id.t)
46404646 %avar =(n id.t)
4647+ %nvar =(n id.t)
46414648 %atom |
46424649 %any-atom |
46434650 %flag |
@@ -4663,11 +4670,21 @@
46634670 ?: ?=(%var -.b)
46644671 ?: (itype-occurs id.b a sub) ~
46654672 `[[id.b a] sub]
4673+ :: The narrower decimal constraint survives a match with an atom
4674+ :: variable; decimal syntax alone does not make it a loobean.
4675+ ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4676+ ?: &(?=(%avar -.a) ?=(%nvar -.b)) `[[id.a b] sub]
4677+ ?: ?=(%nvar -.a)
4678+ ?. |(?=(%nvar -.b) ?=(%atom -.b)) ~
4679+ `[[id.a b] sub]
4680+ ?: ?=(%nvar -.b)
4681+ ?. ?=(%atom -.a) ~
4682+ `[[id.b a] sub]
46664683 ?: ?=(%avar -.a)
4667− ?. |(?=(%avar -.b) ?=(%atom -.b)) ~
4684+ ?. |(?=(%avar -.b) ?=(%atom -.b) ?=(%any-atom -.b) ?=(%flag -.b)) ~
46684685 `[[id.a b] sub]
46694686 ?: ?=(%avar -.b)
4670− ?. ?=(%atom -.a) ~
4687+ ?. |(?=(%atom -.a) ?=(%any-atom -.a) ?=(%flag -.a)) ~
46714688 `[[id.b a] sub]
46724689 ?: &(?=(%atom -.a) ?=(%atom -.b)) ~
46734690 ?: &(?=(%fn -.a) ?=(%fn -.b))
@@ -4682,10 +4699,10 @@
46824699::
46834700:: +itype-fit: one-way widening from an actual type to an expected type
46844701::
4685−:: Variables that would need a generalized atom constraint, and
4686−:: function compatibility involving unrestricted @, remain unknown.
4702+:: An unknown variable used where @ is expected gains a fresh atom
4703+:: constraint. Function compatibility involving @ remains unknown.
46874704::
4688−+$ ifit $%([%ok sub=isub] [%bad ~] [%unknown ~])
4705++$ ifit $%([%ok sub=isub next=@ud] [%bad ~] [%unknown ~])
46894706++ itype-has-any-atom
46904707 |= [t=itype sub=isub]
46914708 ^- ?
@@ -4693,6 +4710,7 @@
46934710 ?- -.t
46944711 %var |
46954712 %avar |
4713+ %nvar |
46964714 %atom |
46974715 %any-atom &
46984716 %flag |
@@ -4701,37 +4719,40 @@
47014719 ==
47024720::
47034721++ itype-fit
4704− |= [actual=itype expected=itype sub=isub]
4722+ |= [actual=itype expected=itype sub=isub next=@ud]
47054723 ^- ifit
47064724 =. actual (itype-walk actual sub)
47074725 =. expected (itype-walk expected sub)
4708− ?: =(actual expected) [%ok sub]
4726+ ?: =(actual expected) [%ok sub next]
47094727 ?: ?=(%any-atom -.expected)
4710− ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%flag -.actual)) [%ok sub]
4711− ?: ?=(%var -.actual) [%unknown ~]
4728+ ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%flag -.actual)) [%ok sub next]
4729+ ?: ?=(%var -.actual)
4730+ =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
4731+ ?~ unified [%bad ~]
4732+ [%ok u.unified +(next)]
47124733 [%bad ~]
47134734 ?: ?=(%any-atom -.actual)
47144735 ?: ?=(%var -.expected)
47154736 =/ unified=(unit isub) (itype-unify actual expected sub)
47164737 ?~ unified [%bad ~]
4717− [%ok u.unified]
4718− ?: ?=(%avar -.expected) [%unknown ~]
4738+ [%ok u.unified next]
4739+ ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
47194740 [%bad ~]
47204741 ?: &(?=(%cell -.actual) ?=(%cell -.expected))
47214742 =/ first=ifit $(actual hed.actual, expected hed.expected)
47224743 ?. ?=(%ok -.first) first
4723− $(actual tal.actual, expected tal.expected, sub sub.first)
4744+ $(actual tal.actual, expected tal.expected, sub sub.first, next next.first)
47244745 ?: &(?=(%var -.actual) (itype-has-any-atom expected sub))
47254746 [%unknown ~]
47264747 ?: |(?=(%var -.actual) ?=(%var -.expected))
47274748 =/ unified=(unit isub) (itype-unify actual expected sub)
47284749 ?~ unified [%bad ~]
4729− [%ok u.unified]
4750+ [%ok u.unified next]
47304751 ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
47314752 [%unknown ~]
47324753 =/ unified=(unit isub) (itype-unify actual expected sub)
47334754 ?~ unified [%bad ~]
4734− [%ok u.unified]
4755+ [%ok u.unified next]
47354756::
47364757++ itype-unify-test
47374758 ^- (list tape)
@@ -4801,6 +4822,7 @@
48014822 ?- -.t
48024823 %var ~[id.t]
48034824 %avar ~[id.t]
4825+ %nvar ~[id.t]
48044826 %atom ~
48054827 %any-atom ~
48064828 %flag ~
@@ -4825,7 +4847,14 @@
48254847 =/ found=(unit itype) (itype-lookup id.t ren)
48264848 ?~ found t
48274849 u.found
4828− %avar t
4850+ %avar
4851+ =/ found=(unit itype) (itype-lookup id.t ren)
4852+ ?~ found t
4853+ u.found
4854+ %nvar
4855+ =/ found=(unit itype) (itype-lookup id.t ren)
4856+ ?~ found t
4857+ u.found
48294858 %atom t
48304859 %any-atom t
48314860 %flag t
@@ -4833,6 +4862,23 @@
48334862 %cell [%cell $(t hed.t) $(t tal.t)]
48344863 ==
48354864::
4865+:: Variable IDs are unique across the two kinds. Inspecting the
4866+:: normalized type preserves the atom constraint when renaming.
4867+::
4868+++ itype-var-is-atom
4869+ |= [n=@ud t=itype]
4870+ ^- ?
4871+ ?- -.t
4872+ %var |
4873+ %avar =(n id.t)
4874+ %nvar =(n id.t)
4875+ %atom |
4876+ %any-atom |
4877+ %flag |
4878+ %fn |($(t sample.t) $(t product.t))
4879+ %cell |($(t hed.t) $(t tal.t))
4880+ ==
4881+::
48364882:: Canonical numbering makes printed variables independent of the order
48374883:: the unifier happened to allocate intermediates.
48384884::
@@ -4843,7 +4889,8 @@
48434889 =/ n=@ud 0
48444890 |-
48454891 ?~ vars (itype-rename t ren)
4846− $(vars t.vars, ren [[i.vars [%var n]] ren], n +(n))
4892+ =/ replacement=itype ?:((itype-var-is-atom i.vars t) [%avar n] [%var n])
4893+ $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
48474894::
48484895++ instantiate-scheme
48494896 |= [scheme=ischeme state=istate]
@@ -4852,7 +4899,9 @@
48524899 =/ vars=(list @ud) vars.scheme
48534900 |-
48544901 ?~ vars [(itype-rename typ.scheme ren) state]
4855− $(vars t.vars, ren [[i.vars [%var next.state]] ren], state state(next +(next.state)))
4902+ =/ replacement=itype
4903+ ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state])
4904+ $(vars t.vars, ren [[i.vars replacement] ren], state state(next +(next.state)))
48564905::
48574906++ icap-lookup
48584907 |= [n=@t caps=icaps]
@@ -5006,7 +5055,7 @@
50065055 %lit
50075056 ?- form.lit.e
50085057 %number ?: =(%ud aura.lit.e)
5009− [%& [%avar next.state] state(next +(next.state))]
5058+ [%& [%nvar next.state] state(next +(next.state))]
50105059 [%& [%atom aura.lit.e] state]
50115060 %ship [%& [%atom %p] state]
50125061 %date [%& [%atom %da] state]
@@ -5027,6 +5076,10 @@
50275076 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
50285077 [%& typ.instance state.instance]
50295078 %group $(e inner.e)
5079+ %trace
5080+ =/ traced=iresult $(e val.e)
5081+ ?: ?=(%| -.traced) traced
5082+ $(e then.e, state state.p.traced)
50305083 %tuple (infer-simple-items items.e env state)
50315084 %body
50325085 ?^ defs.e [%| "local definitions are not supported by partial inference"]
@@ -5062,10 +5115,10 @@
50625115 ?~ target [%| "cast mold is not supported by partial inference"]
50635116 =/ value=iresult $(e val.e, state state.u.target)
50645117 ?: ?=(%| -.value) value
5065− =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value)
5118+ =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
50665119 ?: ?=(%unknown -.fit) [%| "cast constraint is not supported by partial inference"]
50675120 ?: ?=(%bad -.fit) [%| "cast mold and expression type do not unify"]
5068− [%& typ.u.target state.p.value(sub sub.fit)]
5121+ [%& typ.u.target state.p.value(sub sub.fit, next next.fit)]
50695122 %crash [%& [%var next.state] state(next +(next.state))]
50705123 %gate
50715124 =/ sam=isample-result (infer-sample sample.e env state)
@@ -5089,10 +5142,10 @@
50895142 =/ st=istate state.p.arg
50905143 =/ ht=itype (itype-walk typ.p.head sub.st)
50915144 ?: ?=(%fn -.ht)
5092− =/ fit=ifit (itype-fit typ.p.arg sample.ht sub.st)
5145+ =/ fit=ifit (itype-fit typ.p.arg sample.ht sub.st next.st)
50935146 ?: ?=(%unknown -.fit) [%| "call constraint is not supported by partial inference"]
50945147 ?: ?=(%bad -.fit) [%| "call's sample and argument types do not unify"]
5095− [%& product.ht st(sub sub.fit)]
5148+ [%& product.ht st(sub sub.fit, next next.fit)]
50965149 =/ result=itype [%var next.st]
50975150 =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
50985151 ?~ uni [%| "call's sample and argument types do not unify"]
@@ -5152,7 +5205,12 @@
51525205 %var
51535206 ?: (lth id.t 26) [(add 65 id.t) ~]
51545207 "T{<id.t>}"
5155− %avar "@"
5208+ %avar
5209+ ?: (lth id.t 26) [(add 65 id.t) ~]
5210+ "T{<id.t>}"
5211+ %nvar
5212+ ?: (lth id.t 26) [(add 65 id.t) ~]
5213+ "T{<id.t>}"
51565214 %atom "@{(trip aura.t)}"
51575215 %any-atom "@"
51585216 %flag "?"
@@ -5160,34 +5218,54 @@
51605218 %cell "[{$(t hed.t)} {$(t tal.t)}]"
51615219 ==
51625220::
5163−:: Unfixed aura variables are withheld from the output until inference
5164−:: can generalize them and the printer represents their constraints.
5165−::
5166−++ itype-has-avar
5167− |= t=itype
5168− ^- ?
5169− ?- -.t
5170− %avar &
5171− %var |
5172− %atom |
5173− %any-atom |
5174− %flag |
5175− %fn |($(t sample.t) $(t product.t))
5176− %cell |($(t hed.t) $(t tal.t))
5177− ==
5178−::
51795221:: A capital in a written mold is generalized with its enclosing ++.
5180−:: Until its rigidity and aura constraints are represented, do not
5181−:: report a type when unification made one more specific.
5222+:: Atom constraints may remain generic; until full rigidity checking
5223+:: is implemented, do not report a type if one became more specific.
51825224::
51835225++ constrained-capitals
51845226 |= [caps=icaps sub=isub]
51855227 ^- ?
51865228 ?~ caps |
51875229 =/ resolved=itype (itype-walk [%var id.i.caps] sub)
5188− ?. ?=(%var -.resolved) &
5230+ ?. |(?=(%var -.resolved) ?=(%avar -.resolved)) &
51895231 $(caps t.caps)
51905232::
5233+:: Only atom variables tied to an explicit capital are generalized in
5234+:: this fragment. Other aura variables still need defaulting or inferred
5235+:: constraints. The printer currently handles one atom constraint.
5236+::
5237+++ atom-var-from-cap
5238+ |= [n=@ud caps=icaps sub=isub]
5239+ ^- ?
5240+ ?~ caps |
5241+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
5242+ ?: ?=(%avar -.resolved)
5243+ ?: =(n id.resolved) &
5244+ $(caps t.caps)
5245+ $(caps t.caps)
5246+::
5247+++ unsupported-atom-vars
5248+ |= [t=itype caps=icaps sub=isub]
5249+ ^- ?
5250+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
5251+ =/ count=@ud 0
5252+ |-
5253+ ?~ vars (gth count 1)
5254+ ?: (itype-var-is-atom i.vars t)
5255+ ?. (atom-var-from-cap i.vars caps sub) &
5256+ $(vars t.vars, count +(count))
5257+ $(vars t.vars)
5258+::
5259+++ show-atom-constraint
5260+ |= t=itype
5261+ ^- tape
5262+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
5263+ |-
5264+ ?~ vars ""
5265+ ?: (itype-var-is-atom i.vars t)
5266+ " where {(show-itype [%avar i.vars] ~)} is an atom"
5267+ $(vars t.vars)
5268+::
51915269:: Build the supported part of the value environment in dependency order.
51925270:: Each pass adds successful definitions. Forward references become
51935271:: available on a later pass; recursive groups and unsupported syntax do
@@ -5222,7 +5300,7 @@
52225300 ?: ?=(%| -.result) $(ds t.ds)
52235301 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
52245302 =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5225− ?: (itype-has-avar typ) $(ds t.ds)
5303+ ?: (unsupported-atom-vars typ caps.state.p.result sub.state.p.result) $(ds t.ds)
52265304 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
52275305 ?: (gth (lent vars) 26) $(ds t.ds)
52285306 $(ds t.ds, env [[name.d [typ vars]] env])
@@ -5424,12 +5502,12 @@
54245502 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
54255503 $(ds t.ds, lines [(crip "++ {(trip name.d)}: explicit capital constraints are not supported by partial inference") lines])
54265504 =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5427− ?: (itype-has-avar typ)
5505+ ?: (unsupported-atom-vars typ caps.state.p.result sub.state.p.result)
54285506 $(ds t.ds, lines [(crip "++ {(trip name.d)}: unresolved aura-variable inference") lines])
54295507 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
54305508 ?: (gth (lent vars) 26)
54315509 $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
54325510 =/ printable=itype (canonical-itype typ vars)
5433− =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}")
5511+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
54345512 $(ds t.ds, lines [line lines])
54355513--
jibb-dev/lib/jibb/prelude.jibb+40
@@ -58,3 +58,43 @@
5858 [%$ p=dime]
5959 [%blob p=*]
6060 [%many p=(list coin)]
61+
62++$ pair |$ [A B] [p=A q=B]
63+
64++$ trel |$ [A B C] [p=A q=B r=C]
65+
66++$ qual |$ [A B C D] [p=A q=B r=C s=D]
67+
68++$ cord @t
69+
70++$ knot @ta
71+
72++$ tape (list @tD)
73+
74++$ path (list knot)
75+
76++$ tank
77+ cord
78+ [%leaf p=tape]
79+ [%palm p=(qual tape tape tape tape) q=(list tank)]
80+ [%rose p=(trel tape tape tape) q=(list tank)]
81+
82++$ nail [p=hair q=tape]
83+
84++$ edge [p=hair q=(unit [p=* q=nail])]
85+
86++$ rule $-(nail edge)
87+
88++$ spot [p=path q=pint]
89+
90++$ toon
91+ [%0 p=*]
92+ [%1 p=*]
93+ [%2 p=(list tank)]
94+
95++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
96+
97+++ wonk |= veq=(like A)
98+ ?- q.veq
99+ ~ !!
100+ [~ product] p.product
tests/clay-fixtures/import-expected.txtnew file+4
@@ -0,0 +1,4 @@
1+[ '[id=@ud [done=(union @f:0 @f:1) text=@t]]'
2+ '(union [add text=@t] [toggle id=@ud])'
3+ '[title=@t slug=@ta]'
4+]
tests/clay-fixtures/import.txtnew file+12
@@ -0,0 +1,12 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+@@READER@@
4+=/ now=@da now.bowl
5+=/ todo=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/todo/hoon)
6+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
7+=/ tc=type -.todo
8+=/ bc=type -.blog
9+=/ item (read-mold-in:reader %todo %item (~(play ut tc) (ream '*item')) tc)
10+=/ action (read-mold-in:reader %todo %action (~(play ut tc) (ream '*action')) tc)
11+=/ post (read-mold-in:reader %blog %post (~(play ut bc) (ream '*post')) bc)
12+(pure:m !>([(crip (show-result:reader item)) (crip (show-result:reader action)) (crip (show-result:reader post))]))
tests/golden/prelude-3g-like/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; Hoon 3g includes `like` and `wonk`.
2+tests: The prelude's `like` generic edge mold and `wonk` extractor; the callable value form of `like` is a separate, unresolved question. The source is the complete current prelude.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; generic molds and the `wonk` body are not fully checked yet
tests/golden/prelude-3g-like/source.jibbnew file+100
@@ -0,0 +1,100 @@
1+:: Initial prelude functions. The rest of the inventory is still to come.
2+++ same |= x=A x
3+
4+++ head |= p=[A B]
5+ ?- p
6+ [a b] a
7+
8+++ tail |= p=[A B]
9+ ?- p
10+ [a b] b
11+
12+++ not |= b=?
13+ ?- b
14+ %.y %.n
15+ %.n %.y
16+
17++$ list |$ [A]
18+ ~
19+ [i=A t=(list A)]
20+
21++$ unit |$ [A]
22+ ~
23+ [~ u=A]
24+
25+++ fall |= args=[(unit A) A]
26+ ?- args
27+ [maybe fallback]
28+ ?- maybe
29+ ~ fallback
30+ [~ value] value
31+
32+++ need |= maybe=(unit A)
33+ ?- maybe
34+ ~ !!
35+ [~ value] value
36+
37+++ weld |= args=[(list A) (list A)]
38+ ?- args
39+ [xs ys]
40+ ?- xs
41+ ~ ys
42+ [item rest] [item (weld rest ys)]
43+
44+++ turn |= args=[(list A) $-(A B)]
45+ ?- args
46+ [xs f]
47+ ?- xs
48+ ~ ~
49+ [item rest] [(f item) (turn rest f)]
50+
51++$ dime [p=@ta q=@]
52+
53++$ hair [p=@ud q=@ud]
54+
55++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
56+
57++$ coin
58+ [%$ p=dime]
59+ [%blob p=*]
60+ [%many p=(list coin)]
61+
62++$ pair |$ [A B] [p=A q=B]
63+
64++$ trel |$ [A B C] [p=A q=B r=C]
65+
66++$ qual |$ [A B C D] [p=A q=B r=C s=D]
67+
68++$ cord @t
69+
70++$ knot @ta
71+
72++$ tape (list @tD)
73+
74++$ path (list knot)
75+
76++$ tank
77+ cord
78+ [%leaf p=tape]
79+ [%palm p=(qual tape tape tape tape) q=(list tank)]
80+ [%rose p=(trel tape tape tape) q=(list tank)]
81+
82++$ nail [p=hair q=tape]
83+
84++$ edge [p=hair q=(unit [p=* q=nail])]
85+
86++$ rule $-(nail edge)
87+
88++$ spot [p=path q=pint]
89+
90++$ toon
91+ [%0 p=*]
92+ [%1 p=*]
93+ [%2 p=(list tank)]
94+
95++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
96+
97+++ wonk |= veq=(like A)
98+ ?- q.veq
99+ ~ !!
100+ [~ product] p.product
tests/golden/prelude-3g-like/tokens.txtnew file+599
@@ -0,0 +1,599 @@
1+2:1 glyph ++
2+2:4 name same
3+2:9 glyph |=
4+2:12 name x
5+2:13 tight glyph =
6+2:14 tight tvar A
7+2:16 name x
8+4:1 NEWLINE
9+4:1 glyph ++
10+4:4 name head
11+4:9 glyph |=
12+4:12 name p
13+4:13 tight glyph =
14+4:14 tight glyph [
15+4:15 tight tvar A
16+4:17 tvar B
17+4:18 tight glyph ]
18+5:3 INDENT
19+5:3 glyph ?-
20+5:6 name p
21+6:5 INDENT
22+6:5 glyph [
23+6:6 tight name a
24+6:8 name b
25+6:9 tight glyph ]
26+6:11 name a
27+8:1 DEDENT
28+8:1 DEDENT
29+8:1 NEWLINE
30+8:1 glyph ++
31+8:4 name tail
32+8:9 glyph |=
33+8:12 name p
34+8:13 tight glyph =
35+8:14 tight glyph [
36+8:15 tight tvar A
37+8:17 tvar B
38+8:18 tight glyph ]
39+9:3 INDENT
40+9:3 glyph ?-
41+9:6 name p
42+10:5 INDENT
43+10:5 glyph [
44+10:6 tight name a
45+10:8 name b
46+10:9 tight glyph ]
47+10:11 name b
48+12:1 DEDENT
49+12:1 DEDENT
50+12:1 NEWLINE
51+12:1 glyph ++
52+12:4 name not
53+12:8 glyph |=
54+12:11 name b
55+12:12 tight glyph =
56+12:13 tight glyph ?
57+13:3 INDENT
58+13:3 glyph ?-
59+13:6 name b
60+14:5 INDENT
61+14:5 lit %.y
62+14:9 lit %.n
63+15:5 NEWLINE
64+15:5 lit %.n
65+15:9 lit %.y
66+17:1 DEDENT
67+17:1 DEDENT
68+17:1 NEWLINE
69+17:1 glyph +$
70+17:4 name list
71+17:9 glyph |$
72+17:12 glyph [
73+17:13 tight tvar A
74+17:14 tight glyph ]
75+18:3 INDENT
76+18:3 lit ~
77+19:3 NEWLINE
78+19:3 glyph [
79+19:4 tight name i
80+19:5 tight glyph =
81+19:6 tight tvar A
82+19:8 name t
83+19:9 tight glyph =
84+19:10 tight glyph (
85+19:11 tight name list
86+19:16 tvar A
87+19:17 tight glyph )
88+19:18 tight glyph ]
89+21:1 DEDENT
90+21:1 NEWLINE
91+21:1 glyph +$
92+21:4 name unit
93+21:9 glyph |$
94+21:12 glyph [
95+21:13 tight tvar A
96+21:14 tight glyph ]
97+22:3 INDENT
98+22:3 lit ~
99+23:3 NEWLINE
100+23:3 glyph [
101+23:4 tight lit ~
102+23:6 name u
103+23:7 tight glyph =
104+23:8 tight tvar A
105+23:9 tight glyph ]
106+25:1 DEDENT
107+25:1 NEWLINE
108+25:1 glyph ++
109+25:4 name fall
110+25:9 glyph |=
111+25:12 name args
112+25:16 tight glyph =
113+25:17 tight glyph [
114+25:18 tight glyph (
115+25:19 tight name unit
116+25:24 tvar A
117+25:25 tight glyph )
118+25:27 tvar A
119+25:28 tight glyph ]
120+26:3 INDENT
121+26:3 glyph ?-
122+26:6 name args
123+27:5 INDENT
124+27:5 glyph [
125+27:6 tight name maybe
126+27:12 name fallback
127+27:20 tight glyph ]
128+28:7 INDENT
129+28:7 glyph ?-
130+28:10 name maybe
131+29:9 INDENT
132+29:9 lit ~
133+29:11 name fallback
134+30:9 NEWLINE
135+30:9 glyph [
136+30:10 tight lit ~
137+30:12 name value
138+30:17 tight glyph ]
139+30:19 name value
140+32:1 DEDENT
141+32:1 DEDENT
142+32:1 DEDENT
143+32:1 DEDENT
144+32:1 NEWLINE
145+32:1 glyph ++
146+32:4 name need
147+32:9 glyph |=
148+32:12 name maybe
149+32:17 tight glyph =
150+32:18 tight glyph (
151+32:19 tight name unit
152+32:24 tvar A
153+32:25 tight glyph )
154+33:3 INDENT
155+33:3 glyph ?-
156+33:6 name maybe
157+34:5 INDENT
158+34:5 lit ~
159+34:7 glyph !!
160+35:5 NEWLINE
161+35:5 glyph [
162+35:6 tight lit ~
163+35:8 name value
164+35:13 tight glyph ]
165+35:15 name value
166+37:1 DEDENT
167+37:1 DEDENT
168+37:1 NEWLINE
169+37:1 glyph ++
170+37:4 name weld
171+37:9 glyph |=
172+37:12 name args
173+37:16 tight glyph =
174+37:17 tight glyph [
175+37:18 tight glyph (
176+37:19 tight name list
177+37:24 tvar A
178+37:25 tight glyph )
179+37:27 glyph (
180+37:28 tight name list
181+37:33 tvar A
182+37:34 tight glyph )
183+37:35 tight glyph ]
184+38:3 INDENT
185+38:3 glyph ?-
186+38:6 name args
187+39:5 INDENT
188+39:5 glyph [
189+39:6 tight name xs
190+39:9 name ys
191+39:11 tight glyph ]
192+40:7 INDENT
193+40:7 glyph ?-
194+40:10 name xs
195+41:9 INDENT
196+41:9 lit ~
197+41:11 name ys
198+42:9 NEWLINE
199+42:9 glyph [
200+42:10 tight name item
201+42:15 name rest
202+42:19 tight glyph ]
203+42:21 glyph [
204+42:22 tight name item
205+42:27 glyph (
206+42:28 tight name weld
207+42:33 name rest
208+42:38 name ys
209+42:40 tight glyph )
210+42:41 tight glyph ]
211+44:1 DEDENT
212+44:1 DEDENT
213+44:1 DEDENT
214+44:1 DEDENT
215+44:1 NEWLINE
216+44:1 glyph ++
217+44:4 name turn
218+44:9 glyph |=
219+44:12 name args
220+44:16 tight glyph =
221+44:17 tight glyph [
222+44:18 tight glyph (
223+44:19 tight name list
224+44:24 tvar A
225+44:25 tight glyph )
226+44:27 glyph $-(
227+44:30 tight tvar A
228+44:32 tvar B
229+44:33 tight glyph )
230+44:34 tight glyph ]
231+45:3 INDENT
232+45:3 glyph ?-
233+45:6 name args
234+46:5 INDENT
235+46:5 glyph [
236+46:6 tight name xs
237+46:9 name f
238+46:10 tight glyph ]
239+47:7 INDENT
240+47:7 glyph ?-
241+47:10 name xs
242+48:9 INDENT
243+48:9 lit ~
244+48:11 lit ~
245+49:9 NEWLINE
246+49:9 glyph [
247+49:10 tight name item
248+49:15 name rest
249+49:19 tight glyph ]
250+49:21 glyph [
251+49:22 tight glyph (
252+49:23 tight name f
253+49:25 name item
254+49:29 tight glyph )
255+49:31 glyph (
256+49:32 tight name turn
257+49:37 name rest
258+49:42 name f
259+49:43 tight glyph )
260+49:44 tight glyph ]
261+51:1 DEDENT
262+51:1 DEDENT
263+51:1 DEDENT
264+51:1 DEDENT
265+51:1 NEWLINE
266+51:1 glyph +$
267+51:4 name dime
268+51:9 glyph [
269+51:10 tight name p
270+51:11 tight glyph =
271+51:12 tight aura @ta
272+51:16 name q
273+51:17 tight glyph =
274+51:18 tight aura @
275+51:19 tight glyph ]
276+53:1 NEWLINE
277+53:1 glyph +$
278+53:4 name hair
279+53:9 glyph [
280+53:10 tight name p
281+53:11 tight glyph =
282+53:12 tight aura @ud
283+53:16 name q
284+53:17 tight glyph =
285+53:18 tight aura @ud
286+53:21 tight glyph ]
287+55:1 NEWLINE
288+55:1 glyph +$
289+55:4 name pint
290+55:9 glyph [
291+55:10 tight name p
292+55:11 tight glyph =
293+55:12 tight glyph [
294+55:13 tight name p
295+55:14 tight glyph =
296+55:15 tight aura @
297+55:17 name q
298+55:18 tight glyph =
299+55:19 tight aura @
300+55:20 tight glyph ]
301+55:22 name q
302+55:23 tight glyph =
303+55:24 tight glyph [
304+55:25 tight name p
305+55:26 tight glyph =
306+55:27 tight aura @
307+55:29 name q
308+55:30 tight glyph =
309+55:31 tight aura @
310+55:32 tight glyph ]
311+55:33 tight glyph ]
312+57:1 NEWLINE
313+57:1 glyph +$
314+57:4 name coin
315+58:3 INDENT
316+58:3 glyph [
317+58:4 tight lit %$
318+58:7 name p
319+58:8 tight glyph =
320+58:9 tight name dime
321+58:13 tight glyph ]
322+59:3 NEWLINE
323+59:3 glyph [
324+59:4 tight lit %blob
325+59:10 name p
326+59:11 tight glyph =
327+59:12 tight glyph *
328+59:13 tight glyph ]
329+60:3 NEWLINE
330+60:3 glyph [
331+60:4 tight lit %many
332+60:10 name p
333+60:11 tight glyph =
334+60:12 tight glyph (
335+60:13 tight name list
336+60:18 name coin
337+60:22 tight glyph )
338+60:23 tight glyph ]
339+62:1 DEDENT
340+62:1 NEWLINE
341+62:1 glyph +$
342+62:4 name pair
343+62:9 glyph |$
344+62:12 glyph [
345+62:13 tight tvar A
346+62:15 tvar B
347+62:16 tight glyph ]
348+62:18 glyph [
349+62:19 tight name p
350+62:20 tight glyph =
351+62:21 tight tvar A
352+62:23 name q
353+62:24 tight glyph =
354+62:25 tight tvar B
355+62:26 tight glyph ]
356+64:1 NEWLINE
357+64:1 glyph +$
358+64:4 name trel
359+64:9 glyph |$
360+64:12 glyph [
361+64:13 tight tvar A
362+64:15 tvar B
363+64:17 tvar C
364+64:18 tight glyph ]
365+64:20 glyph [
366+64:21 tight name p
367+64:22 tight glyph =
368+64:23 tight tvar A
369+64:25 name q
370+64:26 tight glyph =
371+64:27 tight tvar B
372+64:29 name r
373+64:30 tight glyph =
374+64:31 tight tvar C
375+64:32 tight glyph ]
376+66:1 NEWLINE
377+66:1 glyph +$
378+66:4 name qual
379+66:9 glyph |$
380+66:12 glyph [
381+66:13 tight tvar A
382+66:15 tvar B
383+66:17 tvar C
384+66:19 tvar D
385+66:20 tight glyph ]
386+66:22 glyph [
387+66:23 tight name p
388+66:24 tight glyph =
389+66:25 tight tvar A
390+66:27 name q
391+66:28 tight glyph =
392+66:29 tight tvar B
393+66:31 name r
394+66:32 tight glyph =
395+66:33 tight tvar C
396+66:35 name s
397+66:36 tight glyph =
398+66:37 tight tvar D
399+66:38 tight glyph ]
400+68:1 NEWLINE
401+68:1 glyph +$
402+68:4 name cord
403+68:9 aura @t
404+70:1 NEWLINE
405+70:1 glyph +$
406+70:4 name knot
407+70:9 aura @ta
408+72:1 NEWLINE
409+72:1 glyph +$
410+72:4 name tape
411+72:9 glyph (
412+72:10 tight name list
413+72:15 aura @tD
414+72:18 tight glyph )
415+74:1 NEWLINE
416+74:1 glyph +$
417+74:4 name path
418+74:9 glyph (
419+74:10 tight name list
420+74:15 name knot
421+74:19 tight glyph )
422+76:1 NEWLINE
423+76:1 glyph +$
424+76:4 name tank
425+77:3 INDENT
426+77:3 name cord
427+78:3 NEWLINE
428+78:3 glyph [
429+78:4 tight lit %leaf
430+78:10 name p
431+78:11 tight glyph =
432+78:12 tight name tape
433+78:16 tight glyph ]
434+79:3 NEWLINE
435+79:3 glyph [
436+79:4 tight lit %palm
437+79:10 name p
438+79:11 tight glyph =
439+79:12 tight glyph (
440+79:13 tight name qual
441+79:18 name tape
442+79:23 name tape
443+79:28 name tape
444+79:33 name tape
445+79:37 tight glyph )
446+79:39 name q
447+79:40 tight glyph =
448+79:41 tight glyph (
449+79:42 tight name list
450+79:47 name tank
451+79:51 tight glyph )
452+79:52 tight glyph ]
453+80:3 NEWLINE
454+80:3 glyph [
455+80:4 tight lit %rose
456+80:10 name p
457+80:11 tight glyph =
458+80:12 tight glyph (
459+80:13 tight name trel
460+80:18 name tape
461+80:23 name tape
462+80:28 name tape
463+80:32 tight glyph )
464+80:34 name q
465+80:35 tight glyph =
466+80:36 tight glyph (
467+80:37 tight name list
468+80:42 name tank
469+80:46 tight glyph )
470+80:47 tight glyph ]
471+82:1 DEDENT
472+82:1 NEWLINE
473+82:1 glyph +$
474+82:4 name nail
475+82:9 glyph [
476+82:10 tight name p
477+82:11 tight glyph =
478+82:12 tight name hair
479+82:17 name q
480+82:18 tight glyph =
481+82:19 tight name tape
482+82:23 tight glyph ]
483+84:1 NEWLINE
484+84:1 glyph +$
485+84:4 name edge
486+84:9 glyph [
487+84:10 tight name p
488+84:11 tight glyph =
489+84:12 tight name hair
490+84:17 name q
491+84:18 tight glyph =
492+84:19 tight glyph (
493+84:20 tight name unit
494+84:25 glyph [
495+84:26 tight name p
496+84:27 tight glyph =
497+84:28 tight glyph *
498+84:30 name q
499+84:31 tight glyph =
500+84:32 tight name nail
501+84:36 tight glyph ]
502+84:37 tight glyph )
503+84:38 tight glyph ]
504+86:1 NEWLINE
505+86:1 glyph +$
506+86:4 name rule
507+86:9 glyph $-(
508+86:12 tight name nail
509+86:17 name edge
510+86:21 tight glyph )
511+88:1 NEWLINE
512+88:1 glyph +$
513+88:4 name spot
514+88:9 glyph [
515+88:10 tight name p
516+88:11 tight glyph =
517+88:12 tight name path
518+88:17 name q
519+88:18 tight glyph =
520+88:19 tight name pint
521+88:23 tight glyph ]
522+90:1 NEWLINE
523+90:1 glyph +$
524+90:4 name toon
525+91:3 INDENT
526+91:3 glyph [
527+91:4 tight lit %0
528+91:7 name p
529+91:8 tight glyph =
530+91:9 tight glyph *
531+91:10 tight glyph ]
532+92:3 NEWLINE
533+92:3 glyph [
534+92:4 tight lit %1
535+92:7 name p
536+92:8 tight glyph =
537+92:9 tight glyph *
538+92:10 tight glyph ]
539+93:3 NEWLINE
540+93:3 glyph [
541+93:4 tight lit %2
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph (
545+93:10 tight name list
546+93:15 name tank
547+93:19 tight glyph )
548+93:20 tight glyph ]
549+95:1 DEDENT
550+95:1 NEWLINE
551+95:1 glyph +$
552+95:4 name like
553+95:9 glyph |$
554+95:12 glyph [
555+95:13 tight tvar A
556+95:14 tight glyph ]
557+95:16 glyph [
558+95:17 tight name p
559+95:18 tight glyph =
560+95:19 tight name hair
561+95:24 name q
562+95:25 tight glyph =
563+95:26 tight glyph (
564+95:27 tight name unit
565+95:32 glyph [
566+95:33 tight name p
567+95:34 tight glyph =
568+95:35 tight tvar A
569+95:37 name q
570+95:38 tight glyph =
571+95:39 tight name nail
572+95:43 tight glyph ]
573+95:44 tight glyph )
574+95:45 tight glyph ]
575+97:1 NEWLINE
576+97:1 glyph ++
577+97:4 name wonk
578+97:9 glyph |=
579+97:12 name veq
580+97:15 tight glyph =
581+97:16 tight glyph (
582+97:17 tight name like
583+97:22 tvar A
584+97:23 tight glyph )
585+98:3 INDENT
586+98:3 glyph ?-
587+98:6 wing q.veq
588+99:5 INDENT
589+99:5 lit ~
590+99:7 glyph !!
591+100:5 NEWLINE
592+100:5 glyph [
593+100:6 tight lit ~
594+100:8 name product
595+100:15 tight glyph ]
596+100:17 wing p.product
597+100:26 DEDENT
598+100:26 DEDENT
599+100:26 NEWLINE
tests/golden/prelude-3g-like/tree.txtnew file+242
@@ -0,0 +1,242 @@
1+(module
2+ (value 2:1 same
3+ (gate 2:9
4+ (face 2:12 x (tvar 2:14 A))
5+ (wing 2:16 x)))
6+ (value 4:1 head
7+ (gate 4:9
8+ (face 4:12 p
9+ (cell 4:14 (tvar 4:15 A) (tvar 4:17 B)))
10+ (body 5:3
11+ (branch 5:3
12+ (wing 5:6 p)
13+ (arm 6:5
14+ (cell 6:5 (bind 6:6 a) (bind 6:8 b))
15+ (wing 6:11 a))))))
16+ (value 8:1 tail
17+ (gate 8:9
18+ (face 8:12 p
19+ (cell 8:14 (tvar 8:15 A) (tvar 8:17 B)))
20+ (body 9:3
21+ (branch 9:3
22+ (wing 9:6 p)
23+ (arm 10:5
24+ (cell 10:5 (bind 10:6 a) (bind 10:8 b))
25+ (wing 10:11 b))))))
26+ (value 12:1 not
27+ (gate 12:8
28+ (face 12:11 b (flag 12:13))
29+ (body 13:3
30+ (branch 13:3
31+ (wing 13:6 b)
32+ (arm 14:5 (lit 14:5 %.y) (lit 14:9 %.n))
33+ (arm 15:5 (lit 15:5 %.n) (lit 15:9 %.y))))))
34+ (mold 17:1 list
35+ (generic 17:9 A
36+ (union 18:3
37+ (const 18:3 ~)
38+ (cell 19:3
39+ (face 19:4 i (tvar 19:6 A))
40+ (face 19:8 t
41+ (apply 19:10 list (tvar 19:16 A)))))))
42+ (mold 21:1 unit
43+ (generic 21:9 A
44+ (union 22:3
45+ (const 22:3 ~)
46+ (cell 23:3
47+ (const 23:4 ~)
48+ (face 23:6 u (tvar 23:8 A))))))
49+ (value 25:1 fall
50+ (gate 25:9
51+ (face 25:12 args
52+ (cell 25:17
53+ (apply 25:18 unit (tvar 25:24 A))
54+ (tvar 25:27 A)))
55+ (body 26:3
56+ (branch 26:3
57+ (wing 26:6 args)
58+ (arm 27:5
59+ (cell 27:5 (bind 27:6 maybe) (bind 27:12 fallback))
60+ (body 28:7
61+ (branch 28:7
62+ (wing 28:10 maybe)
63+ (arm 29:9 (lit 29:9 ~) (wing 29:11 fallback))
64+ (arm 30:9
65+ (cell 30:9 (lit 30:10 ~) (bind 30:12 value))
66+ (wing 30:19 value)))))))))
67+ (value 32:1 need
68+ (gate 32:9
69+ (face 32:12 maybe
70+ (apply 32:18 unit (tvar 32:24 A)))
71+ (body 33:3
72+ (branch 33:3
73+ (wing 33:6 maybe)
74+ (arm 34:5 (lit 34:5 ~) (crash 34:7))
75+ (arm 35:5
76+ (cell 35:5 (lit 35:6 ~) (bind 35:8 value))
77+ (wing 35:15 value))))))
78+ (value 37:1 weld
79+ (gate 37:9
80+ (face 37:12 args
81+ (cell 37:17
82+ (apply 37:18 list (tvar 37:24 A))
83+ (apply 37:27 list (tvar 37:33 A))))
84+ (body 38:3
85+ (branch 38:3
86+ (wing 38:6 args)
87+ (arm 39:5
88+ (cell 39:5 (bind 39:6 xs) (bind 39:9 ys))
89+ (body 40:7
90+ (branch 40:7
91+ (wing 40:10 xs)
92+ (arm 41:9 (lit 41:9 ~) (wing 41:11 ys))
93+ (arm 42:9
94+ (cell 42:9 (bind 42:10 item) (bind 42:15 rest))
95+ (tuple 42:21
96+ (wing 42:22 item)
97+ (group 42:27
98+ (call 42:28 (wing 42:28 weld) (wing 42:33 rest) (wing 42:38 ys))))))))))))
99+ (value 44:1 turn
100+ (gate 44:9
101+ (face 44:12 args
102+ (cell 44:17
103+ (apply 44:18 list (tvar 44:24 A))
104+ (fn 44:27 (tvar 44:30 A) (tvar 44:32 B))))
105+ (body 45:3
106+ (branch 45:3
107+ (wing 45:6 args)
108+ (arm 46:5
109+ (cell 46:5 (bind 46:6 xs) (bind 46:9 f))
110+ (body 47:7
111+ (branch 47:7
112+ (wing 47:10 xs)
113+ (arm 48:9 (lit 48:9 ~) (lit 48:11 ~))
114+ (arm 49:9
115+ (cell 49:9 (bind 49:10 item) (bind 49:15 rest))
116+ (tuple 49:21
117+ (group 49:22
118+ (call 49:23 (wing 49:23 f) (wing 49:25 item)))
119+ (group 49:31
120+ (call 49:32 (wing 49:32 turn) (wing 49:37 rest) (wing 49:42 f))))))))))))
121+ (mold 51:1 dime
122+ (cell 51:9
123+ (face 51:10 p (aura 51:12 @ta))
124+ (face 51:16 q (aura 51:18 @))))
125+ (mold 53:1 hair
126+ (cell 53:9
127+ (face 53:10 p (aura 53:12 @ud))
128+ (face 53:16 q (aura 53:18 @ud))))
129+ (mold 55:1 pint
130+ (cell 55:9
131+ (face 55:10 p
132+ (cell 55:12
133+ (face 55:13 p (aura 55:15 @))
134+ (face 55:17 q (aura 55:19 @))))
135+ (face 55:22 q
136+ (cell 55:24
137+ (face 55:25 p (aura 55:27 @))
138+ (face 55:29 q (aura 55:31 @))))))
139+ (mold 57:1 coin
140+ (union 58:3
141+ (cell 58:3
142+ (const 58:4 %$)
143+ (face 58:7 p (ref 58:9 dime)))
144+ (cell 59:3
145+ (const 59:4 %blob)
146+ (face 59:10 p (noun 59:12)))
147+ (cell 60:3
148+ (const 60:4 %many)
149+ (face 60:10 p
150+ (apply 60:12 list (ref 60:18 coin))))))
151+ (mold 62:1 pair
152+ (generic 62:9 A B
153+ (cell 62:18
154+ (face 62:19 p (tvar 62:21 A))
155+ (face 62:23 q (tvar 62:25 B)))))
156+ (mold 64:1 trel
157+ (generic 64:9 A B C
158+ (cell 64:20
159+ (face 64:21 p (tvar 64:23 A))
160+ (face 64:25 q (tvar 64:27 B))
161+ (face 64:29 r (tvar 64:31 C)))))
162+ (mold 66:1 qual
163+ (generic 66:9 A B C D
164+ (cell 66:22
165+ (face 66:23 p (tvar 66:25 A))
166+ (face 66:27 q (tvar 66:29 B))
167+ (face 66:31 r (tvar 66:33 C))
168+ (face 66:35 s (tvar 66:37 D)))))
169+ (mold 68:1 cord (aura 68:9 @t))
170+ (mold 70:1 knot (aura 70:9 @ta))
171+ (mold 72:1 tape
172+ (apply 72:9 list (aura 72:15 @tD)))
173+ (mold 74:1 path
174+ (apply 74:9 list (ref 74:15 knot)))
175+ (mold 76:1 tank
176+ (union 77:3
177+ (ref 77:3 cord)
178+ (cell 78:3
179+ (const 78:4 %leaf)
180+ (face 78:10 p (ref 78:12 tape)))
181+ (cell 79:3
182+ (const 79:4 %palm)
183+ (face 79:10 p
184+ (apply 79:12 qual (ref 79:18 tape) (ref 79:23 tape) (ref 79:28 tape) (ref 79:33 tape)))
185+ (face 79:39 q
186+ (apply 79:41 list (ref 79:47 tank))))
187+ (cell 80:3
188+ (const 80:4 %rose)
189+ (face 80:10 p
190+ (apply 80:12 trel (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape)))
191+ (face 80:34 q
192+ (apply 80:36 list (ref 80:42 tank))))))
193+ (mold 82:1 nail
194+ (cell 82:9
195+ (face 82:10 p (ref 82:12 hair))
196+ (face 82:17 q (ref 82:19 tape))))
197+ (mold 84:1 edge
198+ (cell 84:9
199+ (face 84:10 p (ref 84:12 hair))
200+ (face 84:17 q
201+ (apply 84:19 unit
202+ (cell 84:25
203+ (face 84:26 p (noun 84:28))
204+ (face 84:30 q (ref 84:32 nail)))))))
205+ (mold 86:1 rule
206+ (fn 86:9 (ref 86:12 nail) (ref 86:17 edge)))
207+ (mold 88:1 spot
208+ (cell 88:9
209+ (face 88:10 p (ref 88:12 path))
210+ (face 88:17 q (ref 88:19 pint))))
211+ (mold 90:1 toon
212+ (union 91:3
213+ (cell 91:3
214+ (const 91:4 %0)
215+ (face 91:7 p (noun 91:9)))
216+ (cell 92:3
217+ (const 92:4 %1)
218+ (face 92:7 p (noun 92:9)))
219+ (cell 93:3
220+ (const 93:4 %2)
221+ (face 93:7 p
222+ (apply 93:9 list (ref 93:15 tank))))))
223+ (mold 95:1 like
224+ (generic 95:9 A
225+ (cell 95:16
226+ (face 95:17 p (ref 95:19 hair))
227+ (face 95:24 q
228+ (apply 95:26 unit
229+ (cell 95:32
230+ (face 95:33 p (tvar 95:35 A))
231+ (face 95:37 q (ref 95:39 nail))))))))
232+ (value 97:1 wonk
233+ (gate 97:9
234+ (face 97:12 veq
235+ (apply 97:16 like (tvar 97:22 A)))
236+ (body 98:3
237+ (branch 98:3
238+ (wing 98:6 q.veq)
239+ (arm 99:5 (lit 99:5 ~) (crash 99:7))
240+ (arm 100:5
241+ (cell 100:5 (lit 100:6 ~) (bind 100:8 product))
242+ (wing 100:17 p.product)))))))
tests/golden/prelude-3g-like/types.txtnew file+30
@@ -0,0 +1,30 @@
1+partial inference; module not checked
2+++ same: $-(A A)
3+++ head: $-([A B] A)
4+++ tail: $-([A B] B)
5+++ not: $-(? ?)
6++$ list: cases proven disjoint; mold not checked
7++$ unit: cases proven disjoint; mold not checked
8+++ fall: sample mold is not supported by partial inference
9+++ need: sample mold is not supported by partial inference
10+++ weld: sample mold is not supported by partial inference
11+++ turn: sample mold is not supported by partial inference
12++$ dime: not checked
13++$ hair: not checked
14++$ pint: not checked
15++$ coin: cases proven disjoint; mold not checked
16++$ pair: not checked
17++$ trel: not checked
18++$ qual: not checked
19++$ cord: not checked
20++$ knot: not checked
21++$ tape: not checked
22++$ path: not checked
23++$ tank: cases proven disjoint; mold not checked
24++$ nail: not checked
25++$ edge: not checked
26++$ rule: not checked
27++$ spot: not checked
28++$ toon: cases proven disjoint; mold not checked
29++$ like: not checked
30+++ wonk: sample mold is not supported by partial inference
tests/golden/prelude-3g-structural/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Overview, Prelude: "The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out"; 1c, 2q and 3g include `pair`, `trel`, `qual`, `cord`, `knot`, `tape`, `path`, `tank`, `nail`, `edge`, `rule`, `spot` and `toon`.
2+tests: The prelude's structural mold declarations, including the byte aura in `tape`, the recursive `tank` union and the `toon` union; source is the complete current prelude.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; it checks supported union-case disjointness but not the molds as a whole
tests/golden/prelude-3g-structural/source.jibbnew file+93
@@ -0,0 +1,93 @@
1+:: Initial prelude functions. The rest of the inventory is still to come.
2+++ same |= x=A x
3+
4+++ head |= p=[A B]
5+ ?- p
6+ [a b] a
7+
8+++ tail |= p=[A B]
9+ ?- p
10+ [a b] b
11+
12+++ not |= b=?
13+ ?- b
14+ %.y %.n
15+ %.n %.y
16+
17++$ list |$ [A]
18+ ~
19+ [i=A t=(list A)]
20+
21++$ unit |$ [A]
22+ ~
23+ [~ u=A]
24+
25+++ fall |= args=[(unit A) A]
26+ ?- args
27+ [maybe fallback]
28+ ?- maybe
29+ ~ fallback
30+ [~ value] value
31+
32+++ need |= maybe=(unit A)
33+ ?- maybe
34+ ~ !!
35+ [~ value] value
36+
37+++ weld |= args=[(list A) (list A)]
38+ ?- args
39+ [xs ys]
40+ ?- xs
41+ ~ ys
42+ [item rest] [item (weld rest ys)]
43+
44+++ turn |= args=[(list A) $-(A B)]
45+ ?- args
46+ [xs f]
47+ ?- xs
48+ ~ ~
49+ [item rest] [(f item) (turn rest f)]
50+
51++$ dime [p=@ta q=@]
52+
53++$ hair [p=@ud q=@ud]
54+
55++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
56+
57++$ coin
58+ [%$ p=dime]
59+ [%blob p=*]
60+ [%many p=(list coin)]
61+
62++$ pair |$ [A B] [p=A q=B]
63+
64++$ trel |$ [A B C] [p=A q=B r=C]
65+
66++$ qual |$ [A B C D] [p=A q=B r=C s=D]
67+
68++$ cord @t
69+
70++$ knot @ta
71+
72++$ tape (list @tD)
73+
74++$ path (list knot)
75+
76++$ tank
77+ cord
78+ [%leaf p=tape]
79+ [%palm p=(qual tape tape tape tape) q=(list tank)]
80+ [%rose p=(trel tape tape tape) q=(list tank)]
81+
82++$ nail [p=hair q=tape]
83+
84++$ edge [p=hair q=(unit [p=* q=nail])]
85+
86++$ rule $-(nail edge)
87+
88++$ spot [p=path q=pint]
89+
90++$ toon
91+ [%0 p=*]
92+ [%1 p=*]
93+ [%2 p=(list tank)]
tests/golden/prelude-3g-structural/tokens.txtnew file+550
@@ -0,0 +1,550 @@
1+2:1 glyph ++
2+2:4 name same
3+2:9 glyph |=
4+2:12 name x
5+2:13 tight glyph =
6+2:14 tight tvar A
7+2:16 name x
8+4:1 NEWLINE
9+4:1 glyph ++
10+4:4 name head
11+4:9 glyph |=
12+4:12 name p
13+4:13 tight glyph =
14+4:14 tight glyph [
15+4:15 tight tvar A
16+4:17 tvar B
17+4:18 tight glyph ]
18+5:3 INDENT
19+5:3 glyph ?-
20+5:6 name p
21+6:5 INDENT
22+6:5 glyph [
23+6:6 tight name a
24+6:8 name b
25+6:9 tight glyph ]
26+6:11 name a
27+8:1 DEDENT
28+8:1 DEDENT
29+8:1 NEWLINE
30+8:1 glyph ++
31+8:4 name tail
32+8:9 glyph |=
33+8:12 name p
34+8:13 tight glyph =
35+8:14 tight glyph [
36+8:15 tight tvar A
37+8:17 tvar B
38+8:18 tight glyph ]
39+9:3 INDENT
40+9:3 glyph ?-
41+9:6 name p
42+10:5 INDENT
43+10:5 glyph [
44+10:6 tight name a
45+10:8 name b
46+10:9 tight glyph ]
47+10:11 name b
48+12:1 DEDENT
49+12:1 DEDENT
50+12:1 NEWLINE
51+12:1 glyph ++
52+12:4 name not
53+12:8 glyph |=
54+12:11 name b
55+12:12 tight glyph =
56+12:13 tight glyph ?
57+13:3 INDENT
58+13:3 glyph ?-
59+13:6 name b
60+14:5 INDENT
61+14:5 lit %.y
62+14:9 lit %.n
63+15:5 NEWLINE
64+15:5 lit %.n
65+15:9 lit %.y
66+17:1 DEDENT
67+17:1 DEDENT
68+17:1 NEWLINE
69+17:1 glyph +$
70+17:4 name list
71+17:9 glyph |$
72+17:12 glyph [
73+17:13 tight tvar A
74+17:14 tight glyph ]
75+18:3 INDENT
76+18:3 lit ~
77+19:3 NEWLINE
78+19:3 glyph [
79+19:4 tight name i
80+19:5 tight glyph =
81+19:6 tight tvar A
82+19:8 name t
83+19:9 tight glyph =
84+19:10 tight glyph (
85+19:11 tight name list
86+19:16 tvar A
87+19:17 tight glyph )
88+19:18 tight glyph ]
89+21:1 DEDENT
90+21:1 NEWLINE
91+21:1 glyph +$
92+21:4 name unit
93+21:9 glyph |$
94+21:12 glyph [
95+21:13 tight tvar A
96+21:14 tight glyph ]
97+22:3 INDENT
98+22:3 lit ~
99+23:3 NEWLINE
100+23:3 glyph [
101+23:4 tight lit ~
102+23:6 name u
103+23:7 tight glyph =
104+23:8 tight tvar A
105+23:9 tight glyph ]
106+25:1 DEDENT
107+25:1 NEWLINE
108+25:1 glyph ++
109+25:4 name fall
110+25:9 glyph |=
111+25:12 name args
112+25:16 tight glyph =
113+25:17 tight glyph [
114+25:18 tight glyph (
115+25:19 tight name unit
116+25:24 tvar A
117+25:25 tight glyph )
118+25:27 tvar A
119+25:28 tight glyph ]
120+26:3 INDENT
121+26:3 glyph ?-
122+26:6 name args
123+27:5 INDENT
124+27:5 glyph [
125+27:6 tight name maybe
126+27:12 name fallback
127+27:20 tight glyph ]
128+28:7 INDENT
129+28:7 glyph ?-
130+28:10 name maybe
131+29:9 INDENT
132+29:9 lit ~
133+29:11 name fallback
134+30:9 NEWLINE
135+30:9 glyph [
136+30:10 tight lit ~
137+30:12 name value
138+30:17 tight glyph ]
139+30:19 name value
140+32:1 DEDENT
141+32:1 DEDENT
142+32:1 DEDENT
143+32:1 DEDENT
144+32:1 NEWLINE
145+32:1 glyph ++
146+32:4 name need
147+32:9 glyph |=
148+32:12 name maybe
149+32:17 tight glyph =
150+32:18 tight glyph (
151+32:19 tight name unit
152+32:24 tvar A
153+32:25 tight glyph )
154+33:3 INDENT
155+33:3 glyph ?-
156+33:6 name maybe
157+34:5 INDENT
158+34:5 lit ~
159+34:7 glyph !!
160+35:5 NEWLINE
161+35:5 glyph [
162+35:6 tight lit ~
163+35:8 name value
164+35:13 tight glyph ]
165+35:15 name value
166+37:1 DEDENT
167+37:1 DEDENT
168+37:1 NEWLINE
169+37:1 glyph ++
170+37:4 name weld
171+37:9 glyph |=
172+37:12 name args
173+37:16 tight glyph =
174+37:17 tight glyph [
175+37:18 tight glyph (
176+37:19 tight name list
177+37:24 tvar A
178+37:25 tight glyph )
179+37:27 glyph (
180+37:28 tight name list
181+37:33 tvar A
182+37:34 tight glyph )
183+37:35 tight glyph ]
184+38:3 INDENT
185+38:3 glyph ?-
186+38:6 name args
187+39:5 INDENT
188+39:5 glyph [
189+39:6 tight name xs
190+39:9 name ys
191+39:11 tight glyph ]
192+40:7 INDENT
193+40:7 glyph ?-
194+40:10 name xs
195+41:9 INDENT
196+41:9 lit ~
197+41:11 name ys
198+42:9 NEWLINE
199+42:9 glyph [
200+42:10 tight name item
201+42:15 name rest
202+42:19 tight glyph ]
203+42:21 glyph [
204+42:22 tight name item
205+42:27 glyph (
206+42:28 tight name weld
207+42:33 name rest
208+42:38 name ys
209+42:40 tight glyph )
210+42:41 tight glyph ]
211+44:1 DEDENT
212+44:1 DEDENT
213+44:1 DEDENT
214+44:1 DEDENT
215+44:1 NEWLINE
216+44:1 glyph ++
217+44:4 name turn
218+44:9 glyph |=
219+44:12 name args
220+44:16 tight glyph =
221+44:17 tight glyph [
222+44:18 tight glyph (
223+44:19 tight name list
224+44:24 tvar A
225+44:25 tight glyph )
226+44:27 glyph $-(
227+44:30 tight tvar A
228+44:32 tvar B
229+44:33 tight glyph )
230+44:34 tight glyph ]
231+45:3 INDENT
232+45:3 glyph ?-
233+45:6 name args
234+46:5 INDENT
235+46:5 glyph [
236+46:6 tight name xs
237+46:9 name f
238+46:10 tight glyph ]
239+47:7 INDENT
240+47:7 glyph ?-
241+47:10 name xs
242+48:9 INDENT
243+48:9 lit ~
244+48:11 lit ~
245+49:9 NEWLINE
246+49:9 glyph [
247+49:10 tight name item
248+49:15 name rest
249+49:19 tight glyph ]
250+49:21 glyph [
251+49:22 tight glyph (
252+49:23 tight name f
253+49:25 name item
254+49:29 tight glyph )
255+49:31 glyph (
256+49:32 tight name turn
257+49:37 name rest
258+49:42 name f
259+49:43 tight glyph )
260+49:44 tight glyph ]
261+51:1 DEDENT
262+51:1 DEDENT
263+51:1 DEDENT
264+51:1 DEDENT
265+51:1 NEWLINE
266+51:1 glyph +$
267+51:4 name dime
268+51:9 glyph [
269+51:10 tight name p
270+51:11 tight glyph =
271+51:12 tight aura @ta
272+51:16 name q
273+51:17 tight glyph =
274+51:18 tight aura @
275+51:19 tight glyph ]
276+53:1 NEWLINE
277+53:1 glyph +$
278+53:4 name hair
279+53:9 glyph [
280+53:10 tight name p
281+53:11 tight glyph =
282+53:12 tight aura @ud
283+53:16 name q
284+53:17 tight glyph =
285+53:18 tight aura @ud
286+53:21 tight glyph ]
287+55:1 NEWLINE
288+55:1 glyph +$
289+55:4 name pint
290+55:9 glyph [
291+55:10 tight name p
292+55:11 tight glyph =
293+55:12 tight glyph [
294+55:13 tight name p
295+55:14 tight glyph =
296+55:15 tight aura @
297+55:17 name q
298+55:18 tight glyph =
299+55:19 tight aura @
300+55:20 tight glyph ]
301+55:22 name q
302+55:23 tight glyph =
303+55:24 tight glyph [
304+55:25 tight name p
305+55:26 tight glyph =
306+55:27 tight aura @
307+55:29 name q
308+55:30 tight glyph =
309+55:31 tight aura @
310+55:32 tight glyph ]
311+55:33 tight glyph ]
312+57:1 NEWLINE
313+57:1 glyph +$
314+57:4 name coin
315+58:3 INDENT
316+58:3 glyph [
317+58:4 tight lit %$
318+58:7 name p
319+58:8 tight glyph =
320+58:9 tight name dime
321+58:13 tight glyph ]
322+59:3 NEWLINE
323+59:3 glyph [
324+59:4 tight lit %blob
325+59:10 name p
326+59:11 tight glyph =
327+59:12 tight glyph *
328+59:13 tight glyph ]
329+60:3 NEWLINE
330+60:3 glyph [
331+60:4 tight lit %many
332+60:10 name p
333+60:11 tight glyph =
334+60:12 tight glyph (
335+60:13 tight name list
336+60:18 name coin
337+60:22 tight glyph )
338+60:23 tight glyph ]
339+62:1 DEDENT
340+62:1 NEWLINE
341+62:1 glyph +$
342+62:4 name pair
343+62:9 glyph |$
344+62:12 glyph [
345+62:13 tight tvar A
346+62:15 tvar B
347+62:16 tight glyph ]
348+62:18 glyph [
349+62:19 tight name p
350+62:20 tight glyph =
351+62:21 tight tvar A
352+62:23 name q
353+62:24 tight glyph =
354+62:25 tight tvar B
355+62:26 tight glyph ]
356+64:1 NEWLINE
357+64:1 glyph +$
358+64:4 name trel
359+64:9 glyph |$
360+64:12 glyph [
361+64:13 tight tvar A
362+64:15 tvar B
363+64:17 tvar C
364+64:18 tight glyph ]
365+64:20 glyph [
366+64:21 tight name p
367+64:22 tight glyph =
368+64:23 tight tvar A
369+64:25 name q
370+64:26 tight glyph =
371+64:27 tight tvar B
372+64:29 name r
373+64:30 tight glyph =
374+64:31 tight tvar C
375+64:32 tight glyph ]
376+66:1 NEWLINE
377+66:1 glyph +$
378+66:4 name qual
379+66:9 glyph |$
380+66:12 glyph [
381+66:13 tight tvar A
382+66:15 tvar B
383+66:17 tvar C
384+66:19 tvar D
385+66:20 tight glyph ]
386+66:22 glyph [
387+66:23 tight name p
388+66:24 tight glyph =
389+66:25 tight tvar A
390+66:27 name q
391+66:28 tight glyph =
392+66:29 tight tvar B
393+66:31 name r
394+66:32 tight glyph =
395+66:33 tight tvar C
396+66:35 name s
397+66:36 tight glyph =
398+66:37 tight tvar D
399+66:38 tight glyph ]
400+68:1 NEWLINE
401+68:1 glyph +$
402+68:4 name cord
403+68:9 aura @t
404+70:1 NEWLINE
405+70:1 glyph +$
406+70:4 name knot
407+70:9 aura @ta
408+72:1 NEWLINE
409+72:1 glyph +$
410+72:4 name tape
411+72:9 glyph (
412+72:10 tight name list
413+72:15 aura @tD
414+72:18 tight glyph )
415+74:1 NEWLINE
416+74:1 glyph +$
417+74:4 name path
418+74:9 glyph (
419+74:10 tight name list
420+74:15 name knot
421+74:19 tight glyph )
422+76:1 NEWLINE
423+76:1 glyph +$
424+76:4 name tank
425+77:3 INDENT
426+77:3 name cord
427+78:3 NEWLINE
428+78:3 glyph [
429+78:4 tight lit %leaf
430+78:10 name p
431+78:11 tight glyph =
432+78:12 tight name tape
433+78:16 tight glyph ]
434+79:3 NEWLINE
435+79:3 glyph [
436+79:4 tight lit %palm
437+79:10 name p
438+79:11 tight glyph =
439+79:12 tight glyph (
440+79:13 tight name qual
441+79:18 name tape
442+79:23 name tape
443+79:28 name tape
444+79:33 name tape
445+79:37 tight glyph )
446+79:39 name q
447+79:40 tight glyph =
448+79:41 tight glyph (
449+79:42 tight name list
450+79:47 name tank
451+79:51 tight glyph )
452+79:52 tight glyph ]
453+80:3 NEWLINE
454+80:3 glyph [
455+80:4 tight lit %rose
456+80:10 name p
457+80:11 tight glyph =
458+80:12 tight glyph (
459+80:13 tight name trel
460+80:18 name tape
461+80:23 name tape
462+80:28 name tape
463+80:32 tight glyph )
464+80:34 name q
465+80:35 tight glyph =
466+80:36 tight glyph (
467+80:37 tight name list
468+80:42 name tank
469+80:46 tight glyph )
470+80:47 tight glyph ]
471+82:1 DEDENT
472+82:1 NEWLINE
473+82:1 glyph +$
474+82:4 name nail
475+82:9 glyph [
476+82:10 tight name p
477+82:11 tight glyph =
478+82:12 tight name hair
479+82:17 name q
480+82:18 tight glyph =
481+82:19 tight name tape
482+82:23 tight glyph ]
483+84:1 NEWLINE
484+84:1 glyph +$
485+84:4 name edge
486+84:9 glyph [
487+84:10 tight name p
488+84:11 tight glyph =
489+84:12 tight name hair
490+84:17 name q
491+84:18 tight glyph =
492+84:19 tight glyph (
493+84:20 tight name unit
494+84:25 glyph [
495+84:26 tight name p
496+84:27 tight glyph =
497+84:28 tight glyph *
498+84:30 name q
499+84:31 tight glyph =
500+84:32 tight name nail
501+84:36 tight glyph ]
502+84:37 tight glyph )
503+84:38 tight glyph ]
504+86:1 NEWLINE
505+86:1 glyph +$
506+86:4 name rule
507+86:9 glyph $-(
508+86:12 tight name nail
509+86:17 name edge
510+86:21 tight glyph )
511+88:1 NEWLINE
512+88:1 glyph +$
513+88:4 name spot
514+88:9 glyph [
515+88:10 tight name p
516+88:11 tight glyph =
517+88:12 tight name path
518+88:17 name q
519+88:18 tight glyph =
520+88:19 tight name pint
521+88:23 tight glyph ]
522+90:1 NEWLINE
523+90:1 glyph +$
524+90:4 name toon
525+91:3 INDENT
526+91:3 glyph [
527+91:4 tight lit %0
528+91:7 name p
529+91:8 tight glyph =
530+91:9 tight glyph *
531+91:10 tight glyph ]
532+92:3 NEWLINE
533+92:3 glyph [
534+92:4 tight lit %1
535+92:7 name p
536+92:8 tight glyph =
537+92:9 tight glyph *
538+92:10 tight glyph ]
539+93:3 NEWLINE
540+93:3 glyph [
541+93:4 tight lit %2
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph (
545+93:10 tight name list
546+93:15 name tank
547+93:19 tight glyph )
548+93:20 tight glyph ]
549+93:21 DEDENT
550+93:21 NEWLINE
tests/golden/prelude-3g-structural/tree.txtnew file+222
@@ -0,0 +1,222 @@
1+(module
2+ (value 2:1 same
3+ (gate 2:9
4+ (face 2:12 x (tvar 2:14 A))
5+ (wing 2:16 x)))
6+ (value 4:1 head
7+ (gate 4:9
8+ (face 4:12 p
9+ (cell 4:14 (tvar 4:15 A) (tvar 4:17 B)))
10+ (body 5:3
11+ (branch 5:3
12+ (wing 5:6 p)
13+ (arm 6:5
14+ (cell 6:5 (bind 6:6 a) (bind 6:8 b))
15+ (wing 6:11 a))))))
16+ (value 8:1 tail
17+ (gate 8:9
18+ (face 8:12 p
19+ (cell 8:14 (tvar 8:15 A) (tvar 8:17 B)))
20+ (body 9:3
21+ (branch 9:3
22+ (wing 9:6 p)
23+ (arm 10:5
24+ (cell 10:5 (bind 10:6 a) (bind 10:8 b))
25+ (wing 10:11 b))))))
26+ (value 12:1 not
27+ (gate 12:8
28+ (face 12:11 b (flag 12:13))
29+ (body 13:3
30+ (branch 13:3
31+ (wing 13:6 b)
32+ (arm 14:5 (lit 14:5 %.y) (lit 14:9 %.n))
33+ (arm 15:5 (lit 15:5 %.n) (lit 15:9 %.y))))))
34+ (mold 17:1 list
35+ (generic 17:9 A
36+ (union 18:3
37+ (const 18:3 ~)
38+ (cell 19:3
39+ (face 19:4 i (tvar 19:6 A))
40+ (face 19:8 t
41+ (apply 19:10 list (tvar 19:16 A)))))))
42+ (mold 21:1 unit
43+ (generic 21:9 A
44+ (union 22:3
45+ (const 22:3 ~)
46+ (cell 23:3
47+ (const 23:4 ~)
48+ (face 23:6 u (tvar 23:8 A))))))
49+ (value 25:1 fall
50+ (gate 25:9
51+ (face 25:12 args
52+ (cell 25:17
53+ (apply 25:18 unit (tvar 25:24 A))
54+ (tvar 25:27 A)))
55+ (body 26:3
56+ (branch 26:3
57+ (wing 26:6 args)
58+ (arm 27:5
59+ (cell 27:5 (bind 27:6 maybe) (bind 27:12 fallback))
60+ (body 28:7
61+ (branch 28:7
62+ (wing 28:10 maybe)
63+ (arm 29:9 (lit 29:9 ~) (wing 29:11 fallback))
64+ (arm 30:9
65+ (cell 30:9 (lit 30:10 ~) (bind 30:12 value))
66+ (wing 30:19 value)))))))))
67+ (value 32:1 need
68+ (gate 32:9
69+ (face 32:12 maybe
70+ (apply 32:18 unit (tvar 32:24 A)))
71+ (body 33:3
72+ (branch 33:3
73+ (wing 33:6 maybe)
74+ (arm 34:5 (lit 34:5 ~) (crash 34:7))
75+ (arm 35:5
76+ (cell 35:5 (lit 35:6 ~) (bind 35:8 value))
77+ (wing 35:15 value))))))
78+ (value 37:1 weld
79+ (gate 37:9
80+ (face 37:12 args
81+ (cell 37:17
82+ (apply 37:18 list (tvar 37:24 A))
83+ (apply 37:27 list (tvar 37:33 A))))
84+ (body 38:3
85+ (branch 38:3
86+ (wing 38:6 args)
87+ (arm 39:5
88+ (cell 39:5 (bind 39:6 xs) (bind 39:9 ys))
89+ (body 40:7
90+ (branch 40:7
91+ (wing 40:10 xs)
92+ (arm 41:9 (lit 41:9 ~) (wing 41:11 ys))
93+ (arm 42:9
94+ (cell 42:9 (bind 42:10 item) (bind 42:15 rest))
95+ (tuple 42:21
96+ (wing 42:22 item)
97+ (group 42:27
98+ (call 42:28 (wing 42:28 weld) (wing 42:33 rest) (wing 42:38 ys))))))))))))
99+ (value 44:1 turn
100+ (gate 44:9
101+ (face 44:12 args
102+ (cell 44:17
103+ (apply 44:18 list (tvar 44:24 A))
104+ (fn 44:27 (tvar 44:30 A) (tvar 44:32 B))))
105+ (body 45:3
106+ (branch 45:3
107+ (wing 45:6 args)
108+ (arm 46:5
109+ (cell 46:5 (bind 46:6 xs) (bind 46:9 f))
110+ (body 47:7
111+ (branch 47:7
112+ (wing 47:10 xs)
113+ (arm 48:9 (lit 48:9 ~) (lit 48:11 ~))
114+ (arm 49:9
115+ (cell 49:9 (bind 49:10 item) (bind 49:15 rest))
116+ (tuple 49:21
117+ (group 49:22
118+ (call 49:23 (wing 49:23 f) (wing 49:25 item)))
119+ (group 49:31
120+ (call 49:32 (wing 49:32 turn) (wing 49:37 rest) (wing 49:42 f))))))))))))
121+ (mold 51:1 dime
122+ (cell 51:9
123+ (face 51:10 p (aura 51:12 @ta))
124+ (face 51:16 q (aura 51:18 @))))
125+ (mold 53:1 hair
126+ (cell 53:9
127+ (face 53:10 p (aura 53:12 @ud))
128+ (face 53:16 q (aura 53:18 @ud))))
129+ (mold 55:1 pint
130+ (cell 55:9
131+ (face 55:10 p
132+ (cell 55:12
133+ (face 55:13 p (aura 55:15 @))
134+ (face 55:17 q (aura 55:19 @))))
135+ (face 55:22 q
136+ (cell 55:24
137+ (face 55:25 p (aura 55:27 @))
138+ (face 55:29 q (aura 55:31 @))))))
139+ (mold 57:1 coin
140+ (union 58:3
141+ (cell 58:3
142+ (const 58:4 %$)
143+ (face 58:7 p (ref 58:9 dime)))
144+ (cell 59:3
145+ (const 59:4 %blob)
146+ (face 59:10 p (noun 59:12)))
147+ (cell 60:3
148+ (const 60:4 %many)
149+ (face 60:10 p
150+ (apply 60:12 list (ref 60:18 coin))))))
151+ (mold 62:1 pair
152+ (generic 62:9 A B
153+ (cell 62:18
154+ (face 62:19 p (tvar 62:21 A))
155+ (face 62:23 q (tvar 62:25 B)))))
156+ (mold 64:1 trel
157+ (generic 64:9 A B C
158+ (cell 64:20
159+ (face 64:21 p (tvar 64:23 A))
160+ (face 64:25 q (tvar 64:27 B))
161+ (face 64:29 r (tvar 64:31 C)))))
162+ (mold 66:1 qual
163+ (generic 66:9 A B C D
164+ (cell 66:22
165+ (face 66:23 p (tvar 66:25 A))
166+ (face 66:27 q (tvar 66:29 B))
167+ (face 66:31 r (tvar 66:33 C))
168+ (face 66:35 s (tvar 66:37 D)))))
169+ (mold 68:1 cord (aura 68:9 @t))
170+ (mold 70:1 knot (aura 70:9 @ta))
171+ (mold 72:1 tape
172+ (apply 72:9 list (aura 72:15 @tD)))
173+ (mold 74:1 path
174+ (apply 74:9 list (ref 74:15 knot)))
175+ (mold 76:1 tank
176+ (union 77:3
177+ (ref 77:3 cord)
178+ (cell 78:3
179+ (const 78:4 %leaf)
180+ (face 78:10 p (ref 78:12 tape)))
181+ (cell 79:3
182+ (const 79:4 %palm)
183+ (face 79:10 p
184+ (apply 79:12 qual (ref 79:18 tape) (ref 79:23 tape) (ref 79:28 tape) (ref 79:33 tape)))
185+ (face 79:39 q
186+ (apply 79:41 list (ref 79:47 tank))))
187+ (cell 80:3
188+ (const 80:4 %rose)
189+ (face 80:10 p
190+ (apply 80:12 trel (ref 80:18 tape) (ref 80:23 tape) (ref 80:28 tape)))
191+ (face 80:34 q
192+ (apply 80:36 list (ref 80:42 tank))))))
193+ (mold 82:1 nail
194+ (cell 82:9
195+ (face 82:10 p (ref 82:12 hair))
196+ (face 82:17 q (ref 82:19 tape))))
197+ (mold 84:1 edge
198+ (cell 84:9
199+ (face 84:10 p (ref 84:12 hair))
200+ (face 84:17 q
201+ (apply 84:19 unit
202+ (cell 84:25
203+ (face 84:26 p (noun 84:28))
204+ (face 84:30 q (ref 84:32 nail)))))))
205+ (mold 86:1 rule
206+ (fn 86:9 (ref 86:12 nail) (ref 86:17 edge)))
207+ (mold 88:1 spot
208+ (cell 88:9
209+ (face 88:10 p (ref 88:12 path))
210+ (face 88:17 q (ref 88:19 pint))))
211+ (mold 90:1 toon
212+ (union 91:3
213+ (cell 91:3
214+ (const 91:4 %0)
215+ (face 91:7 p (noun 91:9)))
216+ (cell 92:3
217+ (const 92:4 %1)
218+ (face 92:7 p (noun 92:9)))
219+ (cell 93:3
220+ (const 93:4 %2)
221+ (face 93:7 p
222+ (apply 93:9 list (ref 93:15 tank)))))))
tests/golden/prelude-3g-structural/types.txtnew file+28
@@ -0,0 +1,28 @@
1+partial inference; module not checked
2+++ same: $-(A A)
3+++ head: $-([A B] A)
4+++ tail: $-([A B] B)
5+++ not: $-(? ?)
6++$ list: cases proven disjoint; mold not checked
7++$ unit: cases proven disjoint; mold not checked
8+++ fall: sample mold is not supported by partial inference
9+++ need: sample mold is not supported by partial inference
10+++ weld: sample mold is not supported by partial inference
11+++ turn: sample mold is not supported by partial inference
12++$ dime: not checked
13++$ hair: not checked
14++$ pint: not checked
15++$ coin: cases proven disjoint; mold not checked
16++$ pair: not checked
17++$ trel: not checked
18++$ qual: not checked
19++$ cord: not checked
20++$ knot: not checked
21++$ tape: not checked
22++$ path: not checked
23++$ tank: cases proven disjoint; mold not checked
24++$ nail: not checked
25++$ edge: not checked
26++$ rule: not checked
27++$ spot: not checked
28++$ toon: cases proven disjoint; mold not checked
tests/golden/types-partial-atom-constraint/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: a type variable used where an atom is required gains an atom constraint; printed types show `where A is an atom`.
2+tests: the constraint generalizes, is instantiated independently for ship, cord and loobean, rejects a cell, remains shared at two positions, and does not allow decimal literals to become loobeans even through a generic call.
3+expect: parses
4+expect-types: a partial inference report, not a checked module
tests/golden/types-partial-atom-constraint/source.jibbnew file+14
@@ -0,0 +1,14 @@
1+++ keep |= x=A
2+ ~& ^- @ x
3+ x
4+++ ship (keep ~zod)
5+++ cord (keep "hello")
6+++ flag (keep %.y)
7+++ bad (keep [~zod "hi"])
8+++ first |= p=[A A]
9+ ?- p
10+ [a b]
11+ ~& ^- @ a
12+ b
13+++ decimal ^- ? 1
14+++ relay ^- ? (keep 7)
tests/golden/types-partial-atom-constraint/tokens.txtnew file+91
@@ -0,0 +1,91 @@
1+1:1 glyph ++
2+1:4 name keep
3+1:9 glyph |=
4+1:12 name x
5+1:13 tight glyph =
6+1:14 tight tvar A
7+2:3 INDENT
8+2:3 glyph ~&
9+2:6 glyph ^-
10+2:9 aura @
11+2:11 name x
12+3:5 INDENT
13+3:5 name x
14+4:1 DEDENT
15+4:1 DEDENT
16+4:1 NEWLINE
17+4:1 glyph ++
18+4:4 name ship
19+4:9 glyph (
20+4:10 tight name keep
21+4:15 lit ~zod
22+4:19 tight glyph )
23+5:1 NEWLINE
24+5:1 glyph ++
25+5:4 name cord
26+5:9 glyph (
27+5:10 tight name keep
28+5:15 str "hello"
29+5:22 tight glyph )
30+6:1 NEWLINE
31+6:1 glyph ++
32+6:4 name flag
33+6:9 glyph (
34+6:10 tight name keep
35+6:15 lit %.y
36+6:18 tight glyph )
37+7:1 NEWLINE
38+7:1 glyph ++
39+7:4 name bad
40+7:8 glyph (
41+7:9 tight name keep
42+7:14 glyph [
43+7:15 tight lit ~zod
44+7:20 str "hi"
45+7:24 tight glyph ]
46+7:25 tight glyph )
47+8:1 NEWLINE
48+8:1 glyph ++
49+8:4 name first
50+8:10 glyph |=
51+8:13 name p
52+8:14 tight glyph =
53+8:15 tight glyph [
54+8:16 tight tvar A
55+8:18 tvar A
56+8:19 tight glyph ]
57+9:3 INDENT
58+9:3 glyph ?-
59+9:6 name p
60+10:5 INDENT
61+10:5 glyph [
62+10:6 tight name a
63+10:8 name b
64+10:9 tight glyph ]
65+11:7 INDENT
66+11:7 glyph ~&
67+11:10 glyph ^-
68+11:13 aura @
69+11:15 name a
70+12:9 INDENT
71+12:9 name b
72+13:1 DEDENT
73+13:1 DEDENT
74+13:1 DEDENT
75+13:1 DEDENT
76+13:1 NEWLINE
77+13:1 glyph ++
78+13:4 name decimal
79+13:12 glyph ^-
80+13:15 glyph ?
81+13:17 lit 1
82+14:1 NEWLINE
83+14:1 glyph ++
84+14:4 name relay
85+14:10 glyph ^-
86+14:13 glyph ?
87+14:15 glyph (
88+14:16 tight name keep
89+14:21 lit 7
90+14:22 tight glyph )
91+14:23 NEWLINE
tests/golden/types-partial-atom-constraint/tree.txtnew file+42
@@ -0,0 +1,42 @@
1+(module
2+ (value 1:1 keep
3+ (gate 1:9
4+ (face 1:12 x (tvar 1:14 A))
5+ (body 2:3
6+ (trace 2:3
7+ (cast 2:6 (aura 2:9 @) (wing 2:11 x))
8+ (body 3:5 (wing 3:5 x))))))
9+ (value 4:1 ship
10+ (group 4:9
11+ (call 4:10 (wing 4:10 keep) (lit 4:15 ~zod))))
12+ (value 5:1 cord
13+ (group 5:9
14+ (call 5:10 (wing 5:10 keep) (str 5:15 "hello"))))
15+ (value 6:1 flag
16+ (group 6:9
17+ (call 6:10 (wing 6:10 keep) (lit 6:15 %.y))))
18+ (value 7:1 bad
19+ (group 7:8
20+ (call 7:9
21+ (wing 7:9 keep)
22+ (tuple 7:14 (lit 7:15 ~zod) (str 7:20 "hi")))))
23+ (value 8:1 first
24+ (gate 8:10
25+ (face 8:13 p
26+ (cell 8:15 (tvar 8:16 A) (tvar 8:18 A)))
27+ (body 9:3
28+ (branch 9:3
29+ (wing 9:6 p)
30+ (arm 10:5
31+ (cell 10:5 (bind 10:6 a) (bind 10:8 b))
32+ (body 11:7
33+ (trace 11:7
34+ (cast 11:10 (aura 11:13 @) (wing 11:15 a))
35+ (body 12:9 (wing 12:9 b)))))))))
36+ (value 13:1 decimal
37+ (cast 13:12 (flag 13:15) (lit 13:17 1)))
38+ (value 14:1 relay
39+ (cast 14:10
40+ (flag 14:13)
41+ (group 14:15
42+ (call 14:16 (wing 14:16 keep) (lit 14:21 7))))))
tests/golden/types-partial-atom-constraint/types.txtnew file+9
@@ -0,0 +1,9 @@
1+partial inference; module not checked
2+++ keep: $-(A A) where A is an atom
3+++ ship: @p
4+++ cord: @t
5+++ flag: ?
6+++ bad: call's sample and argument types do not unify
7+++ first: $-([A A] A) where A is an atom
8+++ decimal: cast mold and expression type do not unify
9+++ relay: cast mold and expression type do not unify
tests/golden/types-partial-atom-widening/types.txt+1−1
@@ -4,7 +4,7 @@ partial inference; module not checked
44++ widen: @
55++ flag: @
66++ narrow: cast mold and expression type do not unify
7−++ constrained: cast constraint is not supported by partial inference
7+++ constrained: $-(A @) where A is an atom
88++ nested: call constraint is not supported by partial inference
99+$ open: not checked
1010++ named: $-(@ @)
tests/importer/shadow.txt+1
@@ -5,6 +5,7 @@
55++ jug |$([key value] (map key (set value)))
66+| %defs
77+$ mm ((mop @ud @t) lte)
8++$ mn [table=((mop @ud @t) lte) other=@ud]
89+$ aa (jar @ud @t)
910+$ bb [field=(jug @ud @t)]
1011--
tests/importer/small.txt+5
@@ -14,6 +14,11 @@
1414+$ compound-fields [one=(map @ud (jar @t @ud)) two=(list (jug @t @ud))]
1515+$ mop-test ((mop @ud @t) lte)
1616+$ nested-mop [table=((mop @ud @t) lte) other=@ud]
17++$ two-mops [a=((mop @ud @t) lte) b=((mop @t @ud) lte)]
18++$ mixed-mop [a=((mop @ud @t) lte) b=(list @ud)]
19++$ named-mop [a=((mop @ud word) lte) b=@ud]
20++$ word @t
21++$ mop-list (list ((mop @ud @t) lte))
1722+$ signed @sd
1823+$ float @rd
1924+$ gate-test $-(@ud @ud)
tests/importer/tree.txt+6−1
@@ -11,7 +11,11 @@ nested-alias: (jar @ud (jug @ud @t))
1111compound: (map @ud (list (jar @ud (jug @t @ud))))
1212compound-fields: [one=(map @ud (jar @t @ud)) two=(list (jug @t @ud))]
1313mop: (mop @ud @t)
14−nested-mop: error: a nested Hoon mop needs source-aware import
14+nested-mop: [table=(mop @ud @t) other=@ud]
15+two-mops: [a=(mop @ud @t) b=(mop @t @ud)]
16+mixed-mop: error: a nested Hoon mop needs source-aware import
17+named-mop: error: a nested Hoon mop needs source-aware import
18+mop-list: error: a nested Hoon mop needs source-aware import
1519signed: error: signed and float auras cannot be imported
1620float: error: signed and float auras cannot be imported
1721gate: error: cores and gates cannot be imported
@@ -25,6 +29,7 @@ chapter-direct-hit: yes
2529chapter-wrapped-hit: yes
2630chapter-direct-miss: no
2731chapter-wrapped-miss: no
32+shadow-nested-mop: error: Hoon collection provenance is unavailable or shadowed
2833shadow-mop: error: Hoon collection provenance is unavailable or shadowed
2934shadow-jar: error: Hoon collection provenance is unavailable or shadowed
3035shadow-jug: error: Hoon collection provenance is unavailable or shadowed
tests/lib/jibb.hoon+145−127
@@ -1140,108 +1140,120 @@
11401140/* tok-373 %txt /tests/golden/prelude-3g-basic/tokens/txt
11411141/* tre-373 %txt /tests/golden/prelude-3g-basic/tree/txt
11421142/* typ-373 %txt /tests/golden/prelude-3g-basic/types/txt
1143−/* src-374 %jibb /tests/golden/prelude-core-functions/source/jibb
1144−/* tok-374 %txt /tests/golden/prelude-core-functions/tokens/txt
1145−/* tre-374 %txt /tests/golden/prelude-core-functions/tree/txt
1146−/* typ-374 %txt /tests/golden/prelude-core-functions/types/txt
1147−/* src-375 %jibb /tests/golden/prelude-list-unit/source/jibb
1148−/* tok-375 %txt /tests/golden/prelude-list-unit/tokens/txt
1149−/* tre-375 %txt /tests/golden/prelude-list-unit/tree/txt
1150−/* typ-375 %txt /tests/golden/prelude-list-unit/types/txt
1151−/* src-376 %jibb /tests/golden/types-import-sur/source/jibb
1152−/* tok-376 %txt /tests/golden/types-import-sur/tokens/txt
1153−/* tre-376 %txt /tests/golden/types-import-sur/tree/txt
1154−/* typ-376 %txt /tests/golden/types-import-sur/types/txt
1155−/* imp-376-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1156−/* imp-376-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1157−/* src-377 %jibb /tests/golden/types-partial-apply/source/jibb
1158−/* tok-377 %txt /tests/golden/types-partial-apply/tokens/txt
1159−/* tre-377 %txt /tests/golden/types-partial-apply/tree/txt
1160−/* typ-377 %txt /tests/golden/types-partial-apply/types/txt
1161−/* src-378 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1162−/* tok-378 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1163−/* tre-378 %txt /tests/golden/types-partial-atom-widening/tree/txt
1164−/* typ-378 %txt /tests/golden/types-partial-atom-widening/types/txt
1165−/* src-379 %jibb /tests/golden/types-partial-aura/source/jibb
1166−/* tok-379 %txt /tests/golden/types-partial-aura/tokens/txt
1167−/* tre-379 %txt /tests/golden/types-partial-aura/tree/txt
1168−/* typ-379 %txt /tests/golden/types-partial-aura/types/txt
1169−/* src-380 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1170−/* tok-380 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1171−/* tre-380 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1172−/* typ-380 %txt /tests/golden/types-partial-aura-generalization/types/txt
1173−/* src-381 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1174−/* tok-381 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1175−/* tre-381 %txt /tests/golden/types-partial-bare-atom/tree/txt
1176−/* typ-381 %txt /tests/golden/types-partial-bare-atom/types/txt
1177−/* src-382 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1178−/* tok-382 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1179−/* tre-382 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1180−/* typ-382 %txt /tests/golden/types-partial-dependency-chain/types/txt
1181−/* src-383 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1182−/* tok-383 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1183−/* tre-383 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1184−/* typ-383 %txt /tests/golden/types-partial-explicit-capital/types/txt
1185−/* src-384 %jibb /tests/golden/types-partial-forward/source/jibb
1186−/* tok-384 %txt /tests/golden/types-partial-forward/tokens/txt
1187−/* tre-384 %txt /tests/golden/types-partial-forward/tree/txt
1188−/* typ-384 %txt /tests/golden/types-partial-forward/types/txt
1189−/* src-385 %jibb /tests/golden/types-partial-generalization/source/jibb
1190−/* tok-385 %txt /tests/golden/types-partial-generalization/tokens/txt
1191−/* tre-385 %txt /tests/golden/types-partial-generalization/tree/txt
1192−/* typ-385 %txt /tests/golden/types-partial-generalization/types/txt
1193−/* src-386 %jibb /tests/golden/types-partial-identity/source/jibb
1194−/* tok-386 %txt /tests/golden/types-partial-identity/tokens/txt
1195−/* tre-386 %txt /tests/golden/types-partial-identity/tree/txt
1196−/* typ-386 %txt /tests/golden/types-partial-identity/types/txt
1197−/* src-387 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1198−/* tok-387 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1199−/* tre-387 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1200−/* typ-387 %txt /tests/golden/types-partial-independent-atoms/types/txt
1201−/* src-388 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1202−/* tok-388 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1203−/* tre-388 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1204−/* typ-388 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1205−/* src-389 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1206−/* tok-389 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1207−/* tre-389 %txt /tests/golden/types-partial-mold-composite/tree/txt
1208−/* typ-389 %txt /tests/golden/types-partial-mold-composite/types/txt
1209−/* src-390 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1210−/* tok-390 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1211−/* tre-390 %txt /tests/golden/types-partial-mold-forward/tree/txt
1212−/* typ-390 %txt /tests/golden/types-partial-mold-forward/types/txt
1213−/* src-391 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1214−/* tok-391 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1215−/* tre-391 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1216−/* typ-391 %txt /tests/golden/types-partial-mold-recursive/types/txt
1217−/* src-392 %jibb /tests/golden/types-partial-occurs/source/jibb
1218−/* tok-392 %txt /tests/golden/types-partial-occurs/tokens/txt
1219−/* tre-392 %txt /tests/golden/types-partial-occurs/tree/txt
1220−/* typ-392 %txt /tests/golden/types-partial-occurs/types/txt
1221−/* src-393 %jibb /tests/golden/types-partial-projection/source/jibb
1222−/* tok-393 %txt /tests/golden/types-partial-projection/tokens/txt
1223−/* tre-393 %txt /tests/golden/types-partial-projection/tree/txt
1224−/* typ-393 %txt /tests/golden/types-partial-projection/types/txt
1225−/* src-394 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1226−/* tok-394 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1227−/* tre-394 %txt /tests/golden/types-partial-shadow-global/tree/txt
1228−/* typ-394 %txt /tests/golden/types-partial-shadow-global/types/txt
1229−/* src-395 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1230−/* tok-395 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1231−/* tre-395 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1232−/* typ-395 %txt /tests/golden/types-partial-shared-tvar/types/txt
1233−/* src-396 %jibb /tests/golden/types-partial-union-cases/source/jibb
1234−/* tok-396 %txt /tests/golden/types-partial-union-cases/tokens/txt
1235−/* tre-396 %txt /tests/golden/types-partial-union-cases/tree/txt
1236−/* typ-396 %txt /tests/golden/types-partial-union-cases/types/txt
1237−/* src-397 %jibb /tests/golden/types-partial-union-edges/source/jibb
1238−/* tok-397 %txt /tests/golden/types-partial-union-edges/tokens/txt
1239−/* tre-397 %txt /tests/golden/types-partial-union-edges/tree/txt
1240−/* typ-397 %txt /tests/golden/types-partial-union-edges/types/txt
1241−/* src-398 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1242−/* tok-398 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1243−/* tre-398 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1244−/* typ-398 %txt /tests/golden/types-partial-unresolved-tag/types/txt
1143+/* src-374 %jibb /tests/golden/prelude-3g-like/source/jibb
1144+/* tok-374 %txt /tests/golden/prelude-3g-like/tokens/txt
1145+/* tre-374 %txt /tests/golden/prelude-3g-like/tree/txt
1146+/* typ-374 %txt /tests/golden/prelude-3g-like/types/txt
1147+/* src-375 %jibb /tests/golden/prelude-3g-structural/source/jibb
1148+/* tok-375 %txt /tests/golden/prelude-3g-structural/tokens/txt
1149+/* tre-375 %txt /tests/golden/prelude-3g-structural/tree/txt
1150+/* typ-375 %txt /tests/golden/prelude-3g-structural/types/txt
1151+/* src-376 %jibb /tests/golden/prelude-core-functions/source/jibb
1152+/* tok-376 %txt /tests/golden/prelude-core-functions/tokens/txt
1153+/* tre-376 %txt /tests/golden/prelude-core-functions/tree/txt
1154+/* typ-376 %txt /tests/golden/prelude-core-functions/types/txt
1155+/* src-377 %jibb /tests/golden/prelude-list-unit/source/jibb
1156+/* tok-377 %txt /tests/golden/prelude-list-unit/tokens/txt
1157+/* tre-377 %txt /tests/golden/prelude-list-unit/tree/txt
1158+/* typ-377 %txt /tests/golden/prelude-list-unit/types/txt
1159+/* src-378 %jibb /tests/golden/types-import-sur/source/jibb
1160+/* tok-378 %txt /tests/golden/types-import-sur/tokens/txt
1161+/* tre-378 %txt /tests/golden/types-import-sur/tree/txt
1162+/* typ-378 %txt /tests/golden/types-import-sur/types/txt
1163+/* imp-378-1 %txt /tests/golden/types-import-sur/sur/fixture/txt
1164+/* imp-378-2 %txt /tests/golden/types-import-sur/sur/fixture/txt
1165+/* src-379 %jibb /tests/golden/types-partial-apply/source/jibb
1166+/* tok-379 %txt /tests/golden/types-partial-apply/tokens/txt
1167+/* tre-379 %txt /tests/golden/types-partial-apply/tree/txt
1168+/* typ-379 %txt /tests/golden/types-partial-apply/types/txt
1169+/* src-380 %jibb /tests/golden/types-partial-atom-constraint/source/jibb
1170+/* tok-380 %txt /tests/golden/types-partial-atom-constraint/tokens/txt
1171+/* tre-380 %txt /tests/golden/types-partial-atom-constraint/tree/txt
1172+/* typ-380 %txt /tests/golden/types-partial-atom-constraint/types/txt
1173+/* src-381 %jibb /tests/golden/types-partial-atom-widening/source/jibb
1174+/* tok-381 %txt /tests/golden/types-partial-atom-widening/tokens/txt
1175+/* tre-381 %txt /tests/golden/types-partial-atom-widening/tree/txt
1176+/* typ-381 %txt /tests/golden/types-partial-atom-widening/types/txt
1177+/* src-382 %jibb /tests/golden/types-partial-aura/source/jibb
1178+/* tok-382 %txt /tests/golden/types-partial-aura/tokens/txt
1179+/* tre-382 %txt /tests/golden/types-partial-aura/tree/txt
1180+/* typ-382 %txt /tests/golden/types-partial-aura/types/txt
1181+/* src-383 %jibb /tests/golden/types-partial-aura-generalization/source/jibb
1182+/* tok-383 %txt /tests/golden/types-partial-aura-generalization/tokens/txt
1183+/* tre-383 %txt /tests/golden/types-partial-aura-generalization/tree/txt
1184+/* typ-383 %txt /tests/golden/types-partial-aura-generalization/types/txt
1185+/* src-384 %jibb /tests/golden/types-partial-bare-atom/source/jibb
1186+/* tok-384 %txt /tests/golden/types-partial-bare-atom/tokens/txt
1187+/* tre-384 %txt /tests/golden/types-partial-bare-atom/tree/txt
1188+/* typ-384 %txt /tests/golden/types-partial-bare-atom/types/txt
1189+/* src-385 %jibb /tests/golden/types-partial-dependency-chain/source/jibb
1190+/* tok-385 %txt /tests/golden/types-partial-dependency-chain/tokens/txt
1191+/* tre-385 %txt /tests/golden/types-partial-dependency-chain/tree/txt
1192+/* typ-385 %txt /tests/golden/types-partial-dependency-chain/types/txt
1193+/* src-386 %jibb /tests/golden/types-partial-explicit-capital/source/jibb
1194+/* tok-386 %txt /tests/golden/types-partial-explicit-capital/tokens/txt
1195+/* tre-386 %txt /tests/golden/types-partial-explicit-capital/tree/txt
1196+/* typ-386 %txt /tests/golden/types-partial-explicit-capital/types/txt
1197+/* src-387 %jibb /tests/golden/types-partial-forward/source/jibb
1198+/* tok-387 %txt /tests/golden/types-partial-forward/tokens/txt
1199+/* tre-387 %txt /tests/golden/types-partial-forward/tree/txt
1200+/* typ-387 %txt /tests/golden/types-partial-forward/types/txt
1201+/* src-388 %jibb /tests/golden/types-partial-generalization/source/jibb
1202+/* tok-388 %txt /tests/golden/types-partial-generalization/tokens/txt
1203+/* tre-388 %txt /tests/golden/types-partial-generalization/tree/txt
1204+/* typ-388 %txt /tests/golden/types-partial-generalization/types/txt
1205+/* src-389 %jibb /tests/golden/types-partial-identity/source/jibb
1206+/* tok-389 %txt /tests/golden/types-partial-identity/tokens/txt
1207+/* tre-389 %txt /tests/golden/types-partial-identity/tree/txt
1208+/* typ-389 %txt /tests/golden/types-partial-identity/types/txt
1209+/* src-390 %jibb /tests/golden/types-partial-independent-atoms/source/jibb
1210+/* tok-390 %txt /tests/golden/types-partial-independent-atoms/tokens/txt
1211+/* tre-390 %txt /tests/golden/types-partial-independent-atoms/tree/txt
1212+/* typ-390 %txt /tests/golden/types-partial-independent-atoms/types/txt
1213+/* src-391 %jibb /tests/golden/types-partial-mold-bare-aura/source/jibb
1214+/* tok-391 %txt /tests/golden/types-partial-mold-bare-aura/tokens/txt
1215+/* tre-391 %txt /tests/golden/types-partial-mold-bare-aura/tree/txt
1216+/* typ-391 %txt /tests/golden/types-partial-mold-bare-aura/types/txt
1217+/* src-392 %jibb /tests/golden/types-partial-mold-composite/source/jibb
1218+/* tok-392 %txt /tests/golden/types-partial-mold-composite/tokens/txt
1219+/* tre-392 %txt /tests/golden/types-partial-mold-composite/tree/txt
1220+/* typ-392 %txt /tests/golden/types-partial-mold-composite/types/txt
1221+/* src-393 %jibb /tests/golden/types-partial-mold-forward/source/jibb
1222+/* tok-393 %txt /tests/golden/types-partial-mold-forward/tokens/txt
1223+/* tre-393 %txt /tests/golden/types-partial-mold-forward/tree/txt
1224+/* typ-393 %txt /tests/golden/types-partial-mold-forward/types/txt
1225+/* src-394 %jibb /tests/golden/types-partial-mold-recursive/source/jibb
1226+/* tok-394 %txt /tests/golden/types-partial-mold-recursive/tokens/txt
1227+/* tre-394 %txt /tests/golden/types-partial-mold-recursive/tree/txt
1228+/* typ-394 %txt /tests/golden/types-partial-mold-recursive/types/txt
1229+/* src-395 %jibb /tests/golden/types-partial-occurs/source/jibb
1230+/* tok-395 %txt /tests/golden/types-partial-occurs/tokens/txt
1231+/* tre-395 %txt /tests/golden/types-partial-occurs/tree/txt
1232+/* typ-395 %txt /tests/golden/types-partial-occurs/types/txt
1233+/* src-396 %jibb /tests/golden/types-partial-projection/source/jibb
1234+/* tok-396 %txt /tests/golden/types-partial-projection/tokens/txt
1235+/* tre-396 %txt /tests/golden/types-partial-projection/tree/txt
1236+/* typ-396 %txt /tests/golden/types-partial-projection/types/txt
1237+/* src-397 %jibb /tests/golden/types-partial-shadow-global/source/jibb
1238+/* tok-397 %txt /tests/golden/types-partial-shadow-global/tokens/txt
1239+/* tre-397 %txt /tests/golden/types-partial-shadow-global/tree/txt
1240+/* typ-397 %txt /tests/golden/types-partial-shadow-global/types/txt
1241+/* src-398 %jibb /tests/golden/types-partial-shared-tvar/source/jibb
1242+/* tok-398 %txt /tests/golden/types-partial-shared-tvar/tokens/txt
1243+/* tre-398 %txt /tests/golden/types-partial-shared-tvar/tree/txt
1244+/* typ-398 %txt /tests/golden/types-partial-shared-tvar/types/txt
1245+/* src-399 %jibb /tests/golden/types-partial-union-cases/source/jibb
1246+/* tok-399 %txt /tests/golden/types-partial-union-cases/tokens/txt
1247+/* tre-399 %txt /tests/golden/types-partial-union-cases/tree/txt
1248+/* typ-399 %txt /tests/golden/types-partial-union-cases/types/txt
1249+/* src-400 %jibb /tests/golden/types-partial-union-edges/source/jibb
1250+/* tok-400 %txt /tests/golden/types-partial-union-edges/tokens/txt
1251+/* tre-400 %txt /tests/golden/types-partial-union-edges/tree/txt
1252+/* typ-400 %txt /tests/golden/types-partial-union-edges/types/txt
1253+/* src-401 %jibb /tests/golden/types-partial-unresolved-tag/source/jibb
1254+/* tok-401 %txt /tests/golden/types-partial-unresolved-tag/tokens/txt
1255+/* tre-401 %txt /tests/golden/types-partial-unresolved-tag/tree/txt
1256+/* typ-401 %txt /tests/golden/types-partial-unresolved-tag/types/txt
12451257|%
12461258:: one arm per case
12471259::
@@ -1991,56 +2003,62 @@
19912003 (check ~.lex-tight-wing-ok-1 src-372 `tok-372 `tre-372)
19922004++ test-prelude-3g-basic
19932005 (weld (check ~.prelude-3g-basic src-373 `tok-373 `tre-373) (check-types ~.prelude-3g-basic ~[%tests %golden ~.prelude-3g-basic %source %jibb] src-373 `typ-373))
2006+++ test-prelude-3g-like
2007+ (weld (check ~.prelude-3g-like src-374 `tok-374 `tre-374) (check-types ~.prelude-3g-like ~[%tests %golden ~.prelude-3g-like %source %jibb] src-374 `typ-374))
2008+++ test-prelude-3g-structural
2009+ (weld (check ~.prelude-3g-structural src-375 `tok-375 `tre-375) (check-types ~.prelude-3g-structural ~[%tests %golden ~.prelude-3g-structural %source %jibb] src-375 `typ-375))
19942010++ test-prelude-core-functions
1995− (weld (check ~.prelude-core-functions src-374 `tok-374 `tre-374) (check-types ~.prelude-core-functions ~[%tests %golden ~.prelude-core-functions %source %jibb] src-374 `typ-374))
2011+ (weld (check ~.prelude-core-functions src-376 `tok-376 `tre-376) (check-types ~.prelude-core-functions ~[%tests %golden ~.prelude-core-functions %source %jibb] src-376 `typ-376))
19962012++ test-prelude-list-unit
1997− (weld (check ~.prelude-list-unit src-375 `tok-375 `tre-375) (check-types ~.prelude-list-unit ~[%tests %golden ~.prelude-list-unit %source %jibb] src-375 `typ-375))
2013+ (weld (check ~.prelude-list-unit src-377 `tok-377 `tre-377) (check-types ~.prelude-list-unit ~[%tests %golden ~.prelude-list-unit %source %jibb] src-377 `typ-377))
19982014++ test-types-import-sur
1999− (weld (check ~.types-import-sur src-376 `tok-376 `tre-376) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-376 `typ-376 ~[[%fixture %title imp-376-1] [%fixture %pair imp-376-2]]))
2015+ (weld (check ~.types-import-sur src-378 `tok-378 `tre-378) (check-import-types ~.types-import-sur ~[%tests %golden ~.types-import-sur %source %jibb] src-378 `typ-378 ~[[%fixture %title imp-378-1] [%fixture %pair imp-378-2]]))
20002016++ test-types-partial-apply
2001− (weld (check ~.types-partial-apply src-377 `tok-377 `tre-377) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-377 `typ-377))
2017+ (weld (check ~.types-partial-apply src-379 `tok-379 `tre-379) (check-types ~.types-partial-apply ~[%tests %golden ~.types-partial-apply %source %jibb] src-379 `typ-379))
2018+++ test-types-partial-atom-constraint
2019+ (weld (check ~.types-partial-atom-constraint src-380 `tok-380 `tre-380) (check-types ~.types-partial-atom-constraint ~[%tests %golden ~.types-partial-atom-constraint %source %jibb] src-380 `typ-380))
20022020++ test-types-partial-atom-widening
2003− (weld (check ~.types-partial-atom-widening src-378 `tok-378 `tre-378) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-378 `typ-378))
2021+ (weld (check ~.types-partial-atom-widening src-381 `tok-381 `tre-381) (check-types ~.types-partial-atom-widening ~[%tests %golden ~.types-partial-atom-widening %source %jibb] src-381 `typ-381))
20042022++ test-types-partial-aura
2005− (weld (check ~.types-partial-aura src-379 `tok-379 `tre-379) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-379 `typ-379))
2023+ (weld (check ~.types-partial-aura src-382 `tok-382 `tre-382) (check-types ~.types-partial-aura ~[%tests %golden ~.types-partial-aura %source %jibb] src-382 `typ-382))
20062024++ test-types-partial-aura-generalization
2007− (weld (check ~.types-partial-aura-generalization src-380 `tok-380 `tre-380) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-380 `typ-380))
2025+ (weld (check ~.types-partial-aura-generalization src-383 `tok-383 `tre-383) (check-types ~.types-partial-aura-generalization ~[%tests %golden ~.types-partial-aura-generalization %source %jibb] src-383 `typ-383))
20082026++ test-types-partial-bare-atom
2009− (weld (check ~.types-partial-bare-atom src-381 `tok-381 `tre-381) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-381 `typ-381))
2027+ (weld (check ~.types-partial-bare-atom src-384 `tok-384 `tre-384) (check-types ~.types-partial-bare-atom ~[%tests %golden ~.types-partial-bare-atom %source %jibb] src-384 `typ-384))
20102028++ test-types-partial-dependency-chain
2011− (weld (check ~.types-partial-dependency-chain src-382 `tok-382 `tre-382) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-382 `typ-382))
2029+ (weld (check ~.types-partial-dependency-chain src-385 `tok-385 `tre-385) (check-types ~.types-partial-dependency-chain ~[%tests %golden ~.types-partial-dependency-chain %source %jibb] src-385 `typ-385))
20122030++ test-types-partial-explicit-capital
2013− (weld (check ~.types-partial-explicit-capital src-383 `tok-383 `tre-383) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-383 `typ-383))
2031+ (weld (check ~.types-partial-explicit-capital src-386 `tok-386 `tre-386) (check-types ~.types-partial-explicit-capital ~[%tests %golden ~.types-partial-explicit-capital %source %jibb] src-386 `typ-386))
20142032++ test-types-partial-forward
2015− (weld (check ~.types-partial-forward src-384 `tok-384 `tre-384) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-384 `typ-384))
2033+ (weld (check ~.types-partial-forward src-387 `tok-387 `tre-387) (check-types ~.types-partial-forward ~[%tests %golden ~.types-partial-forward %source %jibb] src-387 `typ-387))
20162034++ test-types-partial-generalization
2017− (weld (check ~.types-partial-generalization src-385 `tok-385 `tre-385) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-385 `typ-385))
2035+ (weld (check ~.types-partial-generalization src-388 `tok-388 `tre-388) (check-types ~.types-partial-generalization ~[%tests %golden ~.types-partial-generalization %source %jibb] src-388 `typ-388))
20182036++ test-types-partial-identity
2019− (weld (check ~.types-partial-identity src-386 `tok-386 `tre-386) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-386 `typ-386))
2037+ (weld (check ~.types-partial-identity src-389 `tok-389 `tre-389) (check-types ~.types-partial-identity ~[%tests %golden ~.types-partial-identity %source %jibb] src-389 `typ-389))
20202038++ test-types-partial-independent-atoms
2021− (weld (check ~.types-partial-independent-atoms src-387 `tok-387 `tre-387) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-387 `typ-387))
2039+ (weld (check ~.types-partial-independent-atoms src-390 `tok-390 `tre-390) (check-types ~.types-partial-independent-atoms ~[%tests %golden ~.types-partial-independent-atoms %source %jibb] src-390 `typ-390))
20222040++ test-types-partial-mold-bare-aura
2023− (weld (check ~.types-partial-mold-bare-aura src-388 `tok-388 `tre-388) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-388 `typ-388))
2041+ (weld (check ~.types-partial-mold-bare-aura src-391 `tok-391 `tre-391) (check-types ~.types-partial-mold-bare-aura ~[%tests %golden ~.types-partial-mold-bare-aura %source %jibb] src-391 `typ-391))
20242042++ test-types-partial-mold-composite
2025− (weld (check ~.types-partial-mold-composite src-389 `tok-389 `tre-389) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-389 `typ-389))
2043+ (weld (check ~.types-partial-mold-composite src-392 `tok-392 `tre-392) (check-types ~.types-partial-mold-composite ~[%tests %golden ~.types-partial-mold-composite %source %jibb] src-392 `typ-392))
20262044++ test-types-partial-mold-forward
2027− (weld (check ~.types-partial-mold-forward src-390 `tok-390 `tre-390) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-390 `typ-390))
2045+ (weld (check ~.types-partial-mold-forward src-393 `tok-393 `tre-393) (check-types ~.types-partial-mold-forward ~[%tests %golden ~.types-partial-mold-forward %source %jibb] src-393 `typ-393))
20282046++ test-types-partial-mold-recursive
2029− (weld (check ~.types-partial-mold-recursive src-391 `tok-391 `tre-391) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-391 `typ-391))
2047+ (weld (check ~.types-partial-mold-recursive src-394 `tok-394 `tre-394) (check-types ~.types-partial-mold-recursive ~[%tests %golden ~.types-partial-mold-recursive %source %jibb] src-394 `typ-394))
20302048++ test-types-partial-occurs
2031− (weld (check ~.types-partial-occurs src-392 `tok-392 `tre-392) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-392 `typ-392))
2049+ (weld (check ~.types-partial-occurs src-395 `tok-395 `tre-395) (check-types ~.types-partial-occurs ~[%tests %golden ~.types-partial-occurs %source %jibb] src-395 `typ-395))
20322050++ test-types-partial-projection
2033− (weld (check ~.types-partial-projection src-393 `tok-393 `tre-393) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-393 `typ-393))
2051+ (weld (check ~.types-partial-projection src-396 `tok-396 `tre-396) (check-types ~.types-partial-projection ~[%tests %golden ~.types-partial-projection %source %jibb] src-396 `typ-396))
20342052++ test-types-partial-shadow-global
2035− (weld (check ~.types-partial-shadow-global src-394 `tok-394 `tre-394) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-394 `typ-394))
2053+ (weld (check ~.types-partial-shadow-global src-397 `tok-397 `tre-397) (check-types ~.types-partial-shadow-global ~[%tests %golden ~.types-partial-shadow-global %source %jibb] src-397 `typ-397))
20362054++ test-types-partial-shared-tvar
2037− (weld (check ~.types-partial-shared-tvar src-395 `tok-395 `tre-395) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-395 `typ-395))
2055+ (weld (check ~.types-partial-shared-tvar src-398 `tok-398 `tre-398) (check-types ~.types-partial-shared-tvar ~[%tests %golden ~.types-partial-shared-tvar %source %jibb] src-398 `typ-398))
20382056++ test-types-partial-union-cases
2039− (weld (check ~.types-partial-union-cases src-396 `tok-396 `tre-396) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-396 `typ-396))
2057+ (weld (check ~.types-partial-union-cases src-399 `tok-399 `tre-399) (check-types ~.types-partial-union-cases ~[%tests %golden ~.types-partial-union-cases %source %jibb] src-399 `typ-399))
20402058++ test-types-partial-union-edges
2041− (weld (check ~.types-partial-union-edges src-397 `tok-397 `tre-397) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-397 `typ-397))
2059+ (weld (check ~.types-partial-union-edges src-400 `tok-400 `tre-400) (check-types ~.types-partial-union-edges ~[%tests %golden ~.types-partial-union-edges %source %jibb] src-400 `typ-400))
20422060++ test-types-partial-unresolved-tag
2043− (weld (check ~.types-partial-unresolved-tag src-398 `tok-398 `tre-398) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-398 `typ-398))
2061+ (weld (check ~.types-partial-unresolved-tag src-401 `tok-401 `tre-401) (check-types ~.types-partial-unresolved-tag ~[%tests %golden ~.types-partial-unresolved-tag %source %jibb] src-401 `typ-401))
20442062::
20452063:: +check: run golden:jibb on a case and compare both outputs
20462064::
tools/clay-fixtures+25−1
@@ -1,9 +1,10 @@
11#!/usr/bin/env python3
2−"""Build the example /sur and mark fixtures through Clay on the fake ship."""
2+"""Build and inspect example /sur and mark fixtures through Clay."""
33
44from pathlib import Path
55import subprocess
66import sys
7+import tempfile
78
89root = Path(__file__).resolve().parent.parent
910ship = root / 'tools' / 'ship'
@@ -22,3 +23,26 @@ if result.stdout != expected:
2223 print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
2324 sys.exit(1)
2425print('Clay fixture builds: 7 passed')
26+
27+# Inject the reader rather than copying it into the fixture: Clay supplies
28+# each compiled /sur type graph, and the current reader examines its molds.
29+reader = (root / 'jibb-dev/lib/jibb-import.hoon').read_text()
30+template = (fixtures / 'import.txt').read_text()
31+if template.count('@@READER@@') != 1:
32+ sys.exit('Clay import fixture needs exactly one reader placeholder')
33+binding = '=/ reader\n' + ''.join(' ' + line for line in reader.splitlines(keepends=True))
34+with tempfile.TemporaryDirectory(prefix='jibb-clay-import-') as tmp:
35+ program = Path(tmp) / 'import.hoon'
36+ program.write_text(template.replace('@@READER@@', binding))
37+ try:
38+ result = subprocess.run([str(ship), 'run', str(program)],
39+ stdout=subprocess.PIPE, check=True)
40+ except subprocess.CalledProcessError as error:
41+ sys.exit(error.returncode)
42+expected = (fixtures / 'import-expected.txt').read_bytes()
43+if result.stdout != expected:
44+ print('Clay imports differ from tests/clay-fixtures/import-expected.txt', file=sys.stderr)
45+ print('expected:', expected.decode().rstrip(), file=sys.stderr)
46+ print('actual: ', result.stdout.decode().rstrip(), file=sys.stderr)
47+ sys.exit(1)
48+print('Clay importer golden: 3 projections passed')
tools/importer-test+1−1
@@ -25,4 +25,4 @@ if result.stdout != expected:
2525 result.stdout.decode().splitlines(keepends=True),
2626 fromfile='expected tree.txt', tofile='actual types'))
2727 sys.exit(1)
28−print('importer golden: 40 projections passed')
28+print('importer golden: 45 projections passed')