on master help sign in
1052 files changed+41404−528
since splitsnapshots
unifiedsplit
README.md+3−3 docs/compiler.md+32−2 docs/development.md+16−4 docs/open-questions.md+12−5 docs/prelude-inventory.md+27−4 docs/prompts/milestone-2.md+8−8 docs/spec/decisions.md+6−6 docs/spec/grammar.md+5−5 docs/spec/overview.md+4−4 docs/status.md+54−8 jibb-dev/lib/jibb-import.hoon+992−55 jibb-dev/lib/jibb.hoon+3389−140 jibb-dev/lib/jibb/prelude.jibb+241−4 my-app/mar/label.hoon+6 my-app/sur/blog.hoon+3−1 my-app/sur/import-fixture.hoon+7 tests/clay-fixtures/bridge-expected.txt+1 tests/clay-fixtures/bridge.txt+14 tests/clay-fixtures/ford-expected.txt+1 tests/clay-fixtures/ford-import-expected.txt+1 tests/clay-fixtures/ford-import.txt+12 tests/clay-fixtures/ford-nested-union-bridge-expected.txt+1 tests/clay-fixtures/ford-nested-union-bridge.txt+14 tests/clay-fixtures/ford-nested-union-expected.txt+1 tests/clay-fixtures/ford-nested-union.txt+9 tests/clay-fixtures/ford-recursive-expected.txt+1 tests/clay-fixtures/ford-recursive.txt+9 tests/clay-fixtures/ford.txt+13 tests/clay-fixtures/import-expected.txt+5 tests/clay-fixtures/import.txt+13 tests/clay-fixtures/mark-bridge-expected.txt+1 tests/clay-fixtures/mark-bridge.txt+11 tests/clay-fixtures/mark-import-expected.txt+1 tests/clay-fixtures/mark-import.txt+9 tests/clay-fixtures/mark-shape-expected.txt+1 tests/clay-fixtures/mark-shape.txt+14 tests/clay-fixtures/record-bridge-expected.txt+1 tests/clay-fixtures/record-bridge.txt+11 tests/golden/doc-grammar-04-step/about.txt+1 tests/golden/doc-grammar-04-step/modules.txt+1 tests/golden/doc-grammar-04-step/types.txt+3 tests/golden/doc-grammar-06-cart-store/about.txt+1 tests/golden/doc-grammar-06-cart-store/modules.txt+1 tests/golden/doc-grammar-06-cart-store/types.txt+7 tests/golden/module-cache-dag/about.txt+4 tests/golden/module-cache-dag/module-trees.txt+46 tests/golden/module-cache-dag/modules.txt+8 tests/golden/module-cache-dag/modules/ui/n0.jibb+3 tests/golden/module-cache-dag/modules/ui/n1.jibb+3 tests/golden/module-cache-dag/modules/ui/n2.jibb+3 tests/golden/module-cache-dag/modules/ui/n3.jibb+3 tests/golden/module-cache-dag/modules/ui/n4.jibb+3 tests/golden/module-cache-dag/modules/ui/n5.jibb+3 tests/golden/module-cache-dag/modules/ui/n6.jibb+3 tests/golden/module-cache-dag/modules/ui/n7.jibb+1 tests/golden/module-cache-dag/source.jibb+2 tests/golden/module-cache-dag/tokens.txt+14 tests/golden/module-cache-dag/tree.txt+5 tests/golden/module-cache-dag/types.txt+2 tests/golden/module-cache-faces/about.txt+4 tests/golden/module-cache-faces/module-trees.txt+4 tests/golden/module-cache-faces/modules.txt+1 tests/golden/module-cache-faces/modules/ui/shared.jibb+1 tests/golden/module-cache-faces/source.jibb+4 tests/golden/module-cache-faces/tokens.txt+28 tests/golden/module-cache-faces/tree.txt+9 tests/golden/module-cache-faces/types.txt+3 tests/golden/module-cache-incomplete/about.txt+4 tests/golden/module-cache-incomplete/module-trees.txt+8 tests/golden/module-cache-incomplete/modules.txt+1 tests/golden/module-cache-incomplete/modules/ui/bad.jibb+2 tests/golden/module-cache-incomplete/source.jibb+3 tests/golden/module-cache-incomplete/tokens.txt+21 tests/golden/module-cache-incomplete/tree.txt+6 tests/golden/module-cache-incomplete/types.txt+2 tests/golden/module-cache-sibling-cycle/about.txt+4 tests/golden/module-cache-sibling-cycle/module-trees.txt+15 tests/golden/module-cache-sibling-cycle/modules.txt+3 tests/golden/module-cache-sibling-cycle/modules/ui/a.jibb+3 tests/golden/module-cache-sibling-cycle/modules/ui/b.jibb+2 tests/golden/module-cache-sibling-cycle/modules/ui/safe.jibb+1 tests/golden/module-cache-sibling-cycle/source.jibb+3 tests/golden/module-cache-sibling-cycle/tokens.txt+18 tests/golden/module-cache-sibling-cycle/tree.txt+4 tests/golden/module-cache-sibling-cycle/types.txt+2 tests/golden/module-fixture-eof/about.txt+3 tests/golden/module-fixture-eof/module-trees.txt+4 tests/golden/module-fixture-eof/modules.txt+1 tests/golden/module-fixture-eof/modules/ui/incomplete.jibb+1 tests/golden/module-fixture-eof/source.jibb+1 tests/golden/module-fixture-eof/tokens.txt+4 tests/golden/module-fixture-eof/tree.txt+2 tests/golden/module-import-atom-scheme/about.txt+4 tests/golden/module-import-atom-scheme/module-trees.txt+13 tests/golden/module-import-atom-scheme/modules.txt+2 tests/golden/module-import-atom-scheme/modules/ui/base.jibb+3 tests/golden/module-import-atom-scheme/modules/ui/mid.jibb+2 tests/golden/module-import-atom-scheme/source.jibb+4 tests/golden/module-import-atom-scheme/tokens.txt+31 tests/golden/module-import-atom-scheme/tree.txt+13 tests/golden/module-import-atom-scheme/types.txt+10 tests/golden/module-import-cycle/about.txt+4 tests/golden/module-import-cycle/module-trees.txt+16 tests/golden/module-import-cycle/modules.txt+2 tests/golden/module-import-cycle/modules/ui/a.jibb+2 tests/golden/module-import-cycle/modules/ui/b.jibb+2 tests/golden/module-import-cycle/path.txt+1 tests/golden/module-import-cycle/source.jibb+2 tests/golden/module-import-cycle/tokens.txt+14 tests/golden/module-import-cycle/tree.txt+5 tests/golden/module-import-cycle/types.txt+2 tests/golden/module-import-empty/about.txt+4 tests/golden/module-import-empty/modules.txt+1 tests/golden/module-import-empty/source.jibb+2 tests/golden/module-import-empty/tokens.txt+14 tests/golden/module-import-empty/tree.txt+5 tests/golden/module-import-empty/types.txt+2 tests/golden/module-import-face-shadow/about.txt+4 tests/golden/module-import-face-shadow/module-trees.txt+4 tests/golden/module-import-face-shadow/modules.txt+1 tests/golden/module-import-face-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-face-shadow/source.jibb+4 tests/golden/module-import-face-shadow/tokens.txt+19 tests/golden/module-import-face-shadow/tree.txt+8 tests/golden/module-import-face-shadow/types.txt+2 tests/golden/module-import-identity/about.txt+4 tests/golden/module-import-identity/module-trees.txt+4 tests/golden/module-import-identity/modules.txt+1 tests/golden/module-import-identity/modules/ui/lib.jibb+1 tests/golden/module-import-identity/source.jibb+3 tests/golden/module-import-identity/tokens.txt+21 tests/golden/module-import-identity/tree.txt+8 tests/golden/module-import-identity/types.txt+3 tests/golden/module-import-invalid/about.txt+4 tests/golden/module-import-invalid/module-trees.txt+4 tests/golden/module-import-invalid/modules.txt+1 tests/golden/module-import-invalid/modules/ui/lib.jibb+1 tests/golden/module-import-invalid/source.jibb+2 tests/golden/module-import-invalid/tokens.txt+14 tests/golden/module-import-invalid/tree.txt+5 tests/golden/module-import-invalid/types.txt+2 tests/golden/module-import-missing-member/about.txt+4 tests/golden/module-import-missing-member/module-trees.txt+4 tests/golden/module-import-missing-member/modules.txt+1 tests/golden/module-import-missing-member/modules/ui/lib.jibb+1 tests/golden/module-import-missing-member/source.jibb+2 tests/golden/module-import-missing-member/tokens.txt+14 tests/golden/module-import-missing-member/tree.txt+5 tests/golden/module-import-missing-member/types.txt+2 tests/golden/module-import-mold/about.txt+4 tests/golden/module-import-mold/module-trees.txt+3 tests/golden/module-import-mold/modules.txt+1 tests/golden/module-import-mold/modules/ui/lib.jibb+1 tests/golden/module-import-mold/source.jibb+2 tests/golden/module-import-mold/tokens.txt+15 tests/golden/module-import-mold/tree.txt+6 tests/golden/module-import-mold/types.txt+2 tests/golden/module-import-prelude-cross-namespace/about.txt+4 tests/golden/module-import-prelude-cross-namespace/modules.txt+1 tests/golden/module-import-prelude-cross-namespace/source.jibb+1 tests/golden/module-import-prelude-cross-namespace/tokens.txt+7 tests/golden/module-import-prelude-cross-namespace/tree.txt+3 tests/golden/module-import-prelude-cross-namespace/types.txt+2 tests/golden/module-import-prelude-mold-shadow/about.txt+4 tests/golden/module-import-prelude-mold-shadow/modules.txt+1 tests/golden/module-import-prelude-mold-shadow/source.jibb+2 tests/golden/module-import-prelude-mold-shadow/tokens.txt+8 tests/golden/module-import-prelude-mold-shadow/tree.txt+3 tests/golden/module-import-prelude-mold-shadow/types.txt+2 tests/golden/module-import-prelude-sample-shadow/about.txt+4 tests/golden/module-import-prelude-sample-shadow/module-trees.txt+4 tests/golden/module-import-prelude-sample-shadow/modules.txt+1 tests/golden/module-import-prelude-sample-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-prelude-sample-shadow/source.jibb+2 tests/golden/module-import-prelude-sample-shadow/tokens.txt+14 tests/golden/module-import-prelude-sample-shadow/tree.txt+4 tests/golden/module-import-prelude-sample-shadow/types.txt+2 tests/golden/module-import-prelude-value-shadow/about.txt+4 tests/golden/module-import-prelude-value-shadow/module-trees.txt+4 tests/golden/module-import-prelude-value-shadow/modules.txt+1 tests/golden/module-import-prelude-value-shadow/modules/ui/lib.jibb+1 tests/golden/module-import-prelude-value-shadow/source.jibb+2 tests/golden/module-import-prelude-value-shadow/tokens.txt+11 tests/golden/module-import-prelude-value-shadow/tree.txt+3 tests/golden/module-import-prelude-value-shadow/types.txt+2 tests/golden/module-import-root-cycle/about.txt+4 tests/golden/module-import-root-cycle/module-trees.txt+8 tests/golden/module-import-root-cycle/modules.txt+1 tests/golden/module-import-root-cycle/modules/ui/a.jibb+2 tests/golden/module-import-root-cycle/path.txt+1 tests/golden/module-import-root-cycle/source.jibb+2 tests/golden/module-import-root-cycle/tokens.txt+17 tests/golden/module-import-root-cycle/tree.txt+7 tests/golden/module-import-root-cycle/types.txt+2 tests/golden/module-import-root-import-shadow/about.txt+4 tests/golden/module-import-root-import-shadow/imports.txt+1 tests/golden/module-import-root-import-shadow/mar/label.txt+5 tests/golden/module-import-root-import-shadow/marks.txt+1 tests/golden/module-import-root-import-shadow/modules.txt+1 tests/golden/module-import-root-import-shadow/source.jibb+4 tests/golden/module-import-root-import-shadow/sur/fixture.txt+3 tests/golden/module-import-root-import-shadow/tokens.txt+20 tests/golden/module-import-root-import-shadow/tree.txt+7 tests/golden/module-import-root-import-shadow/types.txt+3 tests/golden/module-import-separate-namespaces/about.txt+4 tests/golden/module-import-separate-namespaces/module-trees.txt+5 tests/golden/module-import-separate-namespaces/modules.txt+1 tests/golden/module-import-separate-namespaces/modules/ui/lib.jibb+2 tests/golden/module-import-separate-namespaces/source.jibb+3 tests/golden/module-import-separate-namespaces/tokens.txt+22 tests/golden/module-import-separate-namespaces/tree.txt+9 tests/golden/module-import-separate-namespaces/types.txt+3 tests/golden/module-import-sur-scope/about.txt+4 tests/golden/module-import-sur-scope/imports.txt+1 tests/golden/module-import-sur-scope/module-trees.txt+6 tests/golden/module-import-sur-scope/modules.txt+1 tests/golden/module-import-sur-scope/modules/ui/lib.jibb+1 tests/golden/module-import-sur-scope/source.jibb+4 tests/golden/module-import-sur-scope/sur/fixture.txt+3 tests/golden/module-import-sur-scope/tokens.txt+25 tests/golden/module-import-sur-scope/tree.txt+10 tests/golden/module-import-sur-scope/types.txt+2 tests/golden/module-import-transitive/about.txt+4 tests/golden/module-import-transitive/module-trees.txt+20 tests/golden/module-import-transitive/modules.txt+3 tests/golden/module-import-transitive/modules/ui/a.jibb+2 tests/golden/module-import-transitive/modules/ui/b.jibb+2 tests/golden/module-import-transitive/modules/ui/c.jibb+1 tests/golden/module-import-transitive/path.txt+1 tests/golden/module-import-transitive/source.jibb+2 tests/golden/module-import-transitive/tokens.txt+14 tests/golden/module-import-transitive/tree.txt+5 tests/golden/module-import-transitive/types.txt+2 tests/golden/module-import-unused-invalid/about.txt+4 tests/golden/module-import-unused-invalid/module-trees.txt+8 tests/golden/module-import-unused-invalid/modules.txt+2 tests/golden/module-import-unused-invalid/modules/ui/good.jibb+1 tests/golden/module-import-unused-invalid/modules/ui/unused.jibb+1 tests/golden/module-import-unused-invalid/source.jibb+2 tests/golden/module-import-unused-invalid/tokens.txt+14 tests/golden/module-import-unused-invalid/tree.txt+5 tests/golden/module-import-unused-invalid/types.txt+2 tests/golden/prelude-1c-structural/about.txt+4 tests/golden/prelude-1c-structural/source.jibb+122 tests/golden/prelude-1c-structural/tokens.txt+731 tests/golden/prelude-1c-structural/tree.txt+290 tests/golden/prelude-1c-structural/types.txt+37 tests/golden/prelude-3g-basic/about.txt+4 tests/golden/prelude-3g-basic/source.jibb+62 tests/golden/prelude-3g-basic/tokens.txt+354 tests/golden/prelude-3g-basic/tree.txt+156 tests/golden/prelude-3g-basic/types.txt+15 tests/golden/prelude-3g-like/about.txt+4 tests/golden/prelude-3g-like/source.jibb+102 tests/golden/prelude-3g-like/tokens.txt+613 tests/golden/prelude-3g-like/tree.txt+248 tests/golden/prelude-3g-like/types.txt+30 tests/golden/prelude-3g-structural/about.txt+4 tests/golden/prelude-3g-structural/source.jibb+95 tests/golden/prelude-3g-structural/tokens.txt+564 tests/golden/prelude-3g-structural/tree.txt+228 tests/golden/prelude-3g-structural/types.txt+28 tests/golden/prelude-list-helpers/about.txt+4 tests/golden/prelude-list-helpers/source.jibb+140 tests/golden/prelude-list-helpers/tokens.txt+853 tests/golden/prelude-list-helpers/tree.txt+346 tests/golden/prelude-list-helpers/types.txt+41 tests/golden/prelude-list-unit/about.txt+1−1 tests/golden/prelude-list-unit/source.jibb+8−6 tests/golden/prelude-list-unit/tokens.txt+86−72 tests/golden/prelude-list-unit/tree.txt+37−31 tests/golden/prelude-list-unit/types.txt+2−2 tests/golden/prelude-unit-list-transforms/about.txt+4 tests/golden/prelude-unit-list-transforms/source.jibb+286 tests/golden/prelude-unit-list-transforms/tokens.txt+1783 tests/golden/prelude-unit-list-transforms/tree.txt+774 tests/golden/prelude-unit-list-transforms/types.txt+58 tests/golden/types-capital-distinct/about.txt+4 tests/golden/types-capital-distinct/source.jibb+6 tests/golden/types-capital-distinct/tokens.txt+73 tests/golden/types-capital-distinct/tree.txt+33 tests/golden/types-capital-distinct/types.txt+19 tests/golden/types-generic-arity/about.txt+4 tests/golden/types-generic-arity/source.jibb+4 tests/golden/types-generic-arity/tokens.txt+64 tests/golden/types-generic-arity/tree.txt+23 tests/golden/types-generic-arity/types.txt+5 tests/golden/types-generic-face-inference/about.txt+4 tests/golden/types-generic-face-inference/source.jibb+8 tests/golden/types-generic-face-inference/tokens.txt+134 tests/golden/types-generic-face-inference/tree.txt+56 tests/golden/types-generic-face-inference/types.txt+13 tests/golden/types-generic-gates/about.txt+4 tests/golden/types-generic-gates/source.jibb+4 tests/golden/types-generic-gates/tokens.txt+59 tests/golden/types-generic-gates/tree.txt+21 tests/golden/types-generic-gates/types.txt+5 tests/golden/types-generic-import-reverse/about.txt+4 tests/golden/types-generic-import-reverse/module-trees.txt+7 tests/golden/types-generic-import-reverse/modules.txt+1 tests/golden/types-generic-import-reverse/modules/ui/lib.jibb+1 tests/golden/types-generic-import-reverse/source.jibb+3 tests/golden/types-generic-import-reverse/tokens.txt+50 tests/golden/types-generic-import-reverse/tree.txt+18 tests/golden/types-generic-import-reverse/types.txt+3 tests/golden/types-generic-lexical-alias/about.txt+4 tests/golden/types-generic-lexical-alias/source.jibb+3 tests/golden/types-generic-lexical-alias/tokens.txt+35 tests/golden/types-generic-lexical-alias/tree.txt+13 tests/golden/types-generic-lexical-alias/types.txt+4 tests/golden/types-generic-local-parameter/about.txt+4 tests/golden/types-generic-local-parameter/source.jibb+3 tests/golden/types-generic-local-parameter/tokens.txt+37 tests/golden/types-generic-local-parameter/tree.txt+15 tests/golden/types-generic-local-parameter/types.txt+2 tests/golden/types-generic-local-scope/about.txt+4 tests/golden/types-generic-local-scope/source.jibb+3 tests/golden/types-generic-local-scope/tokens.txt+37 tests/golden/types-generic-local-scope/tree.txt+15 tests/golden/types-generic-local-scope/types.txt+2 tests/golden/types-generic-module/about.txt+4 tests/golden/types-generic-module/module-trees.txt+7 tests/golden/types-generic-module/modules.txt+1 tests/golden/types-generic-module/modules/ui/lib.jibb+1 tests/golden/types-generic-module/source.jibb+3 tests/golden/types-generic-module/tokens.txt+39 tests/golden/types-generic-module/tree.txt+14 tests/golden/types-generic-module/types.txt+3 tests/golden/types-generic-nested-scope/about.txt+4 tests/golden/types-generic-nested-scope/source.jibb+3 tests/golden/types-generic-nested-scope/tokens.txt+56 tests/golden/types-generic-nested-scope/tree.txt+21 tests/golden/types-generic-nested-scope/types.txt+4 tests/golden/types-generic-parameters/about.txt+4 tests/golden/types-generic-parameters/source.jibb+4 tests/golden/types-generic-parameters/tokens.txt+64 tests/golden/types-generic-parameters/tree.txt+23 tests/golden/types-generic-parameters/types.txt+5 tests/golden/types-generic-record/about.txt+4 tests/golden/types-generic-record/source.jibb+3 tests/golden/types-generic-record/tokens.txt+47 tests/golden/types-generic-record/tree.txt+18 tests/golden/types-generic-record/types.txt+4 tests/golden/types-generic-recursive-union/about.txt+4 tests/golden/types-generic-recursive-union/source.jibb+6 tests/golden/types-generic-recursive-union/tokens.txt+58 tests/golden/types-generic-recursive-union/tree.txt+24 tests/golden/types-generic-recursive-union/types.txt+5 tests/golden/types-generic-repeated/about.txt+4 tests/golden/types-generic-repeated/source.jibb+3 tests/golden/types-generic-repeated/tokens.txt+47 tests/golden/types-generic-repeated/tree.txt+18 tests/golden/types-generic-repeated/types.txt+10 tests/golden/types-generic-union-alias-face/about.txt+4 tests/golden/types-generic-union-alias-face/module-trees.txt+11 tests/golden/types-generic-union-alias-face/modules.txt+1 tests/golden/types-generic-union-alias-face/modules/ui/base.jibb+3 tests/golden/types-generic-union-alias-face/source.jibb+6 tests/golden/types-generic-union-alias-face/tokens.txt+75 tests/golden/types-generic-union-alias-face/tree.txt+24 tests/golden/types-generic-union-alias-face/types.txt+12 tests/golden/types-generic-union-alias/about.txt+4 tests/golden/types-generic-union-alias/source.jibb+23 tests/golden/types-generic-union-alias/tokens.txt+248 tests/golden/types-generic-union-alias/tree.txt+86 tests/golden/types-generic-union-alias/types.txt+22 tests/golden/types-generic-union-capitals/about.txt+4 tests/golden/types-generic-union-capitals/source.jibb+17 tests/golden/types-generic-union-capitals/tokens.txt+162 tests/golden/types-generic-union-capitals/tree.txt+68 tests/golden/types-generic-union-capitals/types.txt+34 tests/golden/types-generic-union-errors/about.txt+4 tests/golden/types-generic-union-errors/source.jibb+11 tests/golden/types-generic-union-errors/tokens.txt+93 tests/golden/types-generic-union-errors/tree.txt+36 tests/golden/types-generic-union-errors/types.txt+26 tests/golden/types-generic-union-escaping/about.txt+4 tests/golden/types-generic-union-escaping/module-trees.txt+16 tests/golden/types-generic-union-escaping/modules.txt+2 tests/golden/types-generic-union-escaping/modules/ui/base.jibb+3 tests/golden/types-generic-union-escaping/modules/ui/mid.jibb+3 tests/golden/types-generic-union-escaping/source.jibb+3 tests/golden/types-generic-union-escaping/tokens.txt+15 tests/golden/types-generic-union-escaping/tree.txt+4 tests/golden/types-generic-union-escaping/types.txt+3 tests/golden/types-generic-union-import/about.txt+4 tests/golden/types-generic-union-import/module-trees.txt+32 tests/golden/types-generic-union-import/modules.txt+2 tests/golden/types-generic-union-import/modules/ui/shared.jibb+4 tests/golden/types-generic-union-import/modules/ui/twin.jibb+4 tests/golden/types-generic-union-import/source.jibb+9 tests/golden/types-generic-union-import/tokens.txt+79 tests/golden/types-generic-union-import/tree.txt+27 tests/golden/types-generic-union-import/types.txt+7 tests/golden/types-generic-union-local/about.txt+4 tests/golden/types-generic-union-local/source.jibb+34 tests/golden/types-generic-union-local/tokens.txt+297 tests/golden/types-generic-union-local/tree.txt+120 tests/golden/types-generic-union-local/types.txt+22 tests/golden/types-generic-union-transitive/about.txt+4 tests/golden/types-generic-union-transitive/module-trees.txt+27 tests/golden/types-generic-union-transitive/modules.txt+2 tests/golden/types-generic-union-transitive/modules/ui/base.jibb+3 tests/golden/types-generic-union-transitive/modules/ui/mid.jibb+4 tests/golden/types-generic-union-transitive/source.jibb+5 tests/golden/types-generic-union-transitive/tokens.txt+43 tests/golden/types-generic-union-transitive/tree.txt+15 tests/golden/types-generic-union-transitive/types.txt+5 tests/golden/types-import-duplicate-mark/about.txt+4 tests/golden/types-import-duplicate-mark/mar/duplicate.txt+5 tests/golden/types-import-duplicate-mark/marks.txt+1 tests/golden/types-import-duplicate-mark/source.jibb+2 tests/golden/types-import-duplicate-mark/tokens.txt+11 tests/golden/types-import-duplicate-mark/tree.txt+6 tests/golden/types-import-duplicate-mark/types.txt+2 tests/golden/types-import-duplicate-sur/about.txt+4 tests/golden/types-import-duplicate-sur/imports.txt+3 tests/golden/types-import-duplicate-sur/source.jibb+5 tests/golden/types-import-duplicate-sur/sur/fixture.txt+6 tests/golden/types-import-duplicate-sur/tokens.txt+35 tests/golden/types-import-duplicate-sur/tree.txt+18 tests/golden/types-import-duplicate-sur/types.txt+5 tests/golden/types-import-mark-record/about.txt+4 tests/golden/types-import-mark-record/mar/choice.txt+5 tests/golden/types-import-mark-record/mar/note.txt+5 tests/golden/types-import-mark-record/marks.txt+2 tests/golden/types-import-mark-record/source.jibb+5 tests/golden/types-import-mark-record/tokens.txt+30 tests/golden/types-import-mark-record/tree.txt+15 tests/golden/types-import-mark-record/types.txt+4 tests/golden/types-import-mark/about.txt+4 tests/golden/types-import-mark/imports.txt+1 tests/golden/types-import-mark/mar/label.txt+5 tests/golden/types-import-mark/marks.txt+1 tests/golden/types-import-mark/source.jibb+4 tests/golden/types-import-mark/sur/fixture.txt+3 tests/golden/types-import-mark/tokens.txt+22 tests/golden/types-import-mark/tree.txt+11 tests/golden/types-import-mark/types.txt+3 tests/golden/types-import-missing-mold/about.txt+4 tests/golden/types-import-missing-mold/imports.txt+1 tests/golden/types-import-missing-mold/source.jibb+2 tests/golden/types-import-missing-mold/sur/fixture.txt+3 tests/golden/types-import-missing-mold/tokens.txt+11 tests/golden/types-import-missing-mold/tree.txt+6 tests/golden/types-import-missing-mold/types.txt+2 tests/golden/types-import-sur-record-graph/about.txt+4 tests/golden/types-import-sur-record-graph/imports.txt+1 tests/golden/types-import-sur-record-graph/module-trees.txt+7 tests/golden/types-import-sur-record-graph/modules.txt+1 tests/golden/types-import-sur-record-graph/modules/ui/lib.jibb+2 tests/golden/types-import-sur-record-graph/source.jibb+2 tests/golden/types-import-sur-record-graph/sur/fixture.txt+3 tests/golden/types-import-sur-record-graph/tokens.txt+32 tests/golden/types-import-sur-record-graph/tree.txt+13 tests/golden/types-import-sur-record-graph/types.txt+2 tests/golden/types-import-sur/about.txt+4 tests/golden/types-import-sur/imports.txt+2 tests/golden/types-import-sur/source.jibb+3 tests/golden/types-import-sur/sur/fixture.txt+4 tests/golden/types-import-sur/tokens.txt+19 tests/golden/types-import-sur/tree.txt+10 tests/golden/types-import-sur/types.txt+3 tests/golden/types-list-branch/about.txt+4 tests/golden/types-list-branch/modules.txt+1 tests/golden/types-list-branch/source.jibb+81 tests/golden/types-list-branch/tokens.txt+521 tests/golden/types-list-branch/tree.txt+237 tests/golden/types-list-branch/types.txt+41 tests/golden/types-list-cons/about.txt+4 tests/golden/types-list-cons/modules.txt+1 tests/golden/types-list-cons/source.jibb+20 tests/golden/types-list-cons/tokens.txt+217 tests/golden/types-list-cons/tree.txt+85 tests/golden/types-list-cons/types.txt+29 tests/golden/types-list-context/about.txt+4 tests/golden/types-list-context/modules.txt+1 tests/golden/types-list-context/source.jibb+17 tests/golden/types-list-context/tokens.txt+143 tests/golden/types-list-context/tree.txt+59 tests/golden/types-list-context/types.txt+18 tests/golden/types-list-imported/about.txt+4 tests/golden/types-list-imported/imports.txt+2 tests/golden/types-list-imported/modules.txt+1 tests/golden/types-list-imported/source.jibb+14 tests/golden/types-list-imported/sur/fixture.txt+4 tests/golden/types-list-imported/tokens.txt+109 tests/golden/types-list-imported/tree.txt+52 tests/golden/types-list-imported/types.txt+22 tests/golden/types-list-pattern-imported/about.txt+4 tests/golden/types-list-pattern-imported/imports.txt+2 tests/golden/types-list-pattern-imported/modules.txt+1 tests/golden/types-list-pattern-imported/source.jibb+13 tests/golden/types-list-pattern-imported/sur/fixture.txt+5 tests/golden/types-list-pattern-imported/tokens.txt+66 tests/golden/types-list-pattern-imported/tree.txt+32 tests/golden/types-list-pattern-imported/types.txt+4 tests/golden/types-list-patterns/about.txt+4 tests/golden/types-list-patterns/modules.txt+1 tests/golden/types-list-patterns/source.jibb+64 tests/golden/types-list-patterns/tokens.txt+359 tests/golden/types-list-patterns/tree.txt+168 tests/golden/types-list-patterns/types.txt+17 tests/golden/types-list-zero-fit/about.txt+4 tests/golden/types-list-zero-fit/modules.txt+1 tests/golden/types-list-zero-fit/source.jibb+8 tests/golden/types-list-zero-fit/tokens.txt+181 tests/golden/types-list-zero-fit/tree.txt+91 tests/golden/types-list-zero-fit/types.txt+27 tests/golden/types-local-capitals/about.txt+4 tests/golden/types-local-capitals/modules.txt+1 tests/golden/types-local-capitals/source.jibb+73 tests/golden/types-local-capitals/tokens.txt+473 tests/golden/types-local-capitals/tree.txt+229 tests/golden/types-local-capitals/types.txt+28 tests/golden/types-local-recursive/about.txt+4 tests/golden/types-local-recursive/modules.txt+1 tests/golden/types-local-recursive/source.jibb+54 tests/golden/types-local-recursive/tokens.txt+351 tests/golden/types-local-recursive/tree.txt+170 tests/golden/types-local-recursive/types.txt+12 tests/golden/types-missing-tag-context/about.txt+4 tests/golden/types-missing-tag-context/modules.txt+1 tests/golden/types-missing-tag-context/source.jibb+17 tests/golden/types-missing-tag-context/tokens.txt+98 tests/golden/types-missing-tag-context/tree.txt+45 tests/golden/types-missing-tag-context/types.txt+38 tests/golden/types-missing-tag-imported/about.txt+4 tests/golden/types-missing-tag-imported/imports.txt+2 tests/golden/types-missing-tag-imported/source.jibb+6 tests/golden/types-missing-tag-imported/sur/fixture.txt+21 tests/golden/types-missing-tag-imported/tokens.txt+43 tests/golden/types-missing-tag-imported/tree.txt+18 tests/golden/types-missing-tag-imported/types.txt+12 tests/golden/types-missing-tag-named/about.txt+4 tests/golden/types-missing-tag-named/modules.txt+1 tests/golden/types-missing-tag-named/source.jibb+23 tests/golden/types-missing-tag-named/tokens.txt+155 tests/golden/types-missing-tag-named/tree.txt+66 tests/golden/types-missing-tag-named/types.txt+66 tests/golden/types-module-fixtures/about.txt+4 tests/golden/types-module-fixtures/module-trees.txt+13 tests/golden/types-module-fixtures/modules.txt+2 tests/golden/types-module-fixtures/modules/ui/api/blog.jibb+5 tests/golden/types-module-fixtures/modules/ui/components/card.jibb+5 tests/golden/types-module-fixtures/path.txt+1 tests/golden/types-module-fixtures/source.jibb+9 tests/golden/types-module-fixtures/tokens.txt+62 tests/golden/types-module-fixtures/tree.txt+23 tests/golden/types-module-fixtures/types.txt+2 tests/golden/types-module-mixed/about.txt+4 tests/golden/types-module-mixed/imports.txt+1 tests/golden/types-module-mixed/mar/label.txt+5 tests/golden/types-module-mixed/marks.txt+1 tests/golden/types-module-mixed/module-trees.txt+6 tests/golden/types-module-mixed/modules.txt+1 tests/golden/types-module-mixed/modules/ui/helper.jibb+1 tests/golden/types-module-mixed/source.jibb+5 tests/golden/types-module-mixed/sur/fixture.txt+3 tests/golden/types-module-mixed/tokens.txt+29 tests/golden/types-module-mixed/tree.txt+12 tests/golden/types-module-mixed/types.txt+3 tests/golden/types-multi-call/about.txt+4 tests/golden/types-multi-call/modules.txt+1 tests/golden/types-multi-call/source.jibb+42 tests/golden/types-multi-call/tokens.txt+370 tests/golden/types-multi-call/tree.txt+169 tests/golden/types-multi-call/types.txt+100 tests/golden/types-multi-import/about.txt+4 tests/golden/types-multi-import/module-trees.txt+16 tests/golden/types-multi-import/modules.txt+1 tests/golden/types-multi-import/modules/ui/lib.jibb+5 tests/golden/types-multi-import/source.jibb+5 tests/golden/types-multi-import/tokens.txt+43 tests/golden/types-multi-import/tree.txt+20 tests/golden/types-multi-import/types.txt+17 tests/golden/types-null-context/about.txt+4 tests/golden/types-null-context/source.jibb+8 tests/golden/types-null-context/tokens.txt+57 tests/golden/types-null-context/tree.txt+25 tests/golden/types-null-context/types.txt+13 tests/golden/types-null-overlap/about.txt+4 tests/golden/types-null-overlap/source.jibb+3 tests/golden/types-null-overlap/tokens.txt+8 tests/golden/types-null-overlap/tree.txt+3 tests/golden/types-null-overlap/types.txt+8 tests/golden/types-null-unresolved/about.txt+4 tests/golden/types-null-unresolved/source.jibb+18 tests/golden/types-null-unresolved/tokens.txt+79 tests/golden/types-null-unresolved/tree.txt+34 tests/golden/types-null-unresolved/types.txt+9 tests/golden/types-partial-atom-alias/about.txt+4 tests/golden/types-partial-atom-alias/source.jibb+10 tests/golden/types-partial-atom-alias/tokens.txt+67 tests/golden/types-partial-atom-alias/tree.txt+31 tests/golden/types-partial-atom-alias/types.txt+21 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+27 tests/golden/types-partial-atom-widening/about.txt+4 tests/golden/types-partial-atom-widening/source.jibb+9 tests/golden/types-partial-atom-widening/tokens.txt+79 tests/golden/types-partial-atom-widening/tree.txt+35 tests/golden/types-partial-atom-widening/types.txt+16 tests/golden/types-partial-aura-family/about.txt+4 tests/golden/types-partial-aura-family/source.jibb+10 tests/golden/types-partial-aura-family/tokens.txt+100 tests/golden/types-partial-aura-family/tree.txt+44 tests/golden/types-partial-aura-family/types.txt+23 tests/golden/types-partial-aura/about.txt+1−1 tests/golden/types-partial-aura/types.txt+7−1 tests/golden/types-partial-bare-atom/about.txt+4−3 tests/golden/types-partial-bare-atom/types.txt+2−2 tests/golden/types-partial-branch-widening/about.txt+4 tests/golden/types-partial-branch-widening/source.jibb+20 tests/golden/types-partial-branch-widening/tokens.txt+96 tests/golden/types-partial-branch-widening/tree.txt+49 tests/golden/types-partial-branch-widening/types.txt+12 tests/golden/types-partial-conflicting-sites/about.txt+4 tests/golden/types-partial-conflicting-sites/source.jibb+5 tests/golden/types-partial-conflicting-sites/tokens.txt+33 tests/golden/types-partial-conflicting-sites/tree.txt+15 tests/golden/types-partial-conflicting-sites/types.txt+23 tests/golden/types-partial-decimal-default/about.txt+7 tests/golden/types-partial-decimal-default/source.jibb+6 tests/golden/types-partial-decimal-default/tokens.txt+34 tests/golden/types-partial-decimal-default/tree.txt+12 tests/golden/types-partial-decimal-default/types.txt+7 tests/golden/types-partial-independent-atoms/about.txt+4 tests/golden/types-partial-independent-atoms/source.jibb+2 tests/golden/types-partial-independent-atoms/tokens.txt+21 tests/golden/types-partial-independent-atoms/tree.txt+11 tests/golden/types-partial-independent-atoms/types.txt+3 tests/golden/types-partial-local-molds/about.txt+10 tests/golden/types-partial-local-molds/source.jibb+39 tests/golden/types-partial-local-molds/tokens.txt+170 tests/golden/types-partial-local-molds/tree.txt+80 tests/golden/types-partial-local-molds/types.txt+11 tests/golden/types-partial-locals/about.txt+8 tests/golden/types-partial-locals/source.jibb+44 tests/golden/types-partial-locals/tokens.txt+239 tests/golden/types-partial-locals/tree.txt+122 tests/golden/types-partial-locals/types.txt+32 tests/golden/types-partial-many-atom-constraints/about.txt+4 tests/golden/types-partial-many-atom-constraints/source.jibb+13 tests/golden/types-partial-many-atom-constraints/tokens.txt+90 tests/golden/types-partial-many-atom-constraints/tree.txt+44 tests/golden/types-partial-many-atom-constraints/types.txt+26 tests/golden/types-partial-mold-bare-aura/about.txt+2−2 tests/golden/types-partial-mold-bare-aura/types.txt+1−1 tests/golden/types-partial-occurs/types.txt+6 tests/golden/types-partial-shared-tvar/types.txt+6 tests/golden/types-partial-union-cases/types.txt+21−3 tests/golden/types-partial-union-edges/about.txt+3 tests/golden/types-partial-union-edges/source.jibb+24 tests/golden/types-partial-union-edges/tokens.txt+97 tests/golden/types-partial-union-edges/tree.txt+33 tests/golden/types-partial-union-edges/types.txt+15 tests/golden/types-partial-unresolved-tag/about.txt+1−1 tests/golden/types-partial-unresolved-tag/types.txt+1−1 tests/golden/types-prelude-direct/about.txt+4 tests/golden/types-prelude-direct/modules.txt+1 tests/golden/types-prelude-direct/source.jibb+5 tests/golden/types-prelude-direct/tokens.txt+53 tests/golden/types-prelude-direct/tree.txt+25 tests/golden/types-prelude-direct/types.txt+6 tests/golden/types-prelude-interface/about.txt+4 tests/golden/types-prelude-interface/module-trees.txt+13 tests/golden/types-prelude-interface/modules.txt+2 tests/golden/types-prelude-interface/modules/ui/left.jibb+1 tests/golden/types-prelude-interface/modules/ui/right.jibb+1 tests/golden/types-prelude-interface/source.jibb+10 tests/golden/types-prelude-interface/tokens.txt+81 tests/golden/types-prelude-interface/tree.txt+33 tests/golden/types-prelude-interface/types.txt+9 tests/golden/types-prelude-list-functions/about.txt+4 tests/golden/types-prelude-list-functions/module-trees.txt+11 tests/golden/types-prelude-list-functions/modules.txt+1 tests/golden/types-prelude-list-functions/modules/ui/lib.jibb+2 tests/golden/types-prelude-list-functions/source.jibb+18 tests/golden/types-prelude-list-functions/tokens.txt+183 tests/golden/types-prelude-list-functions/tree.txt+87 tests/golden/types-prelude-list-functions/types.txt+28 tests/golden/types-prelude-unit-helpers/about.txt+4 tests/golden/types-prelude-unit-helpers/modules.txt+1 tests/golden/types-prelude-unit-helpers/source.jibb+11 tests/golden/types-prelude-unit-helpers/tokens.txt+131 tests/golden/types-prelude-unit-helpers/tree.txt+75 tests/golden/types-prelude-unit-helpers/types.txt+16 tests/golden/types-record-bound-variable/about.txt+4 tests/golden/types-record-bound-variable/source.jibb+6 tests/golden/types-record-bound-variable/tokens.txt+65 tests/golden/types-record-bound-variable/tree.txt+33 tests/golden/types-record-bound-variable/types.txt+5 tests/golden/types-record-cast-context/about.txt+4 tests/golden/types-record-cast-context/modules.txt+1 tests/golden/types-record-cast-context/source.jibb+24 tests/golden/types-record-cast-context/tokens.txt+234 tests/golden/types-record-cast-context/tree.txt+105 tests/golden/types-record-cast-context/types.txt+49 tests/golden/types-record-change-generic/about.txt+4 tests/golden/types-record-change-generic/modules.txt+1 tests/golden/types-record-change-generic/source.jibb+11 tests/golden/types-record-change-generic/tokens.txt+169 tests/golden/types-record-change-generic/tree.txt+66 tests/golden/types-record-change-generic/types.txt+16 tests/golden/types-record-change/about.txt+4 tests/golden/types-record-change/modules.txt+1 tests/golden/types-record-change/source.jibb+19 tests/golden/types-record-change/tokens.txt+254 tests/golden/types-record-change/tree.txt+99 tests/golden/types-record-change/types.txt+42 tests/golden/types-record-faces/about.txt+4 tests/golden/types-record-faces/source.jibb+8 tests/golden/types-record-faces/tokens.txt+90 tests/golden/types-record-faces/tree.txt+41 tests/golden/types-record-faces/types.txt+15 tests/golden/types-record-import/about.txt+4 tests/golden/types-record-import/module-trees.txt+9 tests/golden/types-record-import/modules.txt+1 tests/golden/types-record-import/modules/ui/lib.jibb+1 tests/golden/types-record-import/source.jibb+3 tests/golden/types-record-import/tokens.txt+36 tests/golden/types-record-import/tree.txt+16 tests/golden/types-record-import/types.txt+3 tests/golden/types-record-local-scheme/about.txt+4 tests/golden/types-record-local-scheme/source.jibb+5 tests/golden/types-record-local-scheme/tokens.txt+44 tests/golden/types-record-local-scheme/tree.txt+20 tests/golden/types-record-local-scheme/types.txt+4 tests/golden/types-record-nested/about.txt+4 tests/golden/types-record-nested/source.jibb+4 tests/golden/types-record-nested/tokens.txt+54 tests/golden/types-record-nested/tree.txt+24 tests/golden/types-record-nested/types.txt+5 tests/golden/types-record-to-tuple/about.txt+4 tests/golden/types-record-to-tuple/source.jibb+4 tests/golden/types-record-to-tuple/tokens.txt+38 tests/golden/types-record-to-tuple/tree.txt+17 tests/golden/types-record-to-tuple/types.txt+5 tests/golden/types-recursion-scc-failures/about.txt+4 tests/golden/types-recursion-scc-failures/modules.txt+1 tests/golden/types-recursion-scc-failures/source.jibb+11 tests/golden/types-recursion-scc-failures/tokens.txt+90 tests/golden/types-recursion-scc-failures/tree.txt+45 tests/golden/types-recursion-scc-failures/types.txt+10 tests/golden/types-recursion-scc-groups/about.txt+4 tests/golden/types-recursion-scc-groups/modules.txt+1 tests/golden/types-recursion-scc-groups/source.jibb+9 tests/golden/types-recursion-scc-groups/tokens.txt+91 tests/golden/types-recursion-scc-groups/tree.txt+42 tests/golden/types-recursion-scc-groups/types.txt+10 tests/golden/types-recursion-scc-import-bad/about.txt+4 tests/golden/types-recursion-scc-import-bad/module-trees.txt+16 tests/golden/types-recursion-scc-import-bad/modules.txt+1 tests/golden/types-recursion-scc-import-bad/modules/ui/lib.jibb+3 tests/golden/types-recursion-scc-import-bad/source.jibb+2 tests/golden/types-recursion-scc-import-bad/tokens.txt+14 tests/golden/types-recursion-scc-import-bad/tree.txt+5 tests/golden/types-recursion-scc-import-bad/types.txt+2 tests/golden/types-recursion-scc-import/about.txt+4 tests/golden/types-recursion-scc-import/module-trees.txt+12 tests/golden/types-recursion-scc-import/modules.txt+1 tests/golden/types-recursion-scc-import/modules/ui/lib.jibb+2 tests/golden/types-recursion-scc-import/source.jibb+3 tests/golden/types-recursion-scc-import/tokens.txt+25 tests/golden/types-recursion-scc-import/tree.txt+12 tests/golden/types-recursion-scc-import/types.txt+3 tests/golden/types-recursion-scc-local/about.txt+4 tests/golden/types-recursion-scc-local/modules.txt+1 tests/golden/types-recursion-scc-local/source.jibb+11 tests/golden/types-recursion-scc-local/tokens.txt+80 tests/golden/types-recursion-scc-local/tree.txt+39 tests/golden/types-recursion-scc-local/types.txt+4 tests/golden/types-recursion-scc-order/about.txt+4 tests/golden/types-recursion-scc-order/modules.txt+1 tests/golden/types-recursion-scc-order/source.jibb+4 tests/golden/types-recursion-scc-order/tokens.txt+33 tests/golden/types-recursion-scc-order/tree.txt+15 tests/golden/types-recursion-scc-order/types.txt+5 tests/golden/types-recursion-scc-shadow/about.txt+4 tests/golden/types-recursion-scc-shadow/modules.txt+1 tests/golden/types-recursion-scc-shadow/source.jibb+3 tests/golden/types-recursion-scc-shadow/tokens.txt+30 tests/golden/types-recursion-scc-shadow/tree.txt+15 tests/golden/types-recursion-scc-shadow/types.txt+4 tests/golden/types-recursive-branch/about.txt+4 tests/golden/types-recursive-branch/modules.txt+1 tests/golden/types-recursive-branch/source.jibb+103 tests/golden/types-recursive-branch/tokens.txt+573 tests/golden/types-recursive-branch/tree.txt+306 tests/golden/types-recursive-branch/types.txt+50 tests/golden/types-recursive-gate/about.txt+4 tests/golden/types-recursive-gate/source.jibb+55 tests/golden/types-recursive-gate/tokens.txt+355 tests/golden/types-recursive-gate/tree.txt+176 tests/golden/types-recursive-gate/types.txt+42 tests/golden/types-recursive-sample/about.txt+4 tests/golden/types-recursive-sample/source.jibb+40 tests/golden/types-recursive-sample/tokens.txt+344 tests/golden/types-recursive-sample/tree.txt+161 tests/golden/types-recursive-sample/types.txt+40 tests/golden/types-string-interpolation/about.txt+4 tests/golden/types-string-interpolation/modules.txt+1 tests/golden/types-string-interpolation/source.jibb+28 tests/golden/types-string-interpolation/tokens.txt+259 tests/golden/types-string-interpolation/tree.txt+109 tests/golden/types-string-interpolation/types.txt+33 tests/golden/types-tuple-context-nested/about.txt+4 tests/golden/types-tuple-context-nested/modules.txt+1 tests/golden/types-tuple-context-nested/source.jibb+24 tests/golden/types-tuple-context-nested/tokens.txt+289 tests/golden/types-tuple-context-nested/tree.txt+140 tests/golden/types-tuple-context-nested/types.txt+55 tests/golden/types-tuple-context/about.txt+4 tests/golden/types-tuple-context/modules.txt+1 tests/golden/types-tuple-context/source.jibb+7 tests/golden/types-tuple-context/tokens.txt+109 tests/golden/types-tuple-context/tree.txt+55 tests/golden/types-tuple-context/types.txt+14 tests/golden/types-union-alias/about.txt+4 tests/golden/types-union-alias/source.jibb+5 tests/golden/types-union-alias/tokens.txt+23 tests/golden/types-union-alias/tree.txt+10 tests/golden/types-union-alias/types.txt+4 tests/golden/types-union-branch-context/about.txt+4 tests/golden/types-union-branch-context/source.jibb+54 tests/golden/types-union-branch-context/tokens.txt+237 tests/golden/types-union-branch-context/tree.txt+120 tests/golden/types-union-branch-context/types.txt+24 tests/golden/types-union-branch-pending/about.txt+4 tests/golden/types-union-branch-pending/source.jibb+24 tests/golden/types-union-branch-pending/tokens.txt+102 tests/golden/types-union-branch-pending/tree.txt+48 tests/golden/types-union-branch-pending/types.txt+6 tests/golden/types-union-constructor-shape/about.txt+4 tests/golden/types-union-constructor-shape/source.jibb+5 tests/golden/types-union-constructor-shape/tokens.txt+58 tests/golden/types-union-constructor-shape/tree.txt+24 tests/golden/types-union-constructor-shape/types.txt+12 tests/golden/types-union-context-flow/about.txt+4 tests/golden/types-union-context-flow/source.jibb+13 tests/golden/types-union-context-flow/tokens.txt+58 tests/golden/types-union-context-flow/tree.txt+26 tests/golden/types-union-context-flow/types.txt+6 tests/golden/types-union-finite-generic/about.txt+4 tests/golden/types-union-finite-generic/modules.txt+1 tests/golden/types-union-finite-generic/source.jibb+48 tests/golden/types-union-finite-generic/tokens.txt+336 tests/golden/types-union-finite-generic/tree.txt+143 tests/golden/types-union-finite-generic/types.txt+11 tests/golden/types-union-finite-limit/about.txt+4 tests/golden/types-union-finite-limit/modules.txt+1 tests/golden/types-union-finite-limit/source.jibb+35 tests/golden/types-union-finite-limit/tokens.txt+233 tests/golden/types-union-finite-limit/tree.txt+89 tests/golden/types-union-finite-limit/types.txt+10 tests/golden/types-union-finite/about.txt+4 tests/golden/types-union-finite/modules.txt+1 tests/golden/types-union-finite/source.jibb+45 tests/golden/types-union-finite/tokens.txt+238 tests/golden/types-union-finite/tree.txt+110 tests/golden/types-union-finite/types.txt+17 tests/golden/types-union-import/about.txt+4 tests/golden/types-union-import/module-trees.txt+8 tests/golden/types-union-import/modules.txt+1 tests/golden/types-union-import/modules/ui/lib.jibb+3 tests/golden/types-union-import/source.jibb+2 tests/golden/types-union-import/tokens.txt+13 tests/golden/types-union-import/tree.txt+4 tests/golden/types-union-import/types.txt+2 tests/golden/types-union-local-pending/about.txt+4 tests/golden/types-union-local-pending/source.jibb+3 tests/golden/types-union-local-pending/tokens.txt+10 tests/golden/types-union-local-pending/tree.txt+5 tests/golden/types-union-local-pending/types.txt+2 tests/golden/types-union-overlap-nested/about.txt+4 tests/golden/types-union-overlap-nested/source.jibb+4 tests/golden/types-union-overlap-nested/tokens.txt+21 tests/golden/types-union-overlap-nested/tree.txt+7 tests/golden/types-union-overlap-nested/types.txt+9 tests/golden/types-union-overlap/about.txt+4 tests/golden/types-union-overlap/source.jibb+4 tests/golden/types-union-overlap/tokens.txt+15 tests/golden/types-union-overlap/tree.txt+5 tests/golden/types-union-overlap/types.txt+9 tests/golden/types-union-patterns-generic/about.txt+4 tests/golden/types-union-patterns-generic/modules.txt+1 tests/golden/types-union-patterns-generic/source.jibb+36 tests/golden/types-union-patterns-generic/tokens.txt+255 tests/golden/types-union-patterns-generic/tree.txt+117 tests/golden/types-union-patterns-generic/types.txt+13 tests/golden/types-union-patterns-import/about.txt+4 tests/golden/types-union-patterns-import/module-trees.txt+8 tests/golden/types-union-patterns-import/modules.txt+1 tests/golden/types-union-patterns-import/modules/ui/lib.jibb+3 tests/golden/types-union-patterns-import/source.jibb+5 tests/golden/types-union-patterns-import/tokens.txt+28 tests/golden/types-union-patterns-import/tree.txt+12 tests/golden/types-union-patterns-import/types.txt+2 tests/golden/types-union-patterns/about.txt+4 tests/golden/types-union-patterns/modules.txt+1 tests/golden/types-union-patterns/source.jibb+74 tests/golden/types-union-patterns/tokens.txt+336 tests/golden/types-union-patterns/tree.txt+152 tests/golden/types-union-patterns/types.txt+25 tests/golden/types-union-phantom-generic/about.txt+4 tests/golden/types-union-phantom-generic/source.jibb+4 tests/golden/types-union-phantom-generic/tokens.txt+21 tests/golden/types-union-phantom-generic/tree.txt+8 tests/golden/types-union-phantom-generic/types.txt+3 tests/golden/types-union-print-cross-namespace/about.txt+4 tests/golden/types-union-print-cross-namespace/module-trees.txt+6 tests/golden/types-union-print-cross-namespace/modules.txt+1 tests/golden/types-union-print-cross-namespace/modules/ui/lib.jibb+4 tests/golden/types-union-print-cross-namespace/source.jibb+3 tests/golden/types-union-print-cross-namespace/tokens.txt+22 tests/golden/types-union-print-cross-namespace/tree.txt+9 tests/golden/types-union-print-cross-namespace/types.txt+3 tests/golden/types-union-print-distinct/about.txt+4 tests/golden/types-union-print-distinct/module-trees.txt+12 tests/golden/types-union-print-distinct/modules.txt+3 tests/golden/types-union-print-distinct/modules/ui/left.jibb+3 tests/golden/types-union-print-distinct/modules/ui/right.jibb+3 tests/golden/types-union-print-distinct/modules/ui/twin.jibb+3 tests/golden/types-union-print-distinct/source.jibb+11 tests/golden/types-union-print-distinct/tokens.txt+87 tests/golden/types-union-print-distinct/tree.txt+34 tests/golden/types-union-print-distinct/types.txt+9 tests/golden/types-union-print-escape/about.txt+4 tests/golden/types-union-print-escape/source.jibb+5 tests/golden/types-union-print-escape/tokens.txt+20 tests/golden/types-union-print-escape/tree.txt+8 tests/golden/types-union-print-escape/types.txt+2 tests/golden/types-union-print-local/about.txt+4 tests/golden/types-union-print-local/source.jibb+6 tests/golden/types-union-print-local/tokens.txt+28 tests/golden/types-union-print-local/tree.txt+12 tests/golden/types-union-print-local/types.txt+5 tests/golden/types-union-print-nested/about.txt+4 tests/golden/types-union-print-nested/source.jibb+7 tests/golden/types-union-print-nested/tokens.txt+42 tests/golden/types-union-print-nested/tree.txt+17 tests/golden/types-union-print-nested/types.txt+6 tests/golden/types-union-print-same-origin/about.txt+4 tests/golden/types-union-print-same-origin/module-trees.txt+4 tests/golden/types-union-print-same-origin/modules.txt+1 tests/golden/types-union-print-same-origin/modules/ui/shared.jibb+3 tests/golden/types-union-print-same-origin/source.jibb+5 tests/golden/types-union-print-same-origin/tokens.txt+35 tests/golden/types-union-print-same-origin/tree.txt+12 tests/golden/types-union-print-same-origin/types.txt+4 tests/golden/types-union-print-transitive/about.txt+4 tests/golden/types-union-print-transitive/module-trees.txt+8 tests/golden/types-union-print-transitive/modules.txt+2 tests/golden/types-union-print-transitive/modules/ui/base.jibb+3 tests/golden/types-union-print-transitive/modules/ui/mid.jibb+2 tests/golden/types-union-print-transitive/source.jibb+2 tests/golden/types-union-print-transitive/tokens.txt+15 tests/golden/types-union-print-transitive/tree.txt+6 tests/golden/types-union-print-transitive/types.txt+2 tests/golden/types-union-singleton/about.txt+4 tests/golden/types-union-singleton/source.jibb+16 tests/golden/types-union-singleton/tokens.txt+130 tests/golden/types-union-singleton/tree.txt+53 tests/golden/types-union-singleton/types.txt+33 tests/golden/types-union-tag-atoms/about.txt+4 tests/golden/types-union-tag-atoms/source.jibb+5 tests/golden/types-union-tag-atoms/tokens.txt+30 tests/golden/types-union-tag-atoms/tree.txt+11 tests/golden/types-union-tag-atoms/types.txt+12 tests/golden/types-union-tags/about.txt+4 tests/golden/types-union-tags/source.jibb+6 tests/golden/types-union-tags/tokens.txt+34 tests/golden/types-union-tags/tree.txt+15 tests/golden/types-union-tags/types.txt+11 tests/golden/types-union-unresolved-flow/about.txt+4 tests/golden/types-union-unresolved-flow/source.jibb+7 tests/golden/types-union-unresolved-flow/tokens.txt+31 tests/golden/types-union-unresolved-flow/tree.txt+12 tests/golden/types-union-unresolved-flow/types.txt+6 tests/golden/types-union-unresolved/about.txt+4 tests/golden/types-union-unresolved/source.jibb+1 tests/golden/types-union-unresolved/tokens.txt+4 tests/golden/types-union-unresolved/tree.txt+2 tests/golden/types-union-unresolved/types.txt+2 tests/golden/types-unit-construction/about.txt+4 tests/golden/types-unit-construction/modules.txt+1 tests/golden/types-unit-construction/source.jibb+29 tests/golden/types-unit-construction/tokens.txt+168 tests/golden/types-unit-construction/tree.txt+71 tests/golden/types-unit-construction/types.txt+32 tests/golden/types-unit-context/about.txt+4 tests/golden/types-unit-context/modules.txt+1 tests/golden/types-unit-context/source.jibb+46 tests/golden/types-unit-context/tokens.txt+489 tests/golden/types-unit-context/tree.txt+220 tests/golden/types-unit-context/types.txt+95 tests/golden/types-unit-patterns/about.txt+4 tests/golden/types-unit-patterns/source.jibb+36 tests/golden/types-unit-patterns/tokens.txt+180 tests/golden/types-unit-patterns/tree.txt+88 tests/golden/types-unit-patterns/types.txt+13 tests/importer/about.txt+18−2 tests/importer/ford.txt+9 tests/importer/mark-gate.txt+3 tests/importer/mark-list.txt+5 tests/importer/mark-recursive.txt+5 tests/importer/mark.txt+5 tests/importer/origin-first.txt+4 tests/importer/origin-other.txt+4 tests/importer/origin-transitive.txt+6 tests/importer/shadow-static.txt+7 tests/importer/shadow.txt+3 tests/importer/small.txt+60 tests/importer/tree.txt+116−2 tests/lib/jibb-bridge.hoon+36−2 tests/lib/jibb-import-diagnostic.hoon+59 tests/lib/jibb-import.hoon+19−1 tests/lib/jibb-mark-bridge.hoon+28 tests/lib/jibb-module-scope.hoon+96 tests/lib/jibb.hoon+1216−108 tests/type-import-diagnostic/about.txt+15 tests/type-import-diagnostic/expected.txt+109 tests/type-import-diagnostic/mark.txt+5 tests/type-import-diagnostic/nested.txt+11 tests/type-import-diagnostic/source.txt+13 tests/type-import-diagnostic/sur.txt+5 tests/type-import/about.txt+18−7 tests/type-import/expected.txt+84−3 tests/type-import/source.txt+48 tests/type-import/sur.txt+15−1 tests/type-mark/about.txt+7 tests/type-mark/collision.txt+3 tests/type-mark/declared.txt+2 tests/type-mark/expected.txt+19 tests/type-mark/missing.txt+1 tests/type-mark/sur.txt+2 tests/type-module-scope/about.txt+16 tests/type-module-scope/expected.txt+58 tools/clay-fixtures+159−1 tools/golden+148−19 tools/golden_case.py+99 tools/importer-test+11−2 tools/ship+197−4 tools/testdata/selftest+149 tools/testdata/ship-selftest+146 tools/type-import-diagnostic-test+43 tools/type-mark-test+35 tools/type-module-scope-test+39
README.md+3−3
@@ -16,7 +16,7 @@ Milestone 1 of the doc's eight, the parser and the `%jibb` mark, is done; milest
1616
1717## Golden tests
1818
19−Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline. A case may also have a `path.txt` specifying its logical `/ui/.../*.jibb` path. An `expect-types:` line in `about.txt` opts it into the provisional `golden-types` checker output in `types.txt`; `--update` creates it.
19+Each case, `tests/golden/<case>/`, holds `source.jibb`, `about.txt` (where it comes from, what it tests, the expected outcome), and the expected outputs: `tokens.txt` from the layout pass and `tree.txt` from the parser. A file holds the output plus one trailing newline. A case may also have a `path.txt` specifying its logical `/ui/.../*.jibb` path. An `expect-types:` line in `about.txt` opts it into the provisional `golden-types` checker output in `types.txt`; `--update` creates it. A case can select Hoon molds in `imports.txt` and provide each module in `sur/<module>.txt`, or select marks in `marks.txt` and provide their source in `mar/<name>.txt`. `modules.txt` selects Jibb source fixtures; their trees go in `module-trees.txt`, and the partial checker can resolve a subset of library imports. See [docs/development.md](docs/development.md).
2020
2121Run them without a ship. This needs `urbit` on PATH and Python 3.
2222
@@ -42,7 +42,7 @@ tools/hoon '(golden /a/b/jibb (crip "++ main view"))'
4242tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
4343```
4444
45−`tools/testdata/selftest` tests both tools against a stub library, and `tools/doc-blocks` against Markdown it writes. `tools/importer-test` compares the partial Hoon importer's fixture projections against their golden file. `tools/type-import-test` checks the importer/checker bridge under eval; the ship suite runs the same fixture.
45+`tools/testdata/selftest` tests both tools against a stub library, and `tools/doc-blocks` against Markdown it writes. `tools/importer-test` compares the partial Hoon importer's fixture projections against their golden file. `tools/type-import-test` and `tools/type-mark-test` check the importer/checker bridges under eval; the ship suite runs the same fixtures.
4646
4747### The doc's examples
4848
@@ -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 types read from the compiled graphs and passed to the partial checker. It compares the results with golden files under `tests/clay-fixtures/`.
9090
9191For anything else:
9292
docs/compiler.md+32−2
@@ -56,9 +56,39 @@ 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, 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, recursive or generic molds, dependency cycles or errors with both conflicting excerpts. 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 `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, faced and unfaced cells, cell sample binders, known record field reads, a two-binder cell pattern, a complete two-arm loobean branch, a complete two-arm unit-shaped branch, closed local mold aliases and acyclic forward value references. For a supported single syntactic top-level recursive gate, the checker infers the sample first and uses that exact sample, including its field faces, in a monomorphic self placeholder. The completed body must unify with the placeholder before the gate is generalized; incompatible recursive arguments can report the call and argument sites. Uses of generalized top-level definitions instantiate their schemes independently. For a complete loobean branch with one direct self-call arm, the checker can infer the other arm independently and use its closed, fully resolved type to seed the recursive result; it then checks the whole body. Open or pending base types do not seed the result, and other branch shapes still depend on the existing partial inference. A supported single local recursive gate also uses a monomorphic self reference while its body is checked, then generalizes variables free of its enclosing environment; captured variables remain shared. Acyclic local value definitions can refer forward. The checker collects written capitals per `++` before inference, excluding nested definitions: a capital used in an enclosing definition is shared with its locals, even when written later, while a capital introduced only in a local definition is generalized there. Sibling locals can introduce independent capitals with the same spelling; generic mold parameters keep their own scope. Top-level groups of syntactic gates are inferred together with monomorphic placeholders and shared substitutions, then generalized only after the whole group checks; downstream uses and library interfaces instantiate those schemes independently. A dependency graph identifies groups with two iterative depth-first passes; its conservative local-reference edges can reject otherwise valid programs. Local mutual groups, polymorphic recursion, value cycles, unresolved literal constraints and unresolved branch joins remain unsupported. Acyclic simple local mold aliases can also refer forward, and are scoped to the body, not its gate's sample. Nonrecursive generic aliases of supported molds can be applied at exact arity, including locally and through library interfaces; their parameters are lexical. Closed, provably disjoint nonrecursive unions and tagged single-case molds support contextual term values, `~` and `|=%tag` constructors. A null-headed cell can match a union case but does not supply a `|=%$` constructor; unresolved tags and nulls remain pending, with distinct partial-inference diagnostics. Nonrecursive top-level generic union molds with provably disjoint cases also support contextual tags and constructors at exact arity; their arguments are retained through generalization and supported library interfaces. Nonrecursive generic aliases can reorder, repeat or omit parameters while preserving a supported union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do mutually recursive local groups and recursive molds. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. A differing-variable face constraint remains unsupported. When inference forces two distinct explicitly written capitals equal, it reports both source sites; forcing a capital to a concrete type remains unsupported in this fragment. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, complete imports, general patterns, general deferred constraints, recursive molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`. Some known tuple and record positions acquire matching faces; other variable-dependent face merges, general branch tag context and ambiguous call-result propagation remain unsupported; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. For a single recursive gate outside a group, the reporting path repeats inference rather than instantiating its generalized interface inside its own body; a group report uses its stored schemes. This adds work, and 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, several collections, jar and jug in ordinary record fields, and direct `$^` unions whose source branches can be proved disjoint. Nested `$^`, nested collection arguments, 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+String interpolation infers its pieces in order and preserves substitutions and pending constraints. A piece with a known atom aura, unrestricted `@`, or a tape `(list @tD)` is accepted; an isolated decimal literal takes its normal `@ud` default. A known cell reports that it needs a printer, and an explicitly generic atom asks for an aura at its use site. Loobeans, term singletons, non-tape collections, open types and a type fixed only later remain unsupported in this fragment.
62+
63+A bare tag that provably matches no case of a known union reports the union and tag sites. This covers casts, single-argument calls, contextual unit payloads, list items and supported branch arms, including unnamed imported unions. Existing tags whose shape or payload does not fit retain the ordinary mismatch; unresolved tags stay pending.
64+
65+A change can replace uniquely named fields on a fully known, faced record spine, including through a nested wing. Replacements receive the field type as context, substitutions and pending constraints are retained, and the resulting type remains the original record. Missing fields, empty changes and definite replacement mismatches report sites; the expected-type site is the edit, since the original field declaration location is not retained. Unknown or partly unfaced spines, ambiguous fields and repeated edits remain unsupported. A cast to a known record also supplies field context to a tuple or record initializer, including nested list and union fields. The expected-type site is the cast mold; the original field declaration location is not retained. The cart-store example’s `init` and `update` infer in this fragment; store kind and declaration checking remain unfinished.
66+
67+For supported closed unions, the type printer keeps the union’s origin separate from its displayed name. It prints an in-scope name such as `msg` or `msg.lib`, including in records and gates; an accessible imported nongeneric alias may name a transitive union. A nongeneric body-local union that escapes its scope, or an origin without an accessible name, prints its cases separated by spaces, parenthesized when nested. That case-list form is print-only. A supported generic union prints its name and all arguments, including unused arguments; when its name is unavailable, the partial printer reports that limitation instead of dropping its arguments. Two faces for the same imported origin remain compatible; compatibility between distinct union origins, including in gate types, remains unsupported. Some comparisons of generic union arguments also remain unsupported rather than deciding equality or mismatch. The Hoon bridge also translates some imported unnamed unions into this representation; unsupported cases remain errors.
68+
69+Multi-argument calls form one right-nested sample: `f a b c` supplies `[a [b c]]`, with the last argument able to be a cell itself. The fragment fits the complete sample, preserving known faces and shared variables. Known sample positions can provide list or union context to arguments; unknown sample shapes use ordinary inference and some contextual forms remain unsupported. For a definite mismatch, the diagnostic points to a specific argument when it can establish which one failed; otherwise it reports the combined sample.
70+
71+A list literal can be inferred when a cast or known gate sample supplies a list type and the supplied prelude has the validated standard list definition. Empty, nonempty and nested literals work, including contextual union tags in elements; mismatched elements report the item and expected type. Imported Hoon lists share this representation. Under the same known context, `~` and zero-valued term literals fit an empty list, and a two-item unfaced cell `[head tail]` is a cons; cons cells and list literals can be nested. Mismatched heads or tails report both sites. A known list result also supplies context through complete loobean, unit-shaped and list-shaped branches, including recursive and nested branches. A known gate sample also supplies context to corresponding positions of a single tuple or record argument, including nested cells; a zero literal can therefore fit a list position. A bound zero constant still remains unsupported rather than a definite mismatch, and an unknown callee does not supply context. Faced or longer cells, uncontextualized construction, and a missing or altered prelude list remain unsupported. For a known standard list with a supported element type, it also infers a complete two-arm branch using `~` and `[item rest]`, in either order. The binders have the element and list types and cannot shadow or duplicate names. Unknown subjects, unsupported element types, other patterns and incomplete arms remain unsupported.
72+
73+A backtick constructs a unit when the supplied prelude has the validated standard `unit` template. Its payload is inferred normally, retaining pending literals and generic variables; nested units work and the prelude’s `some` becomes available. With ordinary result annotations, its `bind`, `biff`, `both` and `flit` also infer. A known unit in a cast, call, list item or record field supplies its payload context, including nested units and lists; definite mismatches identify the payload and context. Unrelated union identities, some variable-dependent fits, and missing or altered prelude templates remain unsupported.
74+
75+A known union of `~` and a null-headed cell can be matched by `~` and `[~ value]` arms in either order. The payload binder is checked for shadowing. Unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported; this fragment infers the prelude’s `fall` and `need` signatures.
76+
77+A known closed union with two or more arms can be matched when each arm provably covers or excludes each remaining case. The checker first tries whole cases; when a pattern splits a case, it can expand known `?` positions into their two noun values, up to 64 alternatives across the union. Binders retain the original case type, and one arm may bind several refinements of that case. It reports missing alternatives and arms already covered, checks tags by noun value, and supports imported and generic union cases. Other partial patterns, expansions above the limit, binders spanning distinct cases, differing arm result types and some complex two-arm subjects remain unsupported; contextual union-pattern branches also remain unsupported. The Grammar’s `step` block infers in this fragment, but its module is not yet checked.
78+
79+A known closed union can also provide context to each arm of a complete loobean or unit-shaped branch in a cast or a call with a known union sample. Nested branches and transparent groups work; a mismatch reports the expected union and the offending arm. General patterns and context through bodies with local definitions remain unsupported, and unrelated unresolved tags stay pending.
80+
81+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 are syntactically fixed atom molds and other fields are fixed atom molds or standard collections of static atom molds. Collection names must not be shadowed. The reader can also import a mark door sample, removing its outer sample face and validating its build subject. The reader checks explicit Hoon `$%`, `$?` and `$^` unions against the Grammar’s disjointness rule, as @iko confirmed on 2026-10-30. It re-evaluates statically recognizable source branches before Hoon can collapse them, checks materialized fork cases, and rejects shapes it cannot prove disjoint. Static records may also have verified standard-collection and `path` siblings. One direct explicit union argument in a standard list, set, map or unit is accepted when its call wrapper and collection provenance are verified and its static cases are pairwise disjoint. A synthetic regression checks that forged wrapper subjects, samples and tails are rejected. Other collection-union forms, nested ordered maps, general source-level disjointness and complete integration with the checker remain unfinished. `+golden-types-imports` can consume fixed-aura atoms, valid term singletons, nested faced or unfaced cells, unions of supported, pairwise-disjoint cases, and opaque standard collections with supported arguments from caller-supplied reader results for declared `/-` imports; `+golden-types-with-marks` accepts the same shapes for declared marks. The caller must pass unchanged results from the source-aware reader: the bridge validates the supplied graph but cannot detect source cases Hoon collapsed before that graph was built. The opaque collection types retain their names and arguments for identity, unification and printing. The validated standard prelude `list` mold shares the imported list representation; other Jibb-written collection molds and most prelude collection operations remain unsupported. 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. The reader validates direct zuse subjects and Ford subjects consisting of faced imported cores and a validated tail, checking imported cores transitively; it rejects shadowed names, inconsistent core subjects and other subject shapes. For a recursive reference, the reader matches the exact Hoon hold against named arms in validated cores, including transitive Ford imports; it rejects missing, unlabelled or ambiguous origins. 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 `tools/type-mark-test` compare bridge reports under eval and on the ship. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
82+
83+Self-recursive `/sur` molds can cross the bridge as opaque module-and-name identities when their supported source-aware graph passes validation. Aliases, foreign references, recursive marks, unfolding, construction and field access remain unsupported; the partial printer declines recursive names that are not in scope.
84+
85+Callers that have a `/sur` core and a name can use `+read-named`: it checks for a locally declared arm before asking Hoon to evaluate the mold, and reports evaluation failures with the final Hoon trace line. `+read-mold-in` remains available when the caller already has the selected type. The opt-in `+read-named-diagnostic` and `+read-mark-diagnostic` preserve successful graphs and distinguish definite `%invalid` aura and core evidence emitted directly by the reader from `%unsupported` failures. Other failures, including unverified union disjointness and vase recognition based only on a name, remain unsupported. These entry points revalidate and re-walk failed types; the opt-in `+golden-types-with-reader-diagnostics` accepts unchanged structured reader results and reports definite aura or core errors at their imported mold use sites, when the import and supplied input are unique. Ordered replay covers direct and nested cell samples, record and function casts, and non-generic same-module aliases; it stops at an unsupported prefix, cycle or shadowing failure. Union molds, generic applications, transitive modules and unsupported reader outcomes still report generic limitations. Replay repeats inference and may add work; this entry point remains partial. Existing checker entry points continue treating failed imports as unsupported. It also fails closed on repeated field faces along an imported record spine, including recursive roots; the diagnostic remains generic. Hoon type graphs can erase unfaced nested-cell boundaries, so the check may conservatively reject a valid source with equal names in distinct erased scopes. Faced nested records and union alternatives keep separate scopes.
86+
87+`+golden-types-with-prelude` accepts case-local Jibb module sources alongside `/sur` and mark results and the vendored prelude source. It resolves reachable ordinary library modules in dependency order, caching completed interfaces per invocation and exporting supported closed value schemes, direct generic unions, and simple or nonrecursive generic mold aliases whose bodies the fragment supports. It detects missing sources and cycles and rejects a dependency if its interface cannot be inferred by the fragment.
88+
89+The supplied prelude is parsed into a **partial interface**: all names actually declared in the source are reserved, while only the molds and values this fragment can infer are available. These include the validated standard `list` mold, `unit`, `same`, `fall`, `need`, `lure`, `weld`, `snoc` and `turn`; unsupported entries, such as most list helpers, remain unavailable. The validated `list` is injected while the prelude’s gates are inferred; `weld` and `turn` use ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through a direct or transitive mold alias. List-dependent prelude mold aliases remain unsupported because their templates are prepared before this injection. A named prelude union keeps the fixed `/lib/jibb/prelude/jibb` origin in every module, and its name remains unqualified when a library exports a type containing it. The prelude inventory is incomplete, so reserving the names in this source does not establish complete shadowing coverage. Prelude imports, including the planned private internal module, are not supported by preparation. The shared module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship.
90+
91+`+prepare-prelude` derives the interface and declared-name inventory from the trusted vendored source. Hosts can reuse its result with `+golden-types-with-prepared-prelude`; they must pass the unchanged result of preparation, not an independently constructed value. Empty, malformed, duplicate-name or import-bearing prelude sources fail closed. `+golden-types-with-prelude` remains the source-taking wrapper. API files, modules with `main`, unsupported definitions and many other features remain outside this subset. The older `+golden-types-with-modules` entry point fails closed for imports because it has no prelude scope. None of these partial reports claims the module has been checked.
6292
6393And the design notes:
6494
docs/development.md+16−4
@@ -61,7 +61,10 @@ 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/type-import-diagnostic-test` | Compares the structured reader diagnostic bridge report under eval |
65+| `tools/type-mark-test` | Checks the partial checker’s mark import boundary against `tests/type-mark/expected.txt` under eval |
66+| `tools/type-module-scope-test` | Checks the partial module checker’s prelude boundary and duplicate-source rejection against `tests/type-module-scope/expected.txt` under eval |
67+| `tools/clay-fixtures` | Syncs `my-app`, builds its example `/sur` files and marks through Clay, checks selected mold and mark projections and the partial checker, and records Ford and mark subject shapes on the fake ship |
6568| `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 |
6669| `tools/doc-blocks` | Checks the doc's `jibb` blocks against the `doc-*` golden cases: `tools/doc-blocks docs/spec` |
6770| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
@@ -76,17 +79,20 @@ git clone https://github.com/urbit/tools /root/src/tools
7679tools/golden # all cases pass
7780tools/importer-test # Hoon importer fixture projections match
7881tools/type-import-test # importer/checker bridge golden report matches
82+tools/type-import-diagnostic-test # direct structured reader diagnostics match
83+tools/type-mark-test # mark/checker bridge golden report matches
84+tools/type-module-scope-test # module/prelude scope golden report matches
7985tools/hoon check-spans-test # prints <<>>
80−tools/testdata/selftest # 19 checks, 0 failed
86+tools/testdata/selftest # 22 checks, 0 failed
8187tools/doc-blocks docs/spec # every jibb block has its case
8288tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
8389tools/ship test # the cases pass as -test arms on the ship
8490tools/testdata/ship-selftest # when tools/ship changed
8591tools/ship check-commit # when the mark or the desks changed
86−tools/clay-fixtures # when the my-app Hoon fixtures changed
92+tools/clay-fixtures # when the my-app Hoon fixtures or importer changed
8793```
8894
89−`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.
95+`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. The structured reader diagnostics have their own `tests/lib/jibb-import-diagnostic.hoon` ship test and `tools/type-import-diagnostic-test` eval test. The mark bridge has its own `tests/lib/jibb-mark-bridge.hoon` ship test and `tools/type-mark-test` eval test; both compare the same fixture report. `tests/lib/jibb-module-scope.hoon` and `tools/type-module-scope-test` compare the prelude scope report on the ship and under eval.
9096
9197## Golden cases
9298
@@ -97,6 +103,12 @@ A case is a folder `tests/golden/<name>/` holding:
97103- the expected outputs, `tokens.txt` and `tree.txt`, each the output plus one newline.
98104- optionally, `path.txt`, the logical `/ui/.../*.jibb` path to pass to the compiler; the source remains `source.jibb`.
99105- optionally, an `expect-types:` line in `about.txt` opts the case into `+golden-types`; `types.txt` holds its output plus one newline and `--update` creates it. A `types.txt` also opts in when the line is absent. This interface is provisional while the checker is under construction.
106+- optionally, `imports.txt` selects Hoon `/sur` molds, one `module mold` pair per line. Each module's source goes in `sur/<module>.txt` and is compiled against zuse by both runners. `marks.txt` selects marks, one name per line, with source in `mar/<name>.txt`; both kinds may be supplied together. The reader results go to the partial checker, and a type output is required. Both runners reconstruct fixture text from `%txt` lines and identify the fixture if its compilation crashes; a crash fails the case without discarding its successful parse output. These fixtures currently handle only sources without Ford imports.
107+- optionally, `modules.txt` lists logical `/ui/.../*.jibb` paths, one per line. The corresponding sources live below the case's `modules/ui/` directory. Both runners parse each source at its logical path and compare the combined `module-trees.txt`; `--update` writes that output. A case with type output also supplies these sources and the vendored prelude to the partial module checker. The file opts in even when it lists no sources; use a comment such as `# no module fixtures` for an empty bundle, since zero-byte `%txt` fixtures do not sync reliably on the ship. Blank lines and comment lines are ignored. Cases without `modules.txt` keep their existing no-prelude type interface.
108+
109+The runners prepare the trusted vendored prelude once for their generated test core and share its partial interface. Preparation reserves all names present in that source and supplies the molds and values the fragment can infer; an unsupported declaration remains reserved but unavailable. The source and the checker are incomplete, so the output still says the module has not been checked and does not claim complete shadowing coverage. `+golden-types-with-prelude` accepts source directly; callers using `+golden-types-with-prepared-prelude` must pass the unchanged result of `+prepare-prelude`. Missing, malformed or conflicting source fails closed, and prelude imports are not supported yet.
110+
111+A zero-byte mark fixture currently fails ship synchronization validation after commit. Use a newline-only fixture to test an empty Hoon source on the ship.
100112
101113Names say what a case is for:
102114
docs/open-questions.md+12−5
@@ -18,12 +18,12 @@ On 2026-10-30, @iko adopted gate-free `eq` arguments and map and set keys, treat
1818
1919## Questions milestone 2 raises
2020
21−Found while writing [prompts/milestone-2.md](prompts/milestone-2.md) and checking it against the doc's examples. The numbering is retained so existing references stay valid. The prelude inventory in question 3 and the `like` representation in question 18 remain open; the other questions are settled.
21+Found while writing [prompts/milestone-2.md](prompts/milestone-2.md), checking it against the doc's examples, and building the checker. The numbering is retained so existing references stay valid. Questions 3, 18 and 24 remain open; the other questions are settled.
2222
23231. **Settled: how the prelude identifies jetted functions.** On 2026-10-30, @iko said the prelude functions have working Jibb implementations, and the compiler recognizes their shapes and uses the Hoon versions so jets can fire.
24242. **Settled: how the prelude keeps helpers private.** On 2026-10-30, @iko chose a separate internal prelude module imported by the prelude, without exposing the imported helpers.
25−3. **The prelude's inventory.** On 2026-10-30, @iko chose to include all names from the listed Hoon library sections, excluding groups the spec explicitly leaves out. All of 3g is included; its Hoon `tone` is exposed as `tone.hoon`, distinct from the styling type. On 2026-10-30, @iko also approved `%$` as a term literal and pattern, so Jibb can write the `%$` case of Hoon `coin`. For parsing sections 4j and 4l, only the explicitly listed `slav` and `slaw` are included; other parser helpers are left out. Jibb's `not` negates a loobean, and Hoon's bitwise `not` is exposed as `not.bit`. @iko also agreed to specifying the complete exported inventory in the doc, building its types and gates needed by the examples in milestone 2, and doing native implementations in milestone 3. Prelude unions such as spaces, roles and tones need names that other modules cannot shadow. The actual inventory and signatures still need to be specified.
26−4. **Settled: a capital in a local `++`.** On 2026-10-30, @iko said it shares the enclosing `++`'s variable of that name; a different type uses a different capital. The Grammar and Decisions record this alongside the earlier aura rules.
25+3. **The prelude's inventory.** On 2026-10-30, @iko chose to include all names from the listed Hoon library sections, excluding groups the spec explicitly leaves out. All of 3g is included; its Hoon `tone` is exposed as `tone.hoon`, distinct from the styling type. Hoon 1c `step` is exposed as `step.hoon`, leaving the Grammar example's `step` name available. On 2026-10-30, @iko also approved `%$` as a term literal and pattern, so Jibb can write the `%$` case of Hoon `coin`. For parsing sections 4j and 4l, only the explicitly listed `slav` and `slaw` are included; other parser helpers are left out. Jibb's `not` negates a loobean, and Hoon's bitwise `not` is exposed as `not.bit`. @iko also agreed to specifying the complete exported inventory in the doc, building its types and gates needed by the examples in milestone 2, and doing native implementations in milestone 3. Prelude unions such as spaces, roles and tones need names that other modules cannot shadow. The actual inventory and signatures still need to be specified.
26+4. **Settled: a capital in a local `++`.** On 2026-10-30, @iko said it shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` shares `A` with an enclosing gate whose sample is `x=A`, but generalizes its own `A` if the enclosing `++` does not use `A`. A different type uses a different capital. The Grammar and Decisions record this alongside the earlier aura rules.
27275. **Settled: cells of no items or one.** On 2026-10-30, @iko said a single-item cell is the value and `[]` is an error. The theme's `dark=[tones=[…]]`, a record of one field, must still check.
28286. **Settled: a change with no items.** On 2026-10-30, @iko said `m()` is an error. The parser still accepts it; the checker needs to reject it and add a golden case.
29297. **Settled: the doc's blocks that aren't whole modules.** On 2026-10-30, @iko agreed to check each in its intended context: the `cmd` and `sub` definitions as prelude source, the Core language tab's `update` inside the todo island, and the Grammar's imports example against fixture files.
@@ -32,12 +32,19 @@ 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 a gate-free constraint.** On 2026-10-30, @iko agreed to print the type followed by `where A contains no gates`, as `$-([A A] ?) where A contains no gates`.
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.
41+19. **Settled: Hoon aura families and `step.hoon`.** On 2026-10-30, @iko chose `step.hoon` for Hoon 1c `step`, avoiding a clash with the Grammar example's `step`, and chose one-way widening across Hoon aura families: for example, `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. The `step.hoon` group representation is not implemented yet.
42+20. **Settled: the type of `clap`.** On 2026-10-30, @iko chose one shared value type for both units and the combining gate. If either unit is absent, `clap` returns the other; if both are present, it applies the gate to their values and wraps the result.
43+21. **Settled: duplicate faces in imported Hoon records.** On 2026-10-30, @iko chose to reject an imported Hoon record with duplicate field names where its type is used. Hoon permits `[a=@ud a=@t]` and picks the first `a`; Jibb rejects it.
44+22. **Settled: overlapping imported `$%` and `$?` cases.** On 2026-10-30, @iko confirmed that the general union disjointness rule rejects imported `$%` and `$?` cases that overlap as nouns where the type is used, as it does for `$^`. The importer rejects recognizable overlaps and fails closed when it cannot verify them.
45+23. **Settled: converging explicit capitals.** On 2026-10-30, @iko chose that a body cannot force two separately written capitals to be equal. For `++ repeated |= x=(choice A A) x`, `++ f |= x=(choice A B) (repeated x)` is an error; use `A` in both positions when the type must be shared. This also applies across local captures and within generic mold applications.
46+
47+24. **How the internal prelude provides opaque types.** The public prelude needs an opaque `poke` type, but Jibb has no syntax to declare an opaque type in its private internal module. Should the internal module instead be a compiler-provided private interface that the prelude imports and re-exports, or should Jibb gain syntax for private opaque declarations? @iko has been asked; the answer is pending. The separate internal module and private primitives were already agreed in questions 2 and 14.
4148
4249## Grammar questions never put to the doc's author
4350
docs/prelude-inventory.md+27−4
@@ -14,14 +14,37 @@ Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold
1414
1515`bite` (mold), `bloq` (mold), `each`, `gate` (mold), `list`, `lone`, `lest`, `mold` (mold), `pair`, `pole`, `qual`, `quip`, `step`, `trap`, `tree`, `trel`, `unit`.
1616
17+@iko chose to expose Hoon `step` as `step.hoon`, so it does not clash with the Grammar's `step` example. Hoon's `step` uses `@u`. @iko chose one-way widening across Hoon aura families, such as `@ud` and `@ux` into `@u` and `@tD` into `@t`; the reverse needs a check (see [question 19](open-questions.md)). The prelude group needed to expose `step.hoon` is not implemented. Hoon's `bite` is a union of `bloq` and `[bloq=bloq step=step]`; its declaration awaits that group.
18+
1719## 2a
1820
1921`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
2022
23+The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The partial checker infers `fall`, `need`, `some`, `bind`, `biff`, `both` and `flit`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation remains outstanding for all of them.
24+
25+| Name | Hoon behavior | Jibb status |
26+| --- | --- | --- |
27+| `biff` | Applies a gate returning a unit to a present value; absent stays absent. | Written |
28+| `bind` | Applies a gate to a present value and wraps the result; absent stays absent. | Written |
29+| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Missing |
30+| `both` | Returns a unit of both values when both units are present. | Written |
31+| `clap` | Returns the present unit if only one is present; combines both values with a gate if both are present. | Written with one shared type for both units and the combining gate, as @iko chose |
32+| `clef` | Applies a gate returning a unit when both inputs are present; otherwise returns an absent unit. | Written |
33+| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written |
34+| `fall` | Returns the value of a present unit or the supplied fallback. | Written; inferred by the partial checker |
35+| `flit` | Returns a gate that wraps a value only if it satisfies the predicate. | Written |
36+| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Missing |
37+| `lift` | Takes a mold and a unit, then applies the mold to a present value as `bind` does. | Missing; Jibb molds are not callable values |
38+| `mate` | Returns the present unit if only one is present; when both are present it returns one if their values are equal and crashes otherwise. | Missing |
39+| `need` | Extracts a present value and crashes on an absent unit. | Written; inferred by the partial checker |
40+| `some` | Wraps a value in a present unit. | Written |
41+
2142## 2b
2243
2344`snoc`, `lure`, `fand`, `find`, `flop`, `gulf`, `homo`, `join`, `bake`, `lent`, `levy`, `lien`, `limo`, `murn`, `oust`, `reap`, `rear`, `reel`, `roll`, `scag`, `skid`, `skim`, `skip`, `slag`, `snag`, `snip`, `sort`, `spin`, `spun`, `swag`, `turn`, `weld`, `snap`, `into`, `welp`, `zing`.
2445
46+The current prelude writes `snoc`, `lure`, `flop`, `join`, `levy`, `lien`, `murn`, `rear`, `reel`, `roll`, `skim`, `skip`, `snip`, `turn` and `weld`. `murn` keeps the present products of its gate in order; `join` inserts a separator between items; `snip` drops the last item, and `rear` returns it or crashes on an empty list. The folds take an explicit initial value as the Prelude table specifies. The partial checker infers `snoc`, `lure`, `weld` and `turn` using the validated prelude `list` mold; most other list helpers remain unsupported by that fragment. Backend validation remains outstanding for all of them.
47+
2548## 2c
2649
2750`bex`, `can`, `cat`, `cut`, `end`, `fil`, `hew`, `lsh`, `met`, `rap`, `rep`, `rev`, `rig`, `rip`, `rsh`, `run`, `rut`, `sew`, `swp`, `xeb`, `fe`.
@@ -88,18 +111,18 @@ Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`,
88111
89112| Hoon name | Source shape and Jibb audit |
90113| --- | --- |
91−| `coin` | A union of `[%$ p=dime]`, `[%blob p=*]`, and `[%many p=(list coin)]`. Its `$~` default is dropped: Jibb molds have no default. @iko approved `%$` as a Jibb term literal and pattern on 2026-10-30; the parser implements it and ship verification is pending. Its `%$` case uses the `dime` mold below. |
114+| `coin` | A union of `[%$ p=dime]`, `[%blob p=*]`, and `[%many p=(list coin)]`. Its `$~` default is dropped: Jibb molds have no default. @iko approved `%$` as a Jibb term literal and pattern on 2026-10-30; the parser implements it and its golden cases pass under eval and on the ship. Its `%$` case uses the `dime` mold below. |
92115| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
93116| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
94117| `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. |
118+| `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. |
96119| `nail` | `[p=hair q=tape]`: parsing input. |
97120| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
98121| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
99122| `spot` | `[p=path q=pint]`: a file path and range. |
100123| `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. |
101124| `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. |
125+| `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. |
103126
104127The following shapes can be written as Jibb declarations once their referenced prelude molds are present:
105128
@@ -121,7 +144,7 @@ The following shapes can be written as Jibb declarations once their referenced p
121144 [%2 p=(list tank)]
122145```
123146
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.
147+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.
125148
126149## 4a
127150
docs/prompts/milestone-2.md+8−8
@@ -49,7 +49,7 @@ And from the plan's Risks:
4949
5050## First steps
5151
52−1. **Specify the prelude inventory.** The checker needs the prelude's complete exported inventory and signatures; include all names from the listed Hoon library sections except explicitly excluded groups, as `docs/open-questions.md` question 3 records. The prelude imports private helpers and low-level primitives from a separate internal module without exposing them; its public foundational gates are implemented in Jibb on those primitives.
52+1. **Specify the prelude inventory.** The checker needs the prelude's complete exported inventory and signatures; include all names from the listed Hoon library sections except explicitly excluded groups, as `docs/open-questions.md` question 3 records. The prelude imports private helpers and low-level primitives from a separate internal module without exposing them; its public foundational gates are implemented in Jibb on those primitives. How that module supplies opaque types such as `poke` is still awaiting @iko’s answer: question 24 records the alternatives of a compiler-provided private interface or syntax for private opaque declarations.
5353
5454 The plan's three core-language rules were adopted: gate-free `eq` arguments and map and set keys, with gates opaque for union matching; jetted prelude functions taking gates; and rejection of a non-gate value that depends on itself even through a gate.
55552. **Start the importer early**, as the plan's Risks ask: first on a small `/sur` file, then on Tlon's. "Suggested design" below has a way in.
@@ -59,11 +59,11 @@ And from the plan's Risks:
5959The rules are scattered across the tabs. This is a map of them, not a replacement: read each in place, and where this summary and the doc differ, the doc is right.
6060
6161**Types and inference** (Grammar: Molds, Modules, Runes, Expressions; Decisions: Inference, Type variables, Sample names, Inline gates)
62−- Hindley–Milner with aura variables: "every expression has a principal type, and there is no general subtyping". A specific atom fits `@`, and a specific noun fits `*`, each only in that direction.
63−- `@` 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.
62+- Hindley–Milner with aura variables: "every expression has a principal type, and there is no general subtyping". A specific atom fits `@`, a specific noun fits `*`, and a more specific aura fits an ancestor in its Hoon aura family, each only in that direction; the reverse needs a check.
63+- `@` 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`. `@ud` and `@ux` also fit `@u`, and `@tD` fits `@t`, following Hoon aura families; the reverse needs a check. Distinct specific auras remain distinct. `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.
65−- 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`.
65+- Type variables are capitals, "generalized per `++`". A capital in a local `++` shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` shares `A` with an enclosing gate whose sample is `x=A`, but generalizes its own `A` if the enclosing `++` does not use `A`. A different type takes a different capital. A body cannot force two distinct capitals to be equal; use the same capital where a type is shared. "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 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]`.
@@ -98,7 +98,7 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
9898- `main`'s type decides a module's kind: `(element !!)` a page, `(page R D)` a page with data, `(program D X M)` an island, `(store S)` a store; no `main`, a library.
9999
100100**Importing Hoon types** (overview: Importing Hoon types; Decisions: Hoon types)
101−- The table: `$%` and `$?` become a union; `$@` a union with an atom case; `$^` a union if its cases differ as nouns, else an error where used; `$~` dropped; `map`, `set`, `qeu`, `jar`, `jug` the same, by name; `mop` as `(mop K V)`, read with `on`; other `$|` their base type; `%0`, `%&` and `%|` tags; recursive molds recursive, matched by name; cores, gates, vases, signed and float auras an error where used.
101+- The table: `$%`, `$?` and `$^` become unions only if their cases differ as nouns, else an error where used; `$@` a union with an atom case; `$~` dropped; `map`, `set`, `qeu`, `jar`, `jug` the same, by name; `mop` as `(mop K V)`, read with `on`; other `$|` their base type; `%0`, `%&` and `%|` tags; recursive molds recursive, matched by name; imported records with duplicate field names, cores, gates, vases, signed and float auras are errors where used.
102102- "Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file are fine." A field's unnamed union imports too, although Jibb cannot write one.
103103
104104**Islands, pages and stores** (overview: The Elm architecture on Urbit; Grammar: Modules and the store example)
@@ -113,13 +113,13 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
113113
114114**The prelude** (overview: Prelude, Layout and styling, Links and URLs, Effects)
115115- Hoon's standard library regrouped, "written in Jibb and vendored as `/lib/jibb/prelude`", plus `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, the layout elements and molds, `attr`, `theme`, and `cmd` and `sub` as the overview's Effects block writes them.
116−- Signatures change where the Prelude table says: maps and sets are plain gates over Hoon's trees, as `(get.by m k)`; folds take a start, as `(roll xs init f)`, `rep.by` and `rep.in`; ordered maps go through lull's `on`, as `(get.on lte m k)`.
116+- Signatures change where the Prelude table says: `clap` takes two units of one value type and a combining gate over that type; maps and sets are plain gates over Hoon's trees, as `(get.by m k)`; folds take a start, as `(roll xs init f)`, `rep.by` and `rep.in`; ordered maps go through lull's `on`, as `(get.on lte m k)`.
117117- Left out: signed and float gates, parser helpers outside 3g other than the explicitly listed `slav` and `slaw`, and the table's "The rest" (1b, 2p, 3d, 3f, 4c, 4n, 4o, 5a–5f); "`jam`, `cue` and `fein` run inside the runtime".
118118- Write the prelude in Jibb, enough to give every name its type. Foundational gates use private low-level primitives from the internal prelude module. Jetted functions have working Jibb implementations; the compiler recognizes their shapes and uses the Hoon versions so jets can fire. They may take gates as arguments; the Nock backend comes in milestone 3.
119119- Element signatures are in the Layout and styling table. Paths and unchecked cords have separate declarations, with `link-unsafe`, `image-unsafe` and `go-unsafe` for the unchecked forms. Both navigation declarations produce `[%go url=@t]`; `go` converts its application path to a cord including the app's base path. "The same attribute twice in a literal list is an error."
120120
121121**Errors**
122−- Each one the Grammar tab describes needs a golden case with its message. A start on the list: an aura mismatch; mismatched faces; "msg has no case %submitt"; an unresolved tag, as the Grammar's `add-button` ("nothing fixes the union of %add"); an open constraint at the end of a module; a `|=%tag` whose union has no such case tagged at its head; a union whose cases overlap; a missing `?-` case, named; an arm that earlier arms cover; a value that refers to itself; a shadowed name, including a prelude or imported one; a cell in `{…}` with no printer; an atom of a generic aura in `{…}` or a path's `(…)`; a capital that a body makes a `@ud` or a list; `~[text "hi"]`, where the checker suggests `~[(text "hi")]`; clashing derived names; an import cycle; from an import, a signed or float aura, a core, gate or vase, or a `$^` whose cases don't differ as nouns, each where used; a `(facts …)` outside an API file's `paths`; a gate in island data or a model, naming the field; a repeated attribute in a literal list. Read the Grammar tab, and the other tabs' mentions of "error" and "the checker", and make the list complete.
122+- Each one the Grammar tab describes needs a golden case with its message. A start on the list: an aura mismatch; mismatched faces; "msg has no case %submitt"; an unresolved tag, as the Grammar's `add-button` ("nothing fixes the union of %add"); an open constraint at the end of a module; a `|=%tag` whose union has no such case tagged at its head; a union whose cases overlap; a missing `?-` case, named; an arm that earlier arms cover; a value that refers to itself; a shadowed name, including a prelude or imported one; a cell in `{…}` with no printer; an atom of a generic aura in `{…}` or a path's `(…)`; a capital that a body makes a `@ud` or a list; `~[text "hi"]`, where the checker suggests `~[(text "hi")]`; clashing derived names; an import cycle; from an import, a signed or float aura, a core, gate or vase, or a `$%`, `$?` or `$^` whose cases don't differ as nouns, or a record with duplicate field names, each where used; a `(facts …)` outside an API file's `paths`; a gate in island data or a model, naming the field; a repeated attribute in a literal list. Read the Grammar tab, and the other tabs' mentions of "error" and "the checker", and make the list complete.
123123- For a `+$` whose cases overlap or do not fit, suggest that a record or tuple leaves its `[` open on the `+$` line. `+$ pt` above `@t` and `[@ud @ud]` is a valid union.
124124- "Each error names both conflicting sites, with excerpts." Today's `error` is `[file line col msg]`, a start only; spans keep each node's end so that a type error can underline both sites.
125125- Messages name things in the doc's words and quote the code they're about in backticks, as milestone 1's do. Their wording is fixed by the golden tests once written.
docs/spec/decisions.md+6−6
@@ -26,23 +26,23 @@ 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 gate-free constraints | Print the type followed by `where A contains no gates`, 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 |
33−| Inference | Hindley–Milner with aura variables; `@` is any atom, a specific atom fits `@` but the reverse needs a check, and repeated atom-constrained capitals give the same type; a number takes `@ud` only where its `++` isn't generic over its aura; different specific auras never unify; faces are part of record types, and an unnamed position can take a face but two different faces don't unify; principal types | Decided 2026-10-30 |
33+| Inference | Hindley–Milner with aura variables; `@` is any atom, a specific atom fits `@` and a more specific aura fits an ancestor in its Hoon aura family, but each reverse needs a check, and repeated atom-constrained capitals give the same type; a number takes `@ud` only where its `++` isn't generic over its aura; distinct specific auras remain distinct; faces are part of record types, and an unnamed position can take a face but two different faces don't unify; principal types | Decided 2026-10-30 |
3434| Effects | The library unions `cmd` and `sub`; pokes and requests are opaque, from derived gates and `pure`; islands read agents only by watching; replies get full state, and diffs take a fold; timers carry the time; `%who` gives the owner's `@p`; nacks reach replies as text | Decided 2026-10-29 |
3535| Agent APIs | `/ui/api/<agent>.jibb` with `+$ poke` and `+$ paths`, over the agent's mark types; a case is a name, a path and a type, with `(facts full diff …)` for diffs, told apart by mark; an optional scry path, for pages; an island watching such a request has a type error; typed segments by aura | Decided 2026-10-30 |
3636| Mark names | Any name: `/%` names types after marks, and constructors poke with their type's mark; no alias marks | Decided 2026-10-26 |
3737| Derived gates | API files and stores give a constructor per poke type and a checked request per path or store state; clashing names are errors, including a derived name that clashes with an import face | Decided 2026-10-30 |
38−| Hoon types | A fixed translation table; `map`, `set`, `qeu`, `jar`, `jug` by name; `mop` as `(mop K V)`, read with `on`; unused molds skipped | Decided 2026-10-29 |
38+| Hoon types | A fixed translation table; `map`, `set`, `qeu`, `jar`, `jug` by name; `mop` as `(mop K V)`, read with `on`; imported `$%`, `$?` and `$^` cases must differ as nouns, and records with duplicate field names are errors where used; unused molds skipped | Decided 2026-10-30 |
3939| Layout | Indentation; juxtaposed calls; a bracket open at line end takes one item per line, with no closer | Decided |
4040| Elements | Ordinary gates; containers take attribute lists; `stack` switches at `wide`; `el` adds attributes and wins; headings 1 to 6; `form` sends on Enter, the innermost when nested; `image` from an application path, sized from the file, or a sized URL; no focus control for now | Decided 2026-10-29 |
4141| Long calls | One argument per line inside parentheses | Decided |
4242| Inline gates | Hoon's wide form; the mold may be inferred; a bare sample name binds; `\|=%got` is a case's constructor, typed by the gate expected; a bare tag is always a value | Decided 2026-10-29 |
4343| Empty mold | `!!`, with no values; the expression has any type; pages are `(element !!)`, which keeps islands out of islands | Decided 2026-10-29 |
4444| Noun mold | `*` is the noun type, not a type variable; use a capital for a generic type; a value of a more specific noun type can be used where `*` is expected | Decided 2026-10-30 |
45−| Type variables | Capitals, generalized per `++`; a capital in a local `++` shares the enclosing `++`'s variable of that name, and a different type takes a different capital; one used where an atom is required gains an inferred atom constraint, and cannot be fixed to a more specific type in its body | Decided 2026-10-30 |
45+| Type variables | Capitals, generalized per `++`; a capital in a local `++` shares the enclosing `++`'s variable of that name if the enclosing `++` also uses it; otherwise it is introduced and generalized locally; a different type takes a different capital; a body cannot force distinct capitals to be equal, so a shared type uses the same capital; one used where an atom is required gains an inferred atom constraint, and cannot be fixed to a more specific type in its body | Decided 2026-10-30 |
4646| Loobean mold | `?`, switched with `?-` | Decided 2026-10-26 |
4747| Defaults | None | Decided |
4848| Modules | Records, not cores | Decided |
@@ -50,7 +50,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
5050| Type identity | Recursive molds by name and module | Decided 2026-10-29 |
5151| Binding patterns | In `?-` arms; the last position binds the rest | Decided 2026-10-29 |
5252| Text | Strings are written only as `"…"` and are always cords; tapes come from `trip`; `{…}` prints by aura, a bare `@` as `@ud`, and an atom whose aura its `++` is generic over is an error; `print-date` prints Urbit-style to the minute in the theme's zone, from jibb-dev's zone table; numbers keep Hoon's form | Decided 2026-10-30 |
53−| Auras | Specific auras stay distinct; `@` is any atom, and shared atom-constrained type variables preserve the same aura | Decided 2026-10-30 |
53+| Auras | Specific auras stay distinct; `@` is any atom, a more specific aura fits an ancestor in its Hoon aura family one way, with the reverse requiring a check, and shared atom-constrained type variables preserve the same aura | Decided 2026-10-30 |
5454| Crashes | As in Hoon; an island keeps its model and shows the standard notice; a failing page, or one rendering a control outside an island, gets Jibb's error page; no render limit, so an endless render stalls the ship | Decided 2026-10-29 |
5555| Refinement types | None | Decided |
5656| Imports | `/-`, `/%` (a mark's type, with no face) and `/=`; no `/+`; cycles are errors | Decided 2026-10-29 |
@@ -76,7 +76,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
7676| Dark mode | Hand-written dark tones under `dark`, used when the reader prefers dark | Decided 2026-10-27 |
7777| Links | All text escaped; in-app links are application paths, as `%/blog/(slug)`, with no query or fragment, checked at compile time against routes and static files; paths and unchecked `https`, `mailto` and `tel` URLs and root-relative cords such as `"/apps/groups"` have separate declarations; `link-unsafe`, `image-unsafe` and `go-unsafe` are the unchecked forms; both navigation declarations produce `[%go url=@t]`, with `go` converting the path to a cord including the app's base path; other cords render as text; a CSP on every page | Decided 2026-10-30 |
7878| Data layer | Hoon's nouns: units, treaps, loobeans | Decided |
79−| Prelude | Hoon's standard library regrouped: all names from the listed sections except explicitly excluded groups, including all of 3g, with Hoon's `tone` exposed as `tone.hoon`; arithmetic over aura variables, units, lists, maps, sets, queues, ordered maps, function helpers, text, atom printing, a zoned date printer, time and data molds; folds take a start; jetted functions have working Jibb implementations, whose shapes the compiler recognizes to use the Hoon versions, and may take gates; private helpers and low-level primitives live in a separate internal module imported without exposing them, with public foundational gates implemented in Jibb on those primitives; no signed or float gates, or parser gates outside 3g except `slav` and `slaw`; signed or float auras are errors | Decided 2026-10-30 |
79+| Prelude | Hoon's standard library regrouped: all names from the listed sections except explicitly excluded groups, including all of 3g, with Hoon's `tone` exposed as `tone.hoon` and Hoon's 1c `step` as `step.hoon`; arithmetic over aura variables, units, lists, maps, sets, queues, ordered maps, function helpers, text, atom printing, a zoned date printer, time and data molds; folds take a start; jetted functions have working Jibb implementations, whose shapes the compiler recognizes to use the Hoon versions, and may take gates; private helpers and low-level primitives live in a separate internal module imported without exposing them, with public foundational gates implemented in Jibb on those primitives; `clap` takes two units of the same type and a combining gate over that type; no signed or float gates, or parser gates outside 3g except `slav` and `slaw`; signed or float auras are errors | Decided 2026-10-30 |
8080| Wire format | Noun channels; Jibb's own noun codec in the browser | Decided 2026-10-29 |
8181| Hosting | One thin host agent on `%jibb` binds, caches and serves every Jibb desk; each desk vendors jibb-dev, names its base path in docket's `site+`, and builds and renders with its own copy through fixed entry points; install `%jibb` first; app agents stay plain Hoon; pokes only from the ship | Decided 2026-10-29 |
8282| Private pages | Served by the host per request and never cached; non-owners go to the login page | Decided 2026-10-29 |
docs/spec/grammar.md+5−5
@@ -91,7 +91,7 @@ Imports come first:
9191/= card /ui/components/card :: a Jibb module
9292```
9393
94−`/%` names a type after its mark, so it takes no face, and any mark name works; Hoon's `/%` binds the mark's core instead. Derived constructors such as `todo-action.todo` supply the agent and mark, so code never writes one. API modules re-export their `/%` types, not `/-` faces or `/=` modules. Import cycles are errors.
94+An imported Hoon record with duplicate field names is an error where used; imported union cases must differ as nouns. `/%` names a type after its mark, so it takes no face, and any mark name works; Hoon's `/%` binds the mark's core instead. Derived constructors such as `todo-action.todo` supply the agent and mark, so code never writes one. API modules re-export their `/%` types, not `/-` faces or `/=` modules. Import cycles are errors.
9595
9696## Modules
9797
@@ -118,21 +118,21 @@ Every other name is free.
118118
119119## Molds
120120
121−A mold is only a type: never called on a noun, and with no default. Types are inferred, Hindley–Milner with aura variables: every expression has a principal type, and there is no general subtyping. Two one-way widenings are allowed: a value of a specific atom type fits `@`, and a value of a specific noun type fits `*`; neither rule permits the reverse.
121+A mold is only a type: never called on a noun, and with no default. Types are inferred, Hindley–Milner with aura variables: every expression has a principal type, and there is no general subtyping. These one-way widenings are allowed: a value of a specific atom type fits `@`, a value of a specific noun type fits `*`, and a more specific aura fits an ancestor in its Hoon aura family; the reverse of each widening needs a check.
122122
123−- **Atoms**: `@` is any atom, regardless of aura; auras such as `@ud`, `@t`, `@p` and `@da` are specific atom types. An `@ud` value fits where `@` is expected, but an `@` value needs a check to fit `@ud`. Different specific auras never unify. Each bare `@` independently accepts any atom: it is not an aura variable. Atoms that must share a type take one capital, as `[lo=A hi=A]`, with the atom constraint inferred from the body. `add` takes `[A A]` and returns `A`, with `A` constrained to atoms, so `(add n 1)` with `n=@ud` is a `@ud`. `?` is a loobean.
123+- **Atoms**: `@` is any atom, regardless of aura; auras such as `@ud`, `@t`, `@p` and `@da` are specific atom types. An `@ud` value fits where `@` is expected, but an `@` value needs a check to fit `@ud`. A more specific aura also fits an ancestor in its Hoon aura family: `@ud` and `@ux` fit `@u`, and `@tD` fits `@t`. The reverse needs a check. Distinct specific auras remain distinct; sharing an ancestor does not make them unify. Each bare `@` independently accepts any atom: it is not an aura variable. Atoms that must share a type take one capital, as `[lo=A hi=A]`, with the atom constraint inferred from the body. `add` takes `[A A]` and returns `A`, with `A` constrained to atoms, so `(add n 1)` with `n=@ud` is a `@ud`. `?` is a loobean.
124124- **Constants**: `%add`, `~` and the loobeans have one value each.
125125- **Records and tuples**: `[text=@t done=?]`, `[@t ?]`. An empty `[]` is an error. Faces are part of the type, so `[a=@ b=@]` and `[x=@ y=@]` don't unify. An unnamed position can unify with a faced position and take its face, so `[0 0]` fits `[x=@ud y=@ud]`; two different faces don't unify. A record too long for one line can leave its `[` open, with one field per deeper line, as an expression's bracket does.
126126- **Unions**: a `+$` with several cases below it. Every union written in Jibb has a name, so one used in a field, a sample, a cast, a gate's mold or an argument gets its own `+$`; only imports bring in unions without one. Tags take their union from context, as Tag resolution describes. Cases must differ as nouns: inhabited cases must differ at some position of their right-nested cells, where one is an atom and the other a cell, or both are different constants. `*`, type variables and molds that can be either, such as `(list A)`, can overlap atoms and cells. `?` counts as the two atoms `%.y` and `%.n`: it is disjoint from cells and overlaps the constants 0 and 1. The empty mold `!!` is disjoint from every case; a cell with an empty position at any depth is itself empty and is also disjoint from every case. A union whose cases don't all differ is rejected.
127127- **Containers**: `(list A)`, `(unit A)`, `(set A)`, `(map K V)`, `(mop K V)`, `(qeu A)`, `(jar K V)`, `(jug K V)`.
128−- **Gates**: `$-(A B)`. Type variables are capitals, generalized per `++`. A capital in a local `++` shares the enclosing `++`'s variable of the same name; use another capital for a different type. A type variable used where an atom is required gains an atom constraint, so `++ clamp |= [lo=A hi=A n=A]`, whose body calls `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.
128+- **Gates**: `$-(A B)`. Type variables are capitals, generalized per `++`. A capital in a local `++` shares the enclosing `++`'s variable of the same name if the enclosing `++` also uses it; otherwise the local `++` introduces and generalizes its own variable. For example, `++ inner |= y=A y` uses the enclosing `A` when its enclosing gate has a sample `x=A`; if the enclosing `++` does not use `A`, `inner` generalizes its own `A`. Use another capital for a different type. A body can't force two distinct capitals to be equal; use the same capital wherever a type must be shared. A type variable used where an atom is required gains an atom constraint, so `++ clamp |= [lo=A hi=A n=A]`, whose body calls `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.
129129- **Paths**: `/todos` is constant, `/` empty, and `/todo/[id=@ud]` typed by aura. `%/blog/(slug)` is an `qath`, checked against routes and static files.
130130- **Generic molds**: `+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name.
131131- **Noun**: `*`, not a type variable; use a capital for a generic type. A value already known to have a more specific noun type, such as `@ud`, can be used where `*` is expected. **Empty**: `!!`.
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`. 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/spec/overview.md+4−4
@@ -63,7 +63,7 @@ Hoon's runes and literals in an indentation layout, over Hoon's nouns and molds,
6363
6464| Hoon | Jibb |
6565| --- | --- |
66−| `$%`, `$?` | A union |
66+| `$%`, `$?` | A union if its cases differ as nouns, else an error where used |
6767| `$@` | A union with an atom case |
6868| `$^` | A union if its cases differ as nouns, else an error where used |
6969| `$~` | Dropped |
@@ -72,7 +72,7 @@ Hoon's runes and literals in an indentation layout, over Hoon's nouns and molds,
7272| Other `$\|` | Its base type |
7373| `%0`, `%&`, `%\|` | Tags |
7474| Recursive molds, such as `json` | Recursive, matched by name |
75−| Cores, gates, vases, signed and float auras | An error where used |
75+| Records with duplicate field names; cores, gates, vases, signed and float auras | An error where used |
7676
7777Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file are fine. A union without a name, as a field's `?(%approve %deny)`, imports too, though Jibb can't write one. Messages and printed types show its cases separated by spaces, as `%approve %deny`; this notation is print-only.
7878
@@ -83,14 +83,14 @@ Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/pr
8383| Group | Hoon | Jibb |
8484| --- | --- | --- |
8585| Arithmetic | [1a](https://docs.urbit.org/hoon/stdlib/1a), [2g](https://docs.urbit.org/hoon/stdlib/2g) | Jibb gates over shared atom-constrained type variables, using private low-level primitives: `add`, `sub`, `div`, `mod`, `gth`, `max`, `pow` |
86−| Units | [2a](https://docs.urbit.org/hoon/stdlib/2a) | `fall`, `need`, `bind`, `biff` |
86+| Units | [2a](https://docs.urbit.org/hoon/stdlib/2a) | `fall`, `need`, `bind`, `biff`, `clap`; `clap` takes two units of the same type and a gate combining two values of that type into one of that type |
8787| Lists | [2b](https://docs.urbit.org/hoon/stdlib/2b) | `turn`, `weld`, `snag`, `lent`, `sort`, `skim`; `(roll xs init f)` takes a start |
8888| Maps, sets, queues | [2h](https://docs.urbit.org/hoon/stdlib/2h)–[2m](https://docs.urbit.org/hoon/stdlib/2m), [2o](https://docs.urbit.org/hoon/stdlib/2o) | Plain gates over Hoon's trees, such as `(get.by m k)`; `rep.by` and `rep.in` take a start; ordered maps through lull's `on`, as `(get.on lte m k)` |
8989| Function helpers | [2n](https://docs.urbit.org/hoon/stdlib/2n) | `same`, `head`, `tail`, `cork`, `cury` |
9090| Text | [4b](https://docs.urbit.org/hoon/stdlib/4b) | `crip`, `trip`, `cass`, `cuss`, `trim`, `tufa`, `tuba` |
9191| Atom printing | [4a](https://docs.urbit.org/hoon/stdlib/4a), [4j](https://docs.urbit.org/hoon/stdlib/4j)–[4m](https://docs.urbit.org/hoon/stdlib/4m) | `scot`, `scow`, `slav`, `slaw`. `print-date` prints Urbit-style in the theme's zone, to the minute, as `~2026.10.29..14.30`, from a zone table jibb-dev keeps current. Numbers print as Hoon does, as `1.000` |
9292| Time | [3c](https://docs.urbit.org/hoon/stdlib/3c) | `yore`, `year` |
93−| Data molds | [1c](https://docs.urbit.org/hoon/stdlib/1c), [2q](https://docs.urbit.org/hoon/stdlib/2q), [3g](https://docs.urbit.org/hoon/stdlib/3g) | `unit`, `list`, `pair`, `tape`, `path`, `coin`, `dime` and the rest; Hoon's 3g `tone` is `tone.hoon`, distinct from the styling type |
93+| Data molds | [1c](https://docs.urbit.org/hoon/stdlib/1c), [2q](https://docs.urbit.org/hoon/stdlib/2q), [3g](https://docs.urbit.org/hoon/stdlib/3g) | `unit`, `list`, `pair`, `tape`, `path`, `coin`, `dime` and the rest; Hoon's 3g `tone` is `tone.hoon`, distinct from the styling type, and its 1c `step` is `step.hoon` |
9494| Bits | [2c](https://docs.urbit.org/hoon/stdlib/2c), [2d](https://docs.urbit.org/hoon/stdlib/2d) | Jibb's `not` negates a loobean; Hoon's bitwise `not` is exposed as `not.bit` |
9595| Hashing and ordering | [2e](https://docs.urbit.org/hoon/stdlib/2e), [2f](https://docs.urbit.org/hoon/stdlib/2f) | Natives behind maps and sets; `aor` exposed |
9696| Signed and floats | [3a](https://docs.urbit.org/hoon/stdlib/3a), [3b](https://docs.urbit.org/hoon/stdlib/3b) | Left out; `@s…` and `@r…` auras are errors, imported ones included |
docs/status.md+54−8
@@ -1,6 +1,6 @@
11# Status
22
3−As of 2026-10-30. The plan is [spec/implementation-plan.md](spec/implementation-plan.md); each milestone ends with its checks passing on a fake ship.
3+As of 2026-10-31. The plan is [spec/implementation-plan.md](spec/implementation-plan.md); each milestone ends with its checks passing on a fake ship.
44
55| # | Milestone | Status |
66| --- | --- | --- |
@@ -19,7 +19,9 @@ 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, several collections, jar and jug in record fields, and direct `$^` unions whose cases can be proved disjoint. Nested `$^`, nested collection arguments, ordered maps, marks and general union disjointness remain unfinished. 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; partial bridges pass selected Hoon atoms, term singletons, nested faced or unfaced cells, supported disjoint unions and opaque standard collections from `/sur` molds and marks into inference. Collections retain their names and supported arguments for printing and unification; nested supported union arguments are retained too. The bridge trusts unchanged results from the source-aware reader; a materialized type graph alone cannot reveal cases Hoon already collapsed. The source-validated standard prelude `list` mold shares this representation with imported lists; other Jibb-written collection molds and most prelude collection operations remain unsupported; malformed names and arities fail closed. Selected self-recursive `/sur` molds cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, certain ordered-map fields, direct `$^` unions whose cases can be proved disjoint, and one verified explicit union argument in a list, set, map or unit. Ambiguous recursive origins fail closed; recognizable explicit unions are checked from source before Hoon can collapse their cases, as @iko confirmed for imported `$%`, `$?` and `$^`, while other nested unions, nested ordered maps, general union disjointness and complete import integration remain unfinished. Opt-in structured reader APIs preserve successful graphs and distinguish definite unsupported-aura and core evidence from failures the reader cannot prove; unverified union disjointness and name-only vase recognition remain unsupported. They revalidate and re-walk failed types. An opt-in partial checker entry point consumes unchanged reader results and reports definite aura or core errors at imported mold use sites when their inputs are unique. Ordered replay covers nested cell samples, record and function casts, and non-generic same-module aliases; unsupported prefixes, cycles and shadowing stop it. Union molds, generic applications, transitive modules and unsupported reader outcomes remain generic. Replay repeats inference and may add work. The partial checker resolves a subset of ordinary library imports in dependency order using supplied Jibb sources and a source-derived partial prelude interface, caches completed interfaces per run, and detects missing sources and cycles. It does not yet check API or kind semantics, and the prelude inventory is incomplete. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, acyclic local value definitions with captures, selected single self-recursive top-level and local gates, simple and nonrecursive generic mold aliases, selected faced record casts and field reads, and contextual tags, `~` and constructors for closed disjoint unions, including direct nonrecursive generic unions and propagation through complete loobean and unit-shaped branches in casts and known union-sample calls, including nested branches. Multi-argument calls form a right-nested sample, retain known faces and shared type variables, and can use known sample positions to contextualize list and union arguments. A definite mismatch points to the failing argument when the fragment can establish it, otherwise to the combined sample; unsupported contextual forms still fail closed. For a supported recursive gate, the checker infers the sample first and uses its exact type, including field faces, for one monomorphic self reference. It generalizes after the body is checked; subsequent uses instantiate it independently. Incompatible recursive arguments can report the gate and argument sites. For a complete loobean branch with one direct self-call arm, a separately inferred closed base type can seed the recursive result before the whole body is checked. Open or pending base types do not seed it; other branch shapes remain subject to the fragment’s existing limits. A supported single local recursive gate also uses a monomorphic self reference and generalizes variables free of the enclosing environment after checking its body; captured variables remain shared. The checker collects written capitals per `++` before inference, excluding nested definitions: a capital used in an enclosing definition is shared with its locals even when written later, while a capital introduced only in a local definition is generalized there. Sibling locals can introduce independent capitals with the same spelling; generic mold parameters keep their own scope. Top-level groups of syntactic gates are inferred together with monomorphic placeholders and shared substitutions, then generalized only after the whole group checks; downstream uses and library interfaces instantiate those schemes independently. A dependency graph identifies groups with two iterative depth-first passes; its conservative local-reference edges can reject otherwise valid programs. Local mutual groups, polymorphic recursion, value cycles, unresolved literal constraints and unresolved branch joins remain unsupported. Reporting repeats inference for a single recursive gate outside a group; grouped reports use the stored schemes. Its performance cost remains unmeasured. String interpolation accepts known atom auras, unrestricted `@`, tapes and isolated decimal literals; a known cell asks for a printer, and an explicitly generic atom asks for an aura. Loobeans, term singletons, non-tape collections, open types and a type fixed only later remain unsupported. A known closed union with two or more arms supports patterns that provably cover or exclude each remaining case, including payload binders, imported and generic cases, and binder-free catch-alls. Partial boolean patterns can split known `?` positions into their two noun values, up to 64 alternatives across the union; binders retain their original case type. Missing alternatives and covered arms are reported. Other partial patterns, expansions above the limit, binders spanning distinct cases, differing arm result types, some complex two-arm subjects and contextual union-pattern branches remain unsupported. The Grammar’s `step` block infers in this fragment, but its module is not yet checked. A bare tag proved absent from a known union reports the union and tag sites in casts, single-argument calls, unit payloads, list items and supported branch arms; imported unnamed unions print their cases. Known faced records support uniquely named field changes, including nested wings, with field context passed to replacements and the original record type retained. Missing fields, empty changes and definite mismatches report sites; the expected-type site is the edit because the original field declaration location is not retained. Unknown or partly unfaced spines, ambiguous fields and repeated edits remain unsupported. A known record cast supplies field context to its tuple or record initializer, including nested list and union fields; mismatch diagnostics use the cast mold because the original field declaration location is not retained. The cart-store example’s `init` and `update` now infer, while its kind, declarations and full module remain unchecked. Backtick unit construction uses the validated standard prelude unit template, infers its payload without losing pending constraints, and makes the prelude’s `some` available. Ordinary result annotations also let its `bind`, `biff`, `both` and `flit` infer. A known unit in a cast, call, list item or record field supplies context to its payload, including nested units and lists; mismatches identify the payload and context. Unrelated union identities, some variable-dependent fits, and missing or altered prelude unit templates remain unsupported. Contextual null-headed cells fit their cases, but do not supply a `|=%$` constructor; unresolved nulls remain pending and are reported separately from tags. A known union of `~` and a null-headed cell supports a complete `~` / `[~ value]` branch in either order, including shadow checks; unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported. This fragment infers the prelude’s `fall` and `need` signatures. With the validated prelude list and a known cast or gate sample, empty, nonempty and nested list literals infer their element types, including contextual union tags; a mismatched element names both sites. In that context `~` and zero-valued terms fit an empty list, and two-item unfaced cells form cons lists, including nested cons and imported-list contexts; invalid heads or tails name both sites. A known gate sample also supplies context to matching positions in a single tuple or record argument, including nested cells; zero literals can fit list positions. A bound zero constant remains unsupported rather than a definite mismatch, and an unknown callee does not supply context. Faced or longer cells and a missing or altered prelude list fail closed. A known list result also supplies context through complete loobean, unit-shaped and list-shaped branches, including recursive and nested branches. For a known standard list with a supported element type, a complete `~` / `[item rest]` branch infers the element and tail types in either arm order and checks binders for shadowing. Uncontextualized list construction, unknown subjects, unsupported element types and other or incomplete list patterns remain unsupported. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. Other variable-dependent face merges remain unsupported. Forced equality of distinct written capitals now reports both source sites, following @iko’s decision; forcing one to a concrete type remains unsupported. Imported record spines with repeated faces fail closed where used, but only with a generic unsupported diagnostic. Hoon may erase unfaced nested-cell boundaries, so the check can conservatively reject valid names in distinct erased scopes. Supported closed unions print using an in-scope name or imported alias; an unnamed nongeneric union prints its cases, parenthesized when nested. The latter is print-only. Generic union types retain all arguments in their printed name; if that name is unavailable, the partial printer reports the limitation. Different import faces for the same origin remain compatible; compatibility across distinct union origins and some generic-argument comparisons remain unsupported. Nonrecursive generic aliases can reorder, repeat or omit parameters while retaining a union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do differing-variable face constraints in a union payload. A transitive generic union whose name is unavailable is reported as unsupported instead of hiding its arguments. Unfixed decimal literals default to `@ud` in gate-free inferred types; mutually recursive local groups and recursive molds, general branch tag context, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; a wrapper regression also rejects forged subjects, samples and tails. Its golden fixtures include three real Tlon files. A Clay test passes a Ford-built nested union through the reader into partial inference. The partial prelude includes `murn`, `join`, `snip`, `rear` and the newly agreed shared-type `clap`, parsed but still awaiting checker and backend validation, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
23+
24+The shared prelude interface reserves every name present in the supplied vendored source and makes only supported inferred entries available, including `list`, `unit`, `same`, `fall`, `need`, `lure`, `weld`, `snoc` and `turn`. The validated standard `list` mold is injected when the prelude’s own gates are inferred; `weld` and `turn` have ordinary explicit result casts. An absent or altered `list` is not injected, and an altered declaration cannot leak through direct or transitive mold aliases. List-dependent prelude mold aliases remain unsupported because their templates are prepared before injection. Unsupported entries such as most list helpers remain reserved but unavailable; backend validation of the helpers remains outstanding. All callers use the same prelude origin, so a library can export a type containing unqualified `(unit A)` to another module. Preparation rejects empty, malformed, conflicting or import-bearing source; the prepared value is trusted and must come unchanged from `+prepare-prelude`. The module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship. The source and checker remain incomplete, so this does not establish complete shadowing coverage or a checked module.
2325
2426## Milestone 1: parser and mark
2527
@@ -37,9 +39,9 @@ What the plan asks for, and where it is:
3739
3840Besides the plan's list:
3941
40−- 393 golden cases: 177 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 393-case corpus passed under `urbit eval` in 20.0 s. The fake ship passed all 396 tests, including the importer, importer/checker bridge and unification checks, with 18.9 s for sync and 8.9 s for tests. The importer golden compares 35 projections; `tools/clay-fixtures` also built all seven example Hoon fixtures through Clay.
42−- `tools/testdata/selftest` (19 checks) and `tools/testdata/ship-selftest` test the tools themselves.
42+- 539 golden cases: 323 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.
43+- The 539-case corpus passed under `urbit eval` in 63.0 s. The fake ship passed all 545 tests, including the importer, importer/checker and mark/checker bridges, module scope and unification checks, with 37.7 s for sync and 18.5 s for tests. The importer golden compares 149 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, checks a recursive Ford import's origin, and passes Clay-built types through the Clay-built importer and partial checker.
44+- `tools/testdata/selftest` (22 checks) and `tools/testdata/ship-selftest` test the tools themselves.
4345- 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.
4446- 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).
4547
@@ -55,22 +57,66 @@ Besides the plan's list:
5557| ab797a9 | 2026-10-30 | The 12 grammar decisions of 2026-10-30: four changed the parser, eight confirmed it |
5658| aad6ddb | 2026-10-30 | Drop `$?`; `+$` takes union cases below its name |
5759| 1dd92a6 | 2026-10-30 | Begin type inference and Hoon imports |
58−| This change | 2026-10-30 | Extend partial inference and importer, record type and prelude decisions |
60+| 51ce4d9 | 2026-10-30 | Extend partial inference and importer, record type and prelude decisions |
61+| be6d2a5 | 2026-10-30 | Add atom widening, nested collections and case-local Hoon import fixtures |
62+| 26554ac | 2026-10-30 | Infer an atom constraint, extend the prelude and read example molds through Clay |
63+| fbeaa83 | 2026-10-30 | Extend atom constraints and nested ordered-map imports; connect Clay types to partial inference |
64+| 47a1f49 | 2026-10-30 | Read validated Ford imports, widen aura families, and show both sites of selected errors |
65+| bd37989 | 2026-10-30 | Read mark samples and test partial mark imports; reject unproven nested `$^`; preserve atom constraints through aliases |
66+| 2d5deb2 | 2026-10-30 | Default gate-free decimal types, validate named Hoon mold lookup, and isolate fixture failures |
67+| 1b7dbae | 2026-10-30 | Infer acyclic local definitions and parse case-local Jibb module fixtures |
68+| 8b9c9ac | 2026-10-30 | Preserve recursive import origins, infer simple local molds, and supply Jibb module sources to the partial checker |
69+| 529736a | 2026-10-30 | Infer supported library import graphs and guard nested Hoon `$^` in collections |
70+| 8bf1b12 | 2026-10-30 | Infer selected record faces and check nested `$^` in static Hoon records |
71+| d8ac47d | 2026-10-30 | Cache library interfaces, preserve imported Hoon record faces, and check nested tagged unions |
72+| edd9277 | 2026-10-30 | Infer nonrecursive generic mold aliases with lexical parameters |
73+| 4406f6f | 2026-10-30 | Resolve selected contextual tags and check explicit imported unions |
74+| 5c73614 | 2026-10-30 | Print supported named and escaping union types |
75+| 0070584 | 2026-10-30 | Propagate union context through loobean branches, read selected unions in Hoon collections, and add `flit` |
76+| 250564c | 2026-10-30 | Infer selected named generic unions, test Hoon collection wrappers, and add list helpers |
77+| e95ef8f | 2026-10-30 | Bridge selected Hoon unions into partial inference and support generic union aliases |
78+| 56a899f | 2026-10-30 | Infer matching variable types in faced fields and bridge opaque Hoon collections |
79+| 4d45d2f | 2026-10-30 | Resolve selected contextual null literals |
80+| e878edc | 2026-10-30 | Infer complete unit-shaped branches and bridge selected recursive Hoon molds |
81+| 743dfd8 | 2026-10-30 | Propagate union context through unit-shaped branches |
82+| 3f90fa8 | 2026-10-30 | Share a partial prelude interface across module inference |
83+| 29bd39f | 2026-10-30 | Infer contextual list literals and validate prelude parity |
84+| a2a6ef5 | 2026-10-30 | Infer complete list-shaped branches |
85+| 671fe72 | 2026-10-30 | Infer contextual list nulls and cons cells |
86+| 7e69436 | 2026-10-30 | Infer selected self-recursive gates |
87+| 9ab52e8 | 2026-10-30 | Infer recursive branches with closed base types |
88+| d782b45 | 2026-10-30 | Propagate list context and apply settled type decisions |
89+| c7082e0 | 2026-10-30 | Infer multi-argument calls |
90+| 918acbd | 2026-10-30 | Infer recursive gates from their samples first |
91+| 1470d18 | 2026-10-30 | Infer selected prelude list helpers |
92+| 10cbf9c | 2026-10-30 | Infer selected local recursive gates and distinguish reader diagnostics |
93+| 45afb13 | 2026-10-30 | Infer local capital scopes and report direct reader diagnostics |
94+| 054e651 | 2026-10-30 | Report nested reader diagnostics |
95+| 98c19cd | 2026-10-30 | Infer known-aura string interpolation |
96+| ddba633 | 2026-10-30 | Infer top-level mutually recursive gates |
97+| 9f1517e | 2026-10-30 | Infer whole-case union patterns and prelude `turn` |
98+| 9dd35c8 | 2026-10-31 | Match finite boolean refinements of union cases |
99+| 54852d4 | 2026-10-31 | Contextualize tuple calls and infer known record changes |
100+| 0bc5113 | 2026-10-31 | Contextualize record initializers and infer unit construction |
101+| 264a436 | 2026-10-31 | Contextualize unit payloads in casts, calls and nested values |
102+| This change | 2026-10-31 | Report missing union tags and infer prelude unit helpers |
59103
60104## Checking it
61105
62106On a machine set up as [development.md](development.md) says:
63107
64108```
65−tools/golden # 393 cases under urbit eval
109+tools/golden # 539 cases under urbit eval
66110tools/importer-test # the Hoon importer fixture projection
67111tools/type-import-test # the importer/checker bridge fixture
112+tools/type-mark-test # the mark/checker bridge fixture
113+tools/type-module-scope-test # module and prelude scope fixture
68114tools/hoon check-spans-test # prints <<>> when the span checker works
69115tools/testdata/selftest # the tools themselves
70116tools/doc-blocks docs/spec # the doc's examples are golden cases
71117tools/ship start
72118tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
73−tools/ship test # the same 393 cases as -test arms on the ship
119+tools/ship test # the same 539 cases as -test arms on the ship
74120tools/testdata/ship-selftest
75121tools/ship check-commit # |commit stores .jibb files
76122tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb-import.hoon+992−55
@@ -11,10 +11,18 @@
1111:: a repeated named hold becomes a module-qualified reference.
1212::
1313:: A direct $^ is read from its original branches and accepted only when
14−:: their imported shapes prove disjoint. Nested $^ and some valid but
15−:: unprovably disjoint cases remain unsupported. Source-level overlap in
16−:: other unions, nested collection arguments, ordered maps, Ford import
17−:: provenance, marks and full error locations still need work.
14+:: their imported shapes prove disjoint. A single nested $^ in a
15+:: static record is checked by splitting and reassembling its branches;
16+:: other nested forms and unprovably disjoint cases remain unsupported. Source-level overlap in
17+:: other unions, general nested ordered maps, broader Ford subject
18+:: shapes, ambiguous recursive origins and full error locations still
19+:: need work. One direct union argument to a standard collection is
20+:: recovered only from its exact call wrapper, static independent cases,
21+:: proven disjoint branches and unshadowed standard names. Other source
22+:: shapes fail closed. A nested ordered map is recovered only when its key and
23+:: value are fixed atom molds and
24+:: the other fields are fixed atoms or collections of static atoms;
25+:: other source shapes fail closed.
1826::
1927:: The checker has a small bridge for successful unfaced atom and cell
2028:: results; it rejects other importer shapes. Failures return %|; no
@@ -32,6 +40,12 @@
3240 [%apply name=term args=(list imported)]
3341 [%ref module=term name=term]
3442 [%bad reason=@t]
43+ [%invalid code=?(%aura %core) reason=@t]
44+ ==
45++$ import-diagnostic
46+ $% [%ok value=imported]
47+ [%invalid code=?(%aura %core) message=@t]
48+ [%unsupported message=@t]
3549 ==
3650+$ signatures (list [name=term code=hoon])
3751+$ visiting (list [typ=type name=(unit term)])
@@ -63,16 +77,98 @@
6377 (read-with module name typ ~)
6478::
6579:: +read-mold-in: accept the /sur core as provenance. The core must be
66−:: built directly against zuse and its selected arm must be this type;
67−:: imported Ford subjects need a future provenance-aware host.
80+:: built against zuse or validated Ford imports, and its selected arm
81+:: must be this type. Unknown subject shapes fail closed.
6882++ read-mold-in
6983 |= [module=term name=term typ=type cor=type]
7084 ^- (each imported @t)
7185 ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
72− ?. =(q.q.cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
86+ ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
87+ ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
88+ =/ chapters=(map term tome) q.r.q.cor
89+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
90+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
7391 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
7492 [%| 'Hoon module provenance does not match the selected mold']
75− (read-with module name typ [~ cor])
93+ =/ result (read-with module name typ [~ cor])
94+ ?. ?=([%& *] result) result
95+ result
96+::
97+:: +read-named is the source-aware entry point for callers that have
98+:: not selected a Hoon type yet. Check the core and the local arm
99+:: before invoking Hoon's type engine, which otherwise crashes when
100+:: the requested name is absent.
101+++ read-named
102+ |= [module=term name=term cor=type]
103+ ^- (each imported @t)
104+ ?. ?=([%core *] cor) [%| 'Hoon module provenance is unavailable']
105+ ?: =(cor -:!>(..zuse)) [%| 'Hoon module provenance is unavailable']
106+ ?. (scope-safe cor %$) [%| 'Hoon module provenance is unavailable']
107+ =/ chapters=(map term tome) q.r.q.cor
108+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
109+ [%| (crip "Hoon mold `{(trip name)}` is not declared")]
110+ =/ attempted=(each type tang)
111+ (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
112+ ?- attempted
113+ [%& *] (read-mold-in module name p.attempted cor)
114+ [%| *]
115+ =/ lines=wall (zing (turn (flop p.attempted) |=(a=tank (wash [0 80] a))))
116+ =/ rev=wall (flop lines)
117+ ?~ rev [%| (crip "Hoon mold `{(trip name)}` could not be evaluated")]
118+ [%| (crip "Hoon mold `{(trip name)}` could not be evaluated: {i.rev}")]
119+ ==
120+::
121+:: A mark door's payload is [sample build-subject]. Its outer sample
122+:: face names the door sample, not the imported mark type. Collection
123+:: lookup for the sample happened against the pre-door build subject.
124+++ read-mark
125+ |= [name=term cor=type]
126+ ^- (each imported @t)
127+ ?. ?=([%core *] cor) [%| 'Hoon mark provenance is unavailable']
128+ ?. ?=([%cell *] p.cor) [%| 'Hoon mark sample is unavailable']
129+ ?. =(p.cor q.q.cor) [%| 'Hoon mark provenance is unavailable']
130+ ?. (scope-safe q.p.cor %$) [%| 'Hoon mark provenance is unavailable']
131+ =/ sample=type p.p.cor
132+ =/ raw=type ?:(?=([%face *] sample) q.sample sample)
133+ =/ result (read-with name name raw [~ q.p.cor])
134+ ?. ?=([%& *] result) result
135+ result
136+::
137+++ read-named-diagnostic
138+ |= [module=term name=term cor=type]
139+ ^- import-diagnostic
140+ =/ result=(each imported @t) (read-named module name cor)
141+ ?: ?=(%& -.result) [%ok p.result]
142+ ?. ?=([%core *] cor) [%unsupported p.result]
143+ ?: =(cor -:!>(..zuse)) [%unsupported p.result]
144+ ?. (scope-safe cor %$) [%unsupported p.result]
145+ =/ chapters=(map term tome) q.r.q.cor
146+ ?. (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
147+ [%unsupported p.result]
148+ =/ selected=(each type tang) (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
149+ ?. ?=(%& -.selected) [%unsupported p.result]
150+ =/ again=(each imported tang) (mule |.((walk module p.selected catalog ~ [~ cor])))
151+ ?. ?=(%& -.again) [%unsupported p.result]
152+ =/ evidence=(unit import-diagnostic) (first-invalid p.again)
153+ ?~ evidence [%unsupported p.result]
154+ u.evidence
155+::
156+++ read-mark-diagnostic
157+ |= [name=term cor=type]
158+ ^- import-diagnostic
159+ =/ result=(each imported @t) (read-mark name cor)
160+ ?: ?=(%& -.result) [%ok p.result]
161+ ?. ?=([%core *] cor) [%unsupported p.result]
162+ ?. ?=([%cell *] p.cor) [%unsupported p.result]
163+ ?. =(p.cor q.q.cor) [%unsupported p.result]
164+ ?. (scope-safe q.p.cor %$) [%unsupported p.result]
165+ =/ sample=type p.p.cor
166+ =/ raw=type ?:(?=([%face *] sample) q.sample sample)
167+ =/ again=(each imported tang) (mule |.((walk name raw catalog ~ [~ q.p.cor])))
168+ ?. ?=(%& -.again) [%unsupported p.result]
169+ =/ evidence=(unit import-diagnostic) (first-invalid p.again)
170+ ?~ evidence [%unsupported p.result]
171+ u.evidence
76172::
77173++ read-with
78174 |= [module=term name=term typ=type context=(unit type)]
@@ -102,6 +198,11 @@
102198 =/ w=wing p.p.q.p.body
103199 ?: =(w ~[%jar]) [~ %jar]
104200 ?: =(w ~[%jug]) [~ %jug]
201+ ?: =(w ~[%map]) [~ %map]
202+ ?: =(w ~[%set]) [~ %set]
203+ ?: =(w ~[%qeu]) [~ %qeu]
204+ ?: =(w ~[%list]) [~ %list]
205+ ?: =(w ~[%unit]) [~ %unit]
105206 ~
106207::
107208++ hold-alias
@@ -112,8 +213,139 @@
112213::
113214:: Reconcile source aliases with the expanded type in corresponding
114215:: cells and fields. Return an error unless every alias is accounted for.
216+++ recover-spec
217+ |= [src=spec out=imported]
218+ ^- (each imported @t)
219+ ?. (has-hidden-alias src) [%& out]
220+ ?. ?=([%make [%wing *] *] src)
221+ [%| 'nested collection arguments need source-aware import']
222+ =/ w=wing p.p.src
223+ =/ name=term
224+ ?: =(w ~[%jar]) %jar
225+ ?: =(w ~[%jug]) %jug
226+ ?: =(w ~[%map]) %map
227+ ?: =(w ~[%set]) %set
228+ ?: =(w ~[%qeu]) %qeu
229+ ?: =(w ~[%list]) %list
230+ ?: =(w ~[%unit]) %unit
231+ %$
232+ ?: =(%$ name) [%| 'nested collection arguments need source-aware import']
233+ =/ original=(each imported @t)
234+ ?: |(=(%jar name) =(%jug name))
235+ ?. ?=([%apply %map [* [%apply * [* ~]] ~]] out)
236+ [%| 'nested collection arguments need source-aware import']
237+ =/ inn i.args.i.t.args.out
238+ ?. |(&(?=(%jar name) ?=(%list name.i.t.args.out)) &(?=(%jug name) ?=(%set name.i.t.args.out)))
239+ [%| 'nested collection arguments need source-aware import']
240+ [%& [%apply name ~[i.args.out inn]]]
241+ [%& out]
242+ ?. ?=([%& *] original) original
243+ =/ fixed=imported p.original
244+ ?. ?=([%apply *] fixed) [%| 'nested collection arguments need source-aware import']
245+ ?. =(name name.fixed) [%| 'nested collection arguments need source-aware import']
246+ =/ args (recover-specs q.src args.fixed)
247+ ?- args
248+ [%| *] args
249+ [%& *] [%& [%apply name p.args]]
250+ ==
251+::
252+++ recover-specs
253+ |= [src=(list spec) args=(list imported)]
254+ ^- (each (list imported) @t)
255+ ?~ src ?~(args [%& ~] [%| 'collection argument count mismatch'])
256+ ?~ args [%| 'collection argument count mismatch']
257+ =/ first (recover-spec i.src i.args)
258+ ?- first
259+ [%| *] [%| p.first]
260+ [%& *]
261+ =/ rest $(src t.src, args t.args)
262+ ?- rest
263+ [%| *] rest
264+ [%& *] [%& [p.first p.rest]]
265+ ==
266+ ==
267+::
268+++ recover-hoons
269+ |= [src=(list hoon) args=(list imported)]
270+ ^- (each (list imported) @t)
271+ ?~ src ?~(args [%& ~] [%| 'collection argument count mismatch'])
272+ ?~ args [%| 'collection argument count mismatch']
273+ =/ first=(each imported @t)
274+ ?. (has-hidden-alias i.src) [%& i.args]
275+ ?. ?=([%ktcl *] i.src) [%| 'nested collection arguments need source-aware import']
276+ (recover-spec p.i.src i.args)
277+ ?- first
278+ [%| *] [%| p.first]
279+ [%& *]
280+ =/ rest $(src t.src, args t.args)
281+ ?- rest
282+ [%| *] rest
283+ [%& *] [%& [p.first p.rest]]
284+ ==
285+ ==
286+::
287+:: Replace direct mop expressions in records with a simple placeholder;
288+:: recover-alias restores each from its original source specs afterward.
289+:: Other fields must be fixed atom molds or standard collections with
290+:: statically fixed atom arguments. A dependent mold could otherwise
291+:: change when a field changes. All collection names are checked below.
292+++ static-spec
293+ |= shape=spec
294+ ^- ?
295+ ?+ shape |
296+ [%base *] ?=([%atom *] p.shape)
297+ [%make *]
298+ ?. ?=([%wing *] p.shape) |
299+ =/ w=wing p.p.shape
300+ ?. |(=(w ~[%map]) =(w ~[%set]) =(w ~[%qeu]) =(w ~[%list]) =(w ~[%unit]) =(w ~[%jar]) =(w ~[%jug])) |
301+ (levy q.shape |=(a=spec (static-spec a)))
302+ ==
303+::
304+++ static-arguments
305+ |= args=(list hoon)
306+ ^- ?
307+ ?~ args &
308+ ?. ?=([%ktcl *] i.args) |
309+ ?. (static-spec p.i.args) |
310+ $(args t.args)
311+::
312+++ static-collection
313+ |= src=hoon
314+ ^- ?
315+ =/ alias (source-alias src)
316+ ?~ alias |
317+ ?> ?=([%cncl *] src)
318+ ?> ?=([%tsgr *] p.src)
319+ ?> ?=([%cncl *] q.p.src)
320+ (static-arguments q.q.p.src)
321+::
322+++ patchable-mop-record
323+ |= src=hoon
324+ ^- ?
325+ ?^ -.src &($(src -.src) $(src +.src))
326+ ?+ src |
327+ [%note *] $(src q.src)
328+ [%ktts *] $(src q.src)
329+ [%ktls *] ?=([%sand *] p.src)
330+ [%cncl *]
331+ =/ specs (mop-specs src)
332+ ?~ specs (static-collection src)
333+ &(?=([%base [%atom *]] key.u.specs) ?=([%base [%atom *]] value.u.specs))
334+ ==
335+::
336+++ patch-mops
337+ |= src=hoon
338+ ^- hoon
339+ ?^ -.src [$(src -.src) $(src +.src)]
340+ ?+ src src
341+ [%note *] src(q $(src q.src))
342+ [%ktts *] src(q $(src q.src))
343+ [%cncl *] ?: ?=(^ (mop-specs src)) (ream '*@t')
344+ src
345+ ==
346+::
115347++ recover-alias
116− |= [src=hoon out=imported]
348+ |= [src=hoon out=imported subject=type module=term sig=signatures seen=visiting context=(unit type)]
117349 ^- (each imported @t)
118350 ?. (has-hidden-alias src) [%& out]
119351 ?^ -.src
@@ -139,27 +371,41 @@
139371 [%& *] [%& [%face name.out p.child]]
140372 ==
141373 [%cncl *]
374+ =/ mop=(unit [key=spec value=spec]) (mop-specs src)
375+ ?^ mop
376+ =/ attempt=(each [type type] tang)
377+ (mule |.([(~(play ut subject) [%kttr key.u.mop]) (~(play ut subject) [%kttr value.u.mop])]))
378+ ?- attempt
379+ [%| *] [%| 'a nested Hoon mop needs source-aware import']
380+ [%& *]
381+ =/ key (walk module -.p.attempt sig seen context)
382+ =/ val (walk module +.p.attempt sig seen context)
383+ [%& [%apply %mop ~[key val]]]
384+ ==
142385 =/ alias (source-alias src)
143386 ?~ alias [%| 'a nested collection alias needs source-aware import']
144− ?: (gth (alias-count src) 1)
145− [%| 'nested collection arguments need source-aware import']
146− ?. ?=([%apply %map [* [%apply * [* ~]] ~]] out)
147− [%| 'a nested collection alias needs source-aware import']
148− =/ inner i.args.i.t.args.out
149− ?: &(?=(%jar u.alias) ?=(%list name.i.t.args.out))
150− [%& [%apply %jar ~[i.args.out inner]]]
151− ?: &(?=(%jug u.alias) ?=(%set name.i.t.args.out))
152− [%& [%apply %jug ~[i.args.out inner]]]
153− [%| 'a nested collection alias needs source-aware import']
387+ =/ original=(each imported @t)
388+ ?: |(=(%jar u.alias) =(%jug u.alias))
389+ ?. ?=([%apply %map [* [%apply * [* ~]] ~]] out)
390+ [%| 'a nested collection alias needs source-aware import']
391+ =/ inner i.args.i.t.args.out
392+ ?. |(&(?=(%jar u.alias) ?=(%list name.i.t.args.out)) &(?=(%jug u.alias) ?=(%set name.i.t.args.out)))
393+ [%| 'a nested collection alias needs source-aware import']
394+ [%& [%apply u.alias ~[i.args.out inner]]]
395+ [%& out]
396+ ?. ?=([%& *] original) original
397+ =/ fixed=imported p.original
398+ ?. ?=([%apply *] fixed) [%| 'a nested collection alias needs source-aware import']
399+ ?. =(name.fixed u.alias) [%| 'a nested collection alias needs source-aware import']
400+ ?> ?=([%tsgr *] p.src)
401+ ?> ?=([%cncl *] q.p.src)
402+ =/ args (recover-hoons q.q.p.src args.fixed)
403+ ?- args
404+ [%| *] [%| p.args]
405+ [%& *] [%& [%apply u.alias p.args]]
406+ ==
154407 ==
155408::
156−++ alias-count
157− |= h=*
158− ^- @ud
159− ?: |(=(h [%wing ~[%jar]]) =(h [%wing ~[%jug]]) =(h [%wing ~[%mop]])) 1
160− ?@ h 0
161− (add $(h -.h) $(h +.h))
162−::
163409++ has-hidden-alias
164410 |= h=*
165411 ^- ?
@@ -169,15 +415,69 @@
169415::
170416:: $^ is lowered to a conditional by Hoon's parser; conservatively
171417:: reject its distinctive test until the original branches have been
172−:: checked for disjointness. Other Hoon code can produce the same test,
173−:: so this partial reader may reject some supported molds too.
418+:: checked for disjointness. The tested axis follows the field path;
419+:: tracking that path distinguishes a nested $^ from an ordinary $@.
420+:: Other Hoon code can look the same, so some valid molds may be rejected.
421+:: Collection argument syntax retains $^ as %bckt, before Hoon
422+:: reduces the resulting type and can collapse overlapping cases. Until
423+:: argument-level disjointness is checked, reject those source forms.
424+++ has-spec-cell-union
425+ |= h=*
426+ ^- ?
427+ ?@ h |
428+ ?: ?=([%bckt ^ ^] h) &
429+ |($(h -.h) $(h +.h))
430+::
431+:: The Grammar's disjointness rule applies to imported $% and $? too;
432+:: @iko confirmed the rule for imported unions on 2026-10-30.
433+++ has-spec-general-union
434+ |= h=*
435+ ^- ?
436+ ?@ h |
437+ ?: ?=([%bcwt [^ [^ *]]] h) &
438+ ?: ?=([%bccn [^ [^ *]]] h) &
439+ |($(h -.h) $(h +.h))
440+::
441+++ has-fits-union
442+ |= h=*
443+ ^- ?
444+ ?@ h |
445+ ?: ?=([%wtcl [%fits *] * *] h) &
446+ |($(h -.h) $(h +.h))
447+::
448+++ fits-union-at
449+ |= [h=hoon axis=@ud]
450+ ^- ?
451+ ?. ?=([%fits *] h) |
452+ |(=(q.h ~[[%.y axis]]) =(q.h ~[[%.y (mul 2 axis)]]))
453+::
174454++ has-cell-union
455+ |= h=hoon
456+ ^- ?
457+ ?. ?=([%tsls [%note * *] *] h) (has-cell-union-any h)
458+ (has-cell-union-at q.p.h 6)
459+::
460+++ has-cell-union-any
175461 |= h=*
176462 ^- ?
177463 ?@ h |
178464 ?: =(h [%dtwt [%$ 12]]) &
179465 |($(h -.h) $(h +.h))
180466::
467+++ has-cell-union-at
468+ |= [h=hoon axis=@ud]
469+ ^- ?
470+ ?^ -.h
471+ |($(h -.h, axis (mul 2 axis)) $(h +.h, axis (add 1 (mul 2 axis))))
472+ ?+ h (has-cell-union-any h)
473+ [%note *] $(h q.h)
474+ [%dbug *] $(h q.h)
475+ [%ktts *] $(h q.h)
476+ [%wtcl *]
477+ ?: =(p.h [%dtwt [%$ (mul 2 axis)]]) &
478+ |($(h q.h) $(h r.h))
479+ ==
480+::
181481++ cell-branches
182482 |= h=type
183483 ^- (unit [left=type right=type])
@@ -198,6 +498,112 @@
198498 [%| *] ~
199499 ==
200500::
501+:: A static branch contains atom molds, exact tag constants and cells.
502+:: A tag shape must compare the current axis to the same atom it returns.
503+++ fixed-cell-mold
504+ |= [h=hoon axis=@ud]
505+ ^- ?
506+ ?^ -.h
507+ &($(h -.h, axis (mul 2 axis)) $(h +.h, axis (add 1 (mul 2 axis))))
508+ ?+ h |
509+ [%note *] $(h q.h)
510+ [%dbug *] $(h q.h)
511+ [%ktts *] $(h q.h)
512+ [%ktls *] ?=([%sand *] p.h)
513+ [%cncl *]
514+ ?: =(h [%cncl [%tsgr [%wing ~[[%.y 7]]] [%wing ~[%path]]] ~[[%$ axis]]]) &
515+ (static-collection h)
516+ [%wtcl *]
517+ ?. (fits-union-at p.h axis) |
518+ &($(h q.h) $(h r.h))
519+ [%wtgr *]
520+ ?: =(h [%wtgr [%dtts [%bust %noun] [%$ axis]] [%rock %n 0]]) &
521+ ?. ?=([%dtts [%$ *] [%rock %$ *]] p.h) |
522+ ?. ?=([%rock %tas *] q.h) |
523+ ?^ q.q.h |
524+ &(=(p.p.p.h axis) =(q.q.p.h q.q.h))
525+ ==
526+::
527+:: Return two source records with a single $^ replaced by each branch.
528+++ split-cell-record
529+ |= [h=hoon axis=@ud]
530+ ^- (unit [one=hoon two=hoon])
531+ ?^ -.h
532+ =/ left $(h -.h, axis (mul 2 axis))
533+ =/ right $(h +.h, axis (add 1 (mul 2 axis)))
534+ ?^ left
535+ ?^ right ~
536+ ?. (fixed-cell-mold +.h (add 1 (mul 2 axis))) ~
537+ [~ [[one.u.left +.h] [two.u.left +.h]]]
538+ ?~ right ~
539+ ?. (fixed-cell-mold -.h (mul 2 axis)) ~
540+ [~ [[-.h one.u.right] [-.h two.u.right]]]
541+ ?+ h ~
542+ [%note *]
543+ =/ out $(h q.h)
544+ ?~ out ~
545+ [~ [h(q one.u.out) h(q two.u.out)]]
546+ [%dbug *]
547+ =/ out $(h q.h)
548+ ?~ out ~
549+ [~ [h(q one.u.out) h(q two.u.out)]]
550+ [%ktts *]
551+ =/ out $(h q.h)
552+ ?~ out ~
553+ [~ [h(q one.u.out) h(q two.u.out)]]
554+ [%wtcl *]
555+ ?. |(=(p.h [%dtwt [%$ (mul 2 axis)]]) (fits-union-at p.h axis)) ~
556+ ?. &((fixed-cell-mold q.h axis) (fixed-cell-mold r.h axis)) ~
557+ [~ [q.h r.h]]
558+ ==
559+::
560+:: Reassemble a split source record. Non-union fields must have remained
561+:: unchanged; the replaced field must have provably disjoint branches.
562+++ merge-cell-record
563+ |= [h=hoon axis=@ud a=imported b=imported]
564+ ^- (each imported @t)
565+ ?^ -.h
566+ ?. &(?=([%cell *] a) ?=([%cell *] b))
567+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
568+ =/ left $(h -.h, axis (mul 2 axis), a head.a, b head.b)
569+ ?. ?=([%& *] left) left
570+ =/ right $(h +.h, axis (add 1 (mul 2 axis)), a tail.a, b tail.b)
571+ ?. ?=([%& *] right) right
572+ [%& [%cell p.left p.right]]
573+ ?+ h
574+ ?: =(a b) [%& a]
575+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
576+ [%note *] $(h q.h)
577+ [%dbug *] $(h q.h)
578+ [%ktts *]
579+ ?. &(?=([%face *] a) ?=([%face *] b))
580+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
581+ ?. &(=(p.h name.a) =(p.h name.b))
582+ [%| 'a nested Hoon $^ union needs a source-level disjointness check']
583+ =/ child $(h q.h, a body.a, b body.b)
584+ ?. ?=([%& *] child) child
585+ [%& [%face name.a p.child]]
586+ [%wtcl *]
587+ ?. |(=(p.h [%dtwt [%$ (mul 2 axis)]]) (fits-union-at p.h axis))
588+ [%| 'a Hoon union needs a source-level disjointness check']
589+ ?. (disjoint a b)
590+ ?: ?=([%fits *] p.h) [%| 'Hoon union disjointness could not be verified']
591+ [%| 'Hoon $^ union disjointness could not be verified']
592+ [%& [%fork (sort (weld (union-cases a) (union-cases b)) |=(pair=[imported imported] (dor -.pair +.pair)))]]
593+ ==
594+++ union-cases
595+ |= a=imported
596+ ^- (list imported)
597+ ?. ?=([%fork *] a) ~[a]
598+ (zing (turn cases.a |=(item=imported (union-cases item))))
599+::
600+++ all-disjoint
601+ |= cases=(list imported)
602+ ^- ?
603+ ?~ cases &
604+ ?. (levy t.cases |=(item=imported (disjoint i.cases item))) |
605+ $(cases t.cases)
606+::
201607++ disjoint
202608 |= [a=imported b=imported]
203609 ^- ?
@@ -264,16 +670,33 @@
264670 ?~ has &
265671 u.has
266672::
673+:: Verify every lexical subject layer until the exact standard subject.
674+:: Refuse unknown forms, malformed chapters, mismatched core payloads,
675+:: faces that shadow the selected name, and imported arms of that name.
676+++ scope-safe
677+ |= [scope=type target=term]
678+ ^- ?
679+ ?: =(scope -:!>(..zuse)) &
680+ ?- scope
681+ [%cell *]
682+ ?. ?=([%face *] p.scope) |
683+ ?^ p.p.scope |
684+ ?: =(p.p.scope target) |
685+ ?. ?=([%core *] q.p.scope) |
686+ &($(scope q.p.scope) $(scope q.scope))
687+ [%core *]
688+ ?. =(p.scope q.q.scope) |
689+ =/ chapters=(map term tome) q.r.q.scope
690+ ?: (lien ~(tap by chapters) |=(entry=[term tome] (chapter-unsafe +.entry target))) |
691+ $(scope p.scope)
692+ * |
693+ ==
694+::
267695++ alias-safe
268696 |= [context=(unit type) target=term]
269697 ^- ?
270698 ?~ context |
271− =/ cor=type u.context
272− ?. ?=([%core *] cor) |
273− ?. =(q.q.cor -:!>(..zuse)) |
274− =/ chapters=(map term tome) q.r.q.cor
275− ?: (lien ~(tap by chapters) |=(entry=[term tome] (chapter-unsafe +.entry target))) |
276− &
699+ (scope-safe u.context target)
277700::
278701++ source-uses
279702 |= [src=* target=term]
@@ -282,6 +705,50 @@
282705 ?@ src |
283706 |($(src -.src) $(src +.src))
284707::
708+++ mop-specs-raw
709+ |= body=hoon
710+ ^- (unit [key=spec value=spec])
711+ ?. ?=([%cncl *] body) ~
712+ ?. ?=([%tsgr *] p.body) ~
713+ =/ b=hoon q.p.body
714+ ?. ?=([%cncl *] b) ~
715+ ?. ?=([%cncl *] p.b) ~
716+ ?. ?=([%wing *] p.p.b) ~
717+ ?. =(p.p.p.b ~[%mop]) ~
718+ =/ specs=(list spec) ;;((list spec) q.p.b)
719+ ?. ?=([* [* ~]] specs) ~
720+ [~ [i.specs i.t.specs]]
721+::
722+++ mop-specs
723+ |= body=hoon
724+ ^- (unit [key=spec value=spec])
725+ =/ attempt=(each (unit [key=spec value=spec]) tang)
726+ (mule |.((mop-specs-raw body)))
727+ ?- attempt
728+ [%& *] p.attempt
729+ [%| *] ~
730+ ==
731+::
732+++ mop-arguments-raw
733+ |= h=type
734+ ^- (unit [key=type value=type])
735+ ?. ?=([%hold *] h) ~
736+ =/ original=hoon q.h
737+ ?. ?=([%tsls [%note * *] *] original) ~
738+ =/ specs (mop-specs q.p.original)
739+ ?~ specs ~
740+ [~ [(~(play ut p.h) [%kttr key.u.specs]) (~(play ut p.h) [%kttr value.u.specs])]]
741+::
742+++ mop-arguments
743+ |= h=type
744+ ^- (unit [key=type value=type])
745+ =/ attempt=(each (unit [key=type value=type]) tang)
746+ (mule |.((mop-arguments-raw h)))
747+ ?- attempt
748+ [%& *] p.attempt
749+ [%| *] ~
750+ ==
751+::
285752++ match-signature
286753 |= [h=hoon sig=signatures]
287754 ^- (unit term)
@@ -296,6 +763,168 @@
296763 ?: =(typ typ.i.seen) [~ name.i.seen]
297764 $(seen t.seen)
298765::
766+:: Find the source module for an exact recursive hold by evaluating
767+:: locally declared arms of each validated core in the subject. An
768+:: unlabelled core, failed evaluation, or multiple labels is ambiguous.
769+++ origin-candidates
770+ |= [scope=type label=(unit term) name=term typ=type]
771+ ^- (list (unit term))
772+ ?: =(scope -:!>(..zuse)) ~
773+ ?- scope
774+ [%cell *]
775+ ?. ?=([%face *] p.scope) ~[~]
776+ ?^ p.p.scope ~[~]
777+ %+ weld
778+ $(scope q.p.scope, label [~ p.p.scope])
779+ $(scope q.scope, label ~)
780+ [%core *]
781+ =/ chapters=(map term tome) q.r.q.scope
782+ =/ present=? (lien ~(tap by chapters) |=(entry=[term tome] =((chapter-has +.entry name) [~ &])))
783+ =/ own=(list (unit term))
784+ ?. present ~
785+ =/ trial=(each type tang) (mule |.((~(play ut scope) (ream (cat 3 '*' name)))))
786+ ?- trial
787+ [%| *] ~[~]
788+ [%& *] ?: =(p.trial typ) ~[label]
789+ ~
790+ ==
791+ (weld own $(scope p.scope, label ~))
792+ * ~[~]
793+ ==
794+::
795+++ ref-origin
796+ |= [module=term name=term typ=type context=(unit type)]
797+ ^- (unit term)
798+ ?~ context ~
799+ =/ found (origin-candidates u.context [~ module] name typ)
800+ ?~ found ~
801+ ?~ i.found ~
802+ =/ choice=term u.i.found
803+ =/ same
804+ |= item=(unit term)
805+ ^- ?
806+ ?~ item |
807+ =(u.item choice)
808+ ?. (levy t.found same) ~
809+ [~ choice]
810+::
811+::
812+:: A collection case is independent of the subject only when its
813+:: original spec uses literal atoms, tags and finite record structure.
814+++ static-union-spec
815+ |= s=spec
816+ ^- ?
817+ ?+ s |
818+ [%base *] ?=([%atom *] p.s)
819+ [%leaf *] &
820+ [%bcts *] ?@ p.s $(s q.s)
821+ |
822+ [%bccl *] (static-union-specs p.s)
823+ ==
824+::
825+++ static-union-specs
826+ |= parts=(list spec)
827+ ^- ?
828+ ?~ parts &
829+ &((static-union-spec i.parts) $(parts t.parts))
830+::
831+++ union-spec-parts
832+ |= s=spec
833+ ^- (unit (list spec))
834+ ?+ s ~
835+ [%bcwt *] [~ p.s]
836+ [%bccn *] [~ p.s]
837+ [%bckt *] [~ ~[p.s q.s]]
838+ ==
839+::
840+:: Select one direct union argument, replacing exactly that spec with
841+:: @t. The other arguments must be static and cannot contain unions.
842+++ safe-union-parts
843+ |= cases=(list spec)
844+ ^- ?
845+ ?~ cases |
846+ ?~ t.cases |
847+ =/ rest=(list spec) t.cases
848+ &((static-union-spec i.cases) (levy rest |=(part=spec (static-union-spec part))))
849+::
850+++ split-union-arguments
851+ |= [args=(list hoon) index=@ud]
852+ ^- (unit [args=(list hoon) cases=(list spec) index=@ud])
853+ ?~ args ~
854+ ?. ?=([%ktcl *] i.args) ~
855+ =/ cases (union-spec-parts p.i.args)
856+ ?^ cases
857+ ?. (safe-union-parts u.cases) ~
858+ ?. (static-arguments t.args) ~
859+ [~ [[[%ktcl [%base [%atom %t]]] t.args] u.cases index]]
860+ ?. (static-spec p.i.args) ~
861+ =/ rest $(args t.args, index +(index))
862+ ?~ rest ~
863+ [~ [[i.args args.u.rest] cases.u.rest index.u.rest]]
864+::
865+++ replace-union-argument
866+ |= [args=(list imported) index=@ud union=imported]
867+ ^- (unit (list imported))
868+ ?~ args ~
869+ ?: =(index 0)
870+ ?. =([%atom %t ~] i.args) ~
871+ [~ [union t.args]]
872+ =/ rest $(args t.args, index (dec index))
873+ ?~ rest ~
874+ [~ [i.args u.rest]]
875+::
876+:: Accept only the compiler's direct collection call wrapper.
877+++ direct-collection-source
878+ |= [body=hoon original=hoon]
879+ ^- ?
880+ ?. ?=([%cncl [%tsgr * [%cncl *]] *] body) |
881+ ?. =(p.p.body [%wing ~[[%.y 7]]]) |
882+ ?. =(q.body ~[[%$ 6]]) |
883+ ?. ?=([%tsls * *] original) |
884+ =(q.original [%tsls [%dtts [%$ 14] [%$ 2]] [%$ 6]])
885+::
886+++ collection-union
887+ |= [typ=type module=term sig=signatures seen=visiting context=(unit type)]
888+ ^- imported
889+ ?. ?=([%hold *] typ) [%bad 'a Hoon union needs a source-level disjointness check']
890+ =/ is-cell=? (has-spec-cell-union q.typ)
891+ =/ unsupported=@t
892+ ?: is-cell 'a Hoon $^ union needs a source-level disjointness check'
893+ 'a Hoon union needs a source-level disjointness check'
894+ =/ original=hoon q.typ
895+ ?. ?=([%tsls [%note * *] *] original) [%bad unsupported]
896+ =/ body=hoon q.p.original
897+ =/ alias (source-alias body)
898+ ?~ alias [%bad unsupported]
899+ ?. (alias-safe context u.alias) [%bad 'Hoon collection provenance is unavailable or shadowed']
900+ =/ names=(list term) ~[%map %set %qeu %list %unit %jar %jug]
901+ ?: (lien names |=(n=term &((source-uses body n) !(alias-safe context n))))
902+ [%bad 'Hoon collection provenance is unavailable or shadowed']
903+ ?. (direct-collection-source body original) [%bad unsupported]
904+ ?> ?=([%cncl [%tsgr * [%cncl *]] *] body)
905+ =/ split (split-union-arguments q.q.p.body 0)
906+ ?~ split [%bad unsupported]
907+ =/ tried=(each (list type) tang)
908+ (mule |.((turn cases.u.split |=(s=spec (~(play ut p.typ) [%kttr s])))))
909+ ?. ?=([%& *] tried) [%bad unsupported]
910+ =/ cases=(list imported)
911+ (turn p.tried |=(t=type (walk module t sig seen context)))
912+ =/ err (first-bads cases)
913+ ?^ err [%bad u.err]
914+ ?. (all-disjoint cases)
915+ [%bad ?:(is-cell 'Hoon $^ union disjointness could not be verified' 'Hoon union disjointness could not be verified')]
916+ =/ rewritten=hoon original(q.p body(q.q.p args.u.split))
917+ =/ attempt=(each type tang) (mule |.((~(play ut p.typ) rewritten)))
918+ ?. ?=([%& *] attempt) [%bad unsupported]
919+ =/ out=imported (walk module p.attempt sig seen context)
920+ ?. ?=([%apply *] out) [%bad unsupported]
921+ ?. =(name.out u.alias) [%bad unsupported]
922+ =/ replacement=imported
923+ [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
924+ =/ args (replace-union-argument args.out index.u.split replacement)
925+ ?~ args [%bad unsupported]
926+ [%apply name.out u.args]
927+::
299928++ walk
300929 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
301930 ^- imported
@@ -304,19 +933,25 @@
304933 %void [%void ~]
305934 [%atom *]
306935 ?: |(=('s' (cut 3 [0 1] p.typ)) =('r' (cut 3 [0 1] p.typ)))
307− [%bad 'signed and float auras cannot be imported']
936+ [%invalid %aura 'signed and float auras cannot be imported']
308937 [%atom p.typ q.typ]
309938 [%cell *] [%cell $(typ p.typ) $(typ q.typ)]
310− [%core *] [%bad 'cores and gates cannot be imported']
939+ [%core *] [%invalid %core 'cores and gates cannot be imported']
311940 [%face *]
312941 ?@ p.typ [%face p.typ $(typ q.typ)]
313942 [%bad 'a complex Hoon face needs translation']
314943 [%fork *]
315944 =/ cases=(list imported)
316945 (turn ~(tap in:..zuse p.typ) |=(t=type ^$(typ t)))
946+ =/ err (first-bads cases)
947+ ?^ err [%bad u.err]
948+ ?. (all-disjoint cases) [%bad 'Hoon union disjointness could not be verified']
317949 [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
318950 [%hint *] $(typ q.typ)
319951 [%hold *]
952+ ?: &(?=([%tsls [%note * *] *] q.typ) |((has-spec-cell-union q.typ) (has-spec-general-union q.typ)))
953+ =/ nm (hold-name q.typ)
954+ (collection-union typ module sig [[typ nm] seen] context)
320955 =/ named=(unit term) (match-signature q.typ sig)
321956 ?^ named
322957 =/ name u.named
@@ -333,13 +968,46 @@
333968 =/ prior=(unit (unit term)) (find-seen typ seen)
334969 ?^ prior
335970 ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
336− [%ref module u.u.prior]
971+ =/ origin (ref-origin module u.u.prior typ context)
972+ ?~ origin [%bad 'a recursive Hoon mold needs unambiguous source provenance']
973+ [%ref u.origin u.u.prior]
337974 =/ nm (hold-name q.typ)
338− ?: =(nm [~ %vase]) [%bad 'vases cannot be imported']
975+ ?: =(nm [~ %vase]) [%bad 'a Hoon type named vase needs source provenance']
339976 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
340977 [%bad 'Hoon collection provenance is unavailable or shadowed']
341978 ?: &((source-uses q.typ %jug) !(alias-safe context %jug))
342979 [%bad 'Hoon collection provenance is unavailable or shadowed']
980+ ?: &((source-uses q.typ %mop) !(alias-safe context %mop))
981+ [%bad 'Hoon collection provenance is unavailable or shadowed']
982+ =/ mop (mop-arguments typ)
983+ ?^ mop
984+ [%apply %mop ~[$(typ key.u.mop) $(typ value.u.mop)]]
985+ ?: (source-uses q.typ %mop)
986+ =/ checked-names=(list term) ~[%map %set %qeu %list %unit]
987+ ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
988+ [%bad 'Hoon collection provenance is unavailable or shadowed']
989+ ?. ?=([%tsls [%note * *] *] q.typ)
990+ [%bad 'a nested Hoon mop needs source-aware import']
991+ =/ original=hoon q.typ
992+ ?> ?=([%tsls [%note * *] *] original)
993+ =/ source=hoon q.p.original
994+ ?. (patchable-mop-record source)
995+ [%bad 'a nested Hoon mop needs source-aware import']
996+ =/ patched=hoon (patch-mops source)
997+ ?: |(=(source patched) (source-uses patched %mop))
998+ [%bad 'a nested Hoon mop needs source-aware import']
999+ =/ replacement=hoon original(q.p patched)
1000+ =/ attempt=(each type tang) (mule |.((~(play ut p.typ) replacement)))
1001+ ?- attempt
1002+ [%| *] [%bad 'a nested Hoon mop needs source-aware import']
1003+ [%& *]
1004+ =/ projected $(typ p.attempt, seen [[typ nm] seen])
1005+ =/ corrected (recover-alias source projected p.typ module sig seen context)
1006+ ?- corrected
1007+ [%| *] [%bad p.corrected]
1008+ [%& *] p.corrected
1009+ ==
1010+ ==
3431011 =/ branches (cell-branches typ)
3441012 ?^ branches
3451013 =/ first $(typ left.u.branches, seen [[typ nm] seen])
@@ -348,9 +1016,33 @@
3481016 ?^ err [%bad u.err]
3491017 ?: (disjoint first second)
3501018 [%fork (sort ~[first second] |=(pair=[imported imported] (dor -.pair +.pair)))]
351− [%bad 'a Hoon $^ union has overlapping cases']
352− ?: (has-cell-union q.typ)
353− [%bad 'a Hoon $^ union needs a source-level disjointness check']
1019+ [%bad 'Hoon $^ union disjointness could not be verified']
1020+ ?: |((has-cell-union q.typ) (has-fits-union q.typ))
1021+ =/ cannot=@t
1022+ ?: (has-fits-union q.typ) 'a Hoon union needs a source-level disjointness check'
1023+ 'a Hoon $^ union needs a source-level disjointness check'
1024+ =/ checked-names=(list term) ~[%map %set %qeu %list %unit %jar %jug %path]
1025+ ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
1026+ [%bad 'Hoon collection provenance is unavailable or shadowed']
1027+ ?. ?=([%tsls [%note * *] *] q.typ)
1028+ [%bad cannot]
1029+ =/ original=hoon q.typ
1030+ ?> ?=([%tsls [%note * *] *] original)
1031+ =/ body=hoon q.p.original
1032+ =/ split (split-cell-record body 6)
1033+ ?~ split [%bad cannot]
1034+ =/ try=(each [type type] tang)
1035+ (mule |.([(~(play ut p.typ) original(q.p one.u.split)) (~(play ut p.typ) original(q.p two.u.split))]))
1036+ ?. ?=([%& *] try) [%bad cannot]
1037+ =/ first $(typ -.p.try, seen [[typ nm] seen])
1038+ =/ second $(typ +.p.try, seen [[typ nm] seen])
1039+ =/ err (first-bads ~[first second])
1040+ ?^ err [%bad u.err]
1041+ =/ combined (merge-cell-record body 6 first second)
1042+ ?- combined
1043+ [%& *] p.combined
1044+ [%| *] [%bad p.combined]
1045+ ==
3541046 =/ alias (hold-alias q.typ)
3551047 =/ hidden (has-hidden-alias q.typ)
3561048 =/ body $(typ ~(repo ut typ), seen [[typ nm] seen])
@@ -358,21 +1050,18 @@
3581050 ?. hidden body
3591051 ?. ?=([%tsls [%note * *] *] q.typ)
3601052 [%bad 'a nested collection alias needs source-aware import']
361− =/ corrected (recover-alias q.p.q.typ body)
1053+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
3621054 ?- corrected
3631055 [%& *] p.corrected
3641056 [%| *] [%bad p.corrected]
3651057 ==
366− ?: (gth (alias-count q.typ) 1)
367− [%bad 'nested collection arguments need source-aware import']
368− ?. ?=([%apply %map [* [%apply * [* ~]] ~]] body)
1058+ ?. ?=([%tsls [%note * *] *] q.typ)
3691059 [%bad 'a Hoon collection alias could not be recovered']
370− =/ inner i.args.i.t.args.body
371− ?: &(?=(%jar u.alias) ?=(%list name.i.t.args.body))
372− [%apply %jar ~[i.args.body inner]]
373− ?: &(?=(%jug u.alias) ?=(%set name.i.t.args.body))
374− [%apply %jug ~[i.args.body inner]]
375− [%bad 'a Hoon collection alias could not be recovered']
1060+ =/ corrected (recover-alias q.p.q.typ body p.typ module sig seen context)
1061+ ?- corrected
1062+ [%& *] p.corrected
1063+ [%| *] [%bad p.corrected]
1064+ ==
3761065 ==
3771066::
3781067++ first-bad
@@ -384,6 +1073,7 @@
3841073 [%atom *] ~
3851074 [%ref *] ~
3861075 [%bad *] [~ reason.out]
1076+ [%invalid *] [~ reason.out]
3871077 [%face *] $(out body.out)
3881078 [%cell *]
3891079 =/ err $(out head.out)
@@ -400,6 +1090,34 @@
4001090 =/ err (first-bad i.xs)
4011091 ?~ err $(xs t.xs)
4021092 err
1093+::
1094+++ first-invalid
1095+ |= out=imported
1096+ ^- (unit import-diagnostic)
1097+ ?- out
1098+ [%noun *] ~
1099+ [%void *] ~
1100+ [%atom *] ~
1101+ [%ref *] ~
1102+ [%bad *] `[%unsupported reason.out]
1103+ [%invalid *] `[%invalid code.out reason.out]
1104+ [%face *] $(out body.out)
1105+ [%cell *]
1106+ =/ first $(out head.out)
1107+ ?~ first $(out tail.out)
1108+ first
1109+ [%fork *] (first-invalids cases.out)
1110+ [%apply *] (first-invalids args.out)
1111+ ==
1112+::
1113+++ first-invalids
1114+ |= xs=(list imported)
1115+ ^- (unit import-diagnostic)
1116+ ?~ xs ~
1117+ =/ first (first-invalid i.xs)
1118+ ?~ first $(xs t.xs)
1119+ first
1120+::
4031121:: +fixture-test: shared golden expectations for eval and the ship.
4041122:: A synthetic hold whose first $^ branch cannot be evaluated. It tests
4051123:: that a failed branch probe is reported rather than crashing the host.
@@ -464,8 +1182,25 @@
4641182 [%cell [%face %values [%apply %jar ~[[%atom %ud ~] [%atom %t ~]]]] [%face %cache [%apply %jug ~[[%atom %ud ~] [%atom %t ~]]]]]
4651183 =/ errors ?: =((sample %paired-aliases) [%& expect-paired]) errors
4661184 ['multiple collection aliases are preserved' errors]
467− =/ errors ?: =((sample %nested-alias) [%| 'nested collection arguments need source-aware import']) errors
468− ['nested collection arguments remain unsupported' errors]
1185+ =/ expect-nested-alias=imported
1186+ [%apply %jar ~[[%atom %ud ~] [%apply %jug ~[[%atom %ud ~] [%atom %t ~]]]]]
1187+ =/ errors ?: =((sample %nested-alias) [%& expect-nested-alias]) errors
1188+ ['nested collection arguments preserve names' errors]
1189+ =/ expect-mop=imported [%apply %mop ~[[%atom %ud ~] [%atom %t ~]]]
1190+ =/ errors ?: =((sample %mop-test) [%& expect-mop]) errors
1191+ ['ordered map name and arguments' errors]
1192+ =/ expect-nested-mop=imported
1193+ [%cell [%face %table expect-mop] [%face %other [%atom %ud ~]]]
1194+ =/ errors ?: =((sample %nested-mop) [%& expect-nested-mop]) errors
1195+ ['ordered map field is preserved' errors]
1196+ =/ expect-mixed=imported
1197+ [%cell [%face %a expect-mop] [%face %b [%apply %list ~[[%atom %ud ~]]]]]
1198+ =/ errors ?: =((sample %mixed-mop) [%& expect-mixed]) errors
1199+ ['static list sibling is preserved' errors]
1200+ =/ errors ?: =((sample %named-mop) [%| 'a nested Hoon mop needs source-aware import']) errors
1201+ ['non-atom argument remains unsupported' errors]
1202+ =/ errors ?: =((sample %mop-list) [%| 'a nested Hoon mop needs source-aware import']) errors
1203+ ['ordered map in a list remains unsupported' errors]
4691204 =/ errors ?: =((sample %signed) [%| 'signed and float auras cannot be imported']) errors
4701205 ['signed aura rejected' errors]
4711206 =/ errors ?: =((sample %float) [%| 'signed and float auras cannot be imported']) errors
@@ -478,8 +1213,12 @@
4781213 [%fork ~[[%cell [%face %x [%atom %ud ~]] [%face %y [%atom %ud ~]]] [%atom %ud ~]]]
4791214 =/ errors ?: =((sample %valid-cell) [%& expect-valid]) errors
4801215 ['disjoint cell union' errors]
481− =/ errors ?: =((sample %invalid-cell) [%| 'a Hoon $^ union has overlapping cases']) errors
1216+ =/ errors ?: =((sample %invalid-cell) [%| 'Hoon $^ union disjointness could not be verified']) errors
4821217 ['overlapping cell union is rejected' errors]
1218+ =/ errors ?: =((shad %mn) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1219+ ['local mop shadow in a field is rejected' errors]
1220+ =/ errors ?: =((shad %mm) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
1221+ ['local mop shadow is rejected' errors]
4831222 =/ errors ?: =((shad %aa) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
4841223 ['local jar shadow is rejected' errors]
4851224 =/ errors ?: =((shad %bb) [%| 'Hoon collection provenance is unavailable or shadowed']) errors
@@ -518,6 +1257,7 @@
5181257 [%apply *] "({(trip name.out)} {(show-imports args.out)})"
5191258 [%ref *] "{(trip name.out)}.{(trip module.out)}"
5201259 [%bad *] "error: {(trip reason.out)}"
1260+ [%invalid *] "error: {(trip reason.out)}"
5211261 ==
5221262::
5231263++ show-imports
@@ -535,14 +1275,97 @@
5351275 [%| *] "error: {(trip p.result)}"
5361276 ==
5371277::
1278+++ show-import-diagnostic
1279+ |= result=import-diagnostic
1280+ ^- tape
1281+ ?- result
1282+ [%ok *] (show-import value.result)
1283+ [%invalid *] "invalid/{(trip code.result)}: {(trip message.result)}"
1284+ [%unsupported *] "unsupported: {(trip message.result)}"
1285+ ==
1286+::
1287+:: Clay includes debug spans around source nodes. Reproduce that
1288+:: shape without Clay so the same regression runs under eval and -test.
1289+++ decorate-union-source
1290+ |= h=hoon
1291+ ^- hoon
1292+ =/ at=spot [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1293+ ?^ -.h [%dbug at [$(h -.h) $(h +.h)]]
1294+ ?+ h [%dbug at h]
1295+ [%note *] [%dbug at h(q $(h q.h))]
1296+ [%ktts *] [%dbug at h(q $(h q.h))]
1297+ [%wtcl *] [%dbug at h(q $(h q.h), r $(h r.h))]
1298+ ==
1299+::
1300+++ debug-union-fixture
1301+ |= [cor=type name=term]
1302+ ^- (each imported @t)
1303+ =/ typ=type (~(play ut cor) (ream (cat 3 '*' name)))
1304+ ?. ?=([%hold *] typ) [%| 'synthetic union is not a hold']
1305+ =/ original=hoon q.typ
1306+ ?. ?=([%tsls [%note * *] *] original) [%| 'synthetic union source is unavailable']
1307+ =/ source=hoon original(q.p (decorate-union-source q.p.original))
1308+ (read-mold %small name typ(q source))
1309+::
1310+:: Synthetic nodes test each part of the direct collection-call proof.
1311+++ collection-wrapper-fixture
1312+ ^- tape
1313+ =/ call=hoon [%cncl [%tsgr [%wing ~[[%.y 7]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 6]]]
1314+ =/ subject=hoon [%cncl [%tsgr [%wing ~[[%.y 8]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 6]]]
1315+ =/ sample=hoon [%cncl [%tsgr [%wing ~[[%.y 7]]] [%cncl [%wing ~[%list]] ~]] ~[[%$ 2]]]
1316+ =/ good=hoon [%tsls [%note [%made %x ~] call] [%tsls [%dtts [%$ 14] [%$ 2]] [%$ 6]]]
1317+ =/ tail=hoon [%tsls [%note [%made %x ~] call] [%$ 6]]
1318+ =/ args=(list [hoon hoon]) ~[[call good] [subject good] [sample good] [call tail]]
1319+ =/ flags=(list ?) (turn args |=(pair=[hoon hoon] (direct-collection-source -.pair +.pair)))
1320+ ?: =(flags ~[& | | |]) "valid; forged subject, sample and tail rejected"
1321+ "wrapper guard failed"
1322+::
1323+++ overlap-fork-fixture
1324+ ^- type
1325+ =/ nodes=(list type) ~[[%atom %ud ~] [%atom %t ~]]
1326+ [%fork (silt nodes)]
1327+::
1328+++ invalid-fork-fixture
1329+ ^- type
1330+ =/ nodes=(list type) ~[[%atom %ud ~] [%atom %sd ~]]
1331+ [%fork (silt nodes)]
1332+::
5381333++ fixture-output
539− |= [small=@t epic=@t presence=@t docs=@t shadow=@t]
1334+ |= [small=@t epic=@t presence=@t docs=@t shadow=@t shadow-static=@t ford=@t mark=@t mark-rec=@t mark-gate=@t mark-basic=@t origin-trans=@t origin-first=@t origin-other=@t]
5401335 ^- wain
5411336 =/ sc=type -:(ride -:!>(..zuse) small)
5421337 =/ ec=type -:(ride -:!>(..zuse) epic)
5431338 =/ pc=type -:(ride -:!>(..zuse) presence)
5441339 =/ dc=type -:(ride -:!>(..zuse) docs)
5451340 =/ hc=type -:(ride -:!>(..zuse) shadow)
1341+ =/ xc=type -:(ride -:!>(..zuse) shadow-static)
1342+ =/ fp=type [%cell [%face %small sc] -:!>(..zuse)]
1343+ =/ other=type -:(ride -:!>(..zuse) origin-other)
1344+ =/ fc=type -:(ride fp ford)
1345+ ?> ?=([%core *] fc)
1346+ =/ only-list=@t '|%\0a+$ lists (list @ud)\0a--\0a'
1347+ =/ tp=type [%cell [%face %intermediate fc] -:!>(..zuse)]
1348+ =/ tc=type -:(ride tp only-list)
1349+ =/ sp=type [%cell [%face %small xc] -:!>(..zuse)]
1350+ =/ shc=type -:(ride sp only-list)
1351+ =/ mark-core=type -:(ride fp mark)
1352+ =/ mark-rec-core=type -:(ride fp mark-rec)
1353+ =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
1354+ =/ mark-basic-core=type -:(ride -:!>(..zuse) mark-basic)
1355+ =/ fake-vase=type -:(ride -:!>(..zuse) '|%\0a+$ vase @ud\0a--\0a')
1356+ =/ spoof=(unit import-diagnostic)
1357+ (first-invalid [%bad 'signed and float auras cannot be imported'])
1358+ ?> ?=(^ spoof)
1359+ =/ mark-shadow-core=type -:(ride sp mark-basic)
1360+ =/ tshp=type [%cell [%face %intermediate shc] -:!>(..zuse)]
1361+ =/ tshc=type -:(ride tshp only-list)
1362+ =/ trans=type -:(ride tp origin-trans)
1363+ =/ ambiguous-parent=type [%cell [%face %first sc] [%cell [%face %second sc] -:!>(..zuse)]]
1364+ =/ ambiguous=type -:(ride ambiguous-parent origin-first)
1365+ =/ distinct-parent=type [%cell [%face %first sc] [%cell [%face %second other] -:!>(..zuse)]]
1366+ =/ distinct=type -:(ride distinct-parent origin-first)
1367+ =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
1368+ =/ trans-amb=type -:(ride trans-amb-parent origin-trans)
5461369 =/ sample
5471370 |= name=term
5481371 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
@@ -571,11 +1394,107 @@
5711394 (crip "nested-jar: {(show-result (sample %nested-jar))}")
5721395 (crip "paired-aliases: {(show-result (sample %paired-aliases))}")
5731396 (crip "nested-alias: {(show-result (sample %nested-alias))}")
1397+ (crip "compound: {(show-result (sample %compound))}")
1398+ (crip "compound-fields: {(show-result (sample %compound-fields))}")
1399+ (crip "mop: {(show-result (sample %mop-test))}")
1400+ (crip "nested-mop: {(show-result (sample %nested-mop))}")
1401+ (crip "two-mops: {(show-result (sample %two-mops))}")
1402+ (crip "mixed-mop: {(show-result (sample %mixed-mop))}")
1403+ (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
1404+ (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
1405+ (crip "dynamic-sibling-mop: {(show-result (sample %dynamic-sibling-mop))}")
1406+ (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
1407+ (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
1408+ (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
1409+ (crip "mark-list: {(show-result (read-mark %list-mark mark-basic-core))}")
1410+ (crip "mark-shadow: {(show-result (read-mark %list-mark mark-shadow-core))}")
1411+ (crip "mark-not-core: {(show-result (read-mark %bad [%atom %ud ~]))}")
1412+ (crip "ford-list: {(show-result (read-mold-in %ford %lists (~(play ut fc) (ream '*lists')) fc))}")
1413+ (crip "ford-imported: {(show-result (read-mold-in %ford %wrapped (~(play ut fc) (ream '*wrapped')) fc))}")
1414+ (crip "ford-recursive: {(show-result (read-mold-in %ford %recursive (~(play ut fc) (ream '*recursive')) fc))}")
1415+ (crip "ford-local-recursive: {(show-result (read-mold-in %ford %local (~(play ut fc) (ream '*local')) fc))}")
1416+ (crip "ford-recursive-transitive: {(show-result (read-named %outer %wrapped trans))}")
1417+ (crip "ford-recursive-ambiguous: {(show-result (read-named %outer %pick-one ambiguous))}")
1418+ (crip "ford-recursive-transitive-ambiguous: {(show-result (read-named %outer %wrapped trans-amb))}")
1419+ (crip "ford-recursive-distinct-first: {(show-result (read-named %outer %pick-one distinct))}")
1420+ (crip "ford-recursive-distinct-second: {(show-result (read-named %outer %pick-two distinct))}")
1421+ (crip "ford-transitive: {(show-result (read-mold-in %ford %lists (~(play ut tc) (ream '*lists')) tc))}")
1422+ (crip "ford-shadow: {(show-result (read-mold-in %ford %lists (~(play ut shc) (ream '*lists')) shc))}")
1423+ (crip "ford-transitive-shadow: {(show-result (read-mold-in %ford %lists (~(play ut tshc) (ream '*lists')) tshc))}")
1424+ (crip "ford-shadow-face: {?:((scope-safe [%cell [%face %list sc] -:!>(..zuse)] %list) "wrong" "unsafe")}")
1425+ (crip "ford-unknown: {?:((scope-safe [%cell [%atom %ud ~] -:!>(..zuse)] %list) "wrong" "unsafe")}")
1426+ (crip "ford-mismatched-core: {?:((scope-safe fc(p -:!>(..zuse)) %list) "wrong" "unsafe")}")
1427+ (crip "shadow-list-mop: {(show-result (read-mold-in %shadow-static %bad (~(play ut xc) (ream '*bad')) xc))}")
1428+ (crip "named-mop: {(show-result (sample %named-mop))}")
1429+ (crip "mop-list: {(show-result (sample %mop-list))}")
5741430 (crip "signed: {(show-result (sample %signed))}")
5751431 (crip "float: {(show-result (sample %float))}")
5761432 (crip "gate: {(show-result (sample %gate-test))}")
5771433 (crip "vase: {(show-result vase)}")
5781434 (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
1435+ (crip "debug-union: {(show-result (debug-union-fixture sc %action))}")
1436+ (crip "debug-union-overlap: {(show-result (debug-union-fixture sc %explicit-wut-overlap))}")
1437+ (crip "debug-nested-cell: {(show-result (debug-union-fixture sc %nested-valid-cell))}")
1438+ (crip "debug-nested-cell-overlap: {(show-result (debug-union-fixture sc %nested-invalid-cell))}")
1439+ (crip "explicit-graph: {(show-result (read-mold %raw %raw overlap-fork-fixture))}")
1440+ (crip "explicit-graph-unsupported: {(show-result (read-mold %raw %raw invalid-fork-fixture))}")
1441+ (crip "explicit-wut-safe: {(show-result (sample %explicit-wut-safe))}")
1442+ (crip "explicit-percent-overlap: {(show-result (sample %explicit-percent-overlap))}")
1443+ (crip "explicit-wut-overlap: {(show-result (sample %explicit-wut-overlap))}")
1444+ (crip "explicit-collapsed: {(show-result (sample %explicit-collapsed))}")
1445+ (crip "explicit-subsumed: {(show-result (sample %explicit-subsumed))}")
1446+ (crip "explicit-three: {(show-result (sample %explicit-three))}")
1447+ (crip "explicit-unknown: {(show-result (sample %explicit-unknown))}")
1448+ (crip "explicit-nested: {(show-result (sample %explicit-nested))}")
1449+ (crip "collection-union-wrapper: {collection-wrapper-fixture}")
1450+ (crip "collection-union-list: {(show-result (sample %collection-union-list))}")
1451+ (crip "collection-union-set: {(show-result (sample %collection-union-set))}")
1452+ (crip "collection-union-map-key: {(show-result (sample %collection-union-map-key))}")
1453+ (crip "collection-union-map-value: {(show-result (sample %collection-union-map-value))}")
1454+ (crip "collection-union-unit: {(show-result (sample %collection-union-unit))}")
1455+ (crip "collection-union-collapsed: {(show-result (sample %collection-union-collapsed))}")
1456+ (crip "collection-union-multiple: {(show-result (sample %collection-union-multiple))}")
1457+ (crip "collection-union-nested: {(show-result (sample %collection-union-nested))}")
1458+ (crip "collection-union-dependent: {(show-result (sample %collection-union-dependent))}")
1459+ (crip "collection-union-shadow: {(show-result (read-named %shadow %collection-union-shadow xc))}")
1460+ (crip "explicit-list: {(show-result (sample %explicit-list))}")
1461+ (crip "explicit-set: {(show-result (sample %explicit-set))}")
1462+ (crip "explicit-faces: {(show-result (sample %explicit-faces))}")
1463+ (crip "explicit-alias: {(show-result (sample %explicit-alias))}")
1464+ (crip "explicit-ford: {(show-result (read-named %outer %bad-union trans))}")
1465+ (crip "explicit-shadow-path: {(show-result (read-named %shadow %path-shadow xc))}")
1466+ (crip "list-bckt-field: {(show-result (sample %list-bckt-field))}")
1467+ (crip "list-noun-overlap: {(show-result (sample %list-noun-overlap))}")
1468+ (crip "list-null-overlap: {(show-result (sample %list-null-overlap))}")
1469+ (crip "list-nested-atom-cell: {(show-result (sample %list-nested-atom-cell))}")
1470+ (crip "list-nested-valid-cell: {(show-result (sample %list-nested-valid-cell))}")
1471+ (crip "list-nested-invalid-cell: {(show-result (sample %list-nested-invalid-cell))}")
1472+ (crip "map-nested-invalid-cell: {(show-result (sample %map-nested-invalid-cell))}")
1473+ (crip "set-direct-invalid-cell: {(show-result (sample %set-direct-invalid-cell))}")
1474+ (crip "map-key-invalid-cell: {(show-result (sample %map-key-invalid-cell))}")
1475+ (crip "nested-atom-cell: {(show-result (sample %nested-atom-cell))}")
1476+ (crip "nested-tags: {(show-result (sample %nested-tags))}")
1477+ (crip "nested-tags-overlap: {(show-result (sample %nested-tags-overlap))}")
1478+ (crip "nested-tagged: {(show-result (sample %nested-tagged))}")
1479+ (crip "nested-tagged-bckt: {(show-result (sample %nested-tagged-bckt))}")
1480+ (crip "nested-tagged-overlap: {(show-result (sample %nested-tagged-overlap))}")
1481+ (crip "nested-tagged-alias: {(show-result (sample %nested-tagged-alias))}")
1482+ (crip "nested-tagged-ford: {(show-result (read-named %outer %tagged trans))}")
1483+ (crip "tag-static-valid: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%rock %tas %foo]] 13) "yes" "no")}")
1484+ (crip "tag-static-wrong-axis: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 12] [%rock %$ %foo]] [%rock %tas %foo]] 13) "wrong" "no")}")
1485+ (crip "tag-static-nonconstant: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%$ 13]] 13) "wrong" "no")}")
1486+ (crip "tag-static-wrong-value: {?:((fixed-cell-mold [%wtgr [%dtts [%$ 13] [%rock %$ %foo]] [%rock %tas %bar]] 13) "wrong" "no")}")
1487+ (crip "nested-first-cell: {(show-result (sample %nested-first-cell))}")
1488+ (crip "nested-alias-cell: {(show-result (sample %nested-alias-cell))}")
1489+ (crip "nested-multiple-cell: {(show-result (sample %nested-multiple-cell))}")
1490+ (crip "nested-named-sibling: {(show-result (sample %nested-named-sibling))}")
1491+ (crip "nested-list-sibling: {(show-result (sample %nested-list-sibling))}")
1492+ (crip "nested-validated-sibling: {(show-result (sample %nested-validated-sibling))}")
1493+ (crip "nested-validated-branch: {(show-result (sample %nested-validated-branch))}")
1494+ (crip "nested-named-branch: {(show-result (sample %nested-named-branch))}")
1495+ (crip "nested-ford-cell: {(show-result (read-named %outer %nested trans))}")
1496+ (crip "nested-valid-cell: {(show-result (sample %nested-valid-cell))}")
1497+ (crip "nested-invalid-cell: {(show-result (sample %nested-invalid-cell))}")
5791498 (crip "valid-cell: {(show-result (sample %valid-cell))}")
5801499 (crip "invalid-cell: {(show-result (sample %invalid-cell))}")
5811500 (crip "chapter-malformed: {?:((chapter-unsafe [%x %y %z] %jar) "unsafe" "wrong")}")
@@ -584,9 +1503,27 @@
5841503 (crip "chapter-wrapped-hit: {?:(=((chapter-has [~ chapter-tree] %jar) [~ &]) "yes" "no")}")
5851504 (crip "chapter-direct-miss: {?:(=((chapter-has chapter-tree %jug) [~ &]) "yes" "no")}")
5861505 (crip "chapter-wrapped-miss: {?:(=((chapter-has [~ chapter-tree] %jug) [~ &]) "yes" "no")}")
1506+ (crip "shadow-nested-mop: {(show-result (shad %mn))}")
1507+ (crip "shadow-mop: {(show-result (shad %mm))}")
5871508 (crip "shadow-jar: {(show-result (shad %aa))}")
5881509 (crip "shadow-jug: {(show-result (shad %bb))}")
1510+ (crip "no-provenance-atom: {(show-result (read-mold %small %word (~(play ut sc) (ream '*word'))))}")
1511+ (crip "no-provenance-recursive: {(show-result (read-mold %wrong %alias (~(play ut sc) (ream '*chain'))))}")
5891512 (crip "no-provenance: {(show-result (read-mold %small %jar-test (~(play ut sc) (ream '*jar-test'))))}")
1513+ (crip "named-not-mold: {(show-result (read-named %small %not-mold sc))}")
1514+ (crip "named-present: {(show-result (read-named %small %items sc))}")
1515+ (crip "named-missing: {(show-result (read-named %small %missing sc))}")
1516+ (crip "named-invalid-core: {(show-result (read-named %small %items [%atom %ud ~]))}")
1517+ (crip "named-ford-recursive: {(show-result (read-named %ford %recursive fc))}")
1518+ (crip "diagnostic-items: {(show-import-diagnostic (read-named-diagnostic %small %items sc))}")
1519+ (crip "diagnostic-signed: {(show-import-diagnostic (read-named-diagnostic %small %signed sc))}")
1520+ (crip "diagnostic-float: {(show-import-diagnostic (read-named-diagnostic %small %float sc))}")
1521+ (crip "diagnostic-overlap: {(show-import-diagnostic (read-named-diagnostic %small %explicit-percent-overlap sc))}")
1522+ (crip "diagnostic-unproved: {(show-import-diagnostic (read-named-diagnostic %small %list-nested-invalid-cell sc))}")
1523+ (crip "diagnostic-mark-gate: {(show-import-diagnostic (read-mark-diagnostic %bad mark-gate-core))}")
1524+ (crip "diagnostic-shadow-vase: {(show-import-diagnostic (read-named-diagnostic %fake %vase fake-vase))}")
1525+ (crip "diagnostic-spoof: {(show-import-diagnostic u.spoof)}")
1526+ (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
5901527 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
5911528 (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
5921529 (crip "presence-topic: {(show-result (present %topic))}")
jibb-dev/lib/jibb.hoon+3389−140
@@ -4590,22 +4590,36 @@
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.
4595−:: Bare @ is unsupported until its unrestricted-atom rule is implemented.
4596−:: Only unfaced cells are represented here.
4593+:: Atom constraints tied to an explicit capital or an inferred sample
4594+:: are generalized and printed. Other aura variables remain unsupported until
4595+:: their defaulting and inferred generalization are implemented.
4596+:: Bare @ is a separate unrestricted atom type. A directional fit check
4597+:: permits concrete atoms to widen to it, never the reverse. A fit that
4598+:: needs a not-yet-implemented constraint remains unsupported. Named unions
4599+:: retain origin and ordered arguments, including phantom arguments, apart
4600+:: from their display name. Generic cases must be disjoint for all arguments.
4601+:: Unnamed union printing is informational; it is not Jibb syntax.
45974602::
45984603+$ itype
45994604 $~ [%var 0]
46004605 $% [%var id=@ud]
46014606 [%avar id=@ud]
4607+ [%nvar id=@ud]
46024608 [%atom aura=@ta]
4609+ [%any-atom ~]
46034610 [%flag ~]
4611+ [%tag id=@ud literal=lit constructor=?]
4612+ [%const literal=lit]
4613+ [%collection name=term args=(list itype)]
4614+ [%recursive module=term name=term label=(unit @t)]
4615+ [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4616+ [%face name=term body=itype]
46044617 [%fn sample=itype product=itype]
46054618 [%cell hed=itype tal=itype]
46064619 ==
46074620+$ ibinding [id=@ud val=itype]
46084621+$ isub (list ibinding)
4622++$ ipending [id=@ud literal=lit]
46094623::
46104624++ itype-lookup
46114625 |= [n=@ud sub=isub]
@@ -4626,6 +4640,14 @@
46264640 =/ found=(unit itype) (itype-lookup id.t sub)
46274641 ?~ found t
46284642 $(t u.found)
4643+ %nvar
4644+ =/ found=(unit itype) (itype-lookup id.t sub)
4645+ ?~ found t
4646+ $(t u.found)
4647+ %tag
4648+ =/ found=(unit itype) (itype-lookup id.t sub)
4649+ ?~ found t
4650+ $(t u.found)
46294651 ==
46304652::
46314653++ itype-occurs
@@ -4635,8 +4657,16 @@
46354657 ?- -.t
46364658 %var =(n id.t)
46374659 %avar =(n id.t)
4660+ %nvar =(n id.t)
46384661 %atom |
4662+ %any-atom |
46394663 %flag |
4664+ %tag =(n id.t)
4665+ %const |
4666+ %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4667+ %recursive |
4668+ %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4669+ %face $(t body.t)
46404670 %fn |($(t sample.t) $(t product.t))
46414671 %cell |($(t hed.t) $(t tal.t))
46424672 ==
@@ -4653,19 +4683,44 @@
46534683 =. a (itype-walk a sub)
46544684 =. b (itype-walk b sub)
46554685 ?: =(a b) `sub
4686+ ?: &(?=(%recursive -.a) ?=(%recursive -.b))
4687+ ?:(&(=(module.a module.b) =(name.a name.b)) `sub ~)
4688+ ?: &(?=(%union -.a) ?=(%union -.b))
4689+ ?. =(origin.a origin.b) ~
4690+ ?: &(?=(~ args.a) ?=(~ args.b)) ?:(=(cases.a cases.b) `sub ~)
4691+ ?~ origin.a ~
4692+ (itype-unify-args args.a args.b sub)
4693+ ?: &(?=(%collection -.a) ?=(%collection -.b))
4694+ ?. =(name.a name.b) ~
4695+ (itype-unify-args args.a args.b sub)
46564696 ?: ?=(%var -.a)
46574697 ?: (itype-occurs id.a b sub) ~
46584698 `[[id.a b] sub]
46594699 ?: ?=(%var -.b)
46604700 ?: (itype-occurs id.b a sub) ~
46614701 `[[id.b a] sub]
4702+ :: The narrower decimal constraint survives a match with an atom
4703+ :: variable; decimal syntax alone does not make it a loobean.
4704+ ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4705+ ?: &(?=(%avar -.a) ?=(%nvar -.b)) `[[id.a b] sub]
4706+ ?: ?=(%nvar -.a)
4707+ ?. |(?=(%nvar -.b) ?=(%atom -.b)) ~
4708+ `[[id.a b] sub]
4709+ ?: ?=(%nvar -.b)
4710+ ?. ?=(%atom -.a) ~
4711+ `[[id.b a] sub]
46624712 ?: ?=(%avar -.a)
4663− ?. |(?=(%avar -.b) ?=(%atom -.b)) ~
4713+ ?. |(?=(%avar -.b) ?=(%atom -.b) ?=(%any-atom -.b) ?=(%flag -.b)) ~
46644714 `[[id.a b] sub]
46654715 ?: ?=(%avar -.b)
4666− ?. ?=(%atom -.a) ~
4716+ ?. |(?=(%atom -.a) ?=(%any-atom -.a) ?=(%flag -.a)) ~
46674717 `[[id.b a] sub]
4718+ ?: &(?=(%const -.a) ?=(%const -.b))
4719+ ?:(=(val.literal.a val.literal.b) `sub ~)
46684720 ?: &(?=(%atom -.a) ?=(%atom -.b)) ~
4721+ ?: &(?=(%face -.a) ?=(%face -.b))
4722+ ?. =(name.a name.b) ~
4723+ $(a body.a, b body.b)
46694724 ?: &(?=(%fn -.a) ?=(%fn -.b))
46704725 =/ first=(unit isub) $(a sample.a, b sample.b)
46714726 ?~ first ~
@@ -4676,6 +4731,453 @@
46764731 $(a tal.a, b tal.b, sub u.first)
46774732 ~
46784733::
4734+++ itype-unify-args
4735+ |= [as=(list itype) bs=(list itype) sub=isub]
4736+ ^- (unit isub)
4737+ ?~ as ?~(bs `sub ~)
4738+ ?~ bs ~
4739+ =/ next=(unit isub) (itype-unify i.as i.bs sub)
4740+ ?~ next ~
4741+ $(as t.as, bs t.bs, sub u.next)
4742+::
4743+:: +itype-fit: one-way widening from an actual type to an expected type
4744+::
4745+:: An unknown variable used where @ is expected gains a fresh atom
4746+:: constraint. Function compatibility involving @ remains unknown.
4747+::
4748++$ ifit $%([%ok sub=isub next=@ud] [%bad ~] [%unknown ~])
4749+++ itype-has-any-atom
4750+ |= [t=itype sub=isub]
4751+ ^- ?
4752+ =. t (itype-walk t sub)
4753+ ?- -.t
4754+ %var |
4755+ %avar |
4756+ %nvar |
4757+ %atom |
4758+ %any-atom &
4759+ %flag |
4760+ %tag |
4761+ %const |
4762+ %union |((lien cases.t |=(c=itype (itype-has-any-atom c sub))) (lien args.t |=(c=itype (itype-has-any-atom c sub))))
4763+ %recursive |
4764+ %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4765+ %face $(t body.t)
4766+ %fn |($(t sample.t) $(t product.t))
4767+ %cell |($(t hed.t) $(t tal.t))
4768+ ==
4769+::
4770+::
4771+:: Hoon aura families are textual prefixes: @tD is in @t, and @uvJ
4772+:: is in @uv and @u. Jibb permits widening toward the prefix only.
4773+::
4774+++ aura-prefix
4775+ |= [parent=@ta child=@ta]
4776+ ^- ?
4777+ =/ a=tape (trip parent)
4778+ =/ b=tape (trip child)
4779+ |-
4780+ ?~ a &
4781+ ?~ b |
4782+ ?. =(i.a i.b) |
4783+ $(a t.a, b t.b)
4784+::
4785+:: Related auras in a structural unification need a common-type rule;
4786+:: until that rule is implemented, report an unknown rather than error.
4787+::
4788+++ itype-family-related-collection-args
4789+ |= [as=(list itype) bs=(list itype) sub=isub]
4790+ ^- ?
4791+ ?~ as |
4792+ ?~ bs |
4793+ ?: (itype-family-related i.as i.bs sub) &
4794+ $(as t.as, bs t.bs)
4795+::
4796+++ itype-family-related
4797+ |= [a=itype b=itype sub=isub]
4798+ ^- ?
4799+ =. a (itype-walk a sub)
4800+ =. b (itype-walk b sub)
4801+ ?: &(?=(%atom -.a) ?=(%atom -.b))
4802+ ?. !=(aura.a aura.b) |
4803+ |((aura-prefix aura.a aura.b) (aura-prefix aura.b aura.a))
4804+ ?: &(?=(%collection -.a) ?=(%collection -.b))
4805+ ?. =(name.a name.b) |
4806+ (itype-family-related-collection-args args.a args.b sub)
4807+ ?: &(?=(%face -.a) ?=(%face -.b))
4808+ ?. =(name.a name.b) |
4809+ $(a body.a, b body.b)
4810+ ?: &(?=(%cell -.a) ?=(%cell -.b))
4811+ |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
4812+ ?: &(?=(%fn -.a) ?=(%fn -.b))
4813+ |($(a sample.a, b sample.b) $(a product.a, b product.b))
4814+ |
4815+::
4816+:: A branch whose two result types are already concrete can use an
4817+:: explicitly present parent aura (or @) as its result. This does not
4818+:: guess a parent for sibling auras or solve variable-dependent joins.
4819+::
4820+++ itype-has-fixed-atom
4821+ |= typ=itype
4822+ ^- ?
4823+ ?- -.typ
4824+ %var |
4825+ %avar |
4826+ %nvar |
4827+ %atom &
4828+ %any-atom &
4829+ %flag &
4830+ %tag &
4831+ %const &
4832+ %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
4833+ %recursive |
4834+ %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4835+ %face $(typ body.typ)
4836+ %fn |($(typ sample.typ) $(typ product.typ))
4837+ %cell |($(typ hed.typ) $(typ tal.typ))
4838+ ==
4839+::
4840+++ itype-concrete-join
4841+ |= [a=itype b=itype sub=isub]
4842+ ^- (unit itype)
4843+ =. a (itype-walk a sub)
4844+ =. b (itype-walk b sub)
4845+ ?: &(?=(%atom -.a) ?=(%atom -.b))
4846+ ?: (aura-prefix aura.a aura.b) `a
4847+ ?: (aura-prefix aura.b aura.a) `b
4848+ ~
4849+ ?: &(?=(%any-atom -.a) |(?=(%atom -.b) ?=(%flag -.b))) `a
4850+ ?: &(?=(%any-atom -.b) |(?=(%atom -.a) ?=(%flag -.a))) `b
4851+ ~
4852+::
4853+:: Unifying an already-bound tuple with a faced position would need to
4854+:: update the bound type. Until substitutions can retain that information,
4855+:: variable-dependent face merges stay unresolved.
4856+::
4857+++ itype-has-face
4858+ |= [t=itype sub=isub]
4859+ ^- ?
4860+ =. t (itype-walk t sub)
4861+ ?- -.t
4862+ %collection (lien args.t |=(c=itype (itype-has-face c sub)))
4863+ %face &
4864+ %cell |($(t hed.t) $(t tal.t))
4865+ %fn |($(t sample.t) $(t product.t))
4866+ * |
4867+ ==
4868+::
4869+++ itype-face-asym-collection-args
4870+ |= [as=(list itype) bs=(list itype) sub=isub]
4871+ ^- ?
4872+ ?~ as |
4873+ ?~ bs |
4874+ ?: (itype-face-asym i.as i.bs sub) &
4875+ $(as t.as, bs t.bs)
4876+::
4877+++ itype-face-asym
4878+ |= [a=itype b=itype sub=isub]
4879+ ^- ?
4880+ =. a (itype-walk a sub)
4881+ =. b (itype-walk b sub)
4882+ ?: &(?=(%collection -.a) ?=(%collection -.b))
4883+ ?. =(name.a name.b) |
4884+ (itype-face-asym-collection-args args.a args.b sub)
4885+ ?: &(?=(%face -.a) ?=(%face -.b)) $(a body.a, b body.b)
4886+ ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%avar -.b) ?=(%nvar -.b))
4887+ ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%avar -.a) ?=(%nvar -.a))
4888+ ?: &(?=(%cell -.a) ?=(%cell -.b)) |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
4889+ ?: &(?=(%fn -.a) ?=(%fn -.b)) |($(a sample.a, b sample.b) $(a product.a, b product.b))
4890+ |
4891+::
4892+:: A successful cast keeps any explicit faces from either side while
4893+:: retaining the target's aura choices. Both faces have already matched.
4894+::
4895+++ itype-merge-faces
4896+ |= [actual=itype expected=itype sub=isub]
4897+ ^- itype
4898+ =. actual (itype-walk actual sub)
4899+ =. expected (itype-walk expected sub)
4900+ ?: &(?=(%face -.actual) ?=(%face -.expected))
4901+ [%face name.expected $(actual body.actual, expected body.expected)]
4902+ ?: ?=(%face -.actual)
4903+ [%face name.actual $(actual body.actual)]
4904+ ?: ?=(%face -.expected)
4905+ [%face name.expected $(expected body.expected)]
4906+ ?: &(?=(%cell -.actual) ?=(%cell -.expected))
4907+ [%cell $(actual hed.actual, expected hed.expected) $(actual tal.actual, expected tal.expected)]
4908+ expected
4909+::
4910+++ itype-output-may-be-cell
4911+ |= [t=itype sub=isub]
4912+ ^- ?
4913+ =. t (itype-walk t sub)
4914+ ?- -.t
4915+ %var &
4916+ %cell &
4917+ %union &
4918+ %recursive &
4919+ %collection &
4920+ %face $(t body.t)
4921+ %fn |($(t sample.t) $(t product.t))
4922+ * |
4923+ ==
4924+::
4925+++ pending-tags
4926+ |= [tags=(list ipending) sub=isub]
4927+ ^- ?
4928+ ?~ tags |
4929+ ?~ (itype-lookup id.i.tags sub) &
4930+ $(tags t.tags)
4931+::
4932+++ pending-null
4933+ |= [tags=(list ipending) sub=isub]
4934+ ^- ?
4935+ ?~ tags |
4936+ ?: &(?=(%null form.literal.i.tags) ?=(~ (itype-lookup id.i.tags sub))) &
4937+ $(tags t.tags)
4938+::
4939+:: Tags remain constrained until a mold selects a case or permitted atom
4940+:: type. Never generalize an unresolved tag through aliases or cells.
4941+::
4942+++ itype-has-tag
4943+ |= t=itype
4944+ ^- ?
4945+ ?- -.t
4946+ %tag &
4947+ %collection (lien args.t |=(c=itype (itype-has-tag c)))
4948+ %face $(t body.t)
4949+ %fn |($(t sample.t) $(t product.t))
4950+ %cell |($(t hed.t) $(t tal.t))
4951+ %union |((lien cases.t |=(c=itype (itype-has-tag c))) (lien args.t |=(c=itype (itype-has-tag c))))
4952+ * |
4953+ ==
4954+::
4955+++ itype-has-union
4956+ |= t=itype
4957+ ^- ?
4958+ ?- -.t
4959+ %union &
4960+ %collection (lien args.t |=(c=itype (itype-has-union c)))
4961+ %face $(t body.t)
4962+ %fn |($(t sample.t) $(t product.t))
4963+ %cell |($(t hed.t) $(t tal.t))
4964+ * |
4965+ ==
4966+::
4967+:: Until a visible generic alias can be selected, expanding a named
4968+:: generic union would hide phantom arguments and its origin. This is a
4969+:: limitation of partial inference, not the unnamed-union print notation.
4970+::
4971+++ itype-has-hidden-generic
4972+ |= t=itype
4973+ ^- ?
4974+ ?- -.t
4975+ %union
4976+ ?: &(?=(~ label.t) ?=(^ args.t)) &
4977+ (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
4978+ %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
4979+ %face $(t body.t)
4980+ %fn |($(t sample.t) $(t product.t))
4981+ %cell |($(t hed.t) $(t tal.t))
4982+ * |
4983+ ==
4984+::
4985+++ itype-has-recursive
4986+ |= t=itype
4987+ ^- ?
4988+ ?- -.t
4989+ %recursive &
4990+ %collection (lien args.t |=(c=itype (itype-has-recursive c)))
4991+ %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
4992+ %face $(t body.t)
4993+ %cell |($(t hed.t) $(t tal.t))
4994+ %fn |($(t sample.t) $(t product.t))
4995+ * |
4996+ ==
4997+::
4998+++ itype-has-hidden-recursive
4999+ |= t=itype
5000+ ^- ?
5001+ ?- -.t
5002+ %recursive ?=(~ label.t)
5003+ %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
5004+ %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
5005+ %face $(t body.t)
5006+ %cell |($(t hed.t) $(t tal.t))
5007+ %fn |($(t sample.t) $(t product.t))
5008+ * |
5009+ ==
5010+::
5011+++ itype-fit-cases
5012+ |= [actual=itype cases=(list itype) sub=isub next=@ud]
5013+ ^- ifit
5014+ =/ good=(unit ifit) ~
5015+ =/ pending=? |
5016+ |-
5017+ ?~ cases
5018+ ?: pending [%unknown ~]
5019+ ?~ good [%bad ~]
5020+ u.good
5021+ =/ trial=ifit (itype-fit actual i.cases sub next)
5022+ ?- -.trial
5023+ %unknown $(cases t.cases, pending &)
5024+ %bad $(cases t.cases)
5025+ %ok
5026+ ?^ good [%unknown ~]
5027+ $(cases t.cases, good `trial)
5028+ ==
5029+::
5030+:: A constructor needs a case with its tag at the head and a payload
5031+:: compatible with the expected gate sample. Other case forms do not
5032+:: identify a constructor.
5033+::
5034+++ itype-fit-ctor-cases
5035+ |= [tag=lit sample=itype cases=(list itype) sub=isub next=@ud]
5036+ ^- ifit
5037+ =/ found=(unit ifit) ~
5038+ |-
5039+ ?~ cases ?~(found [%bad ~] u.found)
5040+ =/ c=itype (itype-walk i.cases sub)
5041+ ?. ?=(%cell -.c) $(cases t.cases)
5042+ =/ head=itype (itype-walk hed.c sub)
5043+ ?. ?=(%const -.head) $(cases t.cases)
5044+ ?. =(%term form.literal.head) $(cases t.cases)
5045+ ?. =(val.literal.head val.tag) $(cases t.cases)
5046+ ?^ found [%unknown ~]
5047+ =/ trial=ifit (itype-fit sample tal.c sub next)
5048+ $(cases t.cases, found `trial)
5049+::
5050+++ itype-fit
5051+ |= [actual=itype expected=itype sub=isub next=@ud]
5052+ ^- ifit
5053+ =/ uncertain=?
5054+ |(?=(%var -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%var -.expected) ?=(%avar -.expected) ?=(%nvar -.expected))
5055+ =. actual (itype-walk actual sub)
5056+ =. expected (itype-walk expected sub)
5057+ ?: =(actual expected) [%ok sub next]
5058+ ?: &(?=(%recursive -.actual) ?=(%recursive -.expected))
5059+ ?:(&(=(module.actual module.expected) =(name.actual name.expected)) [%ok sub next] [%bad ~])
5060+ ?: &(|(?=(%recursive -.actual) ?=(%recursive -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5061+ ?: &(?=(%union -.actual) ?=(%union -.expected))
5062+ ?. =(origin.actual origin.expected) [%unknown ~]
5063+ ?: &(?=(~ args.actual) ?=(~ args.expected))
5064+ ?:(=(cases.actual cases.expected) [%ok sub next] [%unknown ~])
5065+ ?~ origin.actual [%unknown ~]
5066+ =/ unified=(unit isub) (itype-unify-args args.actual args.expected sub)
5067+ ?^ unified [%ok u.unified next]
5068+ [%unknown ~]
5069+ :: A concrete union value in a tuple may acquire the expected field's
5070+ :: face. A variable-bound union still needs face propagation support.
5071+ ?: &(!uncertain ?=(%union -.actual) ?=(%face -.expected))
5072+ $(expected body.expected)
5073+ ?: ?=(%union -.actual) [%unknown ~]
5074+ ?: &(?=(%union -.expected) |(?=(%avar -.actual) ?=(%nvar -.actual))) [%unknown ~]
5075+ ?: &(?=(%union -.expected) !?=(%var -.actual))
5076+ (itype-fit-cases actual cases.expected sub next)
5077+ ?: ?=(%tag -.actual)
5078+ ?: ?=(%var -.expected)
5079+ =/ u=(unit isub) (itype-unify actual expected sub)
5080+ ?~ u [%bad ~]
5081+ [%ok u.u next]
5082+ ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5083+ ?: ?=(%face -.expected) $(expected body.expected)
5084+ ?: constructor.actual
5085+ ?. ?=(%fn -.expected) [%bad ~]
5086+ =/ product=itype (itype-walk product.expected sub)
5087+ =/ cases=(list itype) ?:(?=(%union -.product) cases.product ~[product])
5088+ =/ trial=ifit (itype-fit-ctor-cases literal.actual sample.expected cases sub next)
5089+ ?. ?=(%ok -.trial) trial
5090+ [%ok [[id.actual expected] sub.trial] next.trial]
5091+ :: Zero may be the empty list. A nested cell fit lacks the context
5092+ :: needed to resolve it here, so do not report a definite mismatch.
5093+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5094+ [%unknown ~]
5095+ ?: ?=(%const -.expected)
5096+ ?:(=(val.literal.actual val.literal.expected) [%ok [[id.actual expected] sub] next] [%bad ~])
5097+ ?: ?=(%atom -.expected)
5098+ ?: |(=(%tas aura.expected) =(%ta aura.expected))
5099+ [%ok [[id.actual expected] sub] next]
5100+ [%bad ~]
5101+ ?: ?=(%flag -.expected)
5102+ ?:(|(=(0 val.literal.actual) =(1 val.literal.actual)) [%ok [[id.actual expected] sub] next] [%bad ~])
5103+ ?: ?=(%any-atom -.expected) [%ok [[id.actual expected] sub] next]
5104+ [%bad ~]
5105+ ?: ?=(%const -.actual)
5106+ ?: ?=(%var -.expected)
5107+ =/ u=(unit isub) (itype-unify actual expected sub)
5108+ ?~ u [%bad ~]
5109+ [%ok u.u next]
5110+ ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5111+ ?: ?=(%face -.expected) $(expected body.expected)
5112+ ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5113+ [%unknown ~]
5114+ ?: ?=(%const -.expected)
5115+ ?:(=(val.literal.actual val.literal.expected) [%ok sub next] [%bad ~])
5116+ ?: ?=(%atom -.expected)
5117+ ?: |(=(%tas aura.expected) =(%ta aura.expected)) [%ok sub next]
5118+ [%bad ~]
5119+ ?: ?=(%flag -.expected)
5120+ ?:(|(=(0 val.literal.actual) =(1 val.literal.actual)) [%ok sub next] [%bad ~])
5121+ ?: ?=(%any-atom -.expected) [%ok sub next]
5122+ [%bad ~]
5123+ ?: &(uncertain (itype-face-asym actual expected sub)) [%unknown ~]
5124+ ?: ?=(%any-atom -.expected)
5125+ ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%flag -.actual)) [%ok sub next]
5126+ ?: ?=(%var -.actual)
5127+ =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
5128+ ?~ unified [%bad ~]
5129+ [%ok u.unified +(next)]
5130+ [%bad ~]
5131+ ?: ?=(%any-atom -.actual)
5132+ ?: ?=(%var -.expected)
5133+ =/ unified=(unit isub) (itype-unify actual expected sub)
5134+ ?~ unified [%bad ~]
5135+ [%ok u.unified next]
5136+ ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5137+ [%bad ~]
5138+ ?: &(?=(%atom -.actual) ?=(%atom -.expected))
5139+ ?: (aura-prefix aura.expected aura.actual) [%ok sub next]
5140+ ?: &((aura-prefix aura.actual aura.expected) uncertain) [%unknown ~]
5141+ [%bad ~]
5142+ ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5143+ =/ first=ifit $(actual hed.actual, expected hed.expected)
5144+ ?. ?=(%ok -.first) first
5145+ $(actual tal.actual, expected tal.expected, sub sub.first, next next.first)
5146+ :: A field may add a face to an occurrence of the very same type
5147+ :: variable. Binding that variable to a face around itself would fail
5148+ :: the occurs check, but its underlying type has already matched.
5149+ ?: &(?=(%var -.actual) ?=(%face -.expected) =(actual (itype-walk body.expected sub)))
5150+ [%ok sub next]
5151+ :: Differing variables and faces need propagation that is not yet
5152+ :: represented. Binding one to the face can create a false mismatch.
5153+ ?: &(?=(%var -.actual) ?=(%face -.expected)) [%unknown ~]
5154+ ?: &(?=(%face -.actual) ?=(%var -.expected)) [%unknown ~]
5155+ ?: &(?=(%var -.actual) (itype-has-any-atom expected sub))
5156+ [%unknown ~]
5157+ ?: |(?=(%var -.actual) ?=(%var -.expected))
5158+ =/ unified=(unit isub) (itype-unify actual expected sub)
5159+ ?~ unified
5160+ ?: |(?=(%face -.actual) ?=(%face -.expected)) [%unknown ~]
5161+ ?: |((itype-has-recursive (itype-normalize actual sub)) (itype-has-recursive (itype-normalize expected sub))) [%unknown ~]
5162+ ?: (itype-family-related actual expected sub) [%unknown ~]
5163+ [%bad ~]
5164+ [%ok u.unified next]
5165+ ?: &(?=(%face -.actual) ?=(%face -.expected))
5166+ ?. =(name.actual name.expected) [%bad ~]
5167+ $(actual body.actual, expected body.expected)
5168+ ?: ?=(%face -.actual) $(actual body.actual)
5169+ ?: ?=(%face -.expected) $(expected body.expected)
5170+ ?: (itype-face-asym actual expected sub) [%unknown ~]
5171+ ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
5172+ [%unknown ~]
5173+ =/ unified=(unit isub) (itype-unify actual expected sub)
5174+ ?~ unified
5175+ ?: |((itype-has-union (itype-normalize actual sub)) (itype-has-union (itype-normalize expected sub))) [%unknown ~]
5176+ ?: |((itype-has-recursive (itype-normalize actual sub)) (itype-has-recursive (itype-normalize expected sub))) [%unknown ~]
5177+ ?: (itype-family-related actual expected sub) [%unknown ~]
5178+ [%bad ~]
5179+ [%ok u.unified next]
5180+::
46795181++ itype-unify-test
46805182 ^- (list tape)
46815183 =/ a=itype [%var 0]
@@ -4700,21 +5202,59 @@
47005202 ["a shared type variable should reject incompatible arguments" problems]
47015203 =? problems ?=(~ (itype-unify same fine ~))
47025204 ["a shared type variable should accept equal arguments" problems]
5205+ =/ list-a=itype [%collection %list ~[a]]
5206+ =/ list-t=itype [%collection %list ~[txt]]
5207+ =/ list-n=itype [%collection %list ~[num]]
5208+ =? problems ?=(^ (itype-unify a list-a ~))
5209+ ["occurs check should look through collection arguments" problems]
5210+ =? problems !=((itype-vars list-a) ~[0])
5211+ ["generalization should see collection argument variables" problems]
5212+ =? problems !=((itype-rename list-a ~[[0 num]]) list-n)
5213+ ["instantiation should rename collection argument variables" problems]
5214+ =? problems ?=(^ (itype-unify list-t list-n ~))
5215+ ["collection arguments with different auras should conflict" problems]
5216+ =? problems ?=(^ (itype-unify list-t [%collection %unit ~[txt]] ~))
5217+ ["different collection names should conflict" problems]
5218+ =? problems !(itype-family-related list-t [%collection %list ~[[%atom 'tD']]] ~)
5219+ ["collection arguments should preserve aura-family uncertainty" problems]
5220+ =? problems !(itype-face-asym [%collection %list ~[[%face %x txt]]] list-t ~)
5221+ ["collection arguments should preserve face uncertainty" problems]
5222+ =/ recursive=itype [%recursive %fixture %chain `'chain.fixture']
5223+ =/ same-recursive=itype [%recursive %fixture %chain ~]
5224+ =/ other-recursive=itype [%recursive %other %chain `'chain.other']
5225+ =? problems ?=(~ (itype-unify recursive same-recursive ~))
5226+ ["recursive identity should not depend on its visible name" problems]
5227+ =? problems ?=(^ (itype-unify recursive other-recursive ~))
5228+ ["recursive identity should include the source module" problems]
5229+ =/ recursive-fit=ifit (itype-fit recursive txt ~ 0)
5230+ =? problems !?=(%unknown -.recursive-fit)
5231+ ["opaque recursive types should not be unfolded by a fit" problems]
5232+ =/ nested-fit=ifit
5233+ (itype-fit [%collection %list ~[a]] list-t ~[[0 recursive]] 1)
5234+ =? problems !?=(%unknown -.nested-fit)
5235+ ["recursive types behind substitutions should remain uncertain" problems]
47035236 problems
47045237::
47055238:: The expression inference below is deliberately a fragment: bindings,
4706−:: simple gates, unary calls, fixed-aura literals, and plain strings. The
5239+:: simple gates, calls, fixed-aura literals, and some interpolated strings. The
47075240:: result for unsupported syntax is a diagnostic, never a checked module.
47085241::
47095242+$ ischeme [typ=itype vars=(list @ud)]
47105243+$ ienv (list [name=term scheme=ischeme])
4711−+$ icaps (list [name=@t id=@ud])
5244++$ imold-types (list [name=term template=ischeme])
5245++$ ifile [values=ienv molds=imold-types at=path]
5246++$ ijimports (list [face=term interface=ifile])
5247++$ icap [name=@t id=@ud at=span]
5248++$ icaps (list icap)
5249++$ iparams (list [name=@t typ=itype])
47125250+$ imolds (list [name=term body=shape])
47135251:: A caller supplies the exact noun returned by +read-mold:jibb-import.
47145252:: This core has no Ford dependencies; unrecognized payloads fail closed.
47155253+$ iexternals (list [module=term name=term result=*])
4716−+$ istate [next=@ud sub=isub caps=icaps molds=imolds globals=(list term) externals=iexternals surs=(list term) active=(list term) in-mold=?]
4717−+$ iresult (each [typ=itype state=istate] tape)
5254++$ imark-externals (list [mark=term result=*])
5255++$ istate [next=@ud sub=isub caps=icaps binders=(list @ud) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) params=iparams active=(list term) tags=(list ipending) in-mold=? at=path top-molds=(list term) prelude=(unit ifile)]
5256++$ idiag [msg=tape sites=(list [at=span note=tape])]
5257++$ iresult (each [typ=itype state=istate] idiag)
47185258+$ isample-result (each [typ=itype env=ienv state=istate] tape)
47195259::
47205260++ ienv-lookup
@@ -4732,20 +5272,70 @@
47325272 |= [t=itype sub=isub]
47335273 ^- itype
47345274 =. t (itype-walk t sub)
5275+ ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5276+ ?: ?=(%union -.t)
5277+ [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5278+ ?: ?=(%face -.t)
5279+ [%face name.t $(t body.t)]
47355280 ?: ?=(%fn -.t)
47365281 [%fn $(t sample.t) $(t product.t)]
47375282 ?: ?=(%cell -.t)
47385283 [%cell $(t hed.t) $(t tal.t)]
47395284 t
47405285::
5286+::
5287+:: Default decimal variables only in types with no gates. A gate can
5288+:: generalize an aura from its sample, which requires constraint analysis
5289+:: beyond this fragment; leave those cases unresolved.
5290+::
5291+++ itype-has-gate
5292+ |= t=itype
5293+ ^- ?
5294+ ?- -.t
5295+ %fn &
5296+ %cell |($(t hed.t) $(t tal.t))
5297+ %recursive |
5298+ %collection (lien args.t |=(c=itype (itype-has-gate c)))
5299+ %face $(t body.t)
5300+ %union (lien cases.t |=(c=itype (itype-has-gate c)))
5301+ %tag |
5302+ %const |
5303+ %var |
5304+ %avar |
5305+ %nvar |
5306+ %atom |
5307+ %any-atom |
5308+ %flag |
5309+ ==
5310+::
5311+++ default-decimals
5312+ |= t=itype
5313+ ^- itype
5314+ ?: (itype-has-gate t) t
5315+ ?- -.t
5316+ %nvar [%atom %ud]
5317+ %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5318+ %face [%face name.t $(t body.t)]
5319+ %cell [%cell $(t hed.t) $(t tal.t)]
5320+ * t
5321+ ==
5322+::
47415323++ itype-vars
47425324 |= t=itype
47435325 ^- (list @ud)
47445326 ?- -.t
47455327 %var ~[id.t]
47465328 %avar ~[id.t]
5329+ %nvar ~[id.t]
47475330 %atom ~
5331+ %any-atom ~
47485332 %flag ~
5333+ %tag ~
5334+ %const ~
5335+ %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
5336+ %recursive ~
5337+ %collection (zing (turn args.t |=(c=itype (itype-vars c))))
5338+ %face $(t body.t)
47495339 %fn (weld $(t sample.t) $(t product.t))
47505340 %cell (weld $(t hed.t) $(t tal.t))
47515341 ==
@@ -4767,13 +5357,50 @@
47675357 =/ found=(unit itype) (itype-lookup id.t ren)
47685358 ?~ found t
47695359 u.found
4770− %avar t
5360+ %avar
5361+ =/ found=(unit itype) (itype-lookup id.t ren)
5362+ ?~ found t
5363+ u.found
5364+ %nvar
5365+ =/ found=(unit itype) (itype-lookup id.t ren)
5366+ ?~ found t
5367+ u.found
47715368 %atom t
5369+ %any-atom t
47725370 %flag t
5371+ %tag t
5372+ %const t
5373+ %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
5374+ %recursive t
5375+ %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
5376+ %face [%face name.t $(t body.t)]
47735377 %fn [%fn $(t sample.t) $(t product.t)]
47745378 %cell [%cell $(t hed.t) $(t tal.t)]
47755379 ==
47765380::
5381+:: Variable IDs are unique across the two kinds. Inspecting the
5382+:: normalized type preserves the atom constraint when renaming.
5383+::
5384+++ itype-var-is-atom
5385+ |= [n=@ud t=itype]
5386+ ^- ?
5387+ ?- -.t
5388+ %var |
5389+ %avar =(n id.t)
5390+ %nvar =(n id.t)
5391+ %atom |
5392+ %any-atom |
5393+ %flag |
5394+ %tag |
5395+ %const |
5396+ %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
5397+ %recursive |
5398+ %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
5399+ %face $(t body.t)
5400+ %fn |($(t sample.t) $(t product.t))
5401+ %cell |($(t hed.t) $(t tal.t))
5402+ ==
5403+::
47775404:: Canonical numbering makes printed variables independent of the order
47785405:: the unifier happened to allocate intermediates.
47795406::
@@ -4784,7 +5411,8 @@
47845411 =/ n=@ud 0
47855412 |-
47865413 ?~ vars (itype-rename t ren)
4787− $(vars t.vars, ren [[i.vars [%var n]] ren], n +(n))
5414+ =/ replacement=itype ?:((itype-var-is-atom i.vars t) [%avar n] [%var n])
5415+ $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
47885416::
47895417++ instantiate-scheme
47905418 |= [scheme=ischeme state=istate]
@@ -4793,7 +5421,13 @@
47935421 =/ vars=(list @ud) vars.scheme
47945422 |-
47955423 ?~ vars [(itype-rename typ.scheme ren) state]
4796− $(vars t.vars, ren [[i.vars [%var next.state]] ren], state state(next +(next.state)))
5424+ =/ replacement=itype
5425+ ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state])
5426+ :: A generalized atom variable is a valid origin for re-generalizing
5427+ :: an alias, just as a sample binder is.
5428+ =/ st=istate state(next +(next.state))
5429+ =? binders.st ?=(%avar -.replacement) [next.state binders.state]
5430+ $(vars t.vars, ren [[i.vars replacement] ren], state st)
47975431::
47985432++ icap-lookup
47995433 |= [n=@t caps=icaps]
@@ -4823,9 +5457,125 @@
48235457 $(ds t.ds)
48245458::
48255459::
4826−:: The importer owns its algebra. Only successful %atom and %cell nouns
4827−:: in the supported subset are decoded here. In particular a singleton,
4828−:: face, union, collection or recursive reference must not be widened.
5460+:: The caller supplies unchanged results from the source-aware importer.
5461+:: That boundary is trusted for source provenance: a fork alone cannot
5462+:: reveal cases Hoon collapsed before it was constructed. Validate the
5463+:: supplied graph independently, including pairwise disjointness. Fixed
5464+:: atoms, term singletons, cells, faces and proven forks are decoded;
5465+:: unsupported singletons, collections and recursive references fail.
5466+::
5467+++ jibb-face-name
5468+ |= name=@
5469+ ^- ?
5470+ =/ chars=tape (trip (@t name))
5471+ ?~ chars |
5472+ ?. (is-lower i.chars) |
5473+ (levy t.chars |=(c=@tD (in c name-mask)))
5474+::
5475+:: A source-aware reader result is trusted for origin. Validate every
5476+:: supplied branch and keep the recursive mold opaque: unfolding its
5477+:: root while naming only its tail would change its type identity.
5478++$ irec-pattern [pat=upat has=?]
5479+++ rec-pattern
5480+ |= [node=* module=term name=term]
5481+ ^- (unit irec-pattern)
5482+ ?@ node ~
5483+ ?+ -.node ~
5484+ %atom
5485+ ?: ?=([%atom %n [~ @]] node)
5486+ ?. =(0 +>+.node) ~
5487+ `[[%atom `0] |]
5488+ ?: ?=([%atom %tas [~ @]] node)
5489+ =/ value=@ +>+.node
5490+ ?. |(=(value 0) (jibb-face-name value)) ~
5491+ `[[%atom `value] |]
5492+ ?. ?=([%atom @ ~] node) ~
5493+ =/ aura=@ta (@ta +<.node)
5494+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
5495+ `[[%atom ~] |]
5496+ %ref
5497+ ?. ?=([%ref @ @] node) ~
5498+ ?. &(=(module +<.node) =(name +>.node)) ~
5499+ `[[%unknown ~] &]
5500+ %face
5501+ ?. ?=([%face @ *] node) ~
5502+ ?. (jibb-face-name +<.node) ~
5503+ $(node +>.node)
5504+ %cell
5505+ ?. ?=([%cell * *] node) ~
5506+ =/ left $(node +<.node)
5507+ ?~ left ~
5508+ =/ right $(node +>.node)
5509+ ?~ right ~
5510+ `[[%cell pat.u.left pat.u.right] |(has.u.left has.u.right)]
5511+ %fork
5512+ =/ cases (rec-patterns +.node module name)
5513+ ?~ cases ~
5514+ ?~ pats.u.cases ~
5515+ ?~ t.pats.u.cases ~
5516+ ?. (rec-patterns-disjoint pats.u.cases) ~
5517+ `[[%or pats.u.cases] has.u.cases]
5518+ ==
5519+::
5520+++ rec-patterns
5521+ |= [nodes=* module=term name=term]
5522+ ^- (unit [pats=(list upat) has=?])
5523+ ?@ nodes ?:(=(nodes 0) `[~ |] ~)
5524+ =/ first (rec-pattern -.nodes module name)
5525+ ?~ first ~
5526+ =/ rest $(nodes +.nodes)
5527+ ?~ rest ~
5528+ `[[pat.u.first pats.u.rest] |(has.u.first has.u.rest)]
5529+::
5530+++ rec-patterns-disjoint
5531+ |= pats=(list upat)
5532+ ^- ?
5533+ ?~ pats &
5534+ ?. (levy t.pats |=(p=upat =(%disjoint (union-relate i.pats p)))) |
5535+ $(pats t.pats)
5536+::
5537+::
5538+::
5539+:: Repeated faces along an imported record spine fail closed. Hoon's type
5540+:: graph can erase unfaced nested-cell boundaries, so that alone does not
5541+:: prove the original source repeated a name within one record. A faced
5542+:: body and each union alternative have separate scopes. Check recursive
5543+:: roots before making them opaque; unused molds are never inspected.
5544+::
5545+++ imported-faces-valid
5546+ |= node=*
5547+ ^- ?
5548+ ?@ node &
5549+ ?+ -.node &
5550+ %face ?:(?=([%face @ *] node) $(node +>.node) |)
5551+ %cell ?:(?=([%cell * *] node) (imported-record-faces-valid node ~) |)
5552+ %fork (imported-faces-valid-list +.node)
5553+ %apply ?:(?=([%apply @ *] node) (imported-faces-valid-list +>.node) |)
5554+ ==
5555+::
5556+++ imported-faces-valid-list
5557+ |= nodes=*
5558+ ^- ?
5559+ ?@ nodes =(nodes 0)
5560+ ?. (imported-faces-valid -.nodes) |
5561+ $(nodes +.nodes)
5562+::
5563+++ imported-record-faces-valid
5564+ |= [node=* names=(list @)]
5565+ ^- ?
5566+ ?: ?=([%cell * *] node)
5567+ =/ head=* +<.node
5568+ =/ rest=* +>.node
5569+ ?: ?=([%face @ *] head)
5570+ ?: (lien names |=(n=@ =(n +<.head))) |
5571+ ?. (imported-faces-valid +>.head) |
5572+ $(node rest, names [+<.head names])
5573+ ?. (imported-faces-valid head) |
5574+ $(node rest)
5575+ ?: ?=([%face @ *] node)
5576+ ?: (lien names |=(n=@ =(n +<.node))) |
5577+ (imported-faces-valid +>.node)
5578+ (imported-faces-valid node)
48295579::
48305580++ import-to-itype
48315581 |= node=*
@@ -4833,10 +5583,41 @@
48335583 ?@ node ~
48345584 ?+ -.node ~
48355585 %atom
5586+ ?: ?=([%atom %tas [~ @]] node)
5587+ =/ value=@ +>+.node
5588+ ?. |(=(value 0) (jibb-face-name value)) ~
5589+ =/ printed=@t ?:(=(value 0) '%$' (cat 3 '%' value))
5590+ `[%const [%term %tas value printed]]
48365591 ?. ?=([%atom @ ~] node) ~
48375592 =/ aura=@ta (@ta +<.node)
4838− ?. ?=(?(%ud %ux %uv %t %ta %tas %p %da %dr) aura) ~
5593+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
48395594 `[%atom aura]
5595+ %apply
5596+ ?. ?=([%apply @ *] node) ~
5597+ =/ name=term (@tas +<.node)
5598+ =/ arity=@ud
5599+ ?: |(=(%list name) =(%unit name) =(%set name) =(%qeu name)) 1
5600+ ?: |(=(%map name) =(%mop name) =(%jar name) =(%jug name)) 2
5601+ 0
5602+ ?: =(arity 0) ~
5603+ =/ args=(unit (list itype)) (import-to-itypes +>.node)
5604+ ?~ args ~
5605+ ?. =(arity (lent u.args)) ~
5606+ `[%collection name u.args]
5607+ %fork
5608+ =/ cases=(unit (list itype)) (import-to-itypes +.node)
5609+ ?~ cases ~
5610+ ?~ u.cases ~
5611+ ?~ t.u.cases ~
5612+ ?. (import-cases-disjoint u.cases) ~
5613+ `[%union u.cases ~ ~ ~]
5614+ %face
5615+ ?. ?=([%face @ *] node) ~
5616+ =/ name=@ +<.node
5617+ ?. (jibb-face-name name) ~
5618+ =/ body=(unit itype) $(node +>.node)
5619+ ?~ body ~
5620+ `[%face (@tas name) u.body]
48405621 %cell
48415622 ?. ?=([%cell * *] node) ~
48425623 =/ left=(unit itype) $(node +<.node)
@@ -4846,6 +5627,36 @@
48465627 `[%cell u.left u.right]
48475628 ==
48485629::
5630+++ import-to-itypes
5631+ |= nodes=*
5632+ ^- (unit (list itype))
5633+ ?@ nodes ?:(=(nodes 0) `~ ~)
5634+ =/ first (import-to-itype -.nodes)
5635+ ?~ first ~
5636+ =/ rest $(nodes +.nodes)
5637+ ?~ rest ~
5638+ `[u.first u.rest]
5639+::
5640+++ import-type-pattern
5641+ |= typ=itype
5642+ ^- upat
5643+ ?- -.typ
5644+ %atom [%atom ~]
5645+ %const [%atom `val.literal.typ]
5646+ %face $(typ body.typ)
5647+ %cell [%cell $(typ hed.typ) $(typ tal.typ)]
5648+ %union [%or (turn cases.typ |=(t=itype (import-type-pattern t)))]
5649+ * [%unknown ~]
5650+ ==
5651+::
5652+++ import-cases-disjoint
5653+ |= cases=(list itype)
5654+ ^- ?
5655+ ?~ cases &
5656+ =/ first=upat (import-type-pattern i.cases)
5657+ ?. (levy t.cases |=(t=itype =(%disjoint (union-relate first (import-type-pattern t))))) |
5658+ $(cases t.cases)
5659+::
48495660++ find-imported-mold
48505661 |= [module=term name=term externals=iexternals surs=(list term)]
48515662 ^- (unit itype)
@@ -4857,7 +5668,15 @@
48575668 =/ result=* result.i.found
48585669 ?@ result ~
48595670 ?. ?=(%& -.result) ~
4860− (import-to-itype +.result)
5671+ =/ node=* +.result
5672+ ?. (imported-faces-valid node) ~
5673+ ?@ node (import-to-itype node)
5674+ ?: ?=(%ref -.node) (import-to-itype node)
5675+ =/ pattern=(unit irec-pattern) (rec-pattern node module name)
5676+ ?~ pattern (import-to-itype node)
5677+ ?. has.u.pattern (import-to-itype node)
5678+ `[%recursive module name `(crip "{(trip name)}.{(trip module)}")]
5679+
48615680::
48625681++ collect-sur-imports
48635682 |= imports=(list import)
@@ -4867,14 +5686,283 @@
48675686 [name.i.imports $(imports t.imports)]
48685687 $(imports t.imports)
48695688::
5689+++ collect-mark-imports
5690+ |= imports=(list import)
5691+ ^- (list term)
5692+ ?~ imports ~
5693+ ?: ?=(%mark -.i.imports)
5694+ [mark.i.imports $(imports t.imports)]
5695+ $(imports t.imports)
5696+::
5697+++ find-imported-mark
5698+ |= [name=term externals=imark-externals marks=(list term)]
5699+ ^- (unit itype)
5700+ ?. (unique-value-name name marks) ~
5701+ =/ found=imark-externals
5702+ (skim externals |=(e=[mark=term result=*] =(name mark.e)))
5703+ ?~ found ~
5704+ ?^ t.found ~
5705+ =/ result=* result.i.found
5706+ ?@ result ~
5707+ ?. ?=(%& -.result) ~
5708+ ?. (imported-faces-valid +.result) ~
5709+ (import-to-itype +.result)
5710+::
5711+++ find-jibb-interface
5712+ |= [face=term imports=ijimports]
5713+ ^- (unit ifile)
5714+ ?~ imports ~
5715+ ?: =(face face.i.imports) `interface.i.imports
5716+ $(imports t.imports)
5717+::
5718+++ find-jibb-mold
5719+ |= [name=term iface=ifile]
5720+ ^- (unit ischeme)
5721+ =/ ms=imold-types molds.iface
5722+ |-
5723+ ?~ ms ~
5724+ ?: =(name name.i.ms) `template.i.ms
5725+ $(ms t.ms)
5726+::
5727+:: An exported alias may name a union from another module. Only a
5728+:: nongeneric alias of the same origin is usable through this import face.
5729+::
5730+++ imported-union-alias
5731+ |= [origin=[at=path name=term] molds=imold-types]
5732+ ^- (unit term)
5733+ ?~ molds ~
5734+ =/ template=ischeme template.i.molds
5735+ ?: &(?=(~ vars.template) ?=(%union -.typ.template))
5736+ ?:(=(`origin origin.typ.template) `name.i.molds $(molds t.molds))
5737+ $(molds t.molds)
5738+::
5739+:: Only names exported by this directly imported module are visible through
5740+:: its face. Other origins retain identity but print as unnamed unions.
5741+::
5742+++ itype-in-import
5743+ |= [t=itype iface=ifile face=term]
5744+ ^- itype
5745+ ?- -.t
5746+ %union
5747+ =/ label=(unit @t)
5748+ ?~ origin.t ~
5749+ ?: =(at.u.origin.t /lib/jibb/prelude/jibb) `name.u.origin.t
5750+ =/ alias=(unit term) ~
5751+ =? alias &(=(at.u.origin.t at.iface) ?=(^ (find-jibb-mold name.u.origin.t iface))) `name.u.origin.t
5752+ =? alias ?=(~ alias) (imported-union-alias u.origin.t molds.iface)
5753+ ?~ alias ~
5754+ `(crip "{(trip u.alias)}.{(trip face)}")
5755+ [%union (turn cases.t |=(c=itype (itype-in-import c iface face))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face)))]
5756+ %recursive [%recursive module.t name.t ~]
5757+ %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face)))]
5758+ %face [%face name.t $(t body.t)]
5759+ %fn [%fn $(t sample.t) $(t product.t)]
5760+ %cell [%cell $(t hed.t) $(t tal.t)]
5761+ * t
5762+ ==
5763+::
5764+++ label-direct-union
5765+ |= [typ=itype body=shape name=term state=istate]
5766+ ^- itype
5767+ ?. ?=(%union -.typ) typ
5768+ =/ direct=? ?=(%union -.body)
5769+ =? direct ?=(%generic -.body) ?=(%union -.body.body)
5770+ ?. direct typ
5771+ ?. (lien top-molds.state |=(n=term =(n name))) typ
5772+ [%union cases.typ `[at.state name] `name args.typ]
5773+::
5774+:: Generic mold parameters are lexical and distinct from the enclosing
5775+:: value's capital variables. Arguments are substituted only once, so
5776+:: an argument's variable ID cannot be captured by a template ID.
5777+:: A generic alias of a named union keeps the underlying union's origin
5778+:: and substituted argument order; an originless union stays unsupported.
5779+::
5780+++ iparam-lookup
5781+ |= [name=@t params=iparams]
5782+ ^- (unit itype)
5783+ ?~ params ~
5784+ ?: =(name name.i.params) `typ.i.params
5785+ $(params t.params)
5786+::
5787+++ distinct-params
5788+ |= names=(list @t)
5789+ ^- ?
5790+ ?~ names &
5791+ ?: (lien t.names |=(n=@t =(n i.names))) |
5792+ $(names t.names)
5793+::
5794+++ bind-params
5795+ |= [names=(list @t) args=(list itype)]
5796+ ^- (unit iparams)
5797+ ?~ names ?~(args `~ ~)
5798+ ?~ args ~
5799+ =/ rest=(unit iparams) $(names t.names, args t.args)
5800+ ?~ rest ~
5801+ `[[i.names i.args] u.rest]
5802+::
5803+++ template-apply
5804+ |= [template=ischeme args=(list itype)]
5805+ ^- (unit itype)
5806+ =/ vars=(list @ud) vars.template
5807+ =/ ren=isub ~
5808+ |-
5809+ ?~ vars ?~(args `(itype-rename typ.template ren) ~)
5810+ ?~ args ~
5811+ $(vars t.vars, args t.args, ren [[i.vars i.args] ren])
5812+::
5813+++ infer-shape-args
5814+ |= [args=(list shape) state=istate]
5815+ ^- (unit [types=(list itype) state=istate])
5816+ ?~ args `[~ state]
5817+ =/ head=(unit [typ=itype state=istate]) (infer-simple-shape i.args state)
5818+ ?~ head ~
5819+ =/ tail=(unit [types=(list itype) state=istate]) $(args t.args, state state.u.head)
5820+ ?~ tail ~
5821+ `[[typ.u.head types.u.tail] state.u.tail]
5822+::
5823+++ fresh-mold-params
5824+ |= [names=(list @t) next=@ud]
5825+ ^- [params=iparams vars=(list @ud) next=@ud]
5826+ ?~ names [~ ~ next]
5827+ =/ rest=[params=iparams vars=(list @ud) next=@ud] $(names t.names, next +(next))
5828+ [[[i.names [%var next]] params.rest] [next vars.rest] next.rest]
5829+::
5830+++ infer-mold-template
5831+ |= [sh=shape state=istate]
5832+ ^- (unit [template=ischeme state=istate])
5833+ ?: ?=(%generic -.sh)
5834+ ?~ vars.sh ~
5835+ ?. (distinct-params vars.sh) ~
5836+ =/ fresh=[params=iparams vars=(list @ud) next=@ud] (fresh-mold-params vars.sh next.state)
5837+ =/ out=(unit [typ=itype state=istate])
5838+ (infer-simple-shape body.sh state(next next.fresh, params params.fresh, in-mold &))
5839+ ?~ out ~
5840+ ?: &(?=(%union -.typ.u.out) !?=(%union -.body.sh) ?=(~ origin.typ.u.out)) ~
5841+ =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.sh))
5842+ typ.u.out(args (turn vars.fresh |=(n=@ud `itype`[%var n])))
5843+ =/ used=(list @ud) (itype-vars typ.u.out)
5844+ ?. (levy used |=(n=@ud (lien vars.fresh |=(p=@ud =(p n))))) ~
5845+ `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state)]
5846+ =/ out=(unit [typ=itype state=istate])
5847+ (infer-simple-shape sh state(params ~, in-mold &))
5848+ ?~ out ~
5849+ ?: ?=(^ (itype-vars typ.u.out)) ~
5850+ `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state)]
5851+::
5852+:: A direct imported reference may carry definite reader evidence. Only
5853+:: uniquely supplied, declared inputs are used; unsupported data stay generic.
5854+++ direct-import-invalid
5855+ |= [sh=shape state=istate]
5856+ ^- (unit idiag)
5857+ ?. ?=(%ref -.sh) ~
5858+ ?~ names.sh ~
5859+ =/ n=term i.names.sh
5860+ =/ raw=*
5861+ ?~ t.names.sh
5862+ ?. (unique-value-name n marks.state) ~
5863+ ?: (lien surs.state |=(x=term =(x n))) ~
5864+ ?: ?=(^ (find-jibb-interface n jimports.state)) ~
5865+ ?: (lien globals.state |=(x=term =(x n))) ~
5866+ ?: (lien reserved-molds.state |=(x=term =(x n))) ~
5867+ ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) ~
5868+ =/ found=imark-externals (skim mark-externals.state |=(e=[mark=term result=*] =(mark.e n)))
5869+ ?~ found ~
5870+ ?^ t.found ~
5871+ result.i.found
5872+ ?^ t.t.names.sh ~
5873+ =/ mod=term i.t.names.sh
5874+ ?: ?=(^ (find-jibb-interface mod jimports.state)) ~
5875+ ?. (unique-value-name mod surs.state) ~
5876+ ?: (lien marks.state |=(x=term =(x mod))) ~
5877+ ?: (lien globals.state |=(x=term =(x mod))) ~
5878+ ?: (lien reserved-molds.state |=(x=term =(x mod))) ~
5879+ ?: (lien molds.state |=(m=[name=term body=shape] =(mod name.m))) ~
5880+ =/ found=iexternals (skim externals.state |=(e=[module=term name=term result=*] &(=(module.e mod) =(name.e n))))
5881+ ?~ found ~
5882+ ?^ t.found ~
5883+ result.i.found
5884+ ?. ?=([%invalid ?(%aura %core) @] raw) ~
5885+ `["{(trip +>.raw)}" ~[[at.sh "invalid imported mold"]]]
5886+::
5887+:: Replay only the shape branches whose evaluation order we can prove.
5888+:: Successful prefixes must be checked before descending to a failure.
5889+++ nested-import-invalid
5890+ |= [sh=shape state=istate]
5891+ ^- (unit idiag)
5892+ ?: ?=(^ (infer-simple-shape sh state)) ~
5893+ ?- -.sh
5894+ %ref
5895+ =/ direct=(unit idiag) (direct-import-invalid sh state)
5896+ ?^ direct direct
5897+ ?~ names.sh ~
5898+ ?^ t.names.sh ~
5899+ =/ n=term i.names.sh
5900+ ?: (lien marks.state |=(x=term =(x n))) ~
5901+ ?: (lien active.state |=(x=term =(x n))) ~
5902+ =/ found=(unit shape) (find-simple-mold n molds.state)
5903+ ?~ found ~
5904+ $(sh u.found, state state(active [n active.state], in-mold &, params ~))
5905+ %fn
5906+ =/ first=(unit [typ=itype state=istate]) (infer-simple-shape sample.sh state)
5907+ ?~ first $(sh sample.sh)
5908+ $(sh product.sh, state state.u.first)
5909+ %cell (nested-field-invalid fields.sh state)
5910+ * ~
5911+ ==
5912+::
5913+++ nested-field-invalid
5914+ |= [fields=(list field) state=istate]
5915+ ^- (unit idiag)
5916+ ?~ fields ~
5917+ =/ sh=shape
5918+ ?- -.i.fields
5919+ %bare shape.i.fields
5920+ %face shape.i.fields
5921+ %pun [%ref at.i.fields ~[name.i.fields]]
5922+ ==
5923+ =/ out=(unit [typ=itype state=istate]) (infer-simple-shape sh state)
5924+ ?~ out (nested-import-invalid sh state)
5925+ $(fields t.fields, state state.u.out)
5926+::
5927+++ sample-import-invalid
5928+ |= [s=sample env=ienv state=istate]
5929+ ^- (unit idiag)
5930+ =/ result=isample-result (infer-sample s env state)
5931+ ?: ?=(%& -.result) ~
5932+ ?. =(p.result "sample mold is not supported by partial inference") ~
5933+ ?- s
5934+ [%face *] (nested-import-invalid shape.s state)
5935+ [%bare *] (nested-import-invalid shape.s state)
5936+ [%pun *] (nested-import-invalid [%ref at.s ~[name.s]] state)
5937+ [%cell *] (nested-samples-invalid items.s env state)
5938+ * ~
5939+ ==
5940+::
5941+++ nested-samples-invalid
5942+ |= [items=(list sample) env=ienv state=istate]
5943+ ^- (unit idiag)
5944+ ?~ items ~
5945+ =/ head=isample-result (infer-sample i.items env state)
5946+ ?: ?=(%| -.head) (sample-import-invalid i.items env state)
5947+ $(items t.items, env env.p.head, state state.p.head)
5948+::
48705949++ infer-simple-shape
48715950 |= [sh=shape state=istate]
48725951 ^- (unit [typ=itype state=istate])
48735952 ?- -.sh
48745953 %aura
4875− ?: =(0 aura.sh) ~
5954+ ?: =(0 aura.sh) `[[%any-atom ~] state]
48765955 `[[%atom aura.sh] state]
48775956 %flag `[[%flag ~] state]
5957+ %const
5958+ ?. |(=(%term form.lit.sh) =(%null form.lit.sh)) ~
5959+ `[[%const lit.sh] state]
5960+ %union
5961+ =/ pairs=(list upair) (union-pairs cases.sh molds.state)
5962+ ?. (levy pairs |=(p=upair =(%disjoint relation.p))) ~
5963+ =/ cs=(unit [types=(list itype) state=istate]) (infer-shape-args cases.sh state)
5964+ ?~ cs ~
5965+ `[[%union types.u.cs ~ ~ ~] state.u.cs]
48785966 %cell (infer-simple-fields fields.sh state)
48795967 %fn
48805968 =/ arg=(unit [typ=itype state=istate]) $(sh sample.sh)
@@ -4887,59 +5975,1034 @@
48875975 =/ n=term i.names.sh
48885976 ?^ t.names.sh
48895977 ?^ t.t.names.sh ~
5978+ =/ iface=(unit ifile) (find-jibb-interface i.t.names.sh jimports.state)
5979+ ?^ iface
5980+ =/ found=(unit ischeme) (find-jibb-mold n u.iface)
5981+ ?~ found ~
5982+ ?^ vars.u.found ~
5983+ `[(itype-in-import typ.u.found u.iface i.t.names.sh) state]
48905984 =/ found=(unit itype)
48915985 (find-imported-mold i.t.names.sh n externals.state surs.state)
48925986 ?~ found ~
48935987 `[u.found state]
5988+ ?: (lien marks.state |=(x=term =(x n)))
5989+ ?^ (find-simple-mold n molds.state) ~
5990+ =/ imported=(unit itype) (find-imported-mark n mark-externals.state marks.state)
5991+ ?~ imported ~
5992+ `[u.imported state]
48945993 ?: (lien active.state |=(x=term =(x n))) ~
48955994 =/ found=(unit shape) (find-simple-mold n molds.state)
4896− ?~ found ~
5995+ ?~ found
5996+ ?: (lien molds.state |=(m=[name=term body=shape] =(name.m n))) ~
5997+ ?~ prelude.state ~
5998+ =/ prelude-entry=(unit ischeme) (find-jibb-mold n u.prelude.state)
5999+ ?~ prelude-entry ~
6000+ ?^ vars.u.prelude-entry ~
6001+ `[typ.u.prelude-entry state]
6002+ =/ out=(unit [typ=itype state=istate])
6003+ $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6004+ ?~ out ~
6005+ `[(label-direct-union typ.u.out u.found n state) state.u.out(active active.state, in-mold in-mold.state, params params.state)]
6006+ %apply
6007+ ?~ ref.sh ~
6008+ =/ args=(unit [types=(list itype) state=istate]) (infer-shape-args args.sh state)
6009+ ?~ args ~
6010+ =/ n=term i.ref.sh
6011+ ?^ t.ref.sh
6012+ ?^ t.t.ref.sh ~
6013+ =/ iface=(unit ifile) (find-jibb-interface i.t.ref.sh jimports.state.u.args)
6014+ ?~ iface ~
6015+ =/ template=(unit ischeme) (find-jibb-mold n u.iface)
6016+ ?~ template ~
6017+ ?~ vars.u.template ~
6018+ =/ applied=(unit itype) (template-apply u.template types.u.args)
6019+ ?~ applied ~
6020+ `[(itype-in-import u.applied u.iface i.t.ref.sh) state.u.args]
6021+ ?: (lien active.state.u.args |=(x=term =(x n))) ~
6022+ =/ found=(unit shape) (find-simple-mold n molds.state.u.args)
6023+ ?~ found
6024+ ?: (lien molds.state.u.args |=(m=[name=term body=shape] =(name.m n))) ~
6025+ ?~ prelude.state.u.args ~
6026+ =/ prelude-entry=(unit ischeme) (find-jibb-mold n u.prelude.state.u.args)
6027+ ?~ prelude-entry ~
6028+ ?~ vars.u.prelude-entry ~
6029+ =/ applied=(unit itype) (template-apply u.prelude-entry types.u.args)
6030+ ?~ applied ~
6031+ `[u.applied state.u.args]
6032+ ?. ?=(%generic -.u.found) ~
6033+ ?. (distinct-params vars.u.found) ~
6034+ =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6035+ ?~ params ~
48976036 =/ out=(unit [typ=itype state=istate])
4898− $(sh u.found, state state(active [n active.state], in-mold &))
6037+ $(sh body.u.found, state state.u.args(active [n active.state.u.args], in-mold &, params u.params))
48996038 ?~ out ~
4900− `[typ.u.out state.u.out(active active.state, in-mold in-mold.state)]
6039+ ?: &(?=(%union -.typ.u.out) !?=(%union -.body.u.found) ?=(~ origin.typ.u.out)) ~
6040+ ?: &(?=(%union -.typ.u.out) ?=(%union -.body.u.found) !(lien top-molds.state.u.args |=(x=term =(x n)))) ~
6041+ =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.u.found))
6042+ (label-direct-union typ.u.out(args types.u.args) u.found n state.u.args)
6043+ `[typ.u.out state.u.out(active active.state.u.args, in-mold in-mold.state.u.args, params params.state.u.args)]
49016044 %tvar
6045+ =/ param=(unit itype) (iparam-lookup name.sh params.state)
6046+ ?^ param `[u.param state]
49026047 ?: in-mold.state ~
49036048 =/ n=(unit @ud) (icap-lookup name.sh caps.state)
49046049 ?^ n `[[%var u.n] state]
4905− `[[%var next.state] state(next +(next.state), caps [[name.sh next.state] caps.state])]
6050+ `[[%var next.state] state(next +(next.state), caps [[name.sh next.state at.sh] caps.state])]
49066051 * ~
49076052 ==
49086053::
4909−++ infer-simple-fields
4910− |= [fields=(list field) state=istate]
4911− ^- (unit [typ=itype state=istate])
4912− ?~ fields ~
4913− ?. ?=(%bare -.i.fields) ~
4914− =/ head=(unit [typ=itype state=istate]) (infer-simple-shape shape.i.fields state)
4915− ?~ head ~
4916− ?~ t.fields head
4917− =/ tail=(unit [typ=itype state=istate]) $(fields t.fields, state state.u.head)
4918− ?~ tail ~
4919− `[[%cell typ.u.head typ.u.tail] state.u.tail]
6054+++ infer-simple-fields
6055+ |= [fields=(list field) state=istate]
6056+ ^- (unit [typ=itype state=istate])
6057+ ?~ fields ~
6058+ =/ field-shape=shape
6059+ ?- -.i.fields
6060+ %bare shape.i.fields
6061+ %face shape.i.fields
6062+ %pun [%ref at.i.fields ~[name.i.fields]]
6063+ ==
6064+ =/ head=(unit [typ=itype state=istate]) (infer-simple-shape field-shape state)
6065+ ?~ head ~
6066+ =/ t=itype typ.u.head
6067+ =. t
6068+ ?- -.i.fields
6069+ %bare t
6070+ %face [%face name.i.fields t]
6071+ %pun [%face name.i.fields t]
6072+ ==
6073+ ?~ t.fields `[t state.u.head]
6074+ =/ tail=(unit [typ=itype state=istate]) $(fields t.fields, state state.u.head)
6075+ ?~ tail ~
6076+ `[[%cell t typ.u.tail] state.u.tail]
6077+::
6078+++ infer-sample
6079+ |= [s=sample env=ienv state=istate]
6080+ ^- isample-result
6081+ ?- -.s
6082+ %bind
6083+ ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6084+ [%| "sample shadows a name"]
6085+ =/ t=itype [%var next.state]
6086+ [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
6087+ %face
6088+ ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6089+ [%| "sample shadows a name"]
6090+ =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6091+ ?~ t [%| "sample mold is not supported by partial inference"]
6092+ [%& typ.u.t [[name.s [typ.u.t ~]] env] state.u.t]
6093+ %bare
6094+ =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6095+ ?~ t [%| "sample mold is not supported by partial inference"]
6096+ [%& typ.u.t env state.u.t]
6097+ %pun
6098+ $(s [%face at.s name.s [%ref at.s ~[name.s]]])
6099+ %cell
6100+ (infer-sample-items items.s env state)
6101+ ==
6102+::
6103+:: Cell-sample binders are faces on their positions; at the top of a
6104+:: sample a binder only supplies a name for the whole sample.
6105+::
6106+++ infer-sample-items
6107+ |= [items=(list sample) env=ienv state=istate]
6108+ ^- isample-result
6109+ ?~ items [%| "empty sample is not supported by partial inference"]
6110+ =/ head=isample-result (infer-sample i.items env state)
6111+ ?: ?=(%| -.head) head
6112+ =/ ht=itype typ.p.head
6113+ =. ht
6114+ ?- -.i.items
6115+ %bind [%face name.i.items ht]
6116+ %face [%face name.i.items ht]
6117+ %pun [%face name.i.items ht]
6118+ * ht
6119+ ==
6120+ ?~ t.items [%& ht env.p.head state.p.head]
6121+ =/ tail=isample-result $(items t.items, env env.p.head, state state.p.head)
6122+ ?: ?=(%| -.tail) tail
6123+ [%& [%cell ht typ.p.tail] env.p.tail state.p.tail]
6124+::
6125+:: Local definitions generalize only variables outside their enclosing
6126+:: environment and explicit-capital scope. Single self-recursive gates
6127+:: use a monomorphic placeholder; mutually recursive groups stay unsupported.
6128+::
6129++$ ilocal-result (each [env=ienv state=istate] idiag)
6130+++ free-env-vars
6131+ |= [env=ienv sub=isub]
6132+ ^- (list @ud)
6133+ ?~ env ~
6134+ =/ sc=ischeme scheme.i.env
6135+ =/ ids=(list @ud) (unique-type-vars (itype-vars typ.sc))
6136+ =/ free=(list @ud) ~
6137+ |-
6138+ ?~ ids (weld free (free-env-vars t.env sub))
6139+ ?: (lien vars.sc |=(n=@ud =(n i.ids))) $(ids t.ids)
6140+ =/ resolved=itype (itype-normalize [%var i.ids] sub)
6141+ $(ids t.ids, free (weld (itype-vars resolved) free))
6142+::
6143+++ free-cap-vars
6144+ |= [caps=icaps sub=isub]
6145+ ^- (list @ud)
6146+ ?~ caps ~
6147+ (weld (itype-vars (itype-normalize [%var id.i.caps] sub)) $(caps t.caps))
6148+::
6149+++ local-names-valid
6150+ |= [ds=(list def) env=ienv state=istate]
6151+ ^- ?
6152+ =/ names=(list term) (global-value-names ds)
6153+ |-
6154+ ?~ ds &
6155+ ?: ?=(%mold -.i.ds) $(ds t.ds)
6156+ ?. (unique-value-name name.i.ds names) |
6157+ ?: ?=(^ (ienv-lookup name.i.ds env)) |
6158+ ?: (lien globals.state |=(n=term =(n name.i.ds))) |
6159+ $(ds t.ds)
6160+::
6161+:: The supported local molds are nonrecursive simple aliases. Validate
6162+:: all of them, including unused ones, before checking any local values.
6163+:: The enclosing gate sample was checked before this scope was entered.
6164+::
6165+++ local-value-defs
6166+ |= ds=(list def)
6167+ ^- (list def)
6168+ ?~ ds ~
6169+ ?: ?=(%mold -.i.ds) $(ds t.ds)
6170+ [i.ds $(ds t.ds)]
6171+::
6172+++ local-mold-names-valid
6173+ |= [locals=imolds state=istate]
6174+ ^- ?
6175+ =/ names=(list term) (turn locals |=(m=[name=term body=shape] name.m))
6176+ |-
6177+ ?~ locals &
6178+ =/ n=term name.i.locals
6179+ ?. (unique-value-name n names) |
6180+ ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
6181+ ?: (lien marks.state |=(m=term =(n m))) |
6182+ ?: (lien reserved-molds.state |=(m=term =(n m))) |
6183+ ?: (lien surs.state |=(m=term =(n m))) |
6184+ $(locals t.locals)
6185+::
6186+++ local-molds-supported
6187+ |= [locals=imolds state=istate]
6188+ ^- ?
6189+ ?~ locals &
6190+ =/ m=[name=term body=shape] i.locals
6191+ =/ inferred=(unit [template=ischeme state=istate])
6192+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
6193+ ?~ inferred |
6194+ $(locals t.locals)
6195+::
6196+:: Gather written capitals belonging to one ++. Nested local definitions
6197+:: establish their own scopes; inline gates remain in the enclosing scope.
6198++$ icap-site [name=@t at=span]
6199+++ scope-shape
6200+ |= s=shape
6201+ ^- (list icap-site)
6202+ ?- -.s
6203+ %tvar ~[[name.s at.s]]
6204+ %apply (zing (turn args.s scope-shape))
6205+ %cell (zing (turn fields.s scope-field))
6206+ %union (zing (turn cases.s scope-shape))
6207+ %fn (weld (scope-shape sample.s) (scope-shape product.s))
6208+ %generic
6209+ =/ inside=(list icap-site) (scope-shape body.s)
6210+ (skim inside |=(site=icap-site !(lien vars.s |=(v=@t =(v name.site)))))
6211+ * ~
6212+ ==
6213+::
6214+++ scope-field
6215+ |= f=field
6216+ ^- (list icap-site)
6217+ ?- -.f
6218+ %face (scope-shape shape.f)
6219+ %bare (scope-shape shape.f)
6220+ %pun ~
6221+ ==
6222+::
6223+++ scope-sample
6224+ |= s=sample
6225+ ^- (list icap-site)
6226+ ?- -.s
6227+ %face (scope-shape shape.s)
6228+ %bare (scope-shape shape.s)
6229+ %cell (zing (turn items.s scope-sample))
6230+ * ~
6231+ ==
6232+::
6233+++ scope-pieces
6234+ |= ps=(list piece)
6235+ ^- (list icap-site)
6236+ ?~ ps ~
6237+ =/ first=(list icap-site)
6238+ ?- -.i.ps
6239+ %expr (scope-expr p.i.ps)
6240+ %text ~
6241+ ==
6242+ (weld first $(ps t.ps))
6243+::
6244+++ scope-qsegs
6245+ |= ps=(list qseg)
6246+ ^- (list icap-site)
6247+ ?~ ps ~
6248+ =/ first=(list icap-site)
6249+ ?- -.i.ps
6250+ %expr (scope-expr p.i.ps)
6251+ %knot ~
6252+ ==
6253+ (weld first $(ps t.ps))
6254+::
6255+++ scope-edits
6256+ |= xs=(list edit)
6257+ ^- (list icap-site)
6258+ ?~ xs ~
6259+ =/ first=(list icap-site) (scope-expr val.i.xs)
6260+ (weld first $(xs t.xs))
6261+::
6262+++ scope-items
6263+ |= xs=(list item)
6264+ ^- (list icap-site)
6265+ ?~ xs ~
6266+ =/ first=(list icap-site) (scope-expr val.i.xs)
6267+ (weld first $(xs t.xs))
6268+::
6269+++ scope-arms
6270+ |= xs=(list arm)
6271+ ^- (list icap-site)
6272+ ?~ xs ~
6273+ =/ first=(list icap-site) (scope-expr val.i.xs)
6274+ (weld first $(xs t.xs))
6275+::
6276+++ scope-exprs
6277+ |= xs=(list expr)
6278+ ^- (list icap-site)
6279+ ?~ xs ~
6280+ =/ first=(list icap-site) (scope-expr i.xs)
6281+ (weld first $(xs t.xs))
6282+::
6283+++ scope-expr
6284+ |= e=expr
6285+ ^- (list icap-site)
6286+ ?- -.e
6287+ %str (scope-pieces pieces.e)
6288+ %qath (scope-qsegs segs.e)
6289+ %change (scope-edits edits.e)
6290+ %pair (scope-expr val.e)
6291+ %unit (scope-expr val.e)
6292+ %group (scope-expr inner.e)
6293+ %list (scope-exprs items.e)
6294+ %tuple (scope-items items.e)
6295+ %gate
6296+ =/ first=(list icap-site) (scope-sample sample.e)
6297+ =/ last=(list icap-site) (scope-expr body.e)
6298+ (weld first last)
6299+ %gate-wide
6300+ =/ first=(list icap-site) (scope-sample sample.e)
6301+ =/ last=(list icap-site) (scope-expr body.e)
6302+ (weld first last)
6303+ %call
6304+ =/ first=(list icap-site) (scope-expr head.e)
6305+ =/ last=(list icap-site) (scope-exprs args.e)
6306+ (weld first last)
6307+ %cast
6308+ =/ first=(list icap-site) (scope-shape shape.e)
6309+ =/ last=(list icap-site) (scope-expr val.e)
6310+ (weld first last)
6311+ %trace
6312+ =/ first=(list icap-site) (scope-expr val.e)
6313+ =/ last=(list icap-site) (scope-expr then.e)
6314+ (weld first last)
6315+ %branch
6316+ =/ first=(list icap-site) (scope-expr subject.e)
6317+ =/ last=(list icap-site) (scope-arms arms.e)
6318+ (weld first last)
6319+ %body (scope-expr final.e)
6320+ * ~
6321+ ==
6322+::
6323+++ reserve-cap-sites
6324+ |= [sites=(list icap-site) state=istate]
6325+ ^- istate
6326+ ?~ sites state
6327+ ?: ?=(^ (icap-lookup name.i.sites caps.state)) $(sites t.sites)
6328+ $(sites t.sites, state state(next +(next.state), caps [[name.i.sites next.state at.i.sites] caps.state]))
6329+::
6330+++ reserve-def-caps
6331+ |= [e=expr state=istate]
6332+ ^- istate
6333+ (reserve-cap-sites (scope-expr e) state)
6334+::
6335+++ infer-local-defs
6336+ |= [ds=(list def) env=ienv state=istate]
6337+ ^- ilocal-result
6338+ =/ remaining=(list def) ~
6339+ =/ progressed=? |
6340+ |-
6341+ ?~ ds
6342+ ?~ remaining [%& env state]
6343+ ?. progressed [%| ["local definitions need unsupported inference" ~]]
6344+ $(ds (flop remaining), remaining ~, progressed |)
6345+ =/ d=def i.ds
6346+ ?> ?=(%value -.d)
6347+ =/ local-state=istate (reserve-def-caps val.d state)
6348+ =/ inferred=iresult (infer-fragment val.d env local-state)
6349+ =/ retried=? ?=(%| -.inferred)
6350+ =? inferred retried (infer-recursive-gate d env local-state)
6351+ ?: ?=(%| -.inferred) $(ds t.ds, remaining [d remaining])
6352+ =/ merged=(unit [first=icap second=icap])
6353+ (merged-capitals caps.state.p.inferred sub.state.p.inferred)
6354+ ?^ merged
6355+ [%| ["distinct type variables `{(trip name.first.u.merged)}` and `{(trip name.second.u.merged)}` must not be forced equal; use the same capital for a shared type" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]]
6356+ ?: (constrained-capitals caps.state.p.inferred sub.state.p.inferred)
6357+ [%| ["explicit capital constraints are not supported by partial inference" ~]]
6358+ =/ typ=itype (itype-normalize typ.p.inferred sub.state.p.inferred)
6359+ ?: |((pending-tags tags.state.p.inferred sub.state.p.inferred) (itype-has-tag typ))
6360+ $(ds t.ds, remaining [d remaining])
6361+ ?: (unsupported-atom-vars typ caps.state.p.inferred binders.state.p.inferred sub.state.p.inferred)
6362+ $(ds t.ds, remaining [d remaining])
6363+ =/ free=(list @ud)
6364+ (weld (free-env-vars env sub.state.p.inferred) (free-cap-vars caps.state sub.state.p.inferred))
6365+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
6366+ =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
6367+ $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state), progressed &)
6368+::
6369+:: Read only fields of a known record. Unresolved field constraints and
6370+:: ambiguous repeated faces are outside this fragment. Imported record
6371+:: spines with repeated names are unavailable when used.
6372+::
6373+++ record-fields-named
6374+ |= [name=term t=itype sub=isub]
6375+ ^- (list itype)
6376+ =. t (itype-walk t sub)
6377+ ?: ?=(%face -.t)
6378+ ?:(=(name name.t) ~[body.t] ~)
6379+ ?. ?=(%cell -.t) ~
6380+ =/ first=(list itype) ~
6381+ =/ head=itype (itype-walk hed.t sub)
6382+ =? first ?=(%face -.head) ?:(=(name name.head) ~[body.head] ~)
6383+ (weld first $(t tal.t))
6384+::
6385+++ infer-field-wing
6386+ |= [names=(list term) env=ienv state=istate]
6387+ ^- iresult
6388+ =/ reverse=(list term) (flop names)
6389+ ?~ reverse [%| ["empty wing" ~]]
6390+ =/ scheme=(unit ischeme) (ienv-lookup i.reverse env)
6391+ ?~ scheme [%| ["field access is not supported by partial inference" ~]]
6392+ =/ inst=[typ=itype state=istate] (instantiate-scheme u.scheme state)
6393+ =/ fields=(list term) t.reverse
6394+ =/ typ=itype typ.inst
6395+ |-
6396+ ?~ fields [%& typ state.inst]
6397+ =/ found=(list itype) (record-fields-named i.fields typ sub.state.inst)
6398+ ?~ found [%| ["field is not available to partial inference" ~]]
6399+ ?^ t.found [%| ["field name is ambiguous in partial inference" ~]]
6400+ $(fields t.fields, typ i.found)
6401+::
6402+:: Propagate a known union or list through supported loobean, unit and list
6403+:: branches. Empty bodies and groups are transparent; bodies with definitions
6404+:: keep their normal scoping and wait for general bidirectional inference.
6405+::
6406+++ context-union-branch
6407+ |= e=expr
6408+ ^- ?
6409+ ?- -.e
6410+ %branch &
6411+ %group $(e inner.e)
6412+ %body ?~(defs.e $(e final.e) |)
6413+ * |
6414+ ==
6415+::
6416+++ infer-union-context
6417+ |= [e=expr expected=itype env=ienv state=istate context=span]
6418+ ^- iresult
6419+ ?: ?=(%group -.e) $(e inner.e)
6420+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
6421+ ?: &(?=(%collection -.expected) =(%list name.expected) (context-list-expression e))
6422+ (infer-list-context e expected env state context)
6423+ ?: ?=(%branch -.e)
6424+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
6425+ ?~ t.arms.e [%| ["branch pattern is not supported by partial inference" ~]]
6426+ ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
6427+ =/ x=arm i.arms.e
6428+ =/ y=arm i.t.arms.e
6429+ ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
6430+ (infer-unit-branch e env state `[expected context])
6431+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y))
6432+ [%| ["branch pattern is not supported by partial inference" ~]]
6433+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
6434+ [%| ["branch pattern is not supported by partial inference" ~]]
6435+ ?: =(val.lit.pat.x val.lit.pat.y)
6436+ [%| ["branch does not cover both loobeans" ~]]
6437+ =/ subject=iresult (infer-fragment subject.e env state)
6438+ ?: ?=(%| -.subject) subject
6439+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
6440+ ?: ?=(%union -.subject-type)
6441+ [%| ["contextual union-pattern branch is not supported by partial inference" ~]]
6442+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
6443+ ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
6444+ =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
6445+ ?: ?=(%| -.left) left
6446+ =/ right=iresult $(e val.y, state state.p.left)
6447+ ?: ?=(%| -.right) right
6448+ [%& expected state.p.right]
6449+ =/ value=iresult (infer-fragment e env state)
6450+ ?: ?=(%| -.value) value
6451+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
6452+ ?: ?=(%unknown -.fit)
6453+ ?: &(?=(%collection -.expected) =(%list name.expected))
6454+ [%| ["branch list constraint is not supported by partial inference" ~]]
6455+ [%| ["branch union constraint is not supported by partial inference" ~]]
6456+ ?: ?=(%bad -.fit)
6457+ =/ missing=(unit idiag) (missing-union-tag e expected sub.state.p.value context)
6458+ ?^ missing [%| u.missing]
6459+ ?: &(?=(%collection -.expected) =(%list name.expected))
6460+ [%| ["branch arm does not fit its expected list" ~[[context "expected list"] [(span-of e) "branch arm"]]]]
6461+ [%| ["branch arm does not fit its expected union" ~[[context "expected union"] [(span-of e) "branch arm"]]]]
6462+ [%& expected state.p.value(sub sub.fit, next next.fit)]
6463+::
6464+:: A list expression needs a known list target and the validated prelude list.
6465+:: Literal items and unfaced two-item cons cells receive that target one by
6466+:: one; pending constraints elsewhere stay in the threaded state.
6467+::
6468+++ context-list-expression
6469+ |= e=expr
6470+ ^- ?
6471+ ?- -.e
6472+ %list &
6473+ %tuple &
6474+ %lit |(=(%null form.lit.e) &(=(%term form.lit.e) =(0 val.lit.e)))
6475+ %group $(e inner.e)
6476+ %body ?~(defs.e $(e final.e) |)
6477+ * |
6478+ ==
6479+::
6480+++ infer-list-context
6481+ |= [e=expr expected=itype env=ienv state=istate context=span]
6482+ ^- iresult
6483+ ?: ?=(%group -.e) $(e inner.e)
6484+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
6485+ ?~ prelude.state [%| ["list literal needs the standard prelude in partial inference" ~]]
6486+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
6487+ [%| ["list literal needs the standard prelude in partial inference" ~]]
6488+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
6489+ ?~ standard [%| ["list literal needs the standard prelude in partial inference" ~]]
6490+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
6491+ [%| ["list literal needs the standard prelude in partial inference" ~]]
6492+ =/ target=itype (itype-walk expected sub.state)
6493+ ?. ?=(%collection -.target) [%| ["list context is not supported by partial inference" ~]]
6494+ ?. =(%list name.target) [%| ["list context is not supported by partial inference" ~]]
6495+ ?~ args.target [%| ["list context is not supported by partial inference" ~]]
6496+ ?^ t.args.target [%| ["list context is not supported by partial inference" ~]]
6497+ ?: ?=(%lit -.e)
6498+ ?. |(=(%null form.lit.e) &(=(%term form.lit.e) =(0 val.lit.e)))
6499+ [%| ["list expression is not supported by partial inference" ~]]
6500+ [%& target state]
6501+ ?: ?=(%list -.e)
6502+ =/ result=iresult (infer-list-items items.e i.args.target env state context)
6503+ ?: ?=(%| -.result) result
6504+ [%& target state.p.result]
6505+ ?. ?=(%tuple -.e) [%| ["list expression is not supported by partial inference" ~]]
6506+ ?~ items.e [%| ["cons shape is not supported by partial inference" ~]]
6507+ ?~ t.items.e [%| ["cons shape is not supported by partial inference" ~]]
6508+ ?^ t.t.items.e [%| ["cons shape is not supported by partial inference" ~]]
6509+ ?^ face.i.items.e [%| ["faced cons is not supported by partial inference" ~]]
6510+ ?^ face.i.t.items.e [%| ["faced cons is not supported by partial inference" ~]]
6511+ =/ head=iresult (infer-list-items ~[val.i.items.e] i.args.target env state context)
6512+ ?: ?=(%| -.head) head
6513+ =/ target=itype (itype-walk target sub.state.p.head)
6514+ =/ tail=iresult
6515+ ?: (context-list-expression val.i.t.items.e)
6516+ (infer-list-context val.i.t.items.e target env state.p.head context)
6517+ (infer-fragment val.i.t.items.e env state.p.head)
6518+ ?: ?=(%| -.tail) tail
6519+ =/ fit=ifit (itype-fit typ.p.tail target sub.state.p.tail next.state.p.tail)
6520+ ?: ?=(%unknown -.fit) [%| ["list tail constraint is not supported by partial inference" ~]]
6521+ ?: ?=(%bad -.fit)
6522+ [%| ["list tail does not fit its expected type" ~[[context (site-type-note "expected list" target sub.state.p.tail)] [(span-of val.i.t.items.e) (site-type-note "list tail" typ.p.tail sub.state.p.tail)]]]]
6523+ [%& target state.p.tail(sub sub.fit, next next.fit)]
6524+::
6525+++ infer-list-items
6526+ |= [items=(list expr) expected=itype env=ienv state=istate context=span]
6527+ ^- iresult
6528+ ?~ items [%& expected state]
6529+ =/ target=itype (itype-walk expected sub.state)
6530+ =/ value=iresult (infer-call-context-arg i.items target env state context)
6531+ ?: ?=(%| -.value) value
6532+ =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
6533+ ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
6534+ ?: ?=(%bad -.fit)
6535+ =/ missing=(unit idiag) (missing-union-tag i.items target sub.state.p.value context)
6536+ ?^ missing [%| u.missing]
6537+ [%| ["list item does not fit its expected type" ~[[context (site-type-note "expected item" target sub.state.p.value)] [(span-of i.items) (site-type-note "list item" typ.p.value sub.state.p.value)]]]]
6538+ $(items t.items, state state.p.value(sub sub.fit, next next.fit))
6539+::
6540+:: The supported unit pattern covers exactly an atom zero and a cell
6541+:: headed by zero, with a single binder for its payload. Unresolved
6542+:: subjects and all other pattern matrices stay outside this fragment.
6543+::
6544+++ unit-empty-pattern
6545+ |= p=pattern
6546+ ^- ?
6547+ ?. ?=(%lit -.p) |
6548+ =(%null form.lit.p)
49206549::
4921−++ infer-sample
4922− |= [s=sample env=ienv state=istate]
4923− ^- isample-result
4924− ?- -.s
4925− %bind
4926− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
4927− [%| "sample shadows a name"]
4928− =/ t=itype [%var next.state]
4929− [%& t [[name.s [t ~]] env] state(next +(next.state))]
6550+++ unit-payload-pattern
6551+ |= p=pattern
6552+ ^- (unit term)
6553+ ?. ?=(%cell -.p) ~
6554+ ?~ items.p ~
6555+ ?~ t.items.p ~
6556+ ?^ t.t.items.p ~
6557+ ?. (unit-empty-pattern i.items.p) ~
6558+ ?. ?=(%bind -.i.t.items.p) ~
6559+ `name.i.t.items.p
6560+::
6561+++ unit-empty-case
6562+ |= t=itype
6563+ ^- ?
6564+ ?. ?=(%const -.t) |
6565+ =(0 val.literal.t)
6566+::
6567+++ unit-payload-case
6568+ |= t=itype
6569+ ^- (unit itype)
6570+ ?. ?=(%cell -.t) ~
6571+ ?. (unit-empty-case hed.t) ~
6572+ =/ payload=itype tal.t
6573+ =? payload ?=(%face -.payload) body.payload
6574+ `payload
6575+::
6576+++ unit-union-payload
6577+ |= t=itype
6578+ ^- (unit itype)
6579+ ?. ?=(%union -.t) ~
6580+ ?~ cases.t ~
6581+ ?~ t.cases.t ~
6582+ ?^ t.t.cases.t ~
6583+ ?: (unit-empty-case i.cases.t) (unit-payload-case i.t.cases.t)
6584+ ?: (unit-empty-case i.t.cases.t) (unit-payload-case i.cases.t)
6585+ ~
6586+::
6587+:: List matching currently covers exactly null and a cell of two binders.
6588+:: The head has the element type and the tail has the whole list type.
6589+:: Other patterns and lists whose element mold is empty remain unsupported.
6590+::
6591+++ list-payload-pattern
6592+ |= p=pattern
6593+ ^- (unit [head=term tail=term])
6594+ ?. ?=(%cell -.p) ~
6595+ ?~ items.p ~
6596+ ?~ t.items.p ~
6597+ ?^ t.t.items.p ~
6598+ ?. ?=(%bind -.i.items.p) ~
6599+ ?. ?=(%bind -.i.t.items.p) ~
6600+ `[name.i.items.p name.i.t.items.p]
6601+::
6602+++ infer-list-branch
6603+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span]) typ=itype]
6604+ ^- iresult
6605+ ?> ?=(%branch -.e)
6606+ ?> ?=(%collection -.typ)
6607+ ?. =(%list name.typ) [%| ["list pattern is not supported by partial inference" ~]]
6608+ ?~ prelude.state [%| ["list pattern needs the standard prelude in partial inference" ~]]
6609+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
6610+ [%| ["list pattern needs the standard prelude in partial inference" ~]]
6611+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
6612+ ?~ standard [%| ["list pattern needs the standard prelude in partial inference" ~]]
6613+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
6614+ [%| ["list pattern needs the standard prelude in partial inference" ~]]
6615+ ?~ args.typ [%| ["list pattern is not supported by partial inference" ~]]
6616+ ?^ t.args.typ [%| ["list pattern is not supported by partial inference" ~]]
6617+ ?~ arms.e [%| ["list branch is not supported by partial inference" ~]]
6618+ ?~ t.arms.e [%| ["list branch is not supported by partial inference" ~]]
6619+ ?^ t.t.arms.e [%| ["list branch is not supported by partial inference" ~]]
6620+ =/ x=arm i.arms.e
6621+ =/ y=arm i.t.arms.e
6622+ =/ first-empty=? (unit-empty-pattern pat.x)
6623+ =/ first-name=(unit [head=term tail=term]) (list-payload-pattern pat.x)
6624+ =/ second-name=(unit [head=term tail=term]) (list-payload-pattern pat.y)
6625+ ?. |(&(first-empty ?=(^ second-name)) &((unit-empty-pattern pat.y) ?=(^ first-name)))
6626+ [%| ["list branch pattern is not supported by partial inference" ~]]
6627+ =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
6628+ ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
6629+ ?: |(=(head.u.binder tail.u.binder) ?=(^ (ienv-lookup head.u.binder env)) ?=(^ (ienv-lookup tail.u.binder env)) (lien globals.state |=(n=term |(=(n head.u.binder) =(n tail.u.binder)))))
6630+ [%| ["pattern binder shadows a name" ~]]
6631+ =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
6632+ =/ left=iresult
6633+ ?~ expected (infer-fragment val.x ?:(first-empty env extended) state)
6634+ (infer-union-context val.x typ.u.expected ?:(first-empty env extended) state context.u.expected)
6635+ ?: ?=(%| -.left) left
6636+ =/ right=iresult
6637+ ?~ expected (infer-fragment val.y ?:(first-empty extended env) state.p.left)
6638+ (infer-union-context val.y typ.u.expected ?:(first-empty extended env) state.p.left context.u.expected)
6639+ ?: ?=(%| -.right) right
6640+ ?^ expected [%& typ.u.expected state.p.right]
6641+ =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
6642+ ?~ joined [%| ["list branch results need unsupported inference" ~]]
6643+ [%& typ.p.left state.p.right(sub u.joined)]
6644+::
6645+++ infer-unit-branch
6646+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
6647+ ^- iresult
6648+ ?> ?=(%branch -.e)
6649+ ?~ arms.e [%| ["unit branch is not supported by partial inference" ~]]
6650+ ?~ t.arms.e [%| ["unit branch is not supported by partial inference" ~]]
6651+ ?^ t.t.arms.e [%| ["unit branch is not supported by partial inference" ~]]
6652+ =/ subject=iresult (infer-fragment subject.e env state)
6653+ ?: ?=(%| -.subject) subject
6654+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6655+ ?: &(?=(%collection -.typ) =(%list name.typ))
6656+ (infer-list-branch e env state.p.subject expected typ)
6657+ =/ x=arm i.arms.e
6658+ =/ y=arm i.t.arms.e
6659+ =/ first-empty=? (unit-empty-pattern pat.x)
6660+ =/ first-name=(unit term) (unit-payload-pattern pat.x)
6661+ =/ second-name=(unit term) (unit-payload-pattern pat.y)
6662+ ?. |(&(first-empty ?=(^ second-name)) &((unit-empty-pattern pat.y) ?=(^ first-name)))
6663+ [%| ["unit branch pattern is not supported by partial inference" ~]]
6664+ =/ binder=(unit term) ?:(first-empty second-name first-name)
6665+ ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
6666+ ?: |(?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
6667+ [%| ["pattern binder shadows a name" ~]]
6668+ =/ payload=(unit itype) (unit-union-payload typ)
6669+ ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
6670+ =/ extended=ienv [[u.binder [u.payload ~]] env]
6671+ =/ left=iresult
6672+ ?~ expected (infer-fragment val.x ?:(first-empty env extended) state.p.subject)
6673+ (infer-union-context val.x typ.u.expected ?:(first-empty env extended) state.p.subject context.u.expected)
6674+ ?: ?=(%| -.left) left
6675+ =/ right=iresult
6676+ ?~ expected (infer-fragment val.y ?:(first-empty extended env) state.p.left)
6677+ (infer-union-context val.y typ.u.expected ?:(first-empty extended env) state.p.left context.u.expected)
6678+ ?: ?=(%| -.right) right
6679+ ?^ expected [%& typ.u.expected state.p.right]
6680+ =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
6681+ ?~ joined [%| ["unit branch results need unsupported inference" ~]]
6682+ [%& typ.p.left state.p.right(sub u.joined)]
6683+::
6684+:: Infer pieces in order, retaining their substitutions and pending tags.
6685+:: A bare decimal literal has no outside type constraint, so it takes its
6686+:: normal @ud default here. Other open numeric and aura variables wait for
6687+:: deferred constraints, which this fragment does not implement yet.
6688+++ infer-string-pieces
6689+ |= [ps=(list piece) env=ienv state=istate]
6690+ ^- iresult
6691+ ?~ ps [%& [%atom %t] state]
6692+ ?: ?=(%text -.i.ps) $(ps t.ps)
6693+ =/ item=iresult (infer-fragment p.i.ps env state)
6694+ ?: ?=(%| -.item) item
6695+ =/ t=itype (itype-normalize typ.p.item sub.state.p.item)
6696+ ?: |(?=(%atom -.t) ?=(%any-atom -.t))
6697+ $(ps t.ps, state state.p.item)
6698+ ?: &(?=(%nvar -.t) ?=(%lit -.p.i.ps) =(%number form.lit.p.i.ps))
6699+ $(ps t.ps, state state.p.item)
6700+ ?: &(?=(%collection -.t) =(%list name.t) =(~[[%atom 'tD']] args.t))
6701+ $(ps t.ps, state state.p.item)
6702+ ?: &(?=(%avar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
6703+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
6704+ ?: ?=(%cell -.t)
6705+ [%| ["a cell in interpolation needs a printer" ~[[(span-of p.i.ps) "cell without a printer"]]]]
6706+ [%| ["interpolation type needs unsupported inference" ~]]
6707+::
6708+:: Whole-case coverage for a known union. When a pattern may cover only
6709+:: part of a case, finite loobean refinements are tried below; other
6710+:: partial coverage stays unsupported until the general pattern matrix.
6711++$ imatch ?(%full %none %unknown)
6712+++ union-pattern-items
6713+ |= [ps=(list pattern) t=itype]
6714+ ^- imatch
6715+ ?~ ps %unknown
6716+ ?~ t.ps (union-pattern i.ps t)
6717+ =. t ?:(?=(%face -.t) body.t t)
6718+ ?. ?=(%cell -.t)
6719+ ?: |(?=(%atom -.t) ?=(%any-atom -.t) ?=(%flag -.t) ?=(%const -.t)) %none
6720+ %unknown
6721+ =/ a=imatch (union-pattern i.ps hed.t)
6722+ =/ b=imatch $(ps t.ps, t tal.t)
6723+ ?: |(=(%none a) =(%none b)) %none
6724+ ?:(&(=(%full a) =(%full b)) %full %unknown)
6725+::
6726+++ union-pattern
6727+ |= [p=pattern t=itype]
6728+ ^- imatch
6729+ =. t ?:(?=(%face -.t) body.t t)
6730+ ?- -.p
6731+ %any %full
6732+ %bind %full
6733+ %lit
6734+ ?: ?=(%const -.t) ?:(=(val.literal.t val.lit.p) %full %none)
6735+ ?: ?=(%cell -.t) %none
6736+ ?: ?=(%flag -.t)
6737+ ?:(|(=(0 val.lit.p) =(1 val.lit.p)) %unknown %none)
6738+ %unknown
6739+ %str ?:(?=(%cell -.t) %none %unknown)
6740+ %cell (union-pattern-items items.p t)
6741+ ==
6742+::
6743+++ union-pattern-has-bind
6744+ |= p=pattern
6745+ ^- ?
6746+ ?: ?=(%bind -.p) &
6747+ ?. ?=(%cell -.p) |
6748+ (lien items.p union-pattern-has-bind)
6749+::
6750+++ union-pattern-bind-items
6751+ |= [ps=(list pattern) t=itype env=ienv globals=(list term)]
6752+ ^- (unit ienv)
6753+ ?~ ps ~
6754+ ?~ t.ps (union-pattern-bind i.ps t env globals)
6755+ =. t ?:(?=(%face -.t) body.t t)
6756+ ?. ?=(%cell -.t) ~
6757+ =/ first=(unit ienv) (union-pattern-bind i.ps hed.t env globals)
6758+ ?~ first ~
6759+ $(ps t.ps, t tal.t, env u.first)
6760+::
6761+++ union-pattern-bind
6762+ |= [p=pattern t=itype env=ienv globals=(list term)]
6763+ ^- (unit ienv)
6764+ =. t ?:(?=(%face -.t) body.t t)
6765+ ?: ?=(%bind -.p)
6766+ ?: |(?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
6767+ `[[name.p [t ~]] env]
6768+ ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
6769+ `env
6770+::
6771+:: Split loobean fields into finite refinements for partial patterns.
6772+:: Keep original cases for binder types and preserve whole-case matching
6773+:: before trying refinements. Cap products at 64; unknown, empty or opaque
6774+:: shapes stay unsupported rather than implying complete pattern checking.
6775++$ ifinite [origin=@ud base=itype part=itype]
6776+++ finite-product
6777+ |= [hs=(list itype) ts=(list itype) out=(list itype)]
6778+ ^- (list itype)
6779+ ?~ hs out
6780+ =/ rows=(list itype) (turn ts |=(t=itype [%cell i.hs t]))
6781+ $(hs t.hs, out (weld rows out))
6782+::
6783+++ finite-type
6784+ |= t=itype
6785+ ^- (unit (list itype))
6786+ ?- -.t
6787+ %flag
6788+ `~[[%const [%loobean %f 0 '%.y']] [%const [%loobean %f 1 '%.n']]]
49306789 %face
4931− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
4932− [%| "sample shadows a name"]
4933− =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
4934− ?~ t [%| "sample mold is not supported by partial inference"]
4935− [%& typ.u.t [[name.s [typ.u.t ~]] env] state.u.t]
4936− %bare
4937− =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
4938− ?~ t [%| "sample mold is not supported by partial inference"]
4939− [%& typ.u.t env state.u.t]
4940− * [%| "sample is not supported by partial inference"]
6790+ =/ body=(unit (list itype)) $(t body.t)
6791+ ?~ body ~
6792+ `(turn u.body |=(x=itype [%face name.t x]))
6793+ %cell
6794+ =/ hed=(unit (list itype)) $(t hed.t)
6795+ ?~ hed ~
6796+ =/ tal=(unit (list itype)) $(t tal.t)
6797+ ?~ tal ~
6798+ ?: (gth (mul (lent u.hed) (lent u.tal)) 64) ~
6799+ `(finite-product u.hed u.tal ~)
6800+ * `~[t]
6801+ ==
6802+::
6803+++ finite-cases
6804+ |= [xs=(list itype) out=(list ifinite) origin=@ud]
6805+ ^- (unit (list ifinite))
6806+ ?~ xs `out
6807+ =/ parts=(unit (list itype)) (finite-type i.xs)
6808+ ?~ parts ~
6809+ ?: (gth (add (lent out) (lent u.parts)) 64) ~
6810+ =/ rows=(list ifinite) (turn u.parts |=(t=itype [origin i.xs t]))
6811+ $(xs t.xs, out (weld out rows), origin +(origin))
6812+::
6813+++ infer-known-union-whole
6814+ |= [e=expr env=ienv state=istate]
6815+ ^- (unit iresult)
6816+ ?> ?=(%branch -.e)
6817+ =/ subject=iresult (infer-fragment subject.e env state)
6818+ ?: ?=(%| -.subject) `subject
6819+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6820+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
6821+ =/ cases=(list itype) cases.typ
6822+ =/ remaining=(list itype) cases
6823+ =/ arms=(list arm) arms.e
6824+ =/ st=istate state.p.subject
6825+ =/ answer=(unit itype) ~
6826+ |-
6827+ ?~ arms
6828+ ?^ remaining
6829+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
6830+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
6831+ `[%& u.answer st]
6832+ =/ a=arm i.arms
6833+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
6834+ ~
6835+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
6836+ ?~ matching
6837+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
6838+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
6839+ `[%| ["union pattern is not supported by partial inference" ~]]
6840+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
6841+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
6842+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
6843+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
6844+ =/ body=iresult (infer-fragment val.a u.bound st)
6845+ ?: ?=(%| -.body) `body
6846+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
6847+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
6848+ ?: mismatch `[%| ["union branch result matching needs unsupported inference" ~]]
6849+ $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body, answer `result)
6850+::
6851+++ infer-known-union-finite
6852+ |= [e=expr env=ienv state=istate]
6853+ ^- iresult
6854+ ?> ?=(%branch -.e)
6855+ =/ subject=iresult (infer-fragment subject.e env state)
6856+ ?: ?=(%| -.subject) subject
6857+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6858+ ?. ?=(%union -.typ) [%| ["branch is not supported by partial inference" ~]]
6859+ =/ expanded=(unit (list ifinite)) (finite-cases cases.typ ~ 0)
6860+ ?~ expanded [%| ["union pattern expansion needs unsupported inference" ~]]
6861+ =/ cases=(list ifinite) u.expanded
6862+ =/ remaining=(list ifinite) cases
6863+ =/ arms=(list arm) arms.e
6864+ =/ st=istate state.p.subject
6865+ =/ answer=(unit itype) ~
6866+ |-
6867+ ?~ arms
6868+ ?^ remaining
6869+ [%| ["missing union case {(show-itype part.i.remaining sub.st)}" ~]]
6870+ ?~ answer [%| ["empty union branch is not supported by partial inference" ~]]
6871+ [%& u.answer st]
6872+ =/ a=arm i.arms
6873+ ?: (lien remaining |=(c=ifinite =(%unknown (union-pattern pat.a part.c))))
6874+ [%| ["partial union pattern is not supported by partial inference" ~]]
6875+ =/ matching=(list ifinite) (skim remaining |=(c=ifinite =(%full (union-pattern pat.a part.c))))
6876+ ?~ matching
6877+ ?: (lien cases |=(c=ifinite =(%full (union-pattern pat.a part.c))))
6878+ [%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
6879+ [%| ["union pattern is not supported by partial inference" ~]]
6880+ ?: &((union-pattern-has-bind pat.a) (lien t.matching |=(c=ifinite !=(origin.c origin.i.matching))))
6881+ [%| ["a union pattern binding several cases is not supported by partial inference" ~]]
6882+ =/ bound=(unit ienv) (union-pattern-bind pat.a base.i.matching env globals.st)
6883+ ?~ bound [%| ["pattern binder shadows a name" ~]]
6884+ =/ body=iresult (infer-fragment val.a u.bound st)
6885+ ?: ?=(%| -.body) body
6886+ =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
6887+ =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
6888+ ?: mismatch [%| ["union branch result matching needs unsupported inference" ~]]
6889+ $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body, answer `result)
6890+::
6891+++ infer-known-union-branch
6892+ |= [e=expr env=ienv state=istate]
6893+ ^- iresult
6894+ =/ whole=(unit iresult) (infer-known-union-whole e env state)
6895+ ?~ whole (infer-known-union-finite e env state)
6896+ u.whole
6897+::
6898+++ known-union-subject
6899+ |= [e=expr env=ienv state=istate]
6900+ ^- (unit itype)
6901+ ?. ?=(%wing -.e) ~
6902+ =/ subject=iresult (infer-fragment e env state)
6903+ ?: ?=(%| -.subject) ~
6904+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6905+ ?. ?=(%union -.typ) ~
6906+ `typ
6907+::
6908+:: Infer changes only against a fully known record spine. Retain the
6909+:: target type; unknown spines and repeated edits remain unsupported.
6910+++ change-spine-known
6911+ |= [t=itype sub=isub]
6912+ ^- ?
6913+ =. t (itype-walk t sub)
6914+ ?: ?=(%face -.t) &
6915+ ?. ?=(%cell -.t) |
6916+ =/ first=itype (itype-walk hed.t sub)
6917+ ?. ?=(%face -.first) |
6918+ $(t tal.t)
6919+::
6920+++ infer-change-edits
6921+ |= [edits=(list edit) target=itype env=ienv state=istate seen=(list term)]
6922+ ^- iresult
6923+ ?~ edits [%& target state]
6924+ =/ entry=edit i.edits
6925+ ?: (lien seen |=(name=term =(name name.entry)))
6926+ [%| ["repeated change fields are not supported by partial inference" ~]]
6927+ ?. (change-spine-known target sub.state)
6928+ [%| ["change target needs a known record in partial inference" ~]]
6929+ =/ found=(list itype) (record-fields-named name.entry target sub.state)
6930+ ?~ found
6931+ [%| ["record has no field `{(trip name.entry)}`" ~[[at.entry "unknown field"]]]]
6932+ ?^ t.found [%| ["change field is ambiguous in partial inference" ~]]
6933+ =/ expected=itype i.found
6934+ =/ value=iresult (infer-call-context-arg val.entry expected env state at.entry)
6935+ ?: ?=(%| -.value) value
6936+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
6937+ ?: ?=(%unknown -.fit) [%| ["change field constraint is not supported by partial inference" ~]]
6938+ ?: ?=(%bad -.fit)
6939+ [%| ["change field and replacement do not unify" ~[[at.entry (site-type-note "expected replacement" expected sub.state.p.value)] [(span-of val.entry) (site-type-note "replacement" typ.p.value sub.state.p.value)]]]]
6940+ $(edits t.edits, state state.p.value(sub sub.fit, next next.fit), seen [name.entry seen])
6941+::
6942+:: Backtick constructs the canonical prelude unit, after checking its
6943+:: prepared template has the standard null and [~ u=A] cases.
6944+++ standard-unit-template
6945+ |= [template=ischeme at=path]
6946+ ^- ?
6947+ ?. =(at /lib/jibb/prelude/jibb) |
6948+ ?~ vars.template |
6949+ ?^ t.vars.template |
6950+ =/ v=@ud i.vars.template
6951+ =/ nil=itype [%const [%null %n 0 '~']]
6952+ =/ expected=itype
6953+ [%union ~[nil [%cell nil [%face %u [%var v]]]] `[at %unit] `%unit ~[[%var v]]]
6954+ =(typ.template expected)
6955+::
6956+:: A named missing-case diagnostic needs more than a failed fit: a case
6957+:: with that tag but the wrong payload is not a missing case. Unknown
6958+:: shapes and atom types that accept terms keep the proof conservative.
6959++$ itag-presence ?(%yes %no %maybe)
6960+++ tag-presence-cases
6961+ |= [cases=(list itype) value=@ sub=isub]
6962+ ^- itag-presence
6963+ ?~ cases %no
6964+ =/ first=itag-presence (tag-presence i.cases value sub)
6965+ ?: =(%yes first) %yes
6966+ =/ rest=itag-presence $(cases t.cases)
6967+ ?: =(%yes rest) %yes
6968+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
6969+ %no
6970+::
6971+++ tag-presence
6972+ |= [t=itype value=@ sub=isub]
6973+ ^- itag-presence
6974+ =. t (itype-walk t sub)
6975+ ?- -.t
6976+ %const ?:(=(value val.literal.t) %yes %no)
6977+ %flag ?:(|(=(value 0) =(value 1)) %yes %no)
6978+ %atom ?:(|(=(%tas aura.t) =(%ta aura.t)) %maybe %no)
6979+ %face $(t body.t)
6980+ %cell
6981+ =/ first=itag-presence $(t hed.t)
6982+ ?: =(%yes first) %yes
6983+ =/ rest=itag-presence $(t tal.t)
6984+ ?: =(%yes rest) %yes
6985+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
6986+ %no
6987+ %union (tag-presence-cases cases.t value sub)
6988+ * %maybe
49416989 ==
49426990::
6991+++ missing-union-tag
6992+ |= [e=expr expected=itype sub=isub context=span]
6993+ ^- (unit idiag)
6994+ ?. ?=(%lit -.e) ~
6995+ ?. =(%term form.lit.e) ~
6996+ =. expected (itype-walk expected sub)
6997+ |-
6998+ ?: ?=(%face -.expected) $(expected (itype-walk body.expected sub))
6999+ ?. ?=(%union -.expected) ~
7000+ ?. =(%no (tag-presence-cases cases.expected val.lit.e sub)) ~
7001+ =/ label=tape
7002+ ?~ label.expected "union {(show-itype expected sub)}"
7003+ (show-itype expected sub)
7004+ `["{label} has no case `{(trip txt.lit.e)}`" ~[[context "expected union"] [(span-of e) "tag"]]]
7005+::
49437006++ infer-fragment
49447007 |= [e=expr env=ienv state=istate]
49457008 ^- iresult
@@ -4947,105 +7010,331 @@
49477010 %lit
49487011 ?- form.lit.e
49497012 %number ?: =(%ud aura.lit.e)
4950− [%& [%avar next.state] state(next +(next.state))]
7013+ [%& [%nvar next.state] state(next +(next.state))]
49517014 [%& [%atom aura.lit.e] state]
49527015 %ship [%& [%atom %p] state]
49537016 %date [%& [%atom %da] state]
49547017 %duration [%& [%atom %dr] state]
49557018 %knot [%& [%atom %ta] state]
49567019 %loobean [%& [%flag ~] state]
4957− * [%| "literal needs contextual inference"]
7020+ %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
7021+ %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
49587022 ==
4959− %str
4960− =/ interpolated=? (lien pieces.e |=(p=piece ?=(%expr -.p)))
4961− ?: interpolated [%| "interpolation is not supported by partial inference"]
4962− [%& [%atom %t] state]
7023+ %unit
7024+ ?~ prelude.state [%| ["unit construction needs the standard prelude in partial inference" ~]]
7025+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
7026+ ?~ standard [%| ["unit construction needs the standard prelude in partial inference" ~]]
7027+ ?. (standard-unit-template u.standard at.u.prelude.state)
7028+ [%| ["unit construction needs the standard prelude in partial inference" ~]]
7029+ =/ value=iresult $(e val.e)
7030+ ?: ?=(%| -.value) value
7031+ =/ result=(unit itype) (template-apply u.standard ~[typ.p.value])
7032+ ?~ result [%| ["unit construction is not supported by partial inference" ~]]
7033+ [%& u.result state.p.value]
7034+ %str (infer-string-pieces pieces.e env state)
49637035 %wing
4964− ?~ names.e [%| "empty wing"]
4965− ?^ t.names.e [%| "field access is not supported by partial inference"]
7036+ ?~ names.e [%| ["empty wing" ~]]
7037+ ?^ t.names.e
7038+ ?^ t.t.names.e (infer-field-wing names.e env state)
7039+ =/ iface=(unit ifile) (find-jibb-interface i.t.names.e jimports.state)
7040+ ?~ iface (infer-field-wing names.e env state)
7041+ =/ member=(unit ischeme) (ienv-lookup i.names.e values.u.iface)
7042+ ?~ member [%| ["module member is not available to partial inference" ~]]
7043+ =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e)
7044+ =/ instance=[typ=itype state=istate] (instantiate-scheme u.member state)
7045+ [%& typ.instance state.instance]
49667046 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
4967− ?~ scheme [%| "name is not available to partial inference"]
7047+ ?~ scheme
7048+ ?~ prelude.state [%| ["name is not available to partial inference" ~]]
7049+ =/ prelude-entry=(unit ischeme) (ienv-lookup i.names.e values.u.prelude.state)
7050+ ?~ prelude-entry [%| ["name is not available to partial inference" ~]]
7051+ =/ inst=[typ=itype state=istate] (instantiate-scheme u.prelude-entry state)
7052+ [%& typ.inst state.inst]
49687053 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
49697054 [%& typ.instance state.instance]
49707055 %group $(e inner.e)
7056+ %change
7057+ ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
7058+ =/ target=iresult $(e [%wing at.e target.e])
7059+ ?: ?=(%| -.target) target
7060+ (infer-change-edits edits.e typ.p.target env state.p.target ~)
7061+ %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e] tags.state])]
7062+ %trace
7063+ =/ traced=iresult $(e val.e)
7064+ ?: ?=(%| -.traced) traced
7065+ $(e then.e, state state.p.traced)
49717066 %tuple (infer-simple-items items.e env state)
49727067 %body
4973− ?^ defs.e [%| "local definitions are not supported by partial inference"]
4974− $(e final.e)
7068+ ?~ defs.e $(e final.e)
7069+ =/ local-names=(list term) (global-value-names defs.e)
7070+ ?. (local-names-valid defs.e env state)
7071+ [%| ["local definitions shadow a name" ~]]
7072+ =/ local-molds=imolds (collect-simple-molds defs.e)
7073+ ?. (local-mold-names-valid local-molds state)
7074+ [%| ["local molds shadow a name" ~]]
7075+ =/ local-state=istate
7076+ state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
7077+ ?. (local-molds-supported local-molds local-state)
7078+ [%| ["local molds need unsupported inference" ~]]
7079+ =/ values=(list def) (local-value-defs defs.e)
7080+ =/ locals=ilocal-result (infer-local-defs values env local-state)
7081+ ?: ?=(%| -.locals) locals
7082+ =/ result=iresult $(e final.e, env env.p.locals, state state.p.locals)
7083+ ?: ?=(%| -.result) result
7084+ [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
49757085 %branch
4976− ?~ arms.e [%| "branch is not supported by partial inference"]
7086+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
49777087 ?~ t.arms.e (infer-cell-branch e env state)
4978− ?^ t.t.arms.e [%| "branch is not supported by partial inference"]
7088+ ?^ t.t.arms.e (infer-known-union-branch e env state)
7089+ =/ known=(unit itype) (known-union-subject subject.e env state)
7090+ ?: &(?=(^ known) ?=(~ (unit-union-payload u.known)))
7091+ (infer-known-union-branch e env state)
49797092 =/ x=arm i.arms.e
49807093 =/ y=arm i.t.arms.e
4981− ?. ?=(%lit -.pat.x) [%| "branch pattern is not supported by partial inference"]
4982− ?. ?=(%lit -.pat.y) [%| "branch pattern is not supported by partial inference"]
7094+ ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
7095+ (infer-unit-branch e env state ~)
7096+ ?. ?=(%lit -.pat.x) (infer-known-union-branch e env state)
7097+ ?. ?=(%lit -.pat.y) (infer-known-union-branch e env state)
49837098 ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
4984− [%| "branch pattern is not supported by partial inference"]
7099+ (infer-known-union-branch e env state)
7100+ ?^ known (infer-known-union-branch e env state)
49857101 ?: =(val.lit.pat.x val.lit.pat.y)
4986− [%| "branch does not cover both loobeans"]
7102+ [%| ["branch does not cover both loobeans" ~]]
49877103 =/ subject=iresult $(e subject.e)
49887104 ?: ?=(%| -.subject) subject
7105+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
7106+ ?: ?=(%union -.subject-type)
7107+ [%| ["union-pattern branch subject is not supported by partial inference" ~]]
49897108 =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
4990− ?~ su [%| "loobean branch subject does not unify with ?"]
7109+ ?~ su [%| ["loobean branch subject does not unify with ?" ~]]
49917110 =/ left=iresult $(e val.x, state state.p.subject(sub u.su))
49927111 ?: ?=(%| -.left) left
49937112 =/ right=iresult $(e val.y, state state.p.left)
49947113 ?: ?=(%| -.right) right
7114+ =/ ltype=itype (itype-normalize typ.p.left sub.state.p.right)
7115+ =/ rtype=itype (itype-normalize typ.p.right sub.state.p.right)
7116+ ?: &(!=(ltype rtype) |(?=(^ (itype-vars ltype)) ?=(^ (itype-vars rtype))) |((itype-has-fixed-atom ltype) (itype-has-fixed-atom rtype)))
7117+ [%| ["branch widening is not supported by partial inference" ~]]
49957118 =/ joined=(unit isub) (itype-unify typ.p.left typ.p.right sub.state.p.right)
4996− ?~ joined [%| "branch arms have incompatible types"]
7119+ ?~ joined
7120+ ?: |((itype-has-recursive ltype) (itype-has-recursive rtype))
7121+ [%| ["recursive branch matching is not supported by partial inference" ~]]
7122+ ?: |((itype-has-tag ltype) (itype-has-tag rtype) (itype-has-union ltype) (itype-has-union rtype))
7123+ [%| ["branch tag or union context is not supported by partial inference" ~]]
7124+ =/ common=(unit itype) (itype-concrete-join typ.p.left typ.p.right sub.state.p.right)
7125+ ?^ common [%& u.common state.p.right]
7126+ ?: |((itype-has-face typ.p.left sub.state.p.right) (itype-has-face typ.p.right sub.state.p.right))
7127+ [%| ["record branch matching is not supported by partial inference" ~]]
7128+ ?: |((itype-has-any-atom typ.p.left sub.state.p.right) (itype-has-any-atom typ.p.right sub.state.p.right) (itype-family-related typ.p.left typ.p.right sub.state.p.right))
7129+ [%| ["branch widening is not supported by partial inference" ~]]
7130+ [%| ["branch arms have incompatible types" ~[[(span-of val.x) (site-type-note "first arm" typ.p.left sub.state.p.right)] [(span-of val.y) (site-type-note "second arm" typ.p.right sub.state.p.right)]]]]
49977131 [%& typ.p.left state.p.right(sub u.joined)]
49987132 %cast
49997133 =/ target=(unit [typ=itype state=istate]) (infer-simple-shape shape.e state)
5000− ?~ target [%| "cast mold is not supported by partial inference"]
5001− =/ value=iresult $(e val.e, state state.u.target)
7134+ ?~ target
7135+ =/ diag=(unit idiag) (nested-import-invalid shape.e state)
7136+ ?^ diag [%| u.diag]
7137+ [%| ["cast mold is not supported by partial inference" ~]]
7138+ =/ value=iresult
7139+ (infer-call-context-arg val.e typ.u.target env state.u.target at.shape.e)
50027140 ?: ?=(%| -.value) value
5003− =/ uni=(unit isub) (itype-unify typ.u.target typ.p.value sub.state.p.value)
5004− ?~ uni [%| "cast mold and expression type do not unify"]
5005− [%& typ.u.target state.p.value(sub u.uni)]
7141+ =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
7142+ ?: ?=(%unknown -.fit) [%| ["cast constraint is not supported by partial inference" ~]]
7143+ ?: ?=(%bad -.fit)
7144+ =/ missing=(unit idiag) (missing-union-tag val.e typ.u.target sub.state.p.value at.shape.e)
7145+ ?^ missing [%| u.missing]
7146+ [%| ["cast mold and expression type do not unify" ~[[at.shape.e (site-type-note "cast mold" typ.u.target sub.state.p.value)] [(span-of val.e) (site-type-note "expression" typ.p.value sub.state.p.value)]]]]
7147+ =/ merged=itype (itype-merge-faces typ.p.value typ.u.target sub.fit)
7148+ [%& merged state.p.value(sub sub.fit, next next.fit)]
50067149 %crash [%& [%var next.state] state(next +(next.state))]
50077150 %gate
50087151 =/ sam=isample-result (infer-sample sample.e env state)
5009− ?: ?=(%| -.sam) [%| p.sam]
7152+ ?: ?=(%| -.sam)
7153+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
7154+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
7155+ [%| [p.sam ~]]
50107156 =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
50117157 ?: ?=(%| -.body) body
50127158 [%& [%fn typ.p.sam typ.p.body] state.p.body]
50137159 %gate-wide
50147160 =/ sam=isample-result (infer-sample sample.e env state)
5015− ?: ?=(%| -.sam) [%| p.sam]
7161+ ?: ?=(%| -.sam)
7162+ =/ diag=(unit idiag) (sample-import-invalid sample.e env state)
7163+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
7164+ [%| [p.sam ~]]
50167165 =/ body=iresult $(e body.e, env env.p.sam, state state.p.sam)
50177166 ?: ?=(%| -.body) body
50187167 [%& [%fn typ.p.sam typ.p.body] state.p.body]
50197168 %call
5020− ?~ args.e [%| "call has no argument"]
5021− ?^ t.args.e [%| "multiple arguments are not supported by partial inference"]
7169+ ?~ args.e [%| ["call has no argument" ~]]
50227170 =/ head=iresult $(e head.e)
50237171 ?: ?=(%| -.head) head
5024− =/ arg=iresult $(e i.args.e, state state.p.head)
7172+ =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
7173+ =/ arg=iresult
7174+ ?^ t.args.e
7175+ ?: ?=(%fn -.head-type)
7176+ (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
7177+ (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
7178+ ?: ?=(%fn -.head-type)
7179+ (infer-call-context-arg i.args.e sample.head-type env state.p.head (span-of head.e))
7180+ $(e i.args.e, state state.p.head)
50257181 ?: ?=(%| -.arg) arg
50267182 =/ st=istate state.p.arg
7183+ =/ ht=itype (itype-walk typ.p.head sub.st)
7184+ ?: ?=(%fn -.ht)
7185+ =/ fit=ifit (itype-fit typ.p.arg sample.ht sub.st next.st)
7186+ ?: ?=(%unknown -.fit) [%| ["call constraint is not supported by partial inference" ~]]
7187+ ?: ?=(%bad -.fit)
7188+ ?~ t.args.e
7189+ =/ missing=(unit idiag) (missing-union-tag i.args.e sample.ht sub.st (span-of head.e))
7190+ ?^ missing [%| u.missing]
7191+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [(span-of i.args.e) (site-type-note "argument" typ.p.arg sub.st)]]]]
7192+ =/ bad=(unit [at=span typ=itype])
7193+ (call-error-site args.e typ.p.arg sample.ht sub.st next.st)
7194+ =/ whole-args=span
7195+ [beg:(span-of i.args.e) end:(span-of (rear args.e))]
7196+ =/ arg-at=span ?~(bad whole-args at.u.bad)
7197+ =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
7198+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [arg-at (site-type-note "argument" arg-type sub.st)]]]]
7199+ ?: &((itype-has-face typ.p.arg sub.fit) (itype-face-asym typ.p.arg sample.ht sub.fit) (itype-output-may-be-cell product.ht sub.fit))
7200+ [%| ["call result face propagation is not supported by partial inference" ~]]
7201+ [%& product.ht st(sub sub.fit, next next.fit)]
50277202 =/ result=itype [%var next.st]
5028− =/ uni=(unit isub)
5029− (itype-unify typ.p.head [%fn typ.p.arg result] sub.st)
5030− ?~ uni [%| "call's sample and argument types do not unify"]
7203+ =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
7204+ ?~ uni
7205+ [%| ["call's sample and argument types do not unify" ~[[(span-of head.e) (site-type-note "called gate" ht sub.st)] [(span-of i.args.e) (site-type-note "argument" typ.p.arg sub.st)]]]]
50317206 [%& result st(next +(next.st), sub u.uni)]
5032− * [%| "expression is not supported by partial inference"]
7207+ * [%| ["expression is not supported by partial inference" ~]]
50337208 ==
50347209::
5035−:: Unfaced tuple expressions are the one supported cell construction.
5036−:: Faced cells wait for the representation to preserve record faces.
7210+:: Locate a definite failing argument after the complete sample fit has
7211+:: failed. If an intermediate fit is uncertain, retain the whole argument
7212+:: span rather than assigning blame to a particular argument.
7213+::
7214+++ call-error-site
7215+ |= [args=(list expr) actual=itype expected=itype sub=isub next=@ud]
7216+ ^- (unit [at=span typ=itype])
7217+ ?~ args ~
7218+ =/ original=[left=itype right=itype] [actual expected]
7219+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%nvar -.left.original) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%nvar -.right.original)) ~
7220+ =. actual (itype-walk actual sub)
7221+ =. expected (itype-walk expected sub)
7222+ ?: &(?=(%face -.expected) !?=(%face -.actual))
7223+ $(expected body.expected)
7224+ ?~ t.args
7225+ =/ fit=ifit (itype-fit actual expected sub next)
7226+ ?. ?=(%bad -.fit) ~
7227+ `[(span-of i.args) (itype-normalize actual sub)]
7228+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
7229+ =/ first=ifit (itype-fit hed.actual hed.expected sub next)
7230+ ?: ?=(%bad -.first) `[(span-of i.args) (itype-normalize hed.actual sub)]
7231+ ?: ?=(%unknown -.first) ~
7232+ $(args t.args, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
7233+::
7234+:: Context can help a call argument or cast value while the final fit
7235+:: checks the complete right-nested type, including any written faces.
7236+::
7237+:: Context can resolve the payload of a canonical prelude unit, but an
7238+:: unrelated union with a similar noun shape is not the same mold.
7239+++ infer-unit-context
7240+ |= [e=expr expected=itype env=ienv state=istate context=span]
7241+ ^- iresult
7242+ ?> ?=(%unit -.e)
7243+ ?> ?=(%union -.expected)
7244+ ?~ prelude.state (infer-fragment e env state)
7245+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
7246+ ?~ standard (infer-fragment e env state)
7247+ ?. (standard-unit-template u.standard at.u.prelude.state) (infer-fragment e env state)
7248+ ?. =(origin.expected `[at.u.prelude.state %unit]) (infer-fragment e env state)
7249+ ?~ args.expected (infer-fragment e env state)
7250+ ?^ t.args.expected (infer-fragment e env state)
7251+ =/ payload=itype i.args.expected
7252+ =/ canonical=(unit itype) (template-apply u.standard ~[payload])
7253+ ?~ canonical (infer-fragment e env state)
7254+ ?> ?=(%union -.u.canonical)
7255+ ?. =((itype-normalize expected(label ~) sub.state) (itype-normalize u.canonical(label ~) sub.state))
7256+ (infer-fragment e env state)
7257+ =/ value=iresult (infer-call-context-arg val.e payload env state context)
7258+ ?: ?=(%| -.value) value
7259+ =/ fit=ifit (itype-fit typ.p.value payload sub.state.p.value next.state.p.value)
7260+ ?: ?=(%unknown -.fit) [%| ["unit payload constraint is not supported by partial inference" ~]]
7261+ ?: ?=(%bad -.fit)
7262+ =/ missing=(unit idiag) (missing-union-tag val.e payload sub.state.p.value context)
7263+ ?^ missing [%| u.missing]
7264+ [%| ["unit payload does not fit its expected type" ~[[context (site-type-note "expected unit payload" payload sub.state.p.value)] [(span-of val.e) (site-type-note "payload" typ.p.value sub.state.p.value)]]]]
7265+ [%& expected state.p.value(sub sub.fit, next next.fit)]
7266+::
7267+++ infer-call-context-arg
7268+ |= [e=expr expected=itype env=ienv state=istate context=span]
7269+ ^- iresult
7270+ =/ target=itype (itype-walk expected sub.state)
7271+ |-
7272+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
7273+ ?: &(?=(%union -.target) ?=(%unit -.e))
7274+ (infer-unit-context e target env state context)
7275+ ?: &(?=(%union -.target) (context-union-branch e))
7276+ (infer-union-context e target env state context)
7277+ ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch e))
7278+ (infer-union-context e target env state context)
7279+ ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression e))
7280+ (infer-list-context e target env state context)
7281+ ?: &(?=(%cell -.target) ?=(%tuple -.e))
7282+ (infer-call-context-items items.e target env state context)
7283+ (infer-fragment e env state)
7284+::
7285+:: Preserve each written face; the final complete sample fit checks faces.
7286+++ infer-call-context-items
7287+ |= [items=(list item) expected=itype env=ienv state=istate context=span]
7288+ ^- iresult
7289+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
7290+ ?~ t.items
7291+ =/ last=iresult (infer-call-context-arg val.i.items expected env state context)
7292+ ?: ?=(%| -.last) last
7293+ =/ typ=itype typ.p.last
7294+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
7295+ [%& typ state.p.last]
7296+ =/ target=itype (itype-walk expected sub.state)
7297+ |-
7298+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
7299+ ?. ?=(%cell -.target) (infer-simple-items items env state)
7300+ =/ head=iresult (infer-call-context-arg val.i.items hed.target env state context)
7301+ ?: ?=(%| -.head) head
7302+ =/ typ=itype typ.p.head
7303+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
7304+ =/ tail=iresult (infer-call-context-items t.items tal.target env state.p.head context)
7305+ ?: ?=(%| -.tail) tail
7306+ [%& [%cell typ typ.p.tail] state.p.tail]
7307+::
7308+++ infer-call-context-args
7309+ |= [args=(list expr) expected=itype env=ienv state=istate context=span]
7310+ ^- iresult
7311+ ?~ args [%| ["call has no argument" ~]]
7312+ ?~ t.args (infer-call-context-arg i.args expected env state context)
7313+ =/ target=itype (itype-walk expected sub.state)
7314+ |-
7315+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
7316+ ?. ?=(%cell -.target)
7317+ (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
7318+ =/ head=iresult (infer-call-context-arg i.args hed.target env state context)
7319+ ?: ?=(%| -.head) head
7320+ =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
7321+ ?: ?=(%| -.tail) tail
7322+ [%& [%cell typ.p.head typ.p.tail] state.p.tail]
7323+::
7324+:: Tuple and record expressions preserve their explicitly written faces.
50377325::
50387326++ infer-simple-items
50397327 |= [items=(list item) env=ienv state=istate]
50407328 ^- iresult
5041− ?~ items [%| "empty cell is not supported by partial inference"]
5042− ?^ face.i.items [%| "record faces are not supported by partial inference"]
7329+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
50437330 =/ head=iresult (infer-fragment val.i.items env state)
50447331 ?: ?=(%| -.head) head
5045− ?~ t.items head
7332+ =/ ht=itype typ.p.head
7333+ =. ht ?~(face.i.items ht [%face u.face.i.items ht])
7334+ ?~ t.items [%& ht state.p.head]
50467335 =/ tail=iresult $(items t.items, state state.p.head)
50477336 ?: ?=(%| -.tail) tail
5048− [%& [%cell typ.p.head typ.p.tail] state.p.tail]
7337+ [%& [%cell ht typ.p.tail] state.p.tail]
50497338::
50507339:: A single two-binder cell pattern covers every value of a cell type.
50517340:: No other pattern matrix is implemented here.
@@ -5054,26 +7343,30 @@
50547343 |= [e=expr env=ienv state=istate]
50557344 ^- iresult
50567345 ?> ?=(%branch -.e)
5057− ?~ arms.e [%| "branch is not supported by partial inference"]
7346+ ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
50587347 =/ arm=arm i.arms.e
5059− ?. ?=(%cell -.pat.arm) [%| "branch pattern is not supported by partial inference"]
7348+ ?. ?=(%cell -.pat.arm) [%| ["branch pattern is not supported by partial inference" ~]]
50607349 =/ pats=(list pattern) items.pat.arm
5061− ?~ pats [%| "branch pattern is not supported by partial inference"]
5062− ?~ t.pats [%| "branch pattern is not supported by partial inference"]
5063− ?^ t.t.pats [%| "branch pattern is not supported by partial inference"]
5064− ?. ?=(%bind -.i.pats) [%| "branch pattern is not supported by partial inference"]
5065− ?. ?=(%bind -.i.t.pats) [%| "branch pattern is not supported by partial inference"]
7350+ ?~ pats [%| ["branch pattern is not supported by partial inference" ~]]
7351+ ?~ t.pats [%| ["branch pattern is not supported by partial inference" ~]]
7352+ ?^ t.t.pats [%| ["branch pattern is not supported by partial inference" ~]]
7353+ ?. ?=(%bind -.i.pats) [%| ["branch pattern is not supported by partial inference" ~]]
7354+ ?. ?=(%bind -.i.t.pats) [%| ["branch pattern is not supported by partial inference" ~]]
50667355 =/ one=term name.i.pats
50677356 =/ two=term name.i.t.pats
50687357 ?: |(=(one two) ?=(^ (ienv-lookup one env)) ?=(^ (ienv-lookup two env)) (lien globals.state |=(x=term |(=(x one) =(x two)))))
5069− [%| "pattern shadows a name"]
7358+ [%| ["pattern shadows a name" ~]]
50707359 =/ subject=iresult (infer-fragment subject.e env state)
50717360 ?: ?=(%| -.subject) subject
50727361 =/ st=istate state.p.subject
7362+ ?: (itype-has-recursive (itype-normalize typ.p.subject sub.st))
7363+ [%| ["recursive pattern is not supported by partial inference" ~]]
7364+ ?: (itype-has-face typ.p.subject sub.st)
7365+ [%| ["record patterns are not supported by partial inference" ~]]
50737366 =/ head=itype [%var next.st]
50747367 =/ tail=itype [%var +(next.st)]
50757368 =/ sub=(unit isub) (itype-unify typ.p.subject [%cell head tail] sub.st)
5076− ?~ sub [%| "cell pattern does not match the subject type"]
7369+ ?~ sub [%| ["cell pattern does not match the subject type" ~]]
50777370 (infer-fragment val.arm [[one [head ~]] [two [tail ~]] env] st(next (add 2 next.st), sub u.sub))
50787371::
50797372++ show-itype
@@ -5084,44 +7377,223 @@
50847377 %var
50857378 ?: (lth id.t 26) [(add 65 id.t) ~]
50867379 "T{<id.t>}"
5087− %avar "@"
7380+ %avar
7381+ ?: (lth id.t 26) [(add 65 id.t) ~]
7382+ "T{<id.t>}"
7383+ %nvar
7384+ ?: (lth id.t 26) [(add 65 id.t) ~]
7385+ "T{<id.t>}"
50887386 %atom "@{(trip aura.t)}"
7387+ %any-atom "@"
50897388 %flag "?"
5090− %fn "$-({$(t sample.t)} {$(t product.t)})"
5091− %cell "[{$(t hed.t)} {$(t tal.t)}]"
7389+ %tag (trip txt.literal.t)
7390+ %const (trip txt.literal.t)
7391+ %union
7392+ ?~ label.t (show-itype-cases cases.t sub)
7393+ ?~ args.t (trip u.label.t)
7394+ "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
7395+ %recursive ?~(label.t "recursive mold" (trip u.label.t))
7396+ %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
7397+ %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
7398+ %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
7399+ %cell "[{(show-itype-item hed.t sub)} {(show-itype-item tal.t sub)}]"
50927400 ==
50937401::
5094−:: Unfixed aura variables are withheld from the output until inference
5095−:: can generalize them and the printer represents their constraints.
7402+++ show-itype-item
7403+ |= [t=itype sub=isub]
7404+ ^- tape
7405+ =. t (itype-walk t sub)
7406+ ?: ?=(%face -.t) "{(trip name.t)}={(show-itype-context body.t sub)}"
7407+ (show-itype-context t sub)
7408+::
7409+++ show-itype-context
7410+ |= [t=itype sub=isub]
7411+ ^- tape
7412+ =. t (itype-walk t sub)
7413+ ?: &(?=(%union -.t) ?=(~ label.t)) "({(show-itype t sub)})"
7414+ (show-itype t sub)
7415+::
7416+++ show-itype-cases
7417+ |= [cases=(list itype) sub=isub]
7418+ ^- tape
7419+ ?~ cases ""
7420+ ?~ t.cases (show-itype-context i.cases sub)
7421+ "{(show-itype-context i.cases sub)} {$(cases t.cases)}"
7422+::
7423+:: Include the type at a conflicting site where it can be printed.
7424+:: A lone unresolved variable or decimal variable keeps the neutral label.
50967425::
5097−++ itype-has-avar
5098− |= t=itype
7426+++ itype-has-nvar
7427+ |= typ=itype
50997428 ^- ?
5100− ?- -.t
5101− %avar &
5102− %var |
5103− %atom |
5104− %flag |
5105− %fn |($(t sample.t) $(t product.t))
5106− %cell |($(t hed.t) $(t tal.t))
7429+ ?- -.typ
7430+ %nvar &
7431+ %var |
7432+ %avar |
7433+ %atom |
7434+ %any-atom |
7435+ %flag |
7436+ %tag |
7437+ %const |
7438+ %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
7439+ %recursive |
7440+ %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
7441+ %face $(typ body.typ)
7442+ %fn |($(typ sample.typ) $(typ product.typ))
7443+ %cell |($(typ hed.typ) $(typ tal.typ))
51077444 ==
51087445::
7446+++ site-type-note
7447+ |= [label=tape typ=itype sub=isub]
7448+ ^- tape
7449+ =/ normalized=itype (itype-normalize typ sub)
7450+ ?: |(?=(%var -.normalized) ?=(%avar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
7451+ ?: (itype-has-hidden-recursive normalized) label
7452+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
7453+ ?: (gth (lent vars) 26) label
7454+ =/ printable=itype (canonical-itype normalized vars)
7455+ "{label} has type {(show-itype printable ~)}{(show-atom-constraint printable)}"
7456+::
51097457:: A capital in a written mold is generalized with its enclosing ++.
5110−:: Until its rigidity and aura constraints are represented, do not
5111−:: report a type when unification made one more specific.
7458+:: Atom constraints may remain generic; until full rigidity checking
7459+:: is implemented, do not report a type if one became more specific.
7460+:: Distinct written capitals cannot be forced equal; use the same
7461+:: capital where a type must be shared (Decisions 2026-10-30).
7462+::
7463+++ cap-id-in
7464+ |= [n=@ud caps=icaps sub=isub]
7465+ ^- ?
7466+ ?~ caps |
7467+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7468+ =/ ident=(unit @ud)
7469+ ?+ -.resolved ~
7470+ %var `id.resolved
7471+ %avar `id.resolved
7472+ ==
7473+ ?~ ident $(caps t.caps)
7474+ ?: =(n u.ident) &
7475+ $(caps t.caps)
7476+::
7477+++ cap-with-id
7478+ |= [n=@ud caps=icaps sub=isub]
7479+ ^- (unit icap)
7480+ ?~ caps ~
7481+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7482+ =/ ident=(unit @ud)
7483+ ?+ -.resolved ~
7484+ %var `id.resolved
7485+ %avar `id.resolved
7486+ ==
7487+ ?~ ident $(caps t.caps)
7488+ ?: =(n u.ident) `i.caps
7489+ $(caps t.caps)
7490+::
7491+++ merged-capitals
7492+ |= [caps=icaps sub=isub]
7493+ ^- (unit [first=icap second=icap])
7494+ ?~ caps ~
7495+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7496+ =/ ident=(unit @ud)
7497+ ?+ -.resolved ~
7498+ %var `id.resolved
7499+ %avar `id.resolved
7500+ ==
7501+ ?~ ident $(caps t.caps)
7502+ =/ found=(unit icap) (cap-with-id u.ident t.caps sub)
7503+ ?^ found `[u.found i.caps]
7504+ $(caps t.caps)
51127505::
51137506++ constrained-capitals
51147507 |= [caps=icaps sub=isub]
51157508 ^- ?
51167509 ?~ caps |
51177510 =/ resolved=itype (itype-walk [%var id.i.caps] sub)
5118− ?. ?=(%var -.resolved) &
7511+ =/ ident=(unit @ud)
7512+ ?+ -.resolved ~
7513+ %var `id.resolved
7514+ %avar `id.resolved
7515+ ==
7516+ ?~ ident &
7517+ ?: (cap-id-in u.ident t.caps sub) &
7518+ $(caps t.caps)
7519+::
7520+:: An atom variable may be generalized when an explicit capital, sample
7521+:: binder or instantiated constraint resolves to it. Decimal variables need
7522+:: defaulting and must not be generalized as arbitrary atom types.
7523+::
7524+++ atom-var-from-cap
7525+ |= [n=@ud caps=icaps sub=isub]
7526+ ^- ?
7527+ ?~ caps |
7528+ =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7529+ ?: ?=(%avar -.resolved)
7530+ ?: =(n id.resolved) &
7531+ $(caps t.caps)
51197532 $(caps t.caps)
51207533::
7534+++ has-atom-var
7535+ |= [n=@ud t=itype]
7536+ ^- ?
7537+ ?- -.t
7538+ %var |
7539+ %avar =(n id.t)
7540+ %nvar |
7541+ %atom |
7542+ %any-atom |
7543+ %flag |
7544+ %tag |
7545+ %const |
7546+ %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
7547+ %recursive |
7548+ %collection (lien args.t |=(c=itype (has-atom-var n c)))
7549+ %face $(t body.t)
7550+ %fn |($(t sample.t) $(t product.t))
7551+ %cell |($(t hed.t) $(t tal.t))
7552+ ==
7553+::
7554+++ atom-var-from-binder
7555+ |= [n=@ud binders=(list @ud) sub=isub]
7556+ ^- ?
7557+ ?~ binders |
7558+ =/ resolved=itype (itype-normalize [%var i.binders] sub)
7559+ :: An instantiated atom variable is not itself a substitution, so
7560+ :: its origin still walks as an unbound variable of the same ID.
7561+ ?: ?=(%var -.resolved)
7562+ ?: =(n id.resolved) &
7563+ $(binders t.binders)
7564+ ?: (has-atom-var n resolved) &
7565+ $(binders t.binders)
7566+::
7567+++ unsupported-atom-vars
7568+ |= [t=itype caps=icaps binders=(list @ud) sub=isub]
7569+ ^- ?
7570+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
7571+ |-
7572+ ?~ vars |
7573+ ?: (itype-var-is-atom i.vars t)
7574+ ?. (has-atom-var i.vars t) &
7575+ ?. |((atom-var-from-cap i.vars caps sub) (atom-var-from-binder i.vars binders sub)) &
7576+ $(vars t.vars)
7577+ $(vars t.vars)
7578+::
7579+++ show-atom-constraint
7580+ |= t=itype
7581+ ^- tape
7582+ =/ vars=(list @ud) (unique-type-vars (itype-vars t))
7583+ =/ printed=? |
7584+ =/ out=tape ""
7585+ |-
7586+ ?~ vars out
7587+ ?: (itype-var-is-atom i.vars t)
7588+ =/ sep=tape ?:(printed ", " " where ")
7589+ =/ clause=tape "{sep}{(show-itype [%avar i.vars] ~)} is an atom"
7590+ $(vars t.vars, printed &, out (weld out clause))
7591+ $(vars t.vars)
7592+::
51217593:: Build the supported part of the value environment in dependency order.
51227594:: Each pass adds successful definitions. Forward references become
5123−:: available on a later pass; recursive groups and unsupported syntax do
5124−:: not enter the environment. Generalized definitions are closed, so a
7595+:: available on a later pass; mutually recursive groups and unsupported
7596+:: syntax do not enter the environment. Generalized definitions are closed, so a
51257597:: use instantiates its variables afresh.
51267598::
51277599++ global-value-names
@@ -5140,31 +7612,470 @@
51407612 ?~ t.hits &
51417613 |
51427614::
7615+:: A top-level gate may refer to itself through one monomorphic placeholder.
7616+:: Its declared sample is inferred first and preserves its field faces.
7617+:: Unify the completed body with that placeholder before generalization;
7618+:: reporting repeats the same check instead of instantiating the gate's
7619+:: generalized interface inside its own body. Mutual groups stay unsupported.
7620+::
7621+++ direct-self-call
7622+ |= [e=expr name=term]
7623+ ^- ?
7624+ ?: ?=(%group -.e) $(e inner.e)
7625+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
7626+ ?. ?=(%call -.e) |
7627+ ?. ?=(%wing -.head.e) |
7628+ =(names.head.e ~[name])
7629+::
7630+++ branch-base-arm
7631+ |= [e=expr name=term]
7632+ ^- (unit expr)
7633+ ?: ?=(%group -.e) $(e inner.e)
7634+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
7635+ ?. ?=(%branch -.e) ~
7636+ ?~ arms.e ~
7637+ ?~ t.arms.e ~
7638+ ?^ t.t.arms.e ~
7639+ =/ x=arm i.arms.e
7640+ =/ y=arm i.t.arms.e
7641+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) ~
7642+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) ~
7643+ ?: =(val.lit.pat.x val.lit.pat.y) ~
7644+ =/ first=? (direct-self-call val.x name)
7645+ =/ second=? (direct-self-call val.y name)
7646+ ?: =(first second) ~
7647+ `?:(first val.y val.x)
7648+::
7649+:: Infer the base arm independently, with the self binding removed. Only
7650+:: a closed type whose constraints resolved can seed the recursive result.
7651+:: The regular body inference then checks both arms with shared state.
7652+::
7653+++ recursive-branch-seed
7654+ |= [d=def env=ienv state=istate]
7655+ ^- (unit itype)
7656+ ?. ?=(%value -.d) ~
7657+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) ~
7658+ =/ gate=expr val.d
7659+ =/ body=expr
7660+ ?- -.gate
7661+ %gate body.gate
7662+ %gate-wide body.gate
7663+ * !!
7664+ ==
7665+ =/ base=(unit expr) (branch-base-arm body name.d)
7666+ ?~ base ~
7667+ =/ outer=ienv (skim env |=(entry=[name=term scheme=ischeme] !=(name.entry name.d)))
7668+ =/ sam=isample-result
7669+ ?- -.gate
7670+ %gate (infer-sample sample.gate outer state)
7671+ %gate-wide (infer-sample sample.gate outer state)
7672+ * !!
7673+ ==
7674+ ?: ?=(%| -.sam) ~
7675+ =/ inferred=iresult (infer-fragment u.base env.p.sam state.p.sam)
7676+ ?: ?=(%| -.inferred) ~
7677+ ?: (pending-tags tags.state.p.inferred sub.state.p.inferred) ~
7678+ ?: (constrained-capitals caps.state.p.inferred sub.state.p.inferred) ~
7679+ =/ typ=itype (itype-normalize typ.p.inferred sub.state.p.inferred)
7680+ ?: ?=(^ (itype-vars typ)) ~
7681+ ?: (itype-has-tag typ) ~
7682+ `typ
7683+::
7684+++ infer-recursive-gate
7685+ |= [d=def env=ienv state=istate]
7686+ ^- iresult
7687+ ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
7688+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
7689+ [%| ["recursive definition is not a gate" ~]]
7690+ =/ result=(unit itype) (recursive-branch-seed d env state)
7691+ =/ gate=expr val.d
7692+ =/ sam=isample-result
7693+ ?- -.gate
7694+ %gate (infer-sample sample.gate env state)
7695+ %gate-wide (infer-sample sample.gate env state)
7696+ * !!
7697+ ==
7698+ ?: ?=(%| -.sam)
7699+ =/ diag=(unit idiag)
7700+ ?- -.gate
7701+ %gate (sample-import-invalid sample.gate env state)
7702+ %gate-wide (sample-import-invalid sample.gate env state)
7703+ * ~
7704+ ==
7705+ ?: &(=(p.sam "sample mold is not supported by partial inference") ?=(^ diag)) [%| u.diag]
7706+ [%| [p.sam ~]]
7707+ =/ id=@ud next.state.p.sam
7708+ =/ product=itype ?~(result [%var id] u.result)
7709+ =/ st=istate state.p.sam(next +(id))
7710+ =/ seed=itype [%fn typ.p.sam product]
7711+ =/ seeded=ienv [[name.d [seed ~]] env.p.sam]
7712+ =/ body=expr
7713+ ?- -.gate
7714+ %gate body.gate
7715+ %gate-wide body.gate
7716+ * !!
7717+ ==
7718+ =/ out=iresult (infer-fragment body seeded st)
7719+ ?: ?=(%| -.out) out
7720+ =/ uni=(unit isub) (itype-unify product typ.p.out sub.state.p.out)
7721+ ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
7722+ [%& [%fn typ.p.sam typ.p.out] state.p.out(sub u.uni)]
7723+::
7724+++ dependency-root
7725+ |= names=(list term)
7726+ ^- (list term)
7727+ ?~ names ~
7728+ ~[(rear names)]
7729+::
7730+++ dependency-exprs
7731+ |= xs=(list expr)
7732+ ^- (list term)
7733+ ?~ xs ~
7734+ =/ first=(list term) (dependency-expr i.xs)
7735+ (weld first $(xs t.xs))
7736+::
7737+++ dependency-pieces
7738+ |= xs=(list piece)
7739+ ^- (list term)
7740+ ?~ xs ~
7741+ =/ first=(list term)
7742+ ?- -.i.xs
7743+ %expr (dependency-expr p.i.xs)
7744+ %text ~
7745+ ==
7746+ (weld first $(xs t.xs))
7747+::
7748+++ dependency-qsegs
7749+ |= xs=(list qseg)
7750+ ^- (list term)
7751+ ?~ xs ~
7752+ =/ first=(list term)
7753+ ?- -.i.xs
7754+ %expr (dependency-expr p.i.xs)
7755+ %knot ~
7756+ ==
7757+ (weld first $(xs t.xs))
7758+::
7759+++ dependency-items
7760+ |= xs=(list item)
7761+ ^- (list term)
7762+ ?~ xs ~
7763+ =/ first=(list term) (dependency-expr val.i.xs)
7764+ (weld first $(xs t.xs))
7765+::
7766+++ dependency-edits
7767+ |= xs=(list edit)
7768+ ^- (list term)
7769+ ?~ xs ~
7770+ =/ first=(list term) (dependency-expr val.i.xs)
7771+ (weld first $(xs t.xs))
7772+::
7773+++ dependency-arms
7774+ |= xs=(list arm)
7775+ ^- (list term)
7776+ ?~ xs ~
7777+ =/ first=(list term) (dependency-expr val.i.xs)
7778+ (weld first $(xs t.xs))
7779+::
7780+++ dependency-defs
7781+ |= xs=(list def)
7782+ ^- (list term)
7783+ ?~ xs ~
7784+ =/ first=(list term)
7785+ ?: ?=(%value -.i.xs) (dependency-expr val.i.xs)
7786+ ~
7787+ (weld first $(xs t.xs))
7788+::
7789+++ dependency-expr
7790+ |= e=expr
7791+ ^- (list term)
7792+ ?- -.e
7793+ %str (dependency-pieces pieces.e)
7794+ %qath (dependency-qsegs segs.e)
7795+ %wing (dependency-root names.e)
7796+ %change
7797+ =/ first=(list term) (dependency-root target.e)
7798+ =/ last=(list term) (dependency-edits edits.e)
7799+ (weld first last)
7800+ %pair (dependency-expr val.e)
7801+ %unit (dependency-expr val.e)
7802+ %group (dependency-expr inner.e)
7803+ %list (dependency-exprs items.e)
7804+ %tuple (dependency-items items.e)
7805+ %gate (dependency-expr body.e)
7806+ %gate-wide (dependency-expr body.e)
7807+ %call
7808+ =/ first=(list term) (dependency-expr head.e)
7809+ =/ last=(list term) (dependency-exprs args.e)
7810+ (weld first last)
7811+ %cast (dependency-expr val.e)
7812+ %trace
7813+ =/ first=(list term) (dependency-expr val.e)
7814+ =/ last=(list term) (dependency-expr then.e)
7815+ (weld first last)
7816+ %branch
7817+ =/ first=(list term) (dependency-expr subject.e)
7818+ =/ last=(list term) (dependency-arms arms.e)
7819+ (weld first last)
7820+ %body
7821+ =/ first=(list term) (dependency-defs defs.e)
7822+ =/ last=(list term) (dependency-expr final.e)
7823+ (weld first last)
7824+ * ~
7825+ ==
7826+::
7827+:: Infer a cyclic top-level component with one monomorphic seed per gate.
7828+:: All members must succeed before any scheme is available; local cyclic
7829+:: groups, pending constraints and unresolved branch joins remain partial.
7830++$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
7831++$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
7832+++ seed-gate-group
7833+ |= [ds=(list def) env=ienv state=istate]
7834+ ^- igate-seeds
7835+ ?~ ds [%& [~ state]]
7836+ =/ d=def i.ds
7837+ ?. ?=(%value -.d) [%| ["recursive group contains a non-gate" ~]]
7838+ =/ gate=expr val.d
7839+ ?. |(?=(%gate -.gate) ?=(%gate-wide -.gate))
7840+ [%| ["recursive group contains a non-gate" ~]]
7841+ =/ initial=istate (reserve-def-caps gate state)
7842+ =/ sam=isample-result
7843+ ?- -.gate
7844+ %gate (infer-sample sample.gate env initial)
7845+ %gate-wide (infer-sample sample.gate env initial)
7846+ * !!
7847+ ==
7848+ ?: ?=(%| -.sam) [%| [p.sam ~]]
7849+ =/ body=expr
7850+ ?- -.gate
7851+ %gate body.gate
7852+ %gate-wide body.gate
7853+ * !!
7854+ ==
7855+ =/ seed=itype [%fn typ.p.sam [%var next.state.p.sam]]
7856+ =/ entry=igate-entry [name.d seed body env.p.sam caps.state.p.sam]
7857+ =/ after=istate state.p.sam(next +(next.state.p.sam), caps caps.state)
7858+ =/ rest=igate-seeds $(ds t.ds, state after)
7859+ ?: ?=(%| -.rest) rest
7860+ [%& [[entry entries.p.rest] state.p.rest]]
7861+::
7862+++ group-seed-env
7863+ |= [entries=(list igate-entry) env=ienv]
7864+ ^- ienv
7865+ ?~ entries env
7866+ [[name.i.entries [typ.i.entries ~]] $(entries t.entries)]
7867+::
7868+++ infer-gate-group-bodies
7869+ |= [entries=(list igate-entry) seeds=ienv state=istate]
7870+ ^- igate-seeds
7871+ ?~ entries [%& [~ state]]
7872+ =/ entry=igate-entry i.entries
7873+ ?> ?=(%fn -.typ.entry)
7874+ =/ scope=ienv (weld seeds env.entry)
7875+ =/ out=iresult (infer-fragment body.entry scope state(caps caps.entry))
7876+ ?: ?=(%| -.out) out
7877+ =/ uni=(unit isub) (itype-unify product.typ.entry typ.p.out sub.state.p.out)
7878+ ?~ uni [%| ["recursive group constraint is not supported by partial inference" ~]]
7879+ =. caps.entry caps.state.p.out
7880+ =/ after=istate state.p.out(sub u.uni, caps caps.state)
7881+ =/ rest=igate-seeds $(entries t.entries, state after)
7882+ ?: ?=(%| -.rest) rest
7883+ [%& [[entry entries.p.rest] state.p.rest]]
7884+::
7885+++ group-schemes
7886+ |= [entries=(list igate-entry) env=ienv outer=istate state=istate]
7887+ ^- (each ienv idiag)
7888+ ?~ entries [%& ~]
7889+ =/ entry=igate-entry i.entries
7890+ =/ merged=(unit [first=icap second=icap]) (merged-capitals caps.entry sub.state)
7891+ ?^ merged
7892+ [%| ["distinct type variables must not be forced equal" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]]
7893+ ?: (constrained-capitals caps.entry sub.state)
7894+ [%| ["explicit capital constraints are not supported by partial inference" ~]]
7895+ =/ typ=itype (itype-normalize typ.entry sub.state)
7896+ ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
7897+ [%| ["recursive group needs unsupported inference" ~]]
7898+ =/ free=(list @ud) (weld (free-env-vars env sub.state) (free-cap-vars caps.outer sub.state))
7899+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
7900+ =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
7901+ ?: (gth (lent vars) 26) [%| ["recursive group needs too many type variables" ~]]
7902+ =/ rest=(each ienv idiag) $(entries t.entries)
7903+ ?: ?=(%| -.rest) rest
7904+ [%& [[name.entry [typ vars]] p.rest]]
7905+::
7906+++ infer-gate-group
7907+ |= [ds=(list def) env=ienv state=istate]
7908+ ^- ilocal-result
7909+ =/ names=(list term) (global-value-names ds)
7910+ ?. (levy names |=(n=term (unique-value-name n names)))
7911+ [%| ["recursive group contains duplicate names" ~]]
7912+ ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
7913+ [%| ["recursive group shadows a name" ~]]
7914+ =/ scoped=istate state(globals (weld names globals.state))
7915+ =/ seeded=igate-seeds (seed-gate-group ds env scoped)
7916+ ?: ?=(%| -.seeded) seeded
7917+ =/ seeds=ienv (group-seed-env entries.p.seeded ~)
7918+ =/ body=igate-seeds (infer-gate-group-bodies entries.p.seeded seeds state.p.seeded)
7919+ ?: ?=(%| -.body) body
7920+ ?: (pending-tags tags.state.p.body sub.state.p.body)
7921+ [%| ["recursive group has unresolved literal constraints" ~]]
7922+ =/ schemes=(each ienv idiag) (group-schemes entries.p.body env state state.p.body)
7923+ ?: ?=(%| -.schemes) schemes
7924+ [%& [(weld p.schemes env) state.p.body(globals globals.state)]]
7925+::
51437926++ add-supported-defs
5144− |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term)]
7927+ |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
51457928 ^- ienv
51467929 ?~ ds env
51477930 =/ d=def i.ds
51487931 ?: ?=(%mold -.d) $(ds t.ds)
51497932 ?. (unique-value-name name.d globals) $(ds t.ds)
51507933 ?^ (ienv-lookup name.d env) $(ds t.ds)
5151− =/ result=iresult (infer-fragment val.d env [0 ~ ~ molds globals externals surs ~ |])
7934+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7935+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
7936+ =. initial (reserve-def-caps val.d initial)
7937+ =/ result=iresult (infer-fragment val.d env initial)
7938+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
51527939 ?: ?=(%| -.result) $(ds t.ds)
51537940 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
5154− =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5155− ?: (itype-has-avar typ) $(ds t.ds)
7941+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
7942+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
7943+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
51567944 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
51577945 ?: (gth (lent vars) 26) $(ds t.ds)
51587946 $(ds t.ds, env [[name.d [typ vars]] env])
51597947::
5160−++ resolve-supported-defs
5161− |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term)]
5162− ^- ienv
7948++$ iresolved [env=ienv grouped=(list term)]
7949++$ iadj (map term (list term))
7950++$ ivisited (map term ?)
7951++$ iwork (list [name=term done=?])
7952++$ iwresult [seen=ivisited order=(list term)]
7953++$ icresult [seen=ivisited component=(list term)]
7954++$ icomponents (list (list term))
7955+++ graph-nameset
7956+ |= [names=(list term) seen=ivisited]
7957+ ^- ivisited
7958+ ?~ names seen
7959+ $(names t.names, seen (~(put by seen) i.names &))
7960+::
7961+++ graph-edges
7962+ |= [name=term graph=iadj]
7963+ ^- (list term)
7964+ =/ found=(unit (list term)) (~(get by graph) name)
7965+ ?~ found ~
7966+ u.found
7967+::
7968+++ graph-make-forward
7969+ |= [ds=(list def) names=ivisited graph=iadj]
7970+ ^- iadj
7971+ ?~ ds graph
7972+ ?. ?=(%value -.i.ds) $(ds t.ds)
7973+ =/ deps=(list term) (dependency-expr val.i.ds)
7974+ =. deps (skim deps |=(n=term ?=(^ (~(get by names) n))))
7975+ $(ds t.ds, graph (~(put by graph) name.i.ds deps))
7976+::
7977+++ graph-add-reverse
7978+ |= [name=term edges=(list term) reverse=iadj]
7979+ ^- iadj
7980+ ?~ edges reverse
7981+ =/ prior=(list term) (graph-edges i.edges reverse)
7982+ $(edges t.edges, reverse (~(put by reverse) i.edges [name prior]))
7983+::
7984+++ graph-reverse
7985+ |= [names=(list term) graph=iadj reverse=iadj]
7986+ ^- iadj
7987+ ?~ names reverse
7988+ =. reverse (graph-add-reverse i.names (graph-edges i.names graph) reverse)
7989+ $(names t.names)
7990+::
7991+++ graph-order
7992+ |= [todo=iwork seen=ivisited order=(list term) graph=iadj]
7993+ ^- iwresult
7994+ ?~ todo [seen order]
7995+ =/ event=[name=term done=?] i.todo
7996+ ?: done.event $(todo t.todo, order [name.event order])
7997+ ?: ?=(^ (~(get by seen) name.event)) $(todo t.todo)
7998+ =. seen (~(put by seen) name.event &)
7999+ =/ children=iwork (turn (graph-edges name.event graph) |=(n=term [n |]))
8000+ $(todo (weld children [[name.event &] t.todo]))
8001+::
8002+++ graph-collect
8003+ |= [todo=(list term) seen=ivisited component=(list term) graph=iadj]
8004+ ^- icresult
8005+ ?~ todo [seen component]
8006+ ?: ?=(^ (~(get by seen) i.todo)) $(todo t.todo)
8007+ =. seen (~(put by seen) i.todo &)
8008+ $(todo (weld (graph-edges i.todo graph) t.todo), component [i.todo component])
8009+::
8010+++ graph-collect-all
8011+ |= [order=(list term) seen=ivisited graph=iadj comps=icomponents]
8012+ ^- icomponents
8013+ ?~ order comps
8014+ ?: ?=(^ (~(get by seen) i.order)) $(order t.order)
8015+ =/ found=icresult (graph-collect ~[i.order] seen ~ graph)
8016+ $(order t.order, seen seen.found, comps [component.found comps])
8017+::
8018+:: Two depth-first passes find components before group inference. Maps
8019+:: preserve the graph identity; duplicate global names fail closed.
8020+++ graph-components
8021+ |= [ds=(list def) names=(list term)]
8022+ ^- icomponents
8023+ =/ nameset=ivisited ~
8024+ =/ pending=(list term) names
8025+ |-
8026+ ?^ pending
8027+ ?: ?=(^ (~(get by nameset) i.pending)) ~
8028+ $(pending t.pending, nameset (~(put by nameset) i.pending &))
8029+ =/ graph=iadj (graph-make-forward ds nameset ~)
8030+ =/ reverse=iadj (graph-reverse names graph ~)
8031+ =/ order=iwresult (graph-order (turn names |=(n=term [n |])) ~ ~ graph)
8032+ (graph-collect-all order.order ~ reverse ~)
8033+::
8034+++ graph-cycle
8035+ |= [component=(list term) graph=iadj]
8036+ ^- ?
8037+ ?~ component |
8038+ ?^ t.component &
8039+ (lien (graph-edges i.component graph) |=(x=term =(x i.component)))
8040+::
8041+++ add-groups
8042+ |= [ds=(list def) components=icomponents graph=iadj env=ienv grouped=(list term) state=istate]
8043+ ^- iresolved
8044+ ?~ components [env grouped]
8045+ =/ component=(list term) i.components
8046+ ?. (graph-cycle component graph) $(components t.components)
8047+ ?: (lien component |=(n=term ?=(^ (ienv-lookup n env)))) $(components t.components)
8048+ =/ members=(list def)
8049+ %+ skim ds
8050+ |= d=def
8051+ &(?=(%value -.d) (lien component |=(n=term =(n name.d))))
8052+ ?. =((lent members) (lent component)) $(components t.components)
8053+ ?. (levy component |=(n=term (unique-value-name n globals.state))) $(components t.components)
8054+ =/ result=ilocal-result (infer-gate-group members env state)
8055+ ?: ?=(%| -.result) $(components t.components)
8056+ $(components t.components, env env.p.result, grouped (weld component grouped))
8057+::
8058+++ resolve-groups
8059+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
8060+ ^- iresolved
51638061 =/ env=ienv ~
8062+ =/ grouped=(list term) ~
8063+ =/ names=(list term) (global-value-names ds)
8064+ =/ nameset=ivisited (graph-nameset names ~)
8065+ =/ graph=iadj (graph-make-forward ds nameset ~)
8066+ =/ components=icomponents (graph-components ds names)
8067+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
51648068 |-
5165− =/ next=ienv (add-supported-defs ds env molds globals externals surs)
5166− ?: =(next env) env
5167− $(env next)
8069+ =/ next=ienv (add-supported-defs ds env molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
8070+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
8071+ =/ out=iresolved (add-groups ds components graph next grouped initial)
8072+ ?: =(env env.out) out
8073+ $(env env.out, grouped grouped.out)
8074+::
8075+++ resolve-supported-defs
8076+ |= [ds=(list def) molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
8077+ ^- ienv
8078+ env:(resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
51688079::
51698080+| %union-analysis
51708081::
@@ -5302,7 +8213,7 @@
53028213 (weld pairs $(cases t.cases))
53038214::
53048215++ show-partial-mold
5305− |= [d=def molds=imolds]
8216+ |= [file=path src=@t d=def molds=imolds]
53068217 ^- @t
53078218 ?> ?=(%mold -.d)
53088219 =/ sh=shape shape.d
@@ -5312,11 +8223,26 @@
53128223 =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
53138224 ?^ overlapping
53148225 =/ p=upair i.overlapping
5315− (crip "+$ {(trip name.d)}: overlapping cases at {(show-loc beg.first.p)} and {(show-loc beg.second.p)}; mold not checked")
8226+ =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
8227+ =/ first=@t (show-error src [file line.beg.first.p col.beg.first.p "first union case"])
8228+ =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
8229+ (of-wain:format ~[summary first second])
53168230 ?: (lien pairs |=(p=upair =(%unknown relation.p)))
53178231 (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
53188232 (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
53198233::
8234+:: +show-inference-diagnostic: a partial report with both source sites
8235+::
8236+++ show-inference-diagnostic
8237+ |= [file=path src=@t name=term diagnostic=idiag]
8238+ ^- @t
8239+ =/ summary=@t (crip "++ {(trip name)}: {msg.diagnostic}")
8240+ =/ excerpts=(list @t)
8241+ %+ turn sites.diagnostic
8242+ |= site=[at=span note=tape]
8243+ (show-error src [file line.beg.at.site col.beg.at.site note.site])
8244+ (of-wain:format [summary excerpts])
8245+::
53208246:: +golden-types: a partial report; it does not claim the module checks
53218247::
53228248++ golden-types
@@ -5333,33 +8259,356 @@
53338259++ golden-types-imports
53348260 |= [file=path src=@t externals=iexternals]
53358261 ^- @t
8262+ (golden-types-with-marks file src externals ~)
8263+::
8264+:: A supplied module is addressed by its logical /ui/.../name/jibb path.
8265+:: Interfaces are closed inference schemes, never raw source shapes.
8266+:: Recursive modules, APIs, derived gates and unsupported definitions do
8267+:: not yield an interface. The reachable graph is checked before the root.
8268+::
8269++$ jsource [at=path source=@t]
8270++$ jbundle (list jsource)
8271++$ jcache (list [at=path iface=ifile])
8272++$ jfile-result (each [iface=ifile cache=jcache] @t)
8273++$ jimports-result (each [resolved=ijimports cache=jcache] @t)
8274+::
8275+++ import-binding-names
8276+ |= imports=(list import)
8277+ ^- (list term)
8278+ ?~ imports ~
8279+ =/ n=term
8280+ ?- -.i.imports
8281+ %jibb face.i.imports
8282+ %sur name.i.imports
8283+ %mark mark.i.imports
8284+ ==
8285+ [n $(imports t.imports)]
8286+::
8287+++ module-scope-valid
8288+ |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
8289+ ^- ?
8290+ =/ imported=(list term) (import-binding-names imports.mod)
8291+ =/ vals=(list term) (global-value-names defs.mod)
8292+ =/ molds=imolds (collect-simple-molds defs.mod)
8293+ =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8294+ ?. %+ levy imported
8295+ |= n=term
8296+ &((unique-value-name n imported) !(lien vals |=(v=term =(n v))) !(lien mold-names |=(m=term =(n m))) !(lien prelude-values |=(v=term =(n v))) !(lien prelude-molds |=(m=term =(n m))))
8297+ |
8298+ ?. (levy vals |=(n=term &((unique-value-name n vals) !(lien prelude-values |=(v=term =(n v)))))) |
8299+ (levy mold-names |=(n=term &((unique-value-name n mold-names) !(lien prelude-molds |=(m=term =(n m))))))
8300+::
8301+++ module-mold-types
8302+ |= [molds=imolds state=istate]
8303+ ^- (each imold-types @t)
8304+ ?~ molds [%& ~]
8305+ =/ m=[name=term body=shape] i.molds
8306+ =/ t=(unit [template=ischeme state=istate])
8307+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
8308+ ?~ t [%| 'module mold needs unsupported inference']
8309+ =. typ.template.u.t (label-direct-union typ.template.u.t body.m name.m state)
8310+ =/ rest=(each imold-types @t) $(molds t.molds)
8311+ ?: ?=(%| -.rest) rest
8312+ [%& [[name.m template.u.t] p.rest]]
8313+::
8314+:: Prepare a provisional interface from the trusted vendored source.
8315+:: Every declared name remains reserved, but only molds and values this
8316+:: fragment can infer are usable. Unsupported bodies are not validated,
8317+:: and imports into the prelude are not supported yet. The fixed origin
8318+:: gives its named unions the same identity in every importing module.
8319+::
8320+:: Recognize only the complete standard prelude list shape. Its recursive
8321+:: tail uses the same parameter and the unqualified list name. The reader
8322+:: verifies Hoon's list provenance before producing the same collection type.
8323+:: The prelude source and reader output are trusted caller inputs.
8324+::
8325+++ standard-prelude-list
8326+ |= sh=shape
8327+ ^- ?
8328+ ?. ?=(%generic -.sh) |
8329+ ?~ vars.sh |
8330+ ?^ t.vars.sh |
8331+ =/ var=@t i.vars.sh
8332+ ?. ?=(%union -.body.sh) |
8333+ =/ cs=(list shape) cases.body.sh
8334+ ?~ cs |
8335+ ?~ t.cs |
8336+ ?^ t.t.cs |
8337+ ?. ?=(%const -.i.cs) |
8338+ ?. =(%null form.lit.i.cs) |
8339+ ?. ?=(%cell -.i.t.cs) |
8340+ =/ fs=(list field) fields.i.t.cs
8341+ ?~ fs |
8342+ ?~ t.fs |
8343+ ?^ t.t.fs |
8344+ ?. ?=(%face -.i.fs) |
8345+ ?. =(%i name.i.fs) |
8346+ ?. ?=(%tvar -.shape.i.fs) |
8347+ ?. =(var name.shape.i.fs) |
8348+ ?. ?=(%face -.i.t.fs) |
8349+ ?. =(%t name.i.t.fs) |
8350+ =/ tail=shape shape.i.t.fs
8351+ ?. ?=(%apply -.tail) |
8352+ ?. =(~[%list] ref.tail) |
8353+ ?~ args.tail |
8354+ ?^ t.args.tail |
8355+ ?. ?=(%tvar -.i.args.tail) |
8356+ =(var name.i.args.tail)
8357+::
8358+++ partial-prelude-molds
8359+ |= [molds=imolds state=istate]
8360+ ^- imold-types
8361+ ?~ molds ~
8362+ =/ m=[name=term body=shape] i.molds
8363+ ?: &(=(at.state /lib/jibb/prelude/jibb) =(%list name.m))
8364+ ?. (standard-prelude-list body.m) $(molds t.molds)
8365+ [[%list [[%collection %list ~[[%var 0]]] ~[0]]] $(molds t.molds)]
8366+ =/ out=(unit [template=ischeme state=istate])
8367+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
8368+ ?~ out $(molds t.molds)
8369+ =. typ.template.u.out (label-direct-union typ.template.u.out body.m name.m state)
8370+ [[name.m template.u.out] $(molds t.molds)]
8371+::
8372+++ partial-prelude-interface
8373+ |= src=@t
8374+ ^- (unit ifile)
8375+ ?: =(0 src) ~
8376+ =/ at=path /lib/jibb/prelude/jibb
8377+ =/ parsed (parse at src)
8378+ ?: ?=(%| -.parsed) ~
8379+ ?^ imports.p.parsed ~
8380+ ?~ defs.p.parsed ~
8381+ ?. (module-scope-valid p.parsed ~ ~) ~
8382+ =/ ds=(list def) defs.p.parsed
8383+ =/ molds=imolds (collect-simple-molds ds)
8384+ =/ names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8385+ =/ globals=(list term) (global-value-names ds)
8386+ :: Remove raw list before inferring any template, so an altered list
8387+ :: cannot leak through an alias. Its name remains reserved either way.
8388+ =/ declared=? (lien names |=(name=term =(%list name)))
8389+ =/ env-molds=imolds molds
8390+ =? env-molds declared
8391+ (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
8392+ =/ reserved=(list term) ?:(declared ~[%list] ~)
8393+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ ~ reserved ~ ~ ~ | at names ~]
8394+ =/ mt=imold-types (partial-prelude-molds molds state)
8395+ =/ partial=ifile [~ mt at]
8396+ =/ env=ienv (resolve-supported-defs ds env-molds globals ~ ~ ~ ~ ~ reserved at `partial)
8397+ `[env mt at]
8398+::
8399++$ iprelude [iface=ifile values=(list term) molds=(list term)]
8400+::
8401+++ prepare-prelude
8402+ |= src=@t
8403+ ^- (unit iprelude)
8404+ =/ iface=(unit ifile) (partial-prelude-interface src)
8405+ ?~ iface ~
8406+ =/ parsed (parse /lib/jibb/prelude/jibb src)
8407+ ?: ?=(%| -.parsed) ~
8408+ =/ vals=(list term) (global-value-names defs.p.parsed)
8409+ =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
8410+ `[u.iface vals ms]
8411+::
8412+++ module-values-complete
8413+ |= [ds=(list def) env=ienv]
8414+ ^- ?
8415+ ?~ ds &
8416+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8417+ ?~ (ienv-lookup name.i.ds env) |
8418+ $(ds t.ds)
8419+::
8420+:: Cache only completed interfaces for this invocation. The source bundle,
8421+:: imported Hoon types and prelude are fixed for the whole graph. Check the
8422+:: active path and duplicate sources before consulting it, so a cache hit
8423+:: cannot hide a cycle or ambiguous source.
8424+::
8425+++ find-jibb-cache
8426+ |= [at=path cache=jcache]
8427+ ^- (unit ifile)
8428+ ?~ cache ~
8429+ ?: =(at at.i.cache) `iface.i.cache
8430+ $(cache t.cache)
8431+::
8432+++ resolve-jibb-imports
8433+ |= [imports=(list import) externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
8434+ ^- jimports-result
8435+ ?~ imports [%& [~ cache]]
8436+ ?. ?=(%jibb -.i.imports) $(imports t.imports)
8437+ =/ at=path (weld path.i.imports `path`~[%jibb])
8438+ ?: (lien active |=(p=path =(p at)))
8439+ [%| (crip "import cycle at {(spud at)}")]
8440+ =/ found=jbundle (skim modules |=(m=jsource =(at at.m)))
8441+ ?~ found [%| (crip "module source missing: {(spud at)}")]
8442+ ?^ t.found [%| (crip "duplicate module sources: {(spud at)}")]
8443+ =/ cached=(unit ifile) (find-jibb-cache at cache)
8444+ =/ iface=jfile-result
8445+ ?^ cached [%& [u.cached cache]]
8446+ (infer-jibb-file at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
8447+ ?: ?=(%| -.iface) [%| p.iface]
8448+ =/ rest=jimports-result $(imports t.imports, cache cache.p.iface)
8449+ ?: ?=(%| -.rest) rest
8450+ [%& [[[face.i.imports iface.p.iface] resolved.p.rest] cache.p.rest]]
8451+::
8452+++ infer-jibb-file
8453+ |= [at=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle active=(list path) prelude-values=(list term) prelude-molds=(list term) cache=jcache prelude=(unit ifile)]
8454+ ^- jfile-result
8455+ ?: ?=([%ui %api *] at) [%| (crip "API module needs unsupported inference: {(spud at)}")]
8456+ =/ parsed (parse at src)
8457+ ?: ?=(%| -.parsed) [%| (crip "module source does not parse: {(spud at)}")]
8458+ =/ mod=module p.parsed
8459+ ?. (module-scope-valid mod prelude-values prelude-molds) [%| (crip "module has conflicting names: {(spud at)}")]
8460+ =/ vals=(list term) (global-value-names defs.mod)
8461+ ?: (lien vals |=(n=term =(n %main)))
8462+ [%| (crip "module kind needs unsupported inference: {(spud at)}")]
8463+ =/ js=jimports-result (resolve-jibb-imports imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
8464+ ?: ?=(%| -.js) [%| p.js]
8465+ =/ molds=imolds (collect-simple-molds defs.mod)
8466+ =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
8467+ =/ surs=(list term) (collect-sur-imports imports.mod)
8468+ =/ marks=(list term) (collect-mark-imports imports.mod)
8469+ =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
8470+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8471+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude]
8472+ =/ mts=(each imold-types @t) (module-mold-types molds state)
8473+ ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
8474+ =/ env=ienv (resolve-supported-defs defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
8475+ ?. (module-values-complete defs.mod env)
8476+ [%| (crip "module definitions need unsupported inference: {(spud at)}")]
8477+ [%& [[env p.mts at] [[at [env p.mts at]] cache.p.js]]]
8478+::
8479+:: +golden-types-with-modules fails closed for imports without prelude
8480+:: scope. +golden-types-with-prelude resolves supported library graphs;
8481+:: its report remains partial and unreachable sources are not examined.
8482+::
8483+++ golden-types-with-modules
8484+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle]
8485+ ^- @t
8486+ =/ parsed (parse file src)
8487+ ?: ?=(%| -.parsed) (show-error src p.parsed)
8488+ ?: (lien imports.p.parsed |=(i=import ?=(%jibb -.i)))
8489+ 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
8490+ (golden-types-with-marks file src externals mark-externals)
8491+::
8492+:: The caller supplies the actual prelude source. Its declared names are
8493+:: reserved, and supported inferred types are made available. The inventory
8494+:: and the checker are incomplete, so this never claims a checked module.
8495+:: Hosts may prepare the same trusted source once and reuse its interface.
8496+::
8497+++ golden-types-with-prelude
8498+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prelude-source=@t]
8499+ ^- @t
8500+ =/ parsed (parse file src)
8501+ ?: ?=(%| -.parsed) (show-error src p.parsed)
8502+ ?: =(0 prelude-source) 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
8503+ =/ prelude (parse /lib/jibb/prelude/jibb prelude-source)
8504+ ?: ?=(%| -.prelude) 'partial inference; module not checked\0aprelude source does not parse; module import inference unsupported'
8505+ =/ prepared=(unit iprelude) (prepare-prelude prelude-source)
8506+ ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
8507+ (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
8508+::
8509+++ golden-types-with-prepared-prelude
8510+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prepared=(unit iprelude)]
8511+ ^- @t
8512+ =/ parsed (parse file src)
8513+ ?: ?=(%| -.parsed) (show-error src p.parsed)
8514+ ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
8515+ =/ prelude-values=(list term) values.u.prepared
8516+ =/ prelude-molds=(list term) molds.u.prepared
8517+ =/ iface=(unit ifile) `iface.u.prepared
8518+ ?. (module-scope-valid p.parsed prelude-values prelude-molds)
8519+ 'partial inference; module not checked\0amodule has conflicting names'
8520+ =/ js=jimports-result
8521+ (resolve-jibb-imports imports.p.parsed externals mark-externals modules ~[file] prelude-values prelude-molds ~ iface)
8522+ ?: ?=(%| -.js) (of-wain:format ~['partial inference; module not checked' p.js])
8523+ =/ scope-values=(list term)
8524+ (weld prelude-values (weld (collect-sur-imports imports.p.parsed) (collect-mark-imports imports.p.parsed)))
8525+ (golden-types-in-context file src externals mark-externals resolved.p.js scope-values prelude-molds iface)
8526+::
8527+:: +golden-types-with-marks: supply declared mark types separately from /sur
8528+:: entries, as [mark result] with the result from +read-mark:jibb-import.
8529+:: Unknown, duplicated, failed and undeclared entries never resolve a mold.
8530+::
8531+:: Callers pass unchanged structured reader results; graph validation
8532+:: remains in the existing bridge, and failures stay available lazily.
8533+++ reader-result-for-checker
8534+ |= result=*
8535+ ^- *
8536+ ?: ?=([%ok *] result) [%& +.result]
8537+ result
8538+::
8539+++ golden-types-with-reader-diagnostics
8540+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals]
8541+ ^- @t
8542+ =/ ex=iexternals
8543+ (turn externals |=(e=[module=term name=term result=*] [module.e name.e (reader-result-for-checker result.e)]))
8544+ =/ mx=imark-externals
8545+ (turn mark-externals |=(e=[mark=term result=*] [mark.e (reader-result-for-checker result.e)]))
8546+ (golden-types-with-marks file src ex mx)
8547+::
8548+++ golden-types-with-marks
8549+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals]
8550+ ^- @t
8551+ (golden-types-in-context file src externals mark-externals ~ ~ ~ ~)
8552+::
8553+++ golden-types-in-context
8554+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals jimports=ijimports prelude-values=(list term) reserved-molds=(list term) prelude=(unit ifile)]
8555+ ^- @t
8556+ =. reserved-molds (weld reserved-molds (turn jimports |=(j=[face=term interface=ifile] face.j)))
53368557 =/ parsed (parse file src)
53378558 ?: ?=(%| -.parsed) (show-error src p.parsed)
53388559 =/ ds=(list def) defs.p.parsed
53398560 =/ molds=imolds (collect-simple-molds ds)
5340− =/ globals=(list term) (global-value-names ds)
8561+ =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
53418562 =/ surs=(list term) (collect-sur-imports imports.p.parsed)
5342− =/ env=ienv (resolve-supported-defs ds molds globals externals surs)
8563+ =/ marks=(list term) (collect-mark-imports imports.p.parsed)
8564+ =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
8565+ =/ env=ienv env.resolution
53438566 =/ lines=(list @t) ~
53448567 |-
53458568 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
53468569 =/ d=def i.ds
53478570 ?: ?=(%mold -.d)
5348− $(ds t.ds, lines [(show-partial-mold d molds) lines])
8571+ $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
53498572 ?. (unique-value-name name.d globals)
53508573 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
5351− =/ result=iresult (infer-fragment val.d env [0 ~ ~ molds globals externals surs ~ |])
8574+ ?: (lien grouped.resolution |=(n=term =(n name.d)))
8575+ =/ found=(unit ischeme) (ienv-lookup name.d env)
8576+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive group unavailable") lines])
8577+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
8578+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
8579+ $(ds t.ds, lines [line lines])
8580+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8581+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude]
8582+ =. initial (reserve-def-caps val.d initial)
8583+ =/ result=iresult
8584+ ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
8585+ (infer-recursive-gate d env initial)
8586+ (infer-fragment val.d env initial)
53528587 ?: ?=(%| -.result)
5353− $(ds t.ds, lines [(crip "++ {(trip name.d)}: {p.result}") lines])
8588+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
8589+ =/ merged=(unit [first=icap second=icap])
8590+ (merged-capitals caps.state.p.result sub.state.p.result)
8591+ ?^ merged
8592+ =/ diag=idiag
8593+ ["distinct type variables `{(trip name.first.u.merged)}` and `{(trip name.second.u.merged)}` must not be forced equal; use the same capital for a shared type" ~[[at.first.u.merged "first type variable"] [at.second.u.merged "second type variable"]]]
8594+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d diag) lines])
53548595 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
53558596 $(ds t.ds, lines [(crip "++ {(trip name.d)}: explicit capital constraints are not supported by partial inference") lines])
5356− =/ typ=itype (itype-normalize typ.p.result sub.state.p.result)
5357− ?: (itype-has-avar typ)
8597+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
8598+ ?: (pending-null tags.state.p.result sub.state.p.result)
8599+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: `~` needs context in partial inference") lines])
8600+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ))
8601+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: tag needs context in partial inference") lines])
8602+ ?: (itype-has-hidden-recursive typ)
8603+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive mold name is not available in this scope") lines])
8604+ ?: (itype-has-hidden-generic typ)
8605+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: generic union name is not available in this scope") lines])
8606+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result)
53588607 $(ds t.ds, lines [(crip "++ {(trip name.d)}: unresolved aura-variable inference") lines])
53598608 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
53608609 ?: (gth (lent vars) 26)
53618610 $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
53628611 =/ printable=itype (canonical-itype typ vars)
5363− =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}")
8612+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
53648613 $(ds t.ds, lines [line lines])
53658614--
jibb-dev/lib/jibb/prelude.jibb+241−4
@@ -37,13 +37,250 @@
3737++ weld |= args=[(list A) (list A)]
3838 ?- args
3939 [xs ys]
40− ?- xs
41− ~ ys
42− [item rest] [item (weld rest ys)]
40+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
4344
4445++ turn |= args=[(list A) $-(A B)]
4546 ?- args
4647 [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
96+
97++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98+
99+++ wonk |= veq=(like A)
100+ ?- q.veq
101+ ~ !!
102+ [~ product] p.product
103+
104++$ lone |$ [A] [p=A]
105+
106++$ lest |$ [A] [i=A t=(list A)]
107+
108++$ pole |$ [A]
109+ ~
110+ [A (pole A)]
111+
112++$ quip |$ [A B] [(list A) B]
113+
114++$ tree |$ [A]
115+ ~
116+ [n=A l=(tree A) r=(tree A)]
117+
118++$ each |$ [A B]
119+ [%| p=B]
120+ [%& p=A]
121+
122++$ bloq @
123+
124+++ some |= item=A `item
125+
126+++ lure |= item=A
127+ ^- (list A) [item ~]
128+
129+++ snoc |= args=[(list A) A]
130+ ?- args
131+ [xs item] (weld xs [item ~])
132+
133+++ flop |= xs=(list A)
134+ ++ reverse-into |= args=[(list A) (list A)]
135+ ?- args
136+ [rest acc]
137+ ?- rest
138+ ~ acc
139+ [item more] (reverse-into more [item acc])
140+ (reverse-into xs ~)
141+
142+++ drop |= maybe=(unit A)
143+ ?- maybe
144+ ~ ~
145+ [~ value] [value ~]
146+
147+++ bind |= args=[(unit A) $-(A B)]
148+ ?- args
149+ [maybe f] ^- (unit B)
150+ ?- maybe
151+ ~ ~
152+ [~ value] `(f value)
153+
154+++ biff |= args=[(unit A) $-(A (unit B))]
155+ ?- args
156+ [maybe f] ^- (unit B)
157+ ?- maybe
158+ ~ ~
159+ [~ value] (f value)
160+
161+++ both |= args=[(unit A) (unit B)]
162+ ?- args
163+ [first second] ^- (unit [A B])
164+ ?- first
165+ ~ ~
166+ [~ a]
167+ ?- second
168+ ~ ~
169+ [~ b] `[a b]
170+
171+++ clap |= args=[(unit A) (unit A) $-([A A] A)]
172+ ?- args
173+ [first second combine]
174+ ?- first
175+ ~ second
176+ [~ a]
177+ ?- second
178+ ~ first
179+ [~ b] `(combine a b)
180+
181+++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
182+ ?- args
183+ [first second combine]
184+ ?- first
185+ ~ ~
186+ [~ a]
187+ ?- second
188+ ~ ~
189+ [~ b] (combine a b)
190+
191+++ skim |= args=[(list A) $-(A ?)]
192+ ?- args
193+ [xs predicate]
194+ ?- xs
195+ ~ ~
196+ [item rest]
197+ ?- (predicate item)
198+ %.y [item (skim rest predicate)]
199+ %.n (skim rest predicate)
200+
201+++ skip |= args=[(list A) $-(A ?)]
202+ ?- args
203+ [xs predicate]
204+ ?- xs
205+ ~ ~
206+ [item rest]
207+ ?- (predicate item)
208+ %.y (skip rest predicate)
209+ %.n [item (skip rest predicate)]
210+
211+++ levy |= args=[(list A) $-(A ?)]
212+ ?- args
213+ [xs predicate]
214+ ?- xs
215+ ~ %.y
216+ [item rest]
217+ ?- (predicate item)
218+ %.y (levy rest predicate)
219+ %.n %.n
220+
221+++ lien |= args=[(list A) $-(A ?)]
222+ ?- args
223+ [xs predicate]
224+ ?- xs
225+ ~ %.n
226+ [item rest]
227+ ?- (predicate item)
228+ %.y %.y
229+ %.n (lien rest predicate)
230+
231+++ roll |= args=[(list A) B $-([A B] B)]
232+ ?- args
233+ [xs start combine]
47234 ?- xs
235+ ~ start
236+ [item rest] (roll rest (combine item start) combine)
237+
238+++ reel |= args=[(list A) B $-([A B] B)]
239+ ?- args
240+ [xs start combine]
241+ ?- xs
242+ ~ start
243+ [item rest] (combine item (reel rest start combine))
244+
245+++ flit |= predicate=$-(A ?)
246+ |= value=A
247+ ^- (unit A)
248+ ?- (predicate value)
249+ %.y `value
250+ %.n ~
251+
252+++ murn |= args=[(list A) $-(A (unit B))]
253+ ?- args
254+ [xs f]
255+ ?- xs
256+ ~ ~
257+ [item rest]
258+ ?- (f item)
259+ ~ (murn rest f)
260+ [~ value] [value (murn rest f)]
261+
262+++ join |= args=[A (list A)]
263+ ?- args
264+ [separator xs]
265+ ?- xs
266+ ~ ~
267+ [item rest]
268+ ?- rest
269+ ~ [item ~]
270+ [next more] [item [separator (join separator rest)]]
271+
272+++ snip |= xs=(list A)
273+ ?- xs
274+ ~ ~
275+ [item rest]
276+ ?- rest
48277 ~ ~
49− [item rest] [(f item) (turn rest f)]
278+ [next more] [item (snip rest)]
279+
280+++ rear |= xs=(list A)
281+ ?- xs
282+ ~ !!
283+ [item rest]
284+ ?- rest
285+ ~ item
286+ [next more] (rear rest)
my-app/mar/label.hoonnew file+6
@@ -0,0 +1,6 @@
1+:: Fixture for the Hoon mark importer; not supplied by the design doc.
2+|_ a=@t
3+++ grab |% ++ noun @t --
4+++ grow |% ++ noun a --
5+++ grad %noun
6+--
my-app/sur/blog.hoon+3−1
@@ -1,4 +1,6 @@
11:: Fixture for the documented examples; not supplied by the design doc.
22|%
3−+$ post [title=@t slug=@ta]
3++$ title @t
4++$ post [title=title slug=@ta]
5++$ chain $@(~ [value=@ud next=chain])
46--
my-app/sur/import-fixture.hoonnew file+7
@@ -0,0 +1,7 @@
1+/- blog
2+:: Fixture for the Hoon importer; not supplied by the design doc.
3+|%
4++$ sample [title=title:blog values=(list @ud)]
5++$ recursive chain:blog
6++$ nested [id=@ud value=$^(@ud [a=@ud b=@t])]
7+--
tests/clay-fixtures/bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ identity: $-(@t @t)'
tests/clay-fixtures/bridge.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ bc=type -.blog
8+=/ title-typ=type (~(play ut bc) (ream '*title'))
9+=/ read-gate=vase (slap reader (ream 'read-mold-in'))
10+=/ title-result=vase (slym read-gate [%blog %title title-typ bc])
11+=/ title=* +.title-result
12+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
13+=/ src=@t '/- blog\0a++ identity |= x=title.blog x\0a'
14+(pure:m (slym check-gate [/ui/test/jibb src ~[[%blog %title title]]]))
tests/clay-fixtures/ford-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y %.y]
tests/clay-fixtures/ford-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"[title=@t values=(list @ud)]"
tests/clay-fixtures/ford-import.txtnew file+12
@@ -0,0 +1,12 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ cor=type -.src
7+=/ typ=type (~(play ut cor) (ream '*sample'))
8+=/ read-gate=vase (slap reader (ream 'read-mold-in'))
9+=/ got=vase (slym read-gate [%import-fixture %sample typ cor])
10+=/ show-gate=vase (slap reader (ream 'show-result'))
11+=/ result=vase (slym show-gate +.got)
12+(pure:m result)
tests/clay-fixtures/ford-nested-union-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ value: $-([id=@ud value=([a=@ud b=@t] @ud)] ([a=@ud b=@t] @ud))\0a++ values: $-([title=@t values=(list @ud)] (list @ud))\0a++ chain: $-(chain.blog chain.blog)'
tests/clay-fixtures/ford-nested-union-bridge.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
6+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
7+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
8+=/ read-gate=vase (slap reader (ream 'read-named'))
9+=/ result=vase (slym read-gate [%import-fixture %nested -.src])
10+=/ sample-result=vase (slym read-gate [%import-fixture %sample -.src])
11+=/ chain-result=vase (slym read-gate [%blog %chain -.blog])
12+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
13+=/ text=@t '/- import-fixture\0a/- blog\0a++ value |= x=nested.import-fixture value.x\0a++ values |= x=sample.import-fixture values.x\0a++ chain |= x=chain.blog x\0a'
14+(pure:m (slym check-gate [/ui/test/jibb text ~[[%import-fixture %nested +.result] [%import-fixture %sample +.sample-result] [%blog %chain +.chain-result]]]))
tests/clay-fixtures/ford-nested-union-expected.txtnew file+1
@@ -0,0 +1 @@
1+"[id=@ud value=(union [a=@ud b=@t] @ud)]"
tests/clay-fixtures/ford-nested-union.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ got=vase (slym read-gate [%import-fixture %nested -.src])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/ford-recursive-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [value=@ud next=chain.blog] @n:0)"
tests/clay-fixtures/ford-recursive.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-named'))
7+=/ got=vase (slym read-gate [%import-fixture %recursive -.src])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/ford.txtnew file+13
@@ -0,0 +1,13 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ src=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/import-fixture/hoon)
5+=/ cor=type -.src
6+?. ?=([%core *] cor) (pure:m !>('not a core'))
7+=/ subject=type q.q.cor
8+=/ cell=? ?=([%cell *] subject)
9+=/ face=? ?=([%cell [%face %blog *] *] subject)
10+=/ core=? ?=([%cell [%face %blog [%core *]] *] subject)
11+=/ tail=? ?:(?=([%cell *] subject) =(q.subject -:!>(..zuse)) |)
12+=/ payload=? =(p.cor subject)
13+(pure:m !>([cell face core tail payload]))
tests/clay-fixtures/import-expected.txtnew file+5
@@ -0,0 +1,5 @@
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+ '@t'
5+]
tests/clay-fixtures/import.txtnew file+13
@@ -0,0 +1,13 @@
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+=/ title (read-mold-in:reader %blog %title (~(play ut bc) (ream '*title')) bc)
13+(pure:m !>([(crip (show-result:reader item)) (crip (show-result:reader action)) (crip (show-result:reader post)) (crip (show-result:reader title))]))
tests/clay-fixtures/mark-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ identity: $-(@t @t)'
tests/clay-fixtures/mark-bridge.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/label/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ read-gate=vase (slap reader (ream 'read-mark'))
8+=/ label-result=vase (slym read-gate [%label -.mark])
9+=/ check-gate=vase (slap jibb (ream 'golden-types-with-marks'))
10+=/ src=@t '/% %label\0a++ identity |= x=label x\0a'
11+(pure:m (slym check-gate [/ui/test/jibb src ~ ~[[%label +.label-result]]]))
tests/clay-fixtures/mark-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [add text=@t] [toggle id=@ud])"
tests/clay-fixtures/mark-import.txtnew file+9
@@ -0,0 +1,9 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ read-gate=vase (slap reader (ream 'read-mark'))
7+=/ got=vase (slym read-gate [%todo-action -.mark])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/mark-shape-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y %.y]
tests/clay-fixtures/mark-shape.txtnew file+14
@@ -0,0 +1,14 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ mark=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/mar/todo-action/hoon)
5+=/ cor=type -.mark
6+?. ?=([%core *] cor) (pure:m !>('not a core'))
7+=/ payload=type p.cor
8+?. ?=([%cell *] payload) (pure:m !>('payload is not a cell'))
9+=/ tail=type q.payload
10+=/ face=? ?=([%face %a *] p.payload)
11+=/ same=? =(payload q.q.cor)
12+=/ imported=? ?=([%cell [%face %todo [%core *]] *] tail)
13+=/ zuse=? ?:(?=([%cell *] tail) =(q.tail -:!>(..zuse)) |)
14+(pure:m !>([face same imported zuse]))
tests/clay-fixtures/record-bridge-expected.txtnew file+1
@@ -0,0 +1 @@
1+'partial inference; module not checked\0a++ title: $-([title=@t slug=@ta] @t)'
tests/clay-fixtures/record-bridge.txtnew file+11
@@ -0,0 +1,11 @@
1+=/ m (strand ,vase)
2+;< =bowl:spider bind:m get-bowl
3+=/ now=@da now.bowl
4+=/ blog=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/sur/blog/hoon)
5+=/ reader=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb-import/hoon)
6+=/ jibb=vase .^(vase %ca /[(scot %p our.bowl)]/my-app/[(scot %da now)]/lib/jibb/hoon)
7+=/ read-gate=vase (slap reader (ream 'read-named'))
8+=/ post-result=vase (slym read-gate [%blog %post -.blog])
9+=/ check-gate=vase (slap jibb (ream 'golden-types-imports'))
10+=/ src=@t '/- blog\0a++ title |= x=post.blog title.x\0a'
11+(pure:m (slym check-gate [/ui/test/jibb src ~[[%blog %post +.post-result]]]))
tests/golden/doc-grammar-04-step/about.txt+1
@@ -1,3 +1,4 @@
11source: Grammar tab, section "Patterns", code block 4 of the tab
22tests: a union `+$ step` with one case per deeper line: cells with tags at the head, in the middle and at the end, faced fields, and a bare term; a blank line between definitions; a `?-` whose arms are cell patterns mixing tags and binding names, and a bare term, with their expressions aligned by extra spaces; interpolated strings and a name as arm expressions
33expect: parses
4+expect-types: a partial inference report
tests/golden/doc-grammar-04-step/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/doc-grammar-04-step/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2++$ step: cases proven disjoint; mold not checked
3+++ describe: $-(step @t)
tests/golden/doc-grammar-06-cart-store/about.txt+1
@@ -1,3 +1,4 @@
11source: Grammar tab, section "Example: a store and an island", code block 6 of the tab (block 5 is the EBNF)
22tests: a store module: a record mold with a mold application and the loobean mold `?`; a union with its cases below; a mold that is a name; a blank line; `++ main (store init update)`; a cast with its mold and expression on one line, `^- state [~ %.n]`; a gate with a cell sample; `?-` arms whose expressions are changes, `s(items=[item items.s])` and `s(open=(not open.s))`
33expect: parses
4+expect-types: a partial inference report
tests/golden/doc-grammar-06-cart-store/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/doc-grammar-06-cart-store/types.txtnew file+7
@@ -0,0 +1,7 @@
1+partial inference; module not checked
2++$ state: not checked
3++$ cart-action: cases proven disjoint; mold not checked
4++$ poke: not checked
5+++ main: name is not available to partial inference
6+++ init: [items=(list @t) open=?]
7+++ update: $-([a=cart-action s=[items=(list @t) open=?]] [items=(list @t) open=?])
tests/golden/module-cache-dag/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module and import cycles are errors.
2+tests: A shared acyclic graph imports each library twice under distinct faces; the reachable identity still infers.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-cache-dag/module-trees.txtnew file+46
@@ -0,0 +1,46 @@
1+/ui/n0.jibb
2+(module
3+ (jibb 1:1 left /ui/n1)
4+ (jibb 2:1 right /ui/n1)
5+ (value 3:1 id
6+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
7+/ui/n1.jibb
8+(module
9+ (jibb 1:1 left /ui/n2)
10+ (jibb 2:1 right /ui/n2)
11+ (value 3:1 id
12+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
13+/ui/n2.jibb
14+(module
15+ (jibb 1:1 left /ui/n3)
16+ (jibb 2:1 right /ui/n3)
17+ (value 3:1 id
18+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
19+/ui/n3.jibb
20+(module
21+ (jibb 1:1 left /ui/n4)
22+ (jibb 2:1 right /ui/n4)
23+ (value 3:1 id
24+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
25+/ui/n4.jibb
26+(module
27+ (jibb 1:1 left /ui/n5)
28+ (jibb 2:1 right /ui/n5)
29+ (value 3:1 id
30+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
31+/ui/n5.jibb
32+(module
33+ (jibb 1:1 left /ui/n6)
34+ (jibb 2:1 right /ui/n6)
35+ (value 3:1 id
36+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
37+/ui/n6.jibb
38+(module
39+ (jibb 1:1 left /ui/n7)
40+ (jibb 2:1 right /ui/n7)
41+ (value 3:1 id
42+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
43+/ui/n7.jibb
44+(module
45+ (value 1:1 id
46+ (gate-wide 1:7 (bind 1:10 x) (wing 1:12 x))))
tests/golden/module-cache-dag/modules.txtnew file+8
@@ -0,0 +1,8 @@
1+/ui/n0.jibb
2+/ui/n1.jibb
3+/ui/n2.jibb
4+/ui/n3.jibb
5+/ui/n4.jibb
6+/ui/n5.jibb
7+/ui/n6.jibb
8+/ui/n7.jibb
tests/golden/module-cache-dag/modules/ui/n0.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n1
2+/= right /ui/n1
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n1.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n2
2+/= right /ui/n2
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n2.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n3
2+/= right /ui/n3
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n3.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n4
2+/= right /ui/n4
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n4.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n5
2+/= right /ui/n5
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n5.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n6
2+/= right /ui/n6
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n6.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= left /ui/n7
2+/= right /ui/n7
3+++ id |=(x x)
tests/golden/module-cache-dag/modules/ui/n7.jibbnew file+1
@@ -0,0 +1 @@
1+++ id |=(x x)
tests/golden/module-cache-dag/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= a /ui/n0
2+++ value (id.a "hi")
tests/golden/module-cache-dag/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name a
3+1:7 glyph /
4+1:8 tight knot ui
5+1:10 tight glyph /
6+1:11 tight knot n0
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name value
10+2:10 glyph (
11+2:11 tight wing id.a
12+2:16 str "hi"
13+2:20 tight glyph )
14+2:21 NEWLINE
tests/golden/module-cache-dag/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 a /ui/n0)
3+ (value 2:1 value
4+ (group 2:10
5+ (call 2:11 (wing 2:11 id.a) (str 2:16 "hi")))))
tests/golden/module-cache-dag/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ value: @t
tests/golden/module-cache-faces/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Imports: "Import cycles are errors".
2+tests: The same library reached under two faces has independently instantiated identity schemes.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-cache-faces/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/shared.jibb
2+(module
3+ (value 1:1 id
4+ (gate-wide 1:7 (bind 1:10 x) (wing 1:12 x))))
tests/golden/module-cache-faces/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/shared.jibb
tests/golden/module-cache-faces/modules/ui/shared.jibbnew file+1
@@ -0,0 +1 @@
1+++ id |=(x x)
tests/golden/module-cache-faces/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/= first /ui/shared
2+/= second /ui/shared
3+++ ship (id.first ~zod)
4+++ text-value (id.second "hi")
tests/golden/module-cache-faces/tokens.txtnew file+28
@@ -0,0 +1,28 @@
1+1:1 glyph /=
2+1:5 name first
3+1:11 glyph /
4+1:12 tight knot ui
5+1:14 tight glyph /
6+1:15 tight knot shared
7+2:1 NEWLINE
8+2:1 glyph /=
9+2:5 name second
10+2:12 glyph /
11+2:13 tight knot ui
12+2:15 tight glyph /
13+2:16 tight knot shared
14+3:1 NEWLINE
15+3:1 glyph ++
16+3:4 name ship
17+3:9 glyph (
18+3:10 tight wing id.first
19+3:19 lit ~zod
20+3:23 tight glyph )
21+4:1 NEWLINE
22+4:1 glyph ++
23+4:4 name text-value
24+4:15 glyph (
25+4:16 tight wing id.second
26+4:26 str "hi"
27+4:30 tight glyph )
28+4:31 NEWLINE
tests/golden/module-cache-faces/tree.txtnew file+9
@@ -0,0 +1,9 @@
1+(module
2+ (jibb 1:1 first /ui/shared)
3+ (jibb 2:1 second /ui/shared)
4+ (value 3:1 ship
5+ (group 3:9
6+ (call 3:10 (wing 3:10 id.first) (lit 3:19 ~zod))))
7+ (value 4:1 text-value
8+ (group 4:15
9+ (call 4:16 (wing 4:16 id.second) (str 4:26 "hi")))))
tests/golden/module-cache-faces/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ ship: @p
3+++ text-value: @t
tests/golden/module-cache-incomplete/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Imports: "Import cycles are errors".
2+tests: A shared library with a recursive mold, which partial inference does not yet support, yields no interface even though one value could be inferred.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-cache-incomplete/module-trees.txtnew file+8
@@ -0,0 +1,8 @@
1+/ui/bad.jibb
2+(module
3+ (mold 1:1 recursive
4+ (cell 1:14
5+ (face 1:15 next (ref 1:20 recursive))
6+ (face 1:30 value (aura 1:36 @t))))
7+ (value 2:1 id
8+ (gate-wide 2:7 (bind 2:10 x) (wing 2:12 x))))
tests/golden/module-cache-incomplete/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/bad.jibb
tests/golden/module-cache-incomplete/modules/ui/bad.jibbnew file+2
@@ -0,0 +1,2 @@
1++$ recursive [next=recursive value=@t]
2+++ id |=(x x)
tests/golden/module-cache-incomplete/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= first /ui/bad
2+/= second /ui/bad
3+++ result (id.first "hi")
tests/golden/module-cache-incomplete/tokens.txtnew file+21
@@ -0,0 +1,21 @@
1+1:1 glyph /=
2+1:5 name first
3+1:11 glyph /
4+1:12 tight knot ui
5+1:14 tight glyph /
6+1:15 tight knot bad
7+2:1 NEWLINE
8+2:1 glyph /=
9+2:5 name second
10+2:12 glyph /
11+2:13 tight knot ui
12+2:15 tight glyph /
13+2:16 tight knot bad
14+3:1 NEWLINE
15+3:1 glyph ++
16+3:4 name result
17+3:11 glyph (
18+3:12 tight wing id.first
19+3:21 str "hi"
20+3:25 tight glyph )
21+3:26 NEWLINE
tests/golden/module-cache-incomplete/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (jibb 1:1 first /ui/bad)
3+ (jibb 2:1 second /ui/bad)
4+ (value 3:1 result
5+ (group 3:11
6+ (call 3:12 (wing 3:12 id.first) (str 3:21 "hi")))))
tests/golden/module-cache-incomplete/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module mold needs unsupported inference: /ui/bad/jibb
tests/golden/module-cache-sibling-cycle/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Imports: "Import cycles are errors".
2+tests: A cycle reached after a previously checked sibling dependency is still reported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-cache-sibling-cycle/module-trees.txtnew file+15
@@ -0,0 +1,15 @@
1+/ui/safe.jibb
2+(module
3+ (value 1:1 id
4+ (gate-wide 1:7 (bind 1:10 x) (wing 1:12 x))))
5+/ui/a.jibb
6+(module
7+ (jibb 1:1 shared /ui/safe)
8+ (jibb 2:1 next /ui/b)
9+ (value 3:1 id
10+ (gate-wide 3:7 (bind 3:10 x) (wing 3:12 x))))
11+/ui/b.jibb
12+(module
13+ (jibb 1:1 back /ui/a)
14+ (value 2:1 id
15+ (gate-wide 2:7 (bind 2:10 x) (wing 2:12 x))))
tests/golden/module-cache-sibling-cycle/modules.txtnew file+3
@@ -0,0 +1,3 @@
1+/ui/safe.jibb
2+/ui/a.jibb
3+/ui/b.jibb
tests/golden/module-cache-sibling-cycle/modules/ui/a.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= shared /ui/safe
2+/= next /ui/b
3+++ id |=(x x)
tests/golden/module-cache-sibling-cycle/modules/ui/b.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= back /ui/a
2+++ id |=(x x)
tests/golden/module-cache-sibling-cycle/modules/ui/safe.jibbnew file+1
@@ -0,0 +1 @@
1+++ id |=(x x)
tests/golden/module-cache-sibling-cycle/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= first /ui/safe
2+/= second /ui/a
3+++ result 1
tests/golden/module-cache-sibling-cycle/tokens.txtnew file+18
@@ -0,0 +1,18 @@
1+1:1 glyph /=
2+1:5 name first
3+1:11 glyph /
4+1:12 tight knot ui
5+1:14 tight glyph /
6+1:15 tight knot safe
7+2:1 NEWLINE
8+2:1 glyph /=
9+2:5 name second
10+2:12 glyph /
11+2:13 tight knot ui
12+2:15 tight glyph /
13+2:16 tight knot a
14+3:1 NEWLINE
15+3:1 glyph ++
16+3:4 name result
17+3:11 lit 1
18+3:12 NEWLINE
tests/golden/module-cache-sibling-cycle/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (jibb 1:1 first /ui/safe)
3+ (jibb 2:1 second /ui/a)
4+ (value 3:1 result (lit 3:11 1)))
tests/golden/module-cache-sibling-cycle/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+import cycle at /ui/a/jibb
tests/golden/module-fixture-eof/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Modules: `+$` takes a mold on its line or its cases on the lines below.
2+tests: The root module parses. The supplied module fixture ends without a newline after `+$ x`; both runners preserve those bytes and report the fixture's missing mold at the same location.
3+expect: parses; the fixture's tree is an error at its end of file
tests/golden/module-fixture-eof/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/incomplete.jibb
2+/ui/incomplete.jibb:1:5: expected a mold, on its line or a deeper one, found the end of the file
3++$ x
4+ ^
tests/golden/module-fixture-eof/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/incomplete.jibb
tests/golden/module-fixture-eof/modules/ui/incomplete.jibbnew file+1
@@ -0,0 +1 @@
1++$ x
tests/golden/module-fixture-eof/source.jibbnew file+1
@@ -0,0 +1 @@
1+++ main 1
tests/golden/module-fixture-eof/tokens.txtnew file+4
@@ -0,0 +1,4 @@
1+1:1 glyph ++
2+1:4 name main
3+1:9 lit 1
4+1:10 NEWLINE
tests/golden/module-fixture-eof/tree.txtnew file+2
@@ -0,0 +1,2 @@
1+(module
2+ (value 1:1 main (lit 1:9 1)))
tests/golden/module-import-atom-scheme/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; type variables are generalized per `++`.
2+tests: An exported atom-constrained gate re-exported by an intermediate module is instantiated independently for @p and @t and rejects a cell.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-atom-scheme/module-trees.txtnew file+13
@@ -0,0 +1,13 @@
1+/ui/mid.jibb
2+(module
3+ (jibb 1:1 base /ui/base)
4+ (value 2:1 alias (wing 2:10 keep.base)))
5+/ui/base.jibb
6+(module
7+ (value 1:1 keep
8+ (gate 1:9
9+ (bind 1:12 x)
10+ (body 2:3
11+ (trace 2:3
12+ (cast 2:6 (aura 2:9 @) (wing 2:11 x))
13+ (body 3:5 (wing 3:5 x)))))))
tests/golden/module-import-atom-scheme/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/mid.jibb
2+/ui/base.jibb
tests/golden/module-import-atom-scheme/modules/ui/base.jibbnew file+3
@@ -0,0 +1,3 @@
1+++ keep |= x
2+ ~& ^- @ x
3+ x
tests/golden/module-import-atom-scheme/modules/ui/mid.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= base /ui/base
2+++ alias keep.base
tests/golden/module-import-atom-scheme/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/= mid /ui/mid
2+++ ship (alias.mid ~zod)
3+++ text-value (alias.mid "hello")
4+++ bad (alias.mid [~zod "hi"])
tests/golden/module-import-atom-scheme/tokens.txtnew file+31
@@ -0,0 +1,31 @@
1+1:1 glyph /=
2+1:5 name mid
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot mid
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name ship
10+2:9 glyph (
11+2:10 tight wing alias.mid
12+2:20 lit ~zod
13+2:24 tight glyph )
14+3:1 NEWLINE
15+3:1 glyph ++
16+3:4 name text-value
17+3:15 glyph (
18+3:16 tight wing alias.mid
19+3:26 str "hello"
20+3:33 tight glyph )
21+4:1 NEWLINE
22+4:1 glyph ++
23+4:4 name bad
24+4:8 glyph (
25+4:9 tight wing alias.mid
26+4:19 glyph [
27+4:20 tight lit ~zod
28+4:25 str "hi"
29+4:29 tight glyph ]
30+4:30 tight glyph )
31+4:31 NEWLINE
tests/golden/module-import-atom-scheme/tree.txtnew file+13
@@ -0,0 +1,13 @@
1+(module
2+ (jibb 1:1 mid /ui/mid)
3+ (value 2:1 ship
4+ (group 2:9
5+ (call 2:10 (wing 2:10 alias.mid) (lit 2:20 ~zod))))
6+ (value 3:1 text-value
7+ (group 3:15
8+ (call 3:16 (wing 3:16 alias.mid) (str 3:26 "hello"))))
9+ (value 4:1 bad
10+ (group 4:8
11+ (call 4:9
12+ (wing 4:9 alias.mid)
13+ (tuple 4:19 (lit 4:20 ~zod) (str 4:25 "hi"))))))
tests/golden/module-import-atom-scheme/types.txtnew file+10
@@ -0,0 +1,10 @@
1+partial inference; module not checked
2+++ ship: @p
3+++ text-value: @t
4+++ bad: call's sample and argument types do not unify
5+/tests/golden/module-import-atom-scheme/source.jibb:4:9: called gate has type $-(A A) where A is an atom
6+++ bad (alias.mid [~zod "hi"])
7+ ^
8+/tests/golden/module-import-atom-scheme/source.jibb:4:19: argument has type [@p @t]
9+++ bad (alias.mid [~zod "hi"])
10+ ^
tests/golden/module-import-cycle/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A cycle between supplied modules is reported without recursing forever.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-cycle/module-trees.txtnew file+16
@@ -0,0 +1,16 @@
1+/ui/a.jibb
2+(module
3+ (jibb 1:1 b /ui/b)
4+ (value 2:1 identity
5+ (gate-wide 2:13
6+ (bind 2:16 x)
7+ (group 2:18
8+ (call 2:19 (wing 2:19 identity.b) (wing 2:30 x))))))
9+/ui/b.jibb
10+(module
11+ (jibb 1:1 a /ui/a)
12+ (value 2:1 identity
13+ (gate-wide 2:13
14+ (bind 2:16 x)
15+ (group 2:18
16+ (call 2:19 (wing 2:19 identity.a) (wing 2:30 x))))))
tests/golden/module-import-cycle/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/a.jibb
2+/ui/b.jibb
tests/golden/module-import-cycle/modules/ui/a.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= b /ui/b
2+++ identity |=(x (identity.b x))
tests/golden/module-import-cycle/modules/ui/b.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= a /ui/a
2+++ identity |=(x (identity.a x))
tests/golden/module-import-cycle/path.txtnew file+1
@@ -0,0 +1 @@
1+/ui/main.jibb
tests/golden/module-import-cycle/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= a /ui/a
2+++ text (identity.a "hi")
tests/golden/module-import-cycle/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name a
3+1:7 glyph /
4+1:8 tight knot ui
5+1:10 tight glyph /
6+1:11 tight knot a
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name text
10+2:9 glyph (
11+2:10 tight wing identity.a
12+2:21 str "hi"
13+2:25 tight glyph )
14+2:26 NEWLINE
tests/golden/module-import-cycle/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 a /ui/a)
3+ (value 2:1 text
4+ (group 2:9
5+ (call 2:10 (wing 2:10 identity.a) (str 2:21 "hi")))))
tests/golden/module-import-cycle/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+import cycle at /ui/a/jibb
tests/golden/module-import-empty/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: An explicit empty source bundle reports the missing imported module.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-empty/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/module-import-empty/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ x (identity.lib "hi")
tests/golden/module-import-empty/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name x
10+2:6 glyph (
11+2:7 tight wing identity.lib
12+2:20 str "hi"
13+2:24 tight glyph )
14+2:25 NEWLINE
tests/golden/module-import-empty/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 x
4+ (group 2:6
5+ (call 2:7 (wing 2:7 identity.lib) (str 2:20 "hi")))))
tests/golden/module-import-empty/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module source missing: /ui/lib/jibb
tests/golden/module-import-face-shadow/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; type variables are generalized per `++`.
2+tests: A body-local mold cannot shadow an imported module face.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-face-shadow/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 identity
4+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
tests/golden/module-import-face-shadow/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-face-shadow/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-face-shadow/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/= lib /ui/lib
2+++ f |= x
3+ +$ lib @t
4+ x
tests/golden/module-import-face-shadow/tokens.txtnew file+19
@@ -0,0 +1,19 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name f
10+2:6 glyph |=
11+2:9 name x
12+3:3 INDENT
13+3:3 glyph +$
14+3:6 name lib
15+3:10 aura @t
16+4:3 NEWLINE
17+4:3 name x
18+4:4 DEDENT
19+4:4 NEWLINE
tests/golden/module-import-face-shadow/tree.txtnew file+8
@@ -0,0 +1,8 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 f
4+ (gate 2:6
5+ (bind 2:9 x)
6+ (body 3:3
7+ (mold 3:3 lib (aura 3:10 @t))
8+ (wing 4:3 x)))))
tests/golden/module-import-face-shadow/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ f: local molds shadow a name
tests/golden/module-import-identity/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: An imported identity is instantiated independently for a cord and a ship.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-identity/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 identity
4+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
tests/golden/module-import-identity/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-identity/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-identity/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= lib /ui/lib
2+++ text (identity.lib "hi")
3+++ ship (identity.lib ~zod)
tests/golden/module-import-identity/tokens.txtnew file+21
@@ -0,0 +1,21 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name text
10+2:9 glyph (
11+2:10 tight wing identity.lib
12+2:23 str "hi"
13+2:27 tight glyph )
14+3:1 NEWLINE
15+3:1 glyph ++
16+3:4 name ship
17+3:9 glyph (
18+3:10 tight wing identity.lib
19+3:23 lit ~zod
20+3:27 tight glyph )
21+3:28 NEWLINE
tests/golden/module-import-identity/tree.txtnew file+8
@@ -0,0 +1,8 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 text
4+ (group 2:9
5+ (call 2:10 (wing 2:10 identity.lib) (str 2:23 "hi"))))
6+ (value 3:1 ship
7+ (group 3:9
8+ (call 3:10 (wing 3:10 identity.lib) (lit 3:23 ~zod)))))
tests/golden/module-import-identity/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ text: @t
3+++ ship: @p
tests/golden/module-import-invalid/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A malformed imported module is reported at its logical path.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-invalid/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+/ui/lib.jibb:1:10: expected a mold, on its line or a deeper one, found the end of the file
3++$ broken
4+ ^
tests/golden/module-import-invalid/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-invalid/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1++$ broken
tests/golden/module-import-invalid/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ x (identity.lib "hi")
tests/golden/module-import-invalid/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name x
10+2:6 glyph (
11+2:7 tight wing identity.lib
12+2:20 str "hi"
13+2:24 tight glyph )
14+2:25 NEWLINE
tests/golden/module-import-invalid/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 x
4+ (group 2:6
5+ (call 2:7 (wing 2:7 identity.lib) (str 2:20 "hi")))))
tests/golden/module-import-invalid/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module source does not parse: /ui/lib/jibb
tests/golden/module-import-missing-member/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A missing member of a supplied module is reported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-missing-member/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 identity
4+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
tests/golden/module-import-missing-member/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-missing-member/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-missing-member/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ x (absent.lib "hi")
tests/golden/module-import-missing-member/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name x
10+2:6 glyph (
11+2:7 tight wing absent.lib
12+2:18 str "hi"
13+2:22 tight glyph )
14+2:23 NEWLINE
tests/golden/module-import-missing-member/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 x
4+ (group 2:6
5+ (call 2:7 (wing 2:7 absent.lib) (str 2:18 "hi")))))
tests/golden/module-import-missing-member/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ x: module member is not available to partial inference
tests/golden/module-import-mold/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A simple named mold exported by an imported module is used in a sample.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-mold/module-trees.txtnew file+3
@@ -0,0 +1,3 @@
1+/ui/lib.jibb
2+(module
3+ (mold 1:1 title (aura 1:10 @t)))
tests/golden/module-import-mold/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-mold/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1++$ title @t
tests/golden/module-import-mold/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ identity |= x=title.lib x
tests/golden/module-import-mold/tokens.txtnew file+15
@@ -0,0 +1,15 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name identity
10+2:13 glyph |=
11+2:16 name x
12+2:17 tight glyph =
13+2:18 tight wing title.lib
14+2:28 name x
15+2:29 NEWLINE
tests/golden/module-import-mold/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 identity
4+ (gate 2:13
5+ (face 2:16 x (ref 2:18 title.lib))
6+ (wing 2:28 x))))
tests/golden/module-import-mold/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ identity: $-(@t @t)
tests/golden/module-import-prelude-cross-namespace/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; molds and values have separate namespaces.
2+tests: A value may share the prelude mold `list` name because the namespaces are separate.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-prelude-cross-namespace/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/module-import-prelude-cross-namespace/source.jibbnew file+1
@@ -0,0 +1 @@
1+++ list |=(x x)
tests/golden/module-import-prelude-cross-namespace/tokens.txtnew file+7
@@ -0,0 +1,7 @@
1+1:1 glyph ++
2+1:4 name list
3+1:9 glyph |=(
4+1:12 tight name x
5+1:14 name x
6+1:15 tight glyph )
7+1:16 NEWLINE
tests/golden/module-import-prelude-cross-namespace/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (value 1:1 list
3+ (gate-wide 1:9 (bind 1:12 x) (wing 1:14 x))))
tests/golden/module-import-prelude-cross-namespace/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ list: $-(A A)
tests/golden/module-import-prelude-mold-shadow/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; molds and values have separate namespaces.
2+tests: A root mold cannot shadow the prelude mold `list`, even with no imports.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-prelude-mold-shadow/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no modules
tests/golden/module-import-prelude-mold-shadow/source.jibbnew file+2
@@ -0,0 +1,2 @@
1++$ list @t
2+++ x 1
tests/golden/module-import-prelude-mold-shadow/tokens.txtnew file+8
@@ -0,0 +1,8 @@
1+1:1 glyph +$
2+1:4 name list
3+1:9 aura @t
4+2:1 NEWLINE
5+2:1 glyph ++
6+2:4 name x
7+2:6 lit 1
8+2:7 NEWLINE
tests/golden/module-import-prelude-mold-shadow/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (mold 1:1 list (aura 1:9 @t))
3+ (value 2:1 x (lit 2:6 1)))
tests/golden/module-import-prelude-mold-shadow/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module has conflicting names
tests/golden/module-import-prelude-sample-shadow/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; molds and values have separate namespaces.
2+tests: A gate sample cannot shadow the prelude value `same`.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-prelude-sample-shadow/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 identity
4+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
tests/golden/module-import-prelude-sample-shadow/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-prelude-sample-shadow/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-prelude-sample-shadow/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ f |=(same same)
tests/golden/module-import-prelude-sample-shadow/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name f
10+2:6 glyph |=(
11+2:9 tight name same
12+2:14 name same
13+2:18 tight glyph )
14+2:19 NEWLINE
tests/golden/module-import-prelude-sample-shadow/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 f
4+ (gate-wide 2:6 (bind 2:9 same) (wing 2:14 same))))
tests/golden/module-import-prelude-sample-shadow/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ f: sample shadows a name
tests/golden/module-import-prelude-value-shadow/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; molds and values have separate namespaces.
2+tests: An imported value cannot shadow the prelude value `same`.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-prelude-value-shadow/module-trees.txtnew file+4
@@ -0,0 +1,4 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 same
4+ (gate-wide 1:9 (bind 1:12 x) (wing 1:14 x))))
tests/golden/module-import-prelude-value-shadow/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-prelude-value-shadow/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ same |=(x x)
tests/golden/module-import-prelude-value-shadow/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ x 1
tests/golden/module-import-prelude-value-shadow/tokens.txtnew file+11
@@ -0,0 +1,11 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name x
10+2:6 lit 1
11+2:7 NEWLINE
tests/golden/module-import-prelude-value-shadow/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 x (lit 2:6 1)))
tests/golden/module-import-prelude-value-shadow/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module has conflicting names: /ui/lib/jibb
tests/golden/module-import-root-cycle/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A cycle back to the root uses its explicit logical path.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-root-cycle/module-trees.txtnew file+8
@@ -0,0 +1,8 @@
1+/ui/a.jibb
2+(module
3+ (jibb 1:1 main /ui/main)
4+ (value 2:1 identity
5+ (gate-wide 2:13
6+ (bind 2:16 x)
7+ (group 2:18
8+ (call 2:19 (wing 2:19 identity.main) (wing 2:33 x))))))
tests/golden/module-import-root-cycle/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/a.jibb
tests/golden/module-import-root-cycle/modules/ui/a.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= main /ui/main
2+++ identity |=(x (identity.main x))
tests/golden/module-import-root-cycle/path.txtnew file+1
@@ -0,0 +1 @@
1+/ui/main.jibb
tests/golden/module-import-root-cycle/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= a /ui/a
2+++ identity |=(x (identity.a x))
tests/golden/module-import-root-cycle/tokens.txtnew file+17
@@ -0,0 +1,17 @@
1+1:1 glyph /=
2+1:5 name a
3+1:7 glyph /
4+1:8 tight knot ui
5+1:10 tight glyph /
6+1:11 tight knot a
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name identity
10+2:13 glyph |=(
11+2:16 tight name x
12+2:18 glyph (
13+2:19 tight wing identity.a
14+2:30 name x
15+2:31 tight glyph )
16+2:32 tight glyph )
17+2:33 NEWLINE
tests/golden/module-import-root-cycle/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (jibb 1:1 a /ui/a)
3+ (value 2:1 identity
4+ (gate-wide 2:13
5+ (bind 2:16 x)
6+ (group 2:18
7+ (call 2:19 (wing 2:19 identity.a) (wing 2:30 x))))))
tests/golden/module-import-root-cycle/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+import cycle at /ui/main/jibb
tests/golden/module-import-root-import-shadow/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included".
2+tests: Samples in the root module cannot shadow names declared by `/-` or `/%`; an explicit empty Jibb module bundle opts into module-aware checking.
3+expect: parses
4+expect-types: partial inference reports each shadowing sample
tests/golden/module-import-root-import-shadow/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture title
tests/golden/module-import-root-import-shadow/mar/label.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=@t
2+++ grab |% ++ noun @t --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/module-import-root-import-shadow/marks.txtnew file+1
@@ -0,0 +1 @@
1+label
tests/golden/module-import-root-import-shadow/modules.txtnew file+1
@@ -0,0 +1 @@
1+# no module fixtures
tests/golden/module-import-root-import-shadow/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/- fixture
2+/% %label
3+++ shadow-sur |=(fixture fixture)
4+++ shadow-mark |=(label label)
tests/golden/module-import-root-import-shadow/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/module-import-root-import-shadow/tokens.txtnew file+20
@@ -0,0 +1,20 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph /%
5+2:5 lit %label
6+3:1 NEWLINE
7+3:1 glyph ++
8+3:4 name shadow-sur
9+3:15 glyph |=(
10+3:18 tight name fixture
11+3:26 name fixture
12+3:33 tight glyph )
13+4:1 NEWLINE
14+4:1 glyph ++
15+4:4 name shadow-mark
16+4:16 glyph |=(
17+4:19 tight name label
18+4:25 name label
19+4:30 tight glyph )
20+4:31 NEWLINE
tests/golden/module-import-root-import-shadow/tree.txtnew file+7
@@ -0,0 +1,7 @@
1+(module
2+ (sur 1:1 fixture)
3+ (mark 2:1 %label)
4+ (value 3:1 shadow-sur
5+ (gate-wide 3:15 (bind 3:18 fixture) (wing 3:26 fixture)))
6+ (value 4:1 shadow-mark
7+ (gate-wide 4:16 (bind 4:19 label) (wing 4:25 label))))
tests/golden/module-import-root-import-shadow/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ shadow-sur: sample shadows a name
3+++ shadow-mark: sample shadows a name
tests/golden/module-import-separate-namespaces/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "No name may shadow one already in scope, imports and the prelude included"; molds and values have separate namespaces.
2+tests: A mold and a value may share a name because their namespaces are separate.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-separate-namespaces/module-trees.txtnew file+5
@@ -0,0 +1,5 @@
1+/ui/lib.jibb
2+(module
3+ (mold 1:1 thing (aura 1:10 @t))
4+ (value 2:1 thing
5+ (gate-wide 2:10 (bind 2:13 x) (wing 2:15 x))))
tests/golden/module-import-separate-namespaces/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-separate-namespaces/modules/ui/lib.jibbnew file+2
@@ -0,0 +1,2 @@
1++$ thing @t
2+++ thing |=(x x)
tests/golden/module-import-separate-namespaces/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= lib /ui/lib
2+++ f |= x=thing.lib x
3+++ y (thing.lib "hi")
tests/golden/module-import-separate-namespaces/tokens.txtnew file+22
@@ -0,0 +1,22 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name f
10+2:6 glyph |=
11+2:9 name x
12+2:10 tight glyph =
13+2:11 tight wing thing.lib
14+2:21 name x
15+3:1 NEWLINE
16+3:1 glyph ++
17+3:4 name y
18+3:6 glyph (
19+3:7 tight wing thing.lib
20+3:17 str "hi"
21+3:21 tight glyph )
22+3:22 NEWLINE
tests/golden/module-import-separate-namespaces/tree.txtnew file+9
@@ -0,0 +1,9 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 f
4+ (gate 2:6
5+ (face 2:9 x (ref 2:11 thing.lib))
6+ (wing 2:21 x)))
7+ (value 3:1 y
8+ (group 3:6
9+ (call 3:7 (wing 3:7 thing.lib) (str 3:17 "hi")))))
tests/golden/module-import-separate-namespaces/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ f: $-(@t @t)
3+++ y: @t
tests/golden/module-import-sur-scope/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: A module may not see the root module’s Hoon import without declaring it.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-sur-scope/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture title
tests/golden/module-import-sur-scope/module-trees.txtnew file+6
@@ -0,0 +1,6 @@
1+/ui/lib.jibb
2+(module
3+ (value 1:1 identity
4+ (gate 1:13
5+ (face 1:16 x (ref 1:18 title.fixture))
6+ (wing 1:32 x))))
tests/golden/module-import-sur-scope/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/module-import-sur-scope/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |= x=title.fixture x
tests/golden/module-import-sur-scope/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/- fixture
2+/= lib /ui/lib
3+++ root |= x=title.fixture x
4+++ imported (identity.lib "hi")
tests/golden/module-import-sur-scope/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/module-import-sur-scope/tokens.txtnew file+25
@@ -0,0 +1,25 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph /=
5+2:5 name lib
6+2:9 glyph /
7+2:10 tight knot ui
8+2:12 tight glyph /
9+2:13 tight knot lib
10+3:1 NEWLINE
11+3:1 glyph ++
12+3:4 name root
13+3:9 glyph |=
14+3:12 name x
15+3:13 tight glyph =
16+3:14 tight wing title.fixture
17+3:28 name x
18+4:1 NEWLINE
19+4:1 glyph ++
20+4:4 name imported
21+4:13 glyph (
22+4:14 tight wing identity.lib
23+4:27 str "hi"
24+4:31 tight glyph )
25+4:32 NEWLINE
tests/golden/module-import-sur-scope/tree.txtnew file+10
@@ -0,0 +1,10 @@
1+(module
2+ (sur 1:1 fixture)
3+ (jibb 2:1 lib /ui/lib)
4+ (value 3:1 root
5+ (gate 3:9
6+ (face 3:12 x (ref 3:14 title.fixture))
7+ (wing 3:28 x)))
8+ (value 4:1 imported
9+ (group 4:13
10+ (call 4:14 (wing 4:14 identity.lib) (str 4:27 "hi")))))
tests/golden/module-import-sur-scope/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module definitions need unsupported inference: /ui/lib/jibb
tests/golden/module-import-transitive/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: Imported modules use a transitive, explicitly supplied A-to-B-to-C dependency chain.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-transitive/module-trees.txtnew file+20
@@ -0,0 +1,20 @@
1+/ui/a.jibb
2+(module
3+ (jibb 1:1 b /ui/b)
4+ (value 2:1 identity
5+ (gate-wide 2:13
6+ (bind 2:16 x)
7+ (group 2:18
8+ (call 2:19 (wing 2:19 identity.b) (wing 2:30 x))))))
9+/ui/b.jibb
10+(module
11+ (jibb 1:1 c /ui/c)
12+ (value 2:1 identity
13+ (gate-wide 2:13
14+ (bind 2:16 x)
15+ (group 2:18
16+ (call 2:19 (wing 2:19 identity.c) (wing 2:30 x))))))
17+/ui/c.jibb
18+(module
19+ (value 1:1 identity
20+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
tests/golden/module-import-transitive/modules.txtnew file+3
@@ -0,0 +1,3 @@
1+/ui/a.jibb
2+/ui/b.jibb
3+/ui/c.jibb
tests/golden/module-import-transitive/modules/ui/a.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= b /ui/b
2+++ identity |=(x (identity.b x))
tests/golden/module-import-transitive/modules/ui/b.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= c /ui/c
2+++ identity |=(x (identity.c x))
tests/golden/module-import-transitive/modules/ui/c.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-transitive/path.txtnew file+1
@@ -0,0 +1 @@
1+/ui/main.jibb
tests/golden/module-import-transitive/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= a /ui/a
2+++ text (identity.a "hi")
tests/golden/module-import-transitive/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name a
3+1:7 glyph /
4+1:8 tight knot ui
5+1:10 tight glyph /
6+1:11 tight knot a
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name text
10+2:9 glyph (
11+2:10 tight wing identity.a
12+2:21 str "hi"
13+2:25 tight glyph )
14+2:26 NEWLINE
tests/golden/module-import-transitive/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 a /ui/a)
3+ (value 2:1 text
4+ (group 2:9
5+ (call 2:10 (wing 2:10 identity.a) (str 2:21 "hi")))))
tests/golden/module-import-transitive/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ text: @t
tests/golden/module-import-unused-invalid/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/=` imports a Jibb module; import cycles are errors.
2+tests: An unused malformed fixture is parsed in module-trees but must not invalidate import inference.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/module-import-unused-invalid/module-trees.txtnew file+8
@@ -0,0 +1,8 @@
1+/ui/good.jibb
2+(module
3+ (value 1:1 identity
4+ (gate-wide 1:13 (bind 1:16 x) (wing 1:18 x))))
5+/ui/unused.jibb
6+/ui/unused.jibb:1:10: expected a mold, on its line or a deeper one, found the end of the file
7++$ broken
8+ ^
tests/golden/module-import-unused-invalid/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/good.jibb
2+/ui/unused.jibb
tests/golden/module-import-unused-invalid/modules/ui/good.jibbnew file+1
@@ -0,0 +1 @@
1+++ identity |=(x x)
tests/golden/module-import-unused-invalid/modules/ui/unused.jibbnew file+1
@@ -0,0 +1 @@
1++$ broken
tests/golden/module-import-unused-invalid/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= good /ui/good
2+++ text (identity.good "hi")
tests/golden/module-import-unused-invalid/tokens.txtnew file+14
@@ -0,0 +1,14 @@
1+1:1 glyph /=
2+1:5 name good
3+1:10 glyph /
4+1:11 tight knot ui
5+1:13 tight glyph /
6+1:14 tight knot good
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name text
10+2:9 glyph (
11+2:10 tight wing identity.good
12+2:24 str "hi"
13+2:28 tight glyph )
14+2:29 NEWLINE
tests/golden/module-import-unused-invalid/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (jibb 1:1 good /ui/good)
3+ (value 2:1 text
4+ (group 2:9
5+ (call 2:10 (wing 2:10 identity.good) (str 2:24 "hi")))))
tests/golden/module-import-unused-invalid/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ text: @t
tests/golden/prelude-1c-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"; section 1c includes `lone`, `lest`, `pole`, `quip`, `tree`, `each` and `bloq`.
2+tests: The prelude's 1c structural molds, including a one-field face, nonempty and faceless lists, a pair of list and state, a recursive tree, an either mold whose `%|` and `%&` cases have distinct tags, and the bare-atom `bloq`. The source contains the prelude definitions through `bloq`.
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-1c-structural/source.jibbnew file+122
@@ -0,0 +1,122 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
96+
97++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98+
99+++ wonk |= veq=(like A)
100+ ?- q.veq
101+ ~ !!
102+ [~ product] p.product
103+
104++$ lone |$ [A] [p=A]
105+
106++$ lest |$ [A] [i=A t=(list A)]
107+
108++$ pole |$ [A]
109+ ~
110+ [A (pole A)]
111+
112++$ quip |$ [A B] [(list A) B]
113+
114++$ tree |$ [A]
115+ ~
116+ [n=A l=(tree A) r=(tree A)]
117+
118++$ each |$ [A B]
119+ [%| p=B]
120+ [%& p=A]
121+
122++$ bloq @
tests/golden/prelude-1c-structural/tokens.txtnew file+731
@@ -0,0 +1,731 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
441+80:3 NEWLINE
442+80:3 glyph [
443+80:4 tight lit %leaf
444+80:10 name p
445+80:11 tight glyph =
446+80:12 tight name tape
447+80:16 tight glyph ]
448+81:3 NEWLINE
449+81:3 glyph [
450+81:4 tight lit %palm
451+81:10 name p
452+81:11 tight glyph =
453+81:12 tight glyph (
454+81:13 tight name qual
455+81:18 name tape
456+81:23 name tape
457+81:28 name tape
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
540+93:3 glyph [
541+93:4 tight lit %0
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph *
545+93:10 tight glyph ]
546+94:3 NEWLINE
547+94:3 glyph [
548+94:4 tight lit %1
549+94:7 name p
550+94:8 tight glyph =
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name wonk
592+99:9 glyph |=
593+99:12 name veq
594+99:15 tight glyph =
595+99:16 tight glyph (
596+99:17 tight name like
597+99:22 tvar A
598+99:23 tight glyph )
599+100:3 INDENT
600+100:3 glyph ?-
601+100:6 wing q.veq
602+101:5 INDENT
603+101:5 lit ~
604+101:7 glyph !!
605+102:5 NEWLINE
606+102:5 glyph [
607+102:6 tight lit ~
608+102:8 name product
609+102:15 tight glyph ]
610+102:17 wing p.product
611+104:1 DEDENT
612+104:1 DEDENT
613+104:1 NEWLINE
614+104:1 glyph +$
615+104:4 name lone
616+104:9 glyph |$
617+104:12 glyph [
618+104:13 tight tvar A
619+104:14 tight glyph ]
620+104:16 glyph [
621+104:17 tight name p
622+104:18 tight glyph =
623+104:19 tight tvar A
624+104:20 tight glyph ]
625+106:1 NEWLINE
626+106:1 glyph +$
627+106:4 name lest
628+106:9 glyph |$
629+106:12 glyph [
630+106:13 tight tvar A
631+106:14 tight glyph ]
632+106:16 glyph [
633+106:17 tight name i
634+106:18 tight glyph =
635+106:19 tight tvar A
636+106:21 name t
637+106:22 tight glyph =
638+106:23 tight glyph (
639+106:24 tight name list
640+106:29 tvar A
641+106:30 tight glyph )
642+106:31 tight glyph ]
643+108:1 NEWLINE
644+108:1 glyph +$
645+108:4 name pole
646+108:9 glyph |$
647+108:12 glyph [
648+108:13 tight tvar A
649+108:14 tight glyph ]
650+109:3 INDENT
651+109:3 lit ~
652+110:3 NEWLINE
653+110:3 glyph [
654+110:4 tight tvar A
655+110:6 glyph (
656+110:7 tight name pole
657+110:12 tvar A
658+110:13 tight glyph )
659+110:14 tight glyph ]
660+112:1 DEDENT
661+112:1 NEWLINE
662+112:1 glyph +$
663+112:4 name quip
664+112:9 glyph |$
665+112:12 glyph [
666+112:13 tight tvar A
667+112:15 tvar B
668+112:16 tight glyph ]
669+112:18 glyph [
670+112:19 tight glyph (
671+112:20 tight name list
672+112:25 tvar A
673+112:26 tight glyph )
674+112:28 tvar B
675+112:29 tight glyph ]
676+114:1 NEWLINE
677+114:1 glyph +$
678+114:4 name tree
679+114:9 glyph |$
680+114:12 glyph [
681+114:13 tight tvar A
682+114:14 tight glyph ]
683+115:3 INDENT
684+115:3 lit ~
685+116:3 NEWLINE
686+116:3 glyph [
687+116:4 tight name n
688+116:5 tight glyph =
689+116:6 tight tvar A
690+116:8 name l
691+116:9 tight glyph =
692+116:10 tight glyph (
693+116:11 tight name tree
694+116:16 tvar A
695+116:17 tight glyph )
696+116:19 name r
697+116:20 tight glyph =
698+116:21 tight glyph (
699+116:22 tight name tree
700+116:27 tvar A
701+116:28 tight glyph )
702+116:29 tight glyph ]
703+118:1 DEDENT
704+118:1 NEWLINE
705+118:1 glyph +$
706+118:4 name each
707+118:9 glyph |$
708+118:12 glyph [
709+118:13 tight tvar A
710+118:15 tvar B
711+118:16 tight glyph ]
712+119:3 INDENT
713+119:3 glyph [
714+119:4 tight lit %|
715+119:7 name p
716+119:8 tight glyph =
717+119:9 tight tvar B
718+119:10 tight glyph ]
719+120:3 NEWLINE
720+120:3 glyph [
721+120:4 tight lit %&
722+120:7 name p
723+120:8 tight glyph =
724+120:9 tight tvar A
725+120:10 tight glyph ]
726+122:1 DEDENT
727+122:1 NEWLINE
728+122:1 glyph +$
729+122:4 name bloq
730+122:9 aura @
731+122:10 NEWLINE
tests/golden/prelude-1c-structural/tree.txtnew file+290
@@ -0,0 +1,290 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184+ (cell 80:3
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
187+ (cell 81:3
188+ (const 81:4 %palm)
189+ (face 81:10 p
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219+ (cell 93:3
220+ (const 93:4 %0)
221+ (face 93:7 p (noun 93:9)))
222+ (cell 94:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 wonk
239+ (gate 99:9
240+ (face 99:12 veq
241+ (apply 99:16 like (tvar 99:22 A)))
242+ (body 100:3
243+ (branch 100:3
244+ (wing 100:6 q.veq)
245+ (arm 101:5 (lit 101:5 ~) (crash 101:7))
246+ (arm 102:5
247+ (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
248+ (wing 102:17 p.product))))))
249+ (mold 104:1 lone
250+ (generic 104:9 A
251+ (cell 104:16
252+ (face 104:17 p (tvar 104:19 A)))))
253+ (mold 106:1 lest
254+ (generic 106:9 A
255+ (cell 106:16
256+ (face 106:17 i (tvar 106:19 A))
257+ (face 106:21 t
258+ (apply 106:23 list (tvar 106:29 A))))))
259+ (mold 108:1 pole
260+ (generic 108:9 A
261+ (union 109:3
262+ (const 109:3 ~)
263+ (cell 110:3
264+ (tvar 110:4 A)
265+ (apply 110:6 pole (tvar 110:12 A))))))
266+ (mold 112:1 quip
267+ (generic 112:9 A B
268+ (cell 112:18
269+ (apply 112:19 list (tvar 112:25 A))
270+ (tvar 112:28 B))))
271+ (mold 114:1 tree
272+ (generic 114:9 A
273+ (union 115:3
274+ (const 115:3 ~)
275+ (cell 116:3
276+ (face 116:4 n (tvar 116:6 A))
277+ (face 116:8 l
278+ (apply 116:10 tree (tvar 116:16 A)))
279+ (face 116:19 r
280+ (apply 116:21 tree (tvar 116:27 A)))))))
281+ (mold 118:1 each
282+ (generic 118:9 A B
283+ (union 119:3
284+ (cell 119:3
285+ (const 119:4 %|)
286+ (face 119:7 p (tvar 119:9 B)))
287+ (cell 120:3
288+ (const 120:4 %&)
289+ (face 120:7 p (tvar 120:9 A))))))
290+ (mold 122:1 bloq (aura 122:9 @)))
tests/golden/prelude-1c-structural/types.txtnew file+37
@@ -0,0 +1,37 @@
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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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
31++$ lone: not checked
32++$ lest: not checked
33++$ pole: cases proven disjoint; mold not checked
34++$ quip: not checked
35++$ tree: cases proven disjoint; mold not checked
36++$ each: cases proven disjoint; mold not checked
37++$ bloq: not checked
tests/golden/prelude-3g-basic/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"; 3g includes `dime`, `hair`, `pint` and `coin`.
2+tests: The prelude's 3g atom and position molds, and the recursive `coin` union with its `%$` term case; bare `@` fields accept atoms independently.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; union-case disjointness is checked but the molds remain unchecked
tests/golden/prelude-3g-basic/source.jibbnew file+62
@@ -0,0 +1,62 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
tests/golden/prelude-3g-basic/tokens.txtnew file+354
@@ -0,0 +1,354 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+62:24 DEDENT
354+62:24 NEWLINE
tests/golden/prelude-3g-basic/tree.txtnew file+156
@@ -0,0 +1,156 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin)))))))
tests/golden/prelude-3g-basic/types.txtnew file+15
@@ -0,0 +1,15 @@
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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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
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 contains the prelude definitions through `like` and `wonk`.
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+102
@@ -0,0 +1,102 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
96+
97++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98+
99+++ wonk |= veq=(like A)
100+ ?- q.veq
101+ ~ !!
102+ [~ product] p.product
tests/golden/prelude-3g-like/tokens.txtnew file+613
@@ -0,0 +1,613 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
441+80:3 NEWLINE
442+80:3 glyph [
443+80:4 tight lit %leaf
444+80:10 name p
445+80:11 tight glyph =
446+80:12 tight name tape
447+80:16 tight glyph ]
448+81:3 NEWLINE
449+81:3 glyph [
450+81:4 tight lit %palm
451+81:10 name p
452+81:11 tight glyph =
453+81:12 tight glyph (
454+81:13 tight name qual
455+81:18 name tape
456+81:23 name tape
457+81:28 name tape
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
540+93:3 glyph [
541+93:4 tight lit %0
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph *
545+93:10 tight glyph ]
546+94:3 NEWLINE
547+94:3 glyph [
548+94:4 tight lit %1
549+94:7 name p
550+94:8 tight glyph =
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name wonk
592+99:9 glyph |=
593+99:12 name veq
594+99:15 tight glyph =
595+99:16 tight glyph (
596+99:17 tight name like
597+99:22 tvar A
598+99:23 tight glyph )
599+100:3 INDENT
600+100:3 glyph ?-
601+100:6 wing q.veq
602+101:5 INDENT
603+101:5 lit ~
604+101:7 glyph !!
605+102:5 NEWLINE
606+102:5 glyph [
607+102:6 tight lit ~
608+102:8 name product
609+102:15 tight glyph ]
610+102:17 wing p.product
611+102:26 DEDENT
612+102:26 DEDENT
613+102:26 NEWLINE
tests/golden/prelude-3g-like/tree.txtnew file+248
@@ -0,0 +1,248 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184+ (cell 80:3
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
187+ (cell 81:3
188+ (const 81:4 %palm)
189+ (face 81:10 p
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219+ (cell 93:3
220+ (const 93:4 %0)
221+ (face 93:7 p (noun 93:9)))
222+ (cell 94:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 wonk
239+ (gate 99:9
240+ (face 99:12 veq
241+ (apply 99:16 like (tvar 99:22 A)))
242+ (body 100:3
243+ (branch 100:3
244+ (wing 100:6 q.veq)
245+ (arm 101:5 (lit 101:5 ~) (crash 101:7))
246+ (arm 102:5
247+ (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
248+ (wing 102: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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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 contains the prelude definitions through `toon`.
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+95
@@ -0,0 +1,95 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
tests/golden/prelude-3g-structural/tokens.txtnew file+564
@@ -0,0 +1,564 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
441+80:3 NEWLINE
442+80:3 glyph [
443+80:4 tight lit %leaf
444+80:10 name p
445+80:11 tight glyph =
446+80:12 tight name tape
447+80:16 tight glyph ]
448+81:3 NEWLINE
449+81:3 glyph [
450+81:4 tight lit %palm
451+81:10 name p
452+81:11 tight glyph =
453+81:12 tight glyph (
454+81:13 tight name qual
455+81:18 name tape
456+81:23 name tape
457+81:28 name tape
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
540+93:3 glyph [
541+93:4 tight lit %0
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph *
545+93:10 tight glyph ]
546+94:3 NEWLINE
547+94:3 glyph [
548+94:4 tight lit %1
549+94:7 name p
550+94:8 tight glyph =
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+95:21 DEDENT
564+95:21 NEWLINE
tests/golden/prelude-3g-structural/tree.txtnew file+228
@@ -0,0 +1,228 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184+ (cell 80:3
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
187+ (cell 81:3
188+ (const 81:4 %palm)
189+ (face 81:10 p
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219+ (cell 93:3
220+ (const 93:4 %0)
221+ (face 93:7 p (noun 93:9)))
222+ (cell 94:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95: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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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/prelude-list-helpers/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 2a and 2b include `some`, `lure`, `snoc` and `flop`.
2+tests: The prelude through its unit constructor, singleton list, append-one gate and tail-recursive list reversal; the local reversal helper shares the enclosing type variable.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; unit, list and recursive helper typing is not complete
tests/golden/prelude-list-helpers/source.jibbnew file+140
@@ -0,0 +1,140 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
96+
97++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98+
99+++ wonk |= veq=(like A)
100+ ?- q.veq
101+ ~ !!
102+ [~ product] p.product
103+
104++$ lone |$ [A] [p=A]
105+
106++$ lest |$ [A] [i=A t=(list A)]
107+
108++$ pole |$ [A]
109+ ~
110+ [A (pole A)]
111+
112++$ quip |$ [A B] [(list A) B]
113+
114++$ tree |$ [A]
115+ ~
116+ [n=A l=(tree A) r=(tree A)]
117+
118++$ each |$ [A B]
119+ [%| p=B]
120+ [%& p=A]
121+
122++$ bloq @
123+
124+++ some |= item=A `item
125+
126+++ lure |= item=A
127+ ^- (list A) [item ~]
128+
129+++ snoc |= args=[(list A) A]
130+ ?- args
131+ [xs item] (weld xs [item ~])
132+
133+++ flop |= xs=(list A)
134+ ++ reverse-into |= args=[(list A) (list A)]
135+ ?- args
136+ [rest acc]
137+ ?- rest
138+ ~ acc
139+ [item more] (reverse-into more [item acc])
140+ (reverse-into xs ~)
tests/golden/prelude-list-helpers/tokens.txtnew file+853
@@ -0,0 +1,853 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
441+80:3 NEWLINE
442+80:3 glyph [
443+80:4 tight lit %leaf
444+80:10 name p
445+80:11 tight glyph =
446+80:12 tight name tape
447+80:16 tight glyph ]
448+81:3 NEWLINE
449+81:3 glyph [
450+81:4 tight lit %palm
451+81:10 name p
452+81:11 tight glyph =
453+81:12 tight glyph (
454+81:13 tight name qual
455+81:18 name tape
456+81:23 name tape
457+81:28 name tape
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
540+93:3 glyph [
541+93:4 tight lit %0
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph *
545+93:10 tight glyph ]
546+94:3 NEWLINE
547+94:3 glyph [
548+94:4 tight lit %1
549+94:7 name p
550+94:8 tight glyph =
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name wonk
592+99:9 glyph |=
593+99:12 name veq
594+99:15 tight glyph =
595+99:16 tight glyph (
596+99:17 tight name like
597+99:22 tvar A
598+99:23 tight glyph )
599+100:3 INDENT
600+100:3 glyph ?-
601+100:6 wing q.veq
602+101:5 INDENT
603+101:5 lit ~
604+101:7 glyph !!
605+102:5 NEWLINE
606+102:5 glyph [
607+102:6 tight lit ~
608+102:8 name product
609+102:15 tight glyph ]
610+102:17 wing p.product
611+104:1 DEDENT
612+104:1 DEDENT
613+104:1 NEWLINE
614+104:1 glyph +$
615+104:4 name lone
616+104:9 glyph |$
617+104:12 glyph [
618+104:13 tight tvar A
619+104:14 tight glyph ]
620+104:16 glyph [
621+104:17 tight name p
622+104:18 tight glyph =
623+104:19 tight tvar A
624+104:20 tight glyph ]
625+106:1 NEWLINE
626+106:1 glyph +$
627+106:4 name lest
628+106:9 glyph |$
629+106:12 glyph [
630+106:13 tight tvar A
631+106:14 tight glyph ]
632+106:16 glyph [
633+106:17 tight name i
634+106:18 tight glyph =
635+106:19 tight tvar A
636+106:21 name t
637+106:22 tight glyph =
638+106:23 tight glyph (
639+106:24 tight name list
640+106:29 tvar A
641+106:30 tight glyph )
642+106:31 tight glyph ]
643+108:1 NEWLINE
644+108:1 glyph +$
645+108:4 name pole
646+108:9 glyph |$
647+108:12 glyph [
648+108:13 tight tvar A
649+108:14 tight glyph ]
650+109:3 INDENT
651+109:3 lit ~
652+110:3 NEWLINE
653+110:3 glyph [
654+110:4 tight tvar A
655+110:6 glyph (
656+110:7 tight name pole
657+110:12 tvar A
658+110:13 tight glyph )
659+110:14 tight glyph ]
660+112:1 DEDENT
661+112:1 NEWLINE
662+112:1 glyph +$
663+112:4 name quip
664+112:9 glyph |$
665+112:12 glyph [
666+112:13 tight tvar A
667+112:15 tvar B
668+112:16 tight glyph ]
669+112:18 glyph [
670+112:19 tight glyph (
671+112:20 tight name list
672+112:25 tvar A
673+112:26 tight glyph )
674+112:28 tvar B
675+112:29 tight glyph ]
676+114:1 NEWLINE
677+114:1 glyph +$
678+114:4 name tree
679+114:9 glyph |$
680+114:12 glyph [
681+114:13 tight tvar A
682+114:14 tight glyph ]
683+115:3 INDENT
684+115:3 lit ~
685+116:3 NEWLINE
686+116:3 glyph [
687+116:4 tight name n
688+116:5 tight glyph =
689+116:6 tight tvar A
690+116:8 name l
691+116:9 tight glyph =
692+116:10 tight glyph (
693+116:11 tight name tree
694+116:16 tvar A
695+116:17 tight glyph )
696+116:19 name r
697+116:20 tight glyph =
698+116:21 tight glyph (
699+116:22 tight name tree
700+116:27 tvar A
701+116:28 tight glyph )
702+116:29 tight glyph ]
703+118:1 DEDENT
704+118:1 NEWLINE
705+118:1 glyph +$
706+118:4 name each
707+118:9 glyph |$
708+118:12 glyph [
709+118:13 tight tvar A
710+118:15 tvar B
711+118:16 tight glyph ]
712+119:3 INDENT
713+119:3 glyph [
714+119:4 tight lit %|
715+119:7 name p
716+119:8 tight glyph =
717+119:9 tight tvar B
718+119:10 tight glyph ]
719+120:3 NEWLINE
720+120:3 glyph [
721+120:4 tight lit %&
722+120:7 name p
723+120:8 tight glyph =
724+120:9 tight tvar A
725+120:10 tight glyph ]
726+122:1 DEDENT
727+122:1 NEWLINE
728+122:1 glyph +$
729+122:4 name bloq
730+122:9 aura @
731+124:1 NEWLINE
732+124:1 glyph ++
733+124:4 name some
734+124:9 glyph |=
735+124:12 name item
736+124:16 tight glyph =
737+124:17 tight tvar A
738+124:19 glyph `
739+124:20 tight name item
740+126:1 NEWLINE
741+126:1 glyph ++
742+126:4 name lure
743+126:9 glyph |=
744+126:12 name item
745+126:16 tight glyph =
746+126:17 tight tvar A
747+127:3 INDENT
748+127:3 glyph ^-
749+127:6 glyph (
750+127:7 tight name list
751+127:12 tvar A
752+127:13 tight glyph )
753+127:15 glyph [
754+127:16 tight name item
755+127:21 lit ~
756+127:22 tight glyph ]
757+129:1 DEDENT
758+129:1 NEWLINE
759+129:1 glyph ++
760+129:4 name snoc
761+129:9 glyph |=
762+129:12 name args
763+129:16 tight glyph =
764+129:17 tight glyph [
765+129:18 tight glyph (
766+129:19 tight name list
767+129:24 tvar A
768+129:25 tight glyph )
769+129:27 tvar A
770+129:28 tight glyph ]
771+130:3 INDENT
772+130:3 glyph ?-
773+130:6 name args
774+131:5 INDENT
775+131:5 glyph [
776+131:6 tight name xs
777+131:9 name item
778+131:13 tight glyph ]
779+131:15 glyph (
780+131:16 tight name weld
781+131:21 name xs
782+131:24 glyph [
783+131:25 tight name item
784+131:30 lit ~
785+131:31 tight glyph ]
786+131:32 tight glyph )
787+133:1 DEDENT
788+133:1 DEDENT
789+133:1 NEWLINE
790+133:1 glyph ++
791+133:4 name flop
792+133:9 glyph |=
793+133:12 name xs
794+133:14 tight glyph =
795+133:15 tight glyph (
796+133:16 tight name list
797+133:21 tvar A
798+133:22 tight glyph )
799+134:3 INDENT
800+134:3 glyph ++
801+134:6 name reverse-into
802+134:19 glyph |=
803+134:22 name args
804+134:26 tight glyph =
805+134:27 tight glyph [
806+134:28 tight glyph (
807+134:29 tight name list
808+134:34 tvar A
809+134:35 tight glyph )
810+134:37 glyph (
811+134:38 tight name list
812+134:43 tvar A
813+134:44 tight glyph )
814+134:45 tight glyph ]
815+135:5 INDENT
816+135:5 glyph ?-
817+135:8 name args
818+136:7 INDENT
819+136:7 glyph [
820+136:8 tight name rest
821+136:13 name acc
822+136:16 tight glyph ]
823+137:9 INDENT
824+137:9 glyph ?-
825+137:12 name rest
826+138:11 INDENT
827+138:11 lit ~
828+138:13 name acc
829+139:11 NEWLINE
830+139:11 glyph [
831+139:12 tight name item
832+139:17 name more
833+139:21 tight glyph ]
834+139:23 glyph (
835+139:24 tight name reverse-into
836+139:37 name more
837+139:42 glyph [
838+139:43 tight name item
839+139:48 name acc
840+139:51 tight glyph ]
841+139:52 tight glyph )
842+140:3 DEDENT
843+140:3 DEDENT
844+140:3 DEDENT
845+140:3 DEDENT
846+140:3 NEWLINE
847+140:3 glyph (
848+140:4 tight name reverse-into
849+140:17 name xs
850+140:20 lit ~
851+140:21 tight glyph )
852+140:22 DEDENT
853+140:22 NEWLINE
tests/golden/prelude-list-helpers/tree.txtnew file+346
@@ -0,0 +1,346 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184+ (cell 80:3
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
187+ (cell 81:3
188+ (const 81:4 %palm)
189+ (face 81:10 p
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219+ (cell 93:3
220+ (const 93:4 %0)
221+ (face 93:7 p (noun 93:9)))
222+ (cell 94:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 wonk
239+ (gate 99:9
240+ (face 99:12 veq
241+ (apply 99:16 like (tvar 99:22 A)))
242+ (body 100:3
243+ (branch 100:3
244+ (wing 100:6 q.veq)
245+ (arm 101:5 (lit 101:5 ~) (crash 101:7))
246+ (arm 102:5
247+ (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
248+ (wing 102:17 p.product))))))
249+ (mold 104:1 lone
250+ (generic 104:9 A
251+ (cell 104:16
252+ (face 104:17 p (tvar 104:19 A)))))
253+ (mold 106:1 lest
254+ (generic 106:9 A
255+ (cell 106:16
256+ (face 106:17 i (tvar 106:19 A))
257+ (face 106:21 t
258+ (apply 106:23 list (tvar 106:29 A))))))
259+ (mold 108:1 pole
260+ (generic 108:9 A
261+ (union 109:3
262+ (const 109:3 ~)
263+ (cell 110:3
264+ (tvar 110:4 A)
265+ (apply 110:6 pole (tvar 110:12 A))))))
266+ (mold 112:1 quip
267+ (generic 112:9 A B
268+ (cell 112:18
269+ (apply 112:19 list (tvar 112:25 A))
270+ (tvar 112:28 B))))
271+ (mold 114:1 tree
272+ (generic 114:9 A
273+ (union 115:3
274+ (const 115:3 ~)
275+ (cell 116:3
276+ (face 116:4 n (tvar 116:6 A))
277+ (face 116:8 l
278+ (apply 116:10 tree (tvar 116:16 A)))
279+ (face 116:19 r
280+ (apply 116:21 tree (tvar 116:27 A)))))))
281+ (mold 118:1 each
282+ (generic 118:9 A B
283+ (union 119:3
284+ (cell 119:3
285+ (const 119:4 %|)
286+ (face 119:7 p (tvar 119:9 B)))
287+ (cell 120:3
288+ (const 120:4 %&)
289+ (face 120:7 p (tvar 120:9 A))))))
290+ (mold 122:1 bloq (aura 122:9 @))
291+ (value 124:1 some
292+ (gate 124:9
293+ (face 124:12 item (tvar 124:17 A))
294+ (unit 124:19 (wing 124:20 item))))
295+ (value 126:1 lure
296+ (gate 126:9
297+ (face 126:12 item (tvar 126:17 A))
298+ (body 127:3
299+ (cast 127:3
300+ (apply 127:6 list (tvar 127:12 A))
301+ (tuple 127:15 (wing 127:16 item) (lit 127:21 ~))))))
302+ (value 129:1 snoc
303+ (gate 129:9
304+ (face 129:12 args
305+ (cell 129:17
306+ (apply 129:18 list (tvar 129:24 A))
307+ (tvar 129:27 A)))
308+ (body 130:3
309+ (branch 130:3
310+ (wing 130:6 args)
311+ (arm 131:5
312+ (cell 131:5 (bind 131:6 xs) (bind 131:9 item))
313+ (group 131:15
314+ (call 131:16
315+ (wing 131:16 weld)
316+ (wing 131:21 xs)
317+ (tuple 131:24 (wing 131:25 item) (lit 131:30 ~)))))))))
318+ (value 133:1 flop
319+ (gate 133:9
320+ (face 133:12 xs
321+ (apply 133:15 list (tvar 133:21 A)))
322+ (body 134:3
323+ (value 134:3 reverse-into
324+ (gate 134:19
325+ (face 134:22 args
326+ (cell 134:27
327+ (apply 134:28 list (tvar 134:34 A))
328+ (apply 134:37 list (tvar 134:43 A))))
329+ (body 135:5
330+ (branch 135:5
331+ (wing 135:8 args)
332+ (arm 136:7
333+ (cell 136:7 (bind 136:8 rest) (bind 136:13 acc))
334+ (body 137:9
335+ (branch 137:9
336+ (wing 137:12 rest)
337+ (arm 138:11 (lit 138:11 ~) (wing 138:13 acc))
338+ (arm 139:11
339+ (cell 139:11 (bind 139:12 item) (bind 139:17 more))
340+ (group 139:23
341+ (call 139:24
342+ (wing 139:24 reverse-into)
343+ (wing 139:37 more)
344+ (tuple 139:42 (wing 139:43 item) (wing 139:48 acc))))))))))))
345+ (group 140:3
346+ (call 140:4 (wing 140:4 reverse-into) (wing 140:17 xs) (lit 140:20 ~)))))))
tests/golden/prelude-list-helpers/types.txtnew file+41
@@ -0,0 +1,41 @@
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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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
31++$ lone: not checked
32++$ lest: not checked
33++$ pole: cases proven disjoint; mold not checked
34++$ quip: not checked
35++$ tree: cases proven disjoint; mold not checked
36++$ each: cases proven disjoint; mold not checked
37++$ bloq: not checked
38+++ some: unit construction needs the standard prelude in partial inference
39+++ lure: cast mold is not supported by partial inference
40+++ snoc: sample mold is not supported by partial inference
41+++ flop: sample mold is not supported by partial inference
tests/golden/prelude-list-unit/about.txt+1−1
@@ -1,4 +1,4 @@
11source: Overview, Prelude: "Hoon's standard library regrouped, written in Jibb"; its data molds include `unit` and `list`, its unit helpers include `fall` and `need`, and its list helpers include `weld` and `turn`.
2−tests: The current prelude's generic recursive list and unit molds and its Jibb-written helpers; the partial inference report does not yet resolve these molds or check recursive gates.
2+tests: The prelude's generic recursive list and unit molds and its Jibb-written helpers; the partial inference report does not yet resolve these molds or check recursive gates.
33expect: parses
44expect-types: a partial inference report, not a checked module
tests/golden/prelude-list-unit/source.jibb+8−6
@@ -37,13 +37,15 @@
3737++ weld |= args=[(list A) (list A)]
3838 ?- args
3939 [xs ys]
40− ?- xs
41− ~ ys
42− [item rest] [item (weld rest ys)]
40+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
4344
4445++ turn |= args=[(list A) $-(A B)]
4546 ?- args
4647 [xs f]
47− ?- xs
48− ~ ~
49− [item rest] [(f item) (turn rest f)]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
tests/golden/prelude-list-unit/tokens.txt+86−72
@@ -190,76 +190,90 @@
19019039:9 name ys
19119139:11 tight glyph ]
19219240:7 INDENT
193−40:7 glyph ?-
194−40:10 name xs
193+40:7 glyph ^-
194+40:10 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
19519841: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−49:45 DEDENT
262−49:45 DEDENT
263−49:45 DEDENT
264−49:45 DEDENT
265−49:45 NEWLINE
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+51:47 DEDENT
275+51:47 DEDENT
276+51:47 DEDENT
277+51:47 DEDENT
278+51:47 DEDENT
279+51:47 NEWLINE
tests/golden/prelude-list-unit/tree.txt+37−31
@@ -87,34 +87,40 @@
8787 (arm 39:5
8888 (cell 39:5 (bind 39:6 xs) (bind 39:9 ys))
8989 (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)))))))))))))
90+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f)))))))))))))))
tests/golden/prelude-list-unit/types.txt+2−2
@@ -5,7 +5,7 @@ partial inference; module not checked
55++ not: $-(? ?)
66+$ list: cases proven disjoint; mold not checked
77+$ 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
8+++ fall: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
1010++ weld: sample mold is not supported by partial inference
1111++ turn: sample mold is not supported by partial inference
tests/golden/prelude-unit-list-transforms/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 2a includes `drop`, `bind`, `biff`, `flit`, `both`, `clap` and `clef`, and 2b includes `join`, `murn`, `rear`, `snip`, `skim`, `skip`, `levy`, `lien`, `roll` and `reel`. Folds take an explicit start.
2+tests: The complete current prelude parses, including unit-to-list conversion, unit mapping and flat mapping, a curried unit-producing filter, three ways to combine units, including `clap` with one shared value type, complementary list filters, present-product mapping, joining, last-item operations, all/any predicates, and left and right folds. The filters retain the order of their selected items.
3+expect: parses
4+expect-types: a partial inference report, not a checked module; unit and list gate typing is not complete
tests/golden/prelude-unit-list-transforms/source.jibbnew file+286
@@ -0,0 +1,286 @@
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+ ^- (list A)
41+ ?- xs
42+ ~ ys
43+ [item rest] [item (weld rest ys)]
44+
45+++ turn |= args=[(list A) $-(A B)]
46+ ?- args
47+ [xs f]
48+ ^- (list B)
49+ ?- xs
50+ ~ ~
51+ [item rest] [(f item) (turn rest f)]
52+
53++$ dime [p=@ta q=@]
54+
55++$ hair [p=@ud q=@ud]
56+
57++$ pint [p=[p=@ q=@] q=[p=@ q=@]]
58+
59++$ coin
60+ [%$ p=dime]
61+ [%blob p=*]
62+ [%many p=(list coin)]
63+
64++$ pair |$ [A B] [p=A q=B]
65+
66++$ trel |$ [A B C] [p=A q=B r=C]
67+
68++$ qual |$ [A B C D] [p=A q=B r=C s=D]
69+
70++$ cord @t
71+
72++$ knot @ta
73+
74++$ tape (list @tD)
75+
76++$ path (list knot)
77+
78++$ tank
79+ cord
80+ [%leaf p=tape]
81+ [%palm p=(qual tape tape tape tape) q=(list tank)]
82+ [%rose p=(trel tape tape tape) q=(list tank)]
83+
84++$ nail [p=hair q=tape]
85+
86++$ edge [p=hair q=(unit [p=* q=nail])]
87+
88++$ rule $-(nail edge)
89+
90++$ spot [p=path q=pint]
91+
92++$ toon
93+ [%0 p=*]
94+ [%1 p=*]
95+ [%2 p=(list tank)]
96+
97++$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98+
99+++ wonk |= veq=(like A)
100+ ?- q.veq
101+ ~ !!
102+ [~ product] p.product
103+
104++$ lone |$ [A] [p=A]
105+
106++$ lest |$ [A] [i=A t=(list A)]
107+
108++$ pole |$ [A]
109+ ~
110+ [A (pole A)]
111+
112++$ quip |$ [A B] [(list A) B]
113+
114++$ tree |$ [A]
115+ ~
116+ [n=A l=(tree A) r=(tree A)]
117+
118++$ each |$ [A B]
119+ [%| p=B]
120+ [%& p=A]
121+
122++$ bloq @
123+
124+++ some |= item=A `item
125+
126+++ lure |= item=A
127+ ^- (list A) [item ~]
128+
129+++ snoc |= args=[(list A) A]
130+ ?- args
131+ [xs item] (weld xs [item ~])
132+
133+++ flop |= xs=(list A)
134+ ++ reverse-into |= args=[(list A) (list A)]
135+ ?- args
136+ [rest acc]
137+ ?- rest
138+ ~ acc
139+ [item more] (reverse-into more [item acc])
140+ (reverse-into xs ~)
141+
142+++ drop |= maybe=(unit A)
143+ ?- maybe
144+ ~ ~
145+ [~ value] [value ~]
146+
147+++ bind |= args=[(unit A) $-(A B)]
148+ ?- args
149+ [maybe f] ^- (unit B)
150+ ?- maybe
151+ ~ ~
152+ [~ value] `(f value)
153+
154+++ biff |= args=[(unit A) $-(A (unit B))]
155+ ?- args
156+ [maybe f] ^- (unit B)
157+ ?- maybe
158+ ~ ~
159+ [~ value] (f value)
160+
161+++ both |= args=[(unit A) (unit B)]
162+ ?- args
163+ [first second] ^- (unit [A B])
164+ ?- first
165+ ~ ~
166+ [~ a]
167+ ?- second
168+ ~ ~
169+ [~ b] `[a b]
170+
171+++ clap |= args=[(unit A) (unit A) $-([A A] A)]
172+ ?- args
173+ [first second combine]
174+ ?- first
175+ ~ second
176+ [~ a]
177+ ?- second
178+ ~ first
179+ [~ b] `(combine a b)
180+
181+++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
182+ ?- args
183+ [first second combine]
184+ ?- first
185+ ~ ~
186+ [~ a]
187+ ?- second
188+ ~ ~
189+ [~ b] (combine a b)
190+
191+++ skim |= args=[(list A) $-(A ?)]
192+ ?- args
193+ [xs predicate]
194+ ?- xs
195+ ~ ~
196+ [item rest]
197+ ?- (predicate item)
198+ %.y [item (skim rest predicate)]
199+ %.n (skim rest predicate)
200+
201+++ skip |= args=[(list A) $-(A ?)]
202+ ?- args
203+ [xs predicate]
204+ ?- xs
205+ ~ ~
206+ [item rest]
207+ ?- (predicate item)
208+ %.y (skip rest predicate)
209+ %.n [item (skip rest predicate)]
210+
211+++ levy |= args=[(list A) $-(A ?)]
212+ ?- args
213+ [xs predicate]
214+ ?- xs
215+ ~ %.y
216+ [item rest]
217+ ?- (predicate item)
218+ %.y (levy rest predicate)
219+ %.n %.n
220+
221+++ lien |= args=[(list A) $-(A ?)]
222+ ?- args
223+ [xs predicate]
224+ ?- xs
225+ ~ %.n
226+ [item rest]
227+ ?- (predicate item)
228+ %.y %.y
229+ %.n (lien rest predicate)
230+
231+++ roll |= args=[(list A) B $-([A B] B)]
232+ ?- args
233+ [xs start combine]
234+ ?- xs
235+ ~ start
236+ [item rest] (roll rest (combine item start) combine)
237+
238+++ reel |= args=[(list A) B $-([A B] B)]
239+ ?- args
240+ [xs start combine]
241+ ?- xs
242+ ~ start
243+ [item rest] (combine item (reel rest start combine))
244+
245+++ flit |= predicate=$-(A ?)
246+ |= value=A
247+ ^- (unit A)
248+ ?- (predicate value)
249+ %.y `value
250+ %.n ~
251+
252+++ murn |= args=[(list A) $-(A (unit B))]
253+ ?- args
254+ [xs f]
255+ ?- xs
256+ ~ ~
257+ [item rest]
258+ ?- (f item)
259+ ~ (murn rest f)
260+ [~ value] [value (murn rest f)]
261+
262+++ join |= args=[A (list A)]
263+ ?- args
264+ [separator xs]
265+ ?- xs
266+ ~ ~
267+ [item rest]
268+ ?- rest
269+ ~ [item ~]
270+ [next more] [item [separator (join separator rest)]]
271+
272+++ snip |= xs=(list A)
273+ ?- xs
274+ ~ ~
275+ [item rest]
276+ ?- rest
277+ ~ ~
278+ [next more] [item (snip rest)]
279+
280+++ rear |= xs=(list A)
281+ ?- xs
282+ ~ !!
283+ [item rest]
284+ ?- rest
285+ ~ item
286+ [next more] (rear rest)
tests/golden/prelude-unit-list-transforms/tokens.txtnew file+1783
@@ -0,0 +1,1783 @@
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 glyph (
195+40:11 tight name list
196+40:16 tvar A
197+40:17 tight glyph )
198+41:9 INDENT
199+41:9 glyph ?-
200+41:12 name xs
201+42:11 INDENT
202+42:11 lit ~
203+42:13 name ys
204+43:11 NEWLINE
205+43:11 glyph [
206+43:12 tight name item
207+43:17 name rest
208+43:21 tight glyph ]
209+43:23 glyph [
210+43:24 tight name item
211+43:29 glyph (
212+43:30 tight name weld
213+43:35 name rest
214+43:40 name ys
215+43:42 tight glyph )
216+43:43 tight glyph ]
217+45:1 DEDENT
218+45:1 DEDENT
219+45:1 DEDENT
220+45:1 DEDENT
221+45:1 DEDENT
222+45:1 NEWLINE
223+45:1 glyph ++
224+45:4 name turn
225+45:9 glyph |=
226+45:12 name args
227+45:16 tight glyph =
228+45:17 tight glyph [
229+45:18 tight glyph (
230+45:19 tight name list
231+45:24 tvar A
232+45:25 tight glyph )
233+45:27 glyph $-(
234+45:30 tight tvar A
235+45:32 tvar B
236+45:33 tight glyph )
237+45:34 tight glyph ]
238+46:3 INDENT
239+46:3 glyph ?-
240+46:6 name args
241+47:5 INDENT
242+47:5 glyph [
243+47:6 tight name xs
244+47:9 name f
245+47:10 tight glyph ]
246+48:7 INDENT
247+48:7 glyph ^-
248+48:10 glyph (
249+48:11 tight name list
250+48:16 tvar B
251+48:17 tight glyph )
252+49:9 INDENT
253+49:9 glyph ?-
254+49:12 name xs
255+50:11 INDENT
256+50:11 lit ~
257+50:13 lit ~
258+51:11 NEWLINE
259+51:11 glyph [
260+51:12 tight name item
261+51:17 name rest
262+51:21 tight glyph ]
263+51:23 glyph [
264+51:24 tight glyph (
265+51:25 tight name f
266+51:27 name item
267+51:31 tight glyph )
268+51:33 glyph (
269+51:34 tight name turn
270+51:39 name rest
271+51:44 name f
272+51:45 tight glyph )
273+51:46 tight glyph ]
274+53:1 DEDENT
275+53:1 DEDENT
276+53:1 DEDENT
277+53:1 DEDENT
278+53:1 DEDENT
279+53:1 NEWLINE
280+53:1 glyph +$
281+53:4 name dime
282+53:9 glyph [
283+53:10 tight name p
284+53:11 tight glyph =
285+53:12 tight aura @ta
286+53:16 name q
287+53:17 tight glyph =
288+53:18 tight aura @
289+53:19 tight glyph ]
290+55:1 NEWLINE
291+55:1 glyph +$
292+55:4 name hair
293+55:9 glyph [
294+55:10 tight name p
295+55:11 tight glyph =
296+55:12 tight aura @ud
297+55:16 name q
298+55:17 tight glyph =
299+55:18 tight aura @ud
300+55:21 tight glyph ]
301+57:1 NEWLINE
302+57:1 glyph +$
303+57:4 name pint
304+57:9 glyph [
305+57:10 tight name p
306+57:11 tight glyph =
307+57:12 tight glyph [
308+57:13 tight name p
309+57:14 tight glyph =
310+57:15 tight aura @
311+57:17 name q
312+57:18 tight glyph =
313+57:19 tight aura @
314+57:20 tight glyph ]
315+57:22 name q
316+57:23 tight glyph =
317+57:24 tight glyph [
318+57:25 tight name p
319+57:26 tight glyph =
320+57:27 tight aura @
321+57:29 name q
322+57:30 tight glyph =
323+57:31 tight aura @
324+57:32 tight glyph ]
325+57:33 tight glyph ]
326+59:1 NEWLINE
327+59:1 glyph +$
328+59:4 name coin
329+60:3 INDENT
330+60:3 glyph [
331+60:4 tight lit %$
332+60:7 name p
333+60:8 tight glyph =
334+60:9 tight name dime
335+60:13 tight glyph ]
336+61:3 NEWLINE
337+61:3 glyph [
338+61:4 tight lit %blob
339+61:10 name p
340+61:11 tight glyph =
341+61:12 tight glyph *
342+61:13 tight glyph ]
343+62:3 NEWLINE
344+62:3 glyph [
345+62:4 tight lit %many
346+62:10 name p
347+62:11 tight glyph =
348+62:12 tight glyph (
349+62:13 tight name list
350+62:18 name coin
351+62:22 tight glyph )
352+62:23 tight glyph ]
353+64:1 DEDENT
354+64:1 NEWLINE
355+64:1 glyph +$
356+64:4 name pair
357+64:9 glyph |$
358+64:12 glyph [
359+64:13 tight tvar A
360+64:15 tvar B
361+64:16 tight glyph ]
362+64:18 glyph [
363+64:19 tight name p
364+64:20 tight glyph =
365+64:21 tight tvar A
366+64:23 name q
367+64:24 tight glyph =
368+64:25 tight tvar B
369+64:26 tight glyph ]
370+66:1 NEWLINE
371+66:1 glyph +$
372+66:4 name trel
373+66:9 glyph |$
374+66:12 glyph [
375+66:13 tight tvar A
376+66:15 tvar B
377+66:17 tvar C
378+66:18 tight glyph ]
379+66:20 glyph [
380+66:21 tight name p
381+66:22 tight glyph =
382+66:23 tight tvar A
383+66:25 name q
384+66:26 tight glyph =
385+66:27 tight tvar B
386+66:29 name r
387+66:30 tight glyph =
388+66:31 tight tvar C
389+66:32 tight glyph ]
390+68:1 NEWLINE
391+68:1 glyph +$
392+68:4 name qual
393+68:9 glyph |$
394+68:12 glyph [
395+68:13 tight tvar A
396+68:15 tvar B
397+68:17 tvar C
398+68:19 tvar D
399+68:20 tight glyph ]
400+68:22 glyph [
401+68:23 tight name p
402+68:24 tight glyph =
403+68:25 tight tvar A
404+68:27 name q
405+68:28 tight glyph =
406+68:29 tight tvar B
407+68:31 name r
408+68:32 tight glyph =
409+68:33 tight tvar C
410+68:35 name s
411+68:36 tight glyph =
412+68:37 tight tvar D
413+68:38 tight glyph ]
414+70:1 NEWLINE
415+70:1 glyph +$
416+70:4 name cord
417+70:9 aura @t
418+72:1 NEWLINE
419+72:1 glyph +$
420+72:4 name knot
421+72:9 aura @ta
422+74:1 NEWLINE
423+74:1 glyph +$
424+74:4 name tape
425+74:9 glyph (
426+74:10 tight name list
427+74:15 aura @tD
428+74:18 tight glyph )
429+76:1 NEWLINE
430+76:1 glyph +$
431+76:4 name path
432+76:9 glyph (
433+76:10 tight name list
434+76:15 name knot
435+76:19 tight glyph )
436+78:1 NEWLINE
437+78:1 glyph +$
438+78:4 name tank
439+79:3 INDENT
440+79:3 name cord
441+80:3 NEWLINE
442+80:3 glyph [
443+80:4 tight lit %leaf
444+80:10 name p
445+80:11 tight glyph =
446+80:12 tight name tape
447+80:16 tight glyph ]
448+81:3 NEWLINE
449+81:3 glyph [
450+81:4 tight lit %palm
451+81:10 name p
452+81:11 tight glyph =
453+81:12 tight glyph (
454+81:13 tight name qual
455+81:18 name tape
456+81:23 name tape
457+81:28 name tape
458+81:33 name tape
459+81:37 tight glyph )
460+81:39 name q
461+81:40 tight glyph =
462+81:41 tight glyph (
463+81:42 tight name list
464+81:47 name tank
465+81:51 tight glyph )
466+81:52 tight glyph ]
467+82:3 NEWLINE
468+82:3 glyph [
469+82:4 tight lit %rose
470+82:10 name p
471+82:11 tight glyph =
472+82:12 tight glyph (
473+82:13 tight name trel
474+82:18 name tape
475+82:23 name tape
476+82:28 name tape
477+82:32 tight glyph )
478+82:34 name q
479+82:35 tight glyph =
480+82:36 tight glyph (
481+82:37 tight name list
482+82:42 name tank
483+82:46 tight glyph )
484+82:47 tight glyph ]
485+84:1 DEDENT
486+84:1 NEWLINE
487+84:1 glyph +$
488+84:4 name nail
489+84:9 glyph [
490+84:10 tight name p
491+84:11 tight glyph =
492+84:12 tight name hair
493+84:17 name q
494+84:18 tight glyph =
495+84:19 tight name tape
496+84:23 tight glyph ]
497+86:1 NEWLINE
498+86:1 glyph +$
499+86:4 name edge
500+86:9 glyph [
501+86:10 tight name p
502+86:11 tight glyph =
503+86:12 tight name hair
504+86:17 name q
505+86:18 tight glyph =
506+86:19 tight glyph (
507+86:20 tight name unit
508+86:25 glyph [
509+86:26 tight name p
510+86:27 tight glyph =
511+86:28 tight glyph *
512+86:30 name q
513+86:31 tight glyph =
514+86:32 tight name nail
515+86:36 tight glyph ]
516+86:37 tight glyph )
517+86:38 tight glyph ]
518+88:1 NEWLINE
519+88:1 glyph +$
520+88:4 name rule
521+88:9 glyph $-(
522+88:12 tight name nail
523+88:17 name edge
524+88:21 tight glyph )
525+90:1 NEWLINE
526+90:1 glyph +$
527+90:4 name spot
528+90:9 glyph [
529+90:10 tight name p
530+90:11 tight glyph =
531+90:12 tight name path
532+90:17 name q
533+90:18 tight glyph =
534+90:19 tight name pint
535+90:23 tight glyph ]
536+92:1 NEWLINE
537+92:1 glyph +$
538+92:4 name toon
539+93:3 INDENT
540+93:3 glyph [
541+93:4 tight lit %0
542+93:7 name p
543+93:8 tight glyph =
544+93:9 tight glyph *
545+93:10 tight glyph ]
546+94:3 NEWLINE
547+94:3 glyph [
548+94:4 tight lit %1
549+94:7 name p
550+94:8 tight glyph =
551+94:9 tight glyph *
552+94:10 tight glyph ]
553+95:3 NEWLINE
554+95:3 glyph [
555+95:4 tight lit %2
556+95:7 name p
557+95:8 tight glyph =
558+95:9 tight glyph (
559+95:10 tight name list
560+95:15 name tank
561+95:19 tight glyph )
562+95:20 tight glyph ]
563+97:1 DEDENT
564+97:1 NEWLINE
565+97:1 glyph +$
566+97:4 name like
567+97:9 glyph |$
568+97:12 glyph [
569+97:13 tight tvar A
570+97:14 tight glyph ]
571+97:16 glyph [
572+97:17 tight name p
573+97:18 tight glyph =
574+97:19 tight name hair
575+97:24 name q
576+97:25 tight glyph =
577+97:26 tight glyph (
578+97:27 tight name unit
579+97:32 glyph [
580+97:33 tight name p
581+97:34 tight glyph =
582+97:35 tight tvar A
583+97:37 name q
584+97:38 tight glyph =
585+97:39 tight name nail
586+97:43 tight glyph ]
587+97:44 tight glyph )
588+97:45 tight glyph ]
589+99:1 NEWLINE
590+99:1 glyph ++
591+99:4 name wonk
592+99:9 glyph |=
593+99:12 name veq
594+99:15 tight glyph =
595+99:16 tight glyph (
596+99:17 tight name like
597+99:22 tvar A
598+99:23 tight glyph )
599+100:3 INDENT
600+100:3 glyph ?-
601+100:6 wing q.veq
602+101:5 INDENT
603+101:5 lit ~
604+101:7 glyph !!
605+102:5 NEWLINE
606+102:5 glyph [
607+102:6 tight lit ~
608+102:8 name product
609+102:15 tight glyph ]
610+102:17 wing p.product
611+104:1 DEDENT
612+104:1 DEDENT
613+104:1 NEWLINE
614+104:1 glyph +$
615+104:4 name lone
616+104:9 glyph |$
617+104:12 glyph [
618+104:13 tight tvar A
619+104:14 tight glyph ]
620+104:16 glyph [
621+104:17 tight name p
622+104:18 tight glyph =
623+104:19 tight tvar A
624+104:20 tight glyph ]
625+106:1 NEWLINE
626+106:1 glyph +$
627+106:4 name lest
628+106:9 glyph |$
629+106:12 glyph [
630+106:13 tight tvar A
631+106:14 tight glyph ]
632+106:16 glyph [
633+106:17 tight name i
634+106:18 tight glyph =
635+106:19 tight tvar A
636+106:21 name t
637+106:22 tight glyph =
638+106:23 tight glyph (
639+106:24 tight name list
640+106:29 tvar A
641+106:30 tight glyph )
642+106:31 tight glyph ]
643+108:1 NEWLINE
644+108:1 glyph +$
645+108:4 name pole
646+108:9 glyph |$
647+108:12 glyph [
648+108:13 tight tvar A
649+108:14 tight glyph ]
650+109:3 INDENT
651+109:3 lit ~
652+110:3 NEWLINE
653+110:3 glyph [
654+110:4 tight tvar A
655+110:6 glyph (
656+110:7 tight name pole
657+110:12 tvar A
658+110:13 tight glyph )
659+110:14 tight glyph ]
660+112:1 DEDENT
661+112:1 NEWLINE
662+112:1 glyph +$
663+112:4 name quip
664+112:9 glyph |$
665+112:12 glyph [
666+112:13 tight tvar A
667+112:15 tvar B
668+112:16 tight glyph ]
669+112:18 glyph [
670+112:19 tight glyph (
671+112:20 tight name list
672+112:25 tvar A
673+112:26 tight glyph )
674+112:28 tvar B
675+112:29 tight glyph ]
676+114:1 NEWLINE
677+114:1 glyph +$
678+114:4 name tree
679+114:9 glyph |$
680+114:12 glyph [
681+114:13 tight tvar A
682+114:14 tight glyph ]
683+115:3 INDENT
684+115:3 lit ~
685+116:3 NEWLINE
686+116:3 glyph [
687+116:4 tight name n
688+116:5 tight glyph =
689+116:6 tight tvar A
690+116:8 name l
691+116:9 tight glyph =
692+116:10 tight glyph (
693+116:11 tight name tree
694+116:16 tvar A
695+116:17 tight glyph )
696+116:19 name r
697+116:20 tight glyph =
698+116:21 tight glyph (
699+116:22 tight name tree
700+116:27 tvar A
701+116:28 tight glyph )
702+116:29 tight glyph ]
703+118:1 DEDENT
704+118:1 NEWLINE
705+118:1 glyph +$
706+118:4 name each
707+118:9 glyph |$
708+118:12 glyph [
709+118:13 tight tvar A
710+118:15 tvar B
711+118:16 tight glyph ]
712+119:3 INDENT
713+119:3 glyph [
714+119:4 tight lit %|
715+119:7 name p
716+119:8 tight glyph =
717+119:9 tight tvar B
718+119:10 tight glyph ]
719+120:3 NEWLINE
720+120:3 glyph [
721+120:4 tight lit %&
722+120:7 name p
723+120:8 tight glyph =
724+120:9 tight tvar A
725+120:10 tight glyph ]
726+122:1 DEDENT
727+122:1 NEWLINE
728+122:1 glyph +$
729+122:4 name bloq
730+122:9 aura @
731+124:1 NEWLINE
732+124:1 glyph ++
733+124:4 name some
734+124:9 glyph |=
735+124:12 name item
736+124:16 tight glyph =
737+124:17 tight tvar A
738+124:19 glyph `
739+124:20 tight name item
740+126:1 NEWLINE
741+126:1 glyph ++
742+126:4 name lure
743+126:9 glyph |=
744+126:12 name item
745+126:16 tight glyph =
746+126:17 tight tvar A
747+127:3 INDENT
748+127:3 glyph ^-
749+127:6 glyph (
750+127:7 tight name list
751+127:12 tvar A
752+127:13 tight glyph )
753+127:15 glyph [
754+127:16 tight name item
755+127:21 lit ~
756+127:22 tight glyph ]
757+129:1 DEDENT
758+129:1 NEWLINE
759+129:1 glyph ++
760+129:4 name snoc
761+129:9 glyph |=
762+129:12 name args
763+129:16 tight glyph =
764+129:17 tight glyph [
765+129:18 tight glyph (
766+129:19 tight name list
767+129:24 tvar A
768+129:25 tight glyph )
769+129:27 tvar A
770+129:28 tight glyph ]
771+130:3 INDENT
772+130:3 glyph ?-
773+130:6 name args
774+131:5 INDENT
775+131:5 glyph [
776+131:6 tight name xs
777+131:9 name item
778+131:13 tight glyph ]
779+131:15 glyph (
780+131:16 tight name weld
781+131:21 name xs
782+131:24 glyph [
783+131:25 tight name item
784+131:30 lit ~
785+131:31 tight glyph ]
786+131:32 tight glyph )
787+133:1 DEDENT
788+133:1 DEDENT
789+133:1 NEWLINE
790+133:1 glyph ++
791+133:4 name flop
792+133:9 glyph |=
793+133:12 name xs
794+133:14 tight glyph =
795+133:15 tight glyph (
796+133:16 tight name list
797+133:21 tvar A
798+133:22 tight glyph )
799+134:3 INDENT
800+134:3 glyph ++
801+134:6 name reverse-into
802+134:19 glyph |=
803+134:22 name args
804+134:26 tight glyph =
805+134:27 tight glyph [
806+134:28 tight glyph (
807+134:29 tight name list
808+134:34 tvar A
809+134:35 tight glyph )
810+134:37 glyph (
811+134:38 tight name list
812+134:43 tvar A
813+134:44 tight glyph )
814+134:45 tight glyph ]
815+135:5 INDENT
816+135:5 glyph ?-
817+135:8 name args
818+136:7 INDENT
819+136:7 glyph [
820+136:8 tight name rest
821+136:13 name acc
822+136:16 tight glyph ]
823+137:9 INDENT
824+137:9 glyph ?-
825+137:12 name rest
826+138:11 INDENT
827+138:11 lit ~
828+138:13 name acc
829+139:11 NEWLINE
830+139:11 glyph [
831+139:12 tight name item
832+139:17 name more
833+139:21 tight glyph ]
834+139:23 glyph (
835+139:24 tight name reverse-into
836+139:37 name more
837+139:42 glyph [
838+139:43 tight name item
839+139:48 name acc
840+139:51 tight glyph ]
841+139:52 tight glyph )
842+140:3 DEDENT
843+140:3 DEDENT
844+140:3 DEDENT
845+140:3 DEDENT
846+140:3 NEWLINE
847+140:3 glyph (
848+140:4 tight name reverse-into
849+140:17 name xs
850+140:20 lit ~
851+140:21 tight glyph )
852+142:1 DEDENT
853+142:1 NEWLINE
854+142:1 glyph ++
855+142:4 name drop
856+142:9 glyph |=
857+142:12 name maybe
858+142:17 tight glyph =
859+142:18 tight glyph (
860+142:19 tight name unit
861+142:24 tvar A
862+142:25 tight glyph )
863+143:3 INDENT
864+143:3 glyph ?-
865+143:6 name maybe
866+144:5 INDENT
867+144:5 lit ~
868+144:7 lit ~
869+145:5 NEWLINE
870+145:5 glyph [
871+145:6 tight lit ~
872+145:8 name value
873+145:13 tight glyph ]
874+145:15 glyph [
875+145:16 tight name value
876+145:22 lit ~
877+145:23 tight glyph ]
878+147:1 DEDENT
879+147:1 DEDENT
880+147:1 NEWLINE
881+147:1 glyph ++
882+147:4 name bind
883+147:9 glyph |=
884+147:12 name args
885+147:16 tight glyph =
886+147:17 tight glyph [
887+147:18 tight glyph (
888+147:19 tight name unit
889+147:24 tvar A
890+147:25 tight glyph )
891+147:27 glyph $-(
892+147:30 tight tvar A
893+147:32 tvar B
894+147:33 tight glyph )
895+147:34 tight glyph ]
896+148:3 INDENT
897+148:3 glyph ?-
898+148:6 name args
899+149:5 INDENT
900+149:5 glyph [
901+149:6 tight name maybe
902+149:12 name f
903+149:13 tight glyph ]
904+149:15 glyph ^-
905+149:18 glyph (
906+149:19 tight name unit
907+149:24 tvar B
908+149:25 tight glyph )
909+150:7 INDENT
910+150:7 glyph ?-
911+150:10 name maybe
912+151:9 INDENT
913+151:9 lit ~
914+151:11 lit ~
915+152:9 NEWLINE
916+152:9 glyph [
917+152:10 tight lit ~
918+152:12 name value
919+152:17 tight glyph ]
920+152:19 glyph `
921+152:20 tight glyph (
922+152:21 tight name f
923+152:23 name value
924+152:28 tight glyph )
925+154:1 DEDENT
926+154:1 DEDENT
927+154:1 DEDENT
928+154:1 DEDENT
929+154:1 NEWLINE
930+154:1 glyph ++
931+154:4 name biff
932+154:9 glyph |=
933+154:12 name args
934+154:16 tight glyph =
935+154:17 tight glyph [
936+154:18 tight glyph (
937+154:19 tight name unit
938+154:24 tvar A
939+154:25 tight glyph )
940+154:27 glyph $-(
941+154:30 tight tvar A
942+154:32 glyph (
943+154:33 tight name unit
944+154:38 tvar B
945+154:39 tight glyph )
946+154:40 tight glyph )
947+154:41 tight glyph ]
948+155:3 INDENT
949+155:3 glyph ?-
950+155:6 name args
951+156:5 INDENT
952+156:5 glyph [
953+156:6 tight name maybe
954+156:12 name f
955+156:13 tight glyph ]
956+156:15 glyph ^-
957+156:18 glyph (
958+156:19 tight name unit
959+156:24 tvar B
960+156:25 tight glyph )
961+157:7 INDENT
962+157:7 glyph ?-
963+157:10 name maybe
964+158:9 INDENT
965+158:9 lit ~
966+158:11 lit ~
967+159:9 NEWLINE
968+159:9 glyph [
969+159:10 tight lit ~
970+159:12 name value
971+159:17 tight glyph ]
972+159:19 glyph (
973+159:20 tight name f
974+159:22 name value
975+159:27 tight glyph )
976+161:1 DEDENT
977+161:1 DEDENT
978+161:1 DEDENT
979+161:1 DEDENT
980+161:1 NEWLINE
981+161:1 glyph ++
982+161:4 name both
983+161:9 glyph |=
984+161:12 name args
985+161:16 tight glyph =
986+161:17 tight glyph [
987+161:18 tight glyph (
988+161:19 tight name unit
989+161:24 tvar A
990+161:25 tight glyph )
991+161:27 glyph (
992+161:28 tight name unit
993+161:33 tvar B
994+161:34 tight glyph )
995+161:35 tight glyph ]
996+162:3 INDENT
997+162:3 glyph ?-
998+162:6 name args
999+163:5 INDENT
1000+163:5 glyph [
1001+163:6 tight name first
1002+163:12 name second
1003+163:18 tight glyph ]
1004+163:20 glyph ^-
1005+163:23 glyph (
1006+163:24 tight name unit
1007+163:29 glyph [
1008+163:30 tight tvar A
1009+163:32 tvar B
1010+163:33 tight glyph ]
1011+163:34 tight glyph )
1012+164:7 INDENT
1013+164:7 glyph ?-
1014+164:10 name first
1015+165:9 INDENT
1016+165:9 lit ~
1017+165:11 lit ~
1018+166:9 NEWLINE
1019+166:9 glyph [
1020+166:10 tight lit ~
1021+166:12 name a
1022+166:13 tight glyph ]
1023+167:11 INDENT
1024+167:11 glyph ?-
1025+167:14 name second
1026+168:13 INDENT
1027+168:13 lit ~
1028+168:15 lit ~
1029+169:13 NEWLINE
1030+169:13 glyph [
1031+169:14 tight lit ~
1032+169:16 name b
1033+169:17 tight glyph ]
1034+169:19 glyph `
1035+169:20 tight glyph [
1036+169:21 tight name a
1037+169:23 name b
1038+169:24 tight glyph ]
1039+171:1 DEDENT
1040+171:1 DEDENT
1041+171:1 DEDENT
1042+171:1 DEDENT
1043+171:1 DEDENT
1044+171:1 DEDENT
1045+171:1 NEWLINE
1046+171:1 glyph ++
1047+171:4 name clap
1048+171:9 glyph |=
1049+171:12 name args
1050+171:16 tight glyph =
1051+171:17 tight glyph [
1052+171:18 tight glyph (
1053+171:19 tight name unit
1054+171:24 tvar A
1055+171:25 tight glyph )
1056+171:27 glyph (
1057+171:28 tight name unit
1058+171:33 tvar A
1059+171:34 tight glyph )
1060+171:36 glyph $-(
1061+171:39 tight glyph [
1062+171:40 tight tvar A
1063+171:42 tvar A
1064+171:43 tight glyph ]
1065+171:45 tvar A
1066+171:46 tight glyph )
1067+171:47 tight glyph ]
1068+172:3 INDENT
1069+172:3 glyph ?-
1070+172:6 name args
1071+173:5 INDENT
1072+173:5 glyph [
1073+173:6 tight name first
1074+173:12 name second
1075+173:19 name combine
1076+173:26 tight glyph ]
1077+174:7 INDENT
1078+174:7 glyph ?-
1079+174:10 name first
1080+175:9 INDENT
1081+175:9 lit ~
1082+175:11 name second
1083+176:9 NEWLINE
1084+176:9 glyph [
1085+176:10 tight lit ~
1086+176:12 name a
1087+176:13 tight glyph ]
1088+177:11 INDENT
1089+177:11 glyph ?-
1090+177:14 name second
1091+178:13 INDENT
1092+178:13 lit ~
1093+178:15 name first
1094+179:13 NEWLINE
1095+179:13 glyph [
1096+179:14 tight lit ~
1097+179:16 name b
1098+179:17 tight glyph ]
1099+179:19 glyph `
1100+179:20 tight glyph (
1101+179:21 tight name combine
1102+179:29 name a
1103+179:31 name b
1104+179:32 tight glyph )
1105+181:1 DEDENT
1106+181:1 DEDENT
1107+181:1 DEDENT
1108+181:1 DEDENT
1109+181:1 DEDENT
1110+181:1 DEDENT
1111+181:1 NEWLINE
1112+181:1 glyph ++
1113+181:4 name clef
1114+181:9 glyph |=
1115+181:12 name args
1116+181:16 tight glyph =
1117+181:17 tight glyph [
1118+181:18 tight glyph (
1119+181:19 tight name unit
1120+181:24 tvar A
1121+181:25 tight glyph )
1122+181:27 glyph (
1123+181:28 tight name unit
1124+181:33 tvar B
1125+181:34 tight glyph )
1126+181:36 glyph $-(
1127+181:39 tight glyph [
1128+181:40 tight tvar A
1129+181:42 tvar B
1130+181:43 tight glyph ]
1131+181:45 glyph (
1132+181:46 tight name unit
1133+181:51 tvar C
1134+181:52 tight glyph )
1135+181:53 tight glyph )
1136+181:54 tight glyph ]
1137+182:3 INDENT
1138+182:3 glyph ?-
1139+182:6 name args
1140+183:5 INDENT
1141+183:5 glyph [
1142+183:6 tight name first
1143+183:12 name second
1144+183:19 name combine
1145+183:26 tight glyph ]
1146+184:7 INDENT
1147+184:7 glyph ?-
1148+184:10 name first
1149+185:9 INDENT
1150+185:9 lit ~
1151+185:11 lit ~
1152+186:9 NEWLINE
1153+186:9 glyph [
1154+186:10 tight lit ~
1155+186:12 name a
1156+186:13 tight glyph ]
1157+187:11 INDENT
1158+187:11 glyph ?-
1159+187:14 name second
1160+188:13 INDENT
1161+188:13 lit ~
1162+188:15 lit ~
1163+189:13 NEWLINE
1164+189:13 glyph [
1165+189:14 tight lit ~
1166+189:16 name b
1167+189:17 tight glyph ]
1168+189:19 glyph (
1169+189:20 tight name combine
1170+189:28 name a
1171+189:30 name b
1172+189:31 tight glyph )
1173+191:1 DEDENT
1174+191:1 DEDENT
1175+191:1 DEDENT
1176+191:1 DEDENT
1177+191:1 DEDENT
1178+191:1 DEDENT
1179+191:1 NEWLINE
1180+191:1 glyph ++
1181+191:4 name skim
1182+191:9 glyph |=
1183+191:12 name args
1184+191:16 tight glyph =
1185+191:17 tight glyph [
1186+191:18 tight glyph (
1187+191:19 tight name list
1188+191:24 tvar A
1189+191:25 tight glyph )
1190+191:27 glyph $-(
1191+191:30 tight tvar A
1192+191:32 glyph ?
1193+191:33 tight glyph )
1194+191:34 tight glyph ]
1195+192:3 INDENT
1196+192:3 glyph ?-
1197+192:6 name args
1198+193:5 INDENT
1199+193:5 glyph [
1200+193:6 tight name xs
1201+193:9 name predicate
1202+193:18 tight glyph ]
1203+194:7 INDENT
1204+194:7 glyph ?-
1205+194:10 name xs
1206+195:9 INDENT
1207+195:9 lit ~
1208+195:11 lit ~
1209+196:9 NEWLINE
1210+196:9 glyph [
1211+196:10 tight name item
1212+196:15 name rest
1213+196:19 tight glyph ]
1214+197:11 INDENT
1215+197:11 glyph ?-
1216+197:14 glyph (
1217+197:15 tight name predicate
1218+197:25 name item
1219+197:29 tight glyph )
1220+198:13 INDENT
1221+198:13 lit %.y
1222+198:17 glyph [
1223+198:18 tight name item
1224+198:23 glyph (
1225+198:24 tight name skim
1226+198:29 name rest
1227+198:34 name predicate
1228+198:43 tight glyph )
1229+198:44 tight glyph ]
1230+199:13 NEWLINE
1231+199:13 lit %.n
1232+199:17 glyph (
1233+199:18 tight name skim
1234+199:23 name rest
1235+199:28 name predicate
1236+199:37 tight glyph )
1237+201:1 DEDENT
1238+201:1 DEDENT
1239+201:1 DEDENT
1240+201:1 DEDENT
1241+201:1 DEDENT
1242+201:1 DEDENT
1243+201:1 NEWLINE
1244+201:1 glyph ++
1245+201:4 name skip
1246+201:9 glyph |=
1247+201:12 name args
1248+201:16 tight glyph =
1249+201:17 tight glyph [
1250+201:18 tight glyph (
1251+201:19 tight name list
1252+201:24 tvar A
1253+201:25 tight glyph )
1254+201:27 glyph $-(
1255+201:30 tight tvar A
1256+201:32 glyph ?
1257+201:33 tight glyph )
1258+201:34 tight glyph ]
1259+202:3 INDENT
1260+202:3 glyph ?-
1261+202:6 name args
1262+203:5 INDENT
1263+203:5 glyph [
1264+203:6 tight name xs
1265+203:9 name predicate
1266+203:18 tight glyph ]
1267+204:7 INDENT
1268+204:7 glyph ?-
1269+204:10 name xs
1270+205:9 INDENT
1271+205:9 lit ~
1272+205:11 lit ~
1273+206:9 NEWLINE
1274+206:9 glyph [
1275+206:10 tight name item
1276+206:15 name rest
1277+206:19 tight glyph ]
1278+207:11 INDENT
1279+207:11 glyph ?-
1280+207:14 glyph (
1281+207:15 tight name predicate
1282+207:25 name item
1283+207:29 tight glyph )
1284+208:13 INDENT
1285+208:13 lit %.y
1286+208:17 glyph (
1287+208:18 tight name skip
1288+208:23 name rest
1289+208:28 name predicate
1290+208:37 tight glyph )
1291+209:13 NEWLINE
1292+209:13 lit %.n
1293+209:17 glyph [
1294+209:18 tight name item
1295+209:23 glyph (
1296+209:24 tight name skip
1297+209:29 name rest
1298+209:34 name predicate
1299+209:43 tight glyph )
1300+209:44 tight glyph ]
1301+211:1 DEDENT
1302+211:1 DEDENT
1303+211:1 DEDENT
1304+211:1 DEDENT
1305+211:1 DEDENT
1306+211:1 DEDENT
1307+211:1 NEWLINE
1308+211:1 glyph ++
1309+211:4 name levy
1310+211:9 glyph |=
1311+211:12 name args
1312+211:16 tight glyph =
1313+211:17 tight glyph [
1314+211:18 tight glyph (
1315+211:19 tight name list
1316+211:24 tvar A
1317+211:25 tight glyph )
1318+211:27 glyph $-(
1319+211:30 tight tvar A
1320+211:32 glyph ?
1321+211:33 tight glyph )
1322+211:34 tight glyph ]
1323+212:3 INDENT
1324+212:3 glyph ?-
1325+212:6 name args
1326+213:5 INDENT
1327+213:5 glyph [
1328+213:6 tight name xs
1329+213:9 name predicate
1330+213:18 tight glyph ]
1331+214:7 INDENT
1332+214:7 glyph ?-
1333+214:10 name xs
1334+215:9 INDENT
1335+215:9 lit ~
1336+215:11 lit %.y
1337+216:9 NEWLINE
1338+216:9 glyph [
1339+216:10 tight name item
1340+216:15 name rest
1341+216:19 tight glyph ]
1342+217:11 INDENT
1343+217:11 glyph ?-
1344+217:14 glyph (
1345+217:15 tight name predicate
1346+217:25 name item
1347+217:29 tight glyph )
1348+218:13 INDENT
1349+218:13 lit %.y
1350+218:17 glyph (
1351+218:18 tight name levy
1352+218:23 name rest
1353+218:28 name predicate
1354+218:37 tight glyph )
1355+219:13 NEWLINE
1356+219:13 lit %.n
1357+219:17 lit %.n
1358+221:1 DEDENT
1359+221:1 DEDENT
1360+221:1 DEDENT
1361+221:1 DEDENT
1362+221:1 DEDENT
1363+221:1 DEDENT
1364+221:1 NEWLINE
1365+221:1 glyph ++
1366+221:4 name lien
1367+221:9 glyph |=
1368+221:12 name args
1369+221:16 tight glyph =
1370+221:17 tight glyph [
1371+221:18 tight glyph (
1372+221:19 tight name list
1373+221:24 tvar A
1374+221:25 tight glyph )
1375+221:27 glyph $-(
1376+221:30 tight tvar A
1377+221:32 glyph ?
1378+221:33 tight glyph )
1379+221:34 tight glyph ]
1380+222:3 INDENT
1381+222:3 glyph ?-
1382+222:6 name args
1383+223:5 INDENT
1384+223:5 glyph [
1385+223:6 tight name xs
1386+223:9 name predicate
1387+223:18 tight glyph ]
1388+224:7 INDENT
1389+224:7 glyph ?-
1390+224:10 name xs
1391+225:9 INDENT
1392+225:9 lit ~
1393+225:11 lit %.n
1394+226:9 NEWLINE
1395+226:9 glyph [
1396+226:10 tight name item
1397+226:15 name rest
1398+226:19 tight glyph ]
1399+227:11 INDENT
1400+227:11 glyph ?-
1401+227:14 glyph (
1402+227:15 tight name predicate
1403+227:25 name item
1404+227:29 tight glyph )
1405+228:13 INDENT
1406+228:13 lit %.y
1407+228:17 lit %.y
1408+229:13 NEWLINE
1409+229:13 lit %.n
1410+229:17 glyph (
1411+229:18 tight name lien
1412+229:23 name rest
1413+229:28 name predicate
1414+229:37 tight glyph )
1415+231:1 DEDENT
1416+231:1 DEDENT
1417+231:1 DEDENT
1418+231:1 DEDENT
1419+231:1 DEDENT
1420+231:1 DEDENT
1421+231:1 NEWLINE
1422+231:1 glyph ++
1423+231:4 name roll
1424+231:9 glyph |=
1425+231:12 name args
1426+231:16 tight glyph =
1427+231:17 tight glyph [
1428+231:18 tight glyph (
1429+231:19 tight name list
1430+231:24 tvar A
1431+231:25 tight glyph )
1432+231:27 tvar B
1433+231:29 glyph $-(
1434+231:32 tight glyph [
1435+231:33 tight tvar A
1436+231:35 tvar B
1437+231:36 tight glyph ]
1438+231:38 tvar B
1439+231:39 tight glyph )
1440+231:40 tight glyph ]
1441+232:3 INDENT
1442+232:3 glyph ?-
1443+232:6 name args
1444+233:5 INDENT
1445+233:5 glyph [
1446+233:6 tight name xs
1447+233:9 name start
1448+233:15 name combine
1449+233:22 tight glyph ]
1450+234:7 INDENT
1451+234:7 glyph ?-
1452+234:10 name xs
1453+235:9 INDENT
1454+235:9 lit ~
1455+235:11 name start
1456+236:9 NEWLINE
1457+236:9 glyph [
1458+236:10 tight name item
1459+236:15 name rest
1460+236:19 tight glyph ]
1461+236:21 glyph (
1462+236:22 tight name roll
1463+236:27 name rest
1464+236:32 glyph (
1465+236:33 tight name combine
1466+236:41 name item
1467+236:46 name start
1468+236:51 tight glyph )
1469+236:53 name combine
1470+236:60 tight glyph )
1471+238:1 DEDENT
1472+238:1 DEDENT
1473+238:1 DEDENT
1474+238:1 DEDENT
1475+238:1 NEWLINE
1476+238:1 glyph ++
1477+238:4 name reel
1478+238:9 glyph |=
1479+238:12 name args
1480+238:16 tight glyph =
1481+238:17 tight glyph [
1482+238:18 tight glyph (
1483+238:19 tight name list
1484+238:24 tvar A
1485+238:25 tight glyph )
1486+238:27 tvar B
1487+238:29 glyph $-(
1488+238:32 tight glyph [
1489+238:33 tight tvar A
1490+238:35 tvar B
1491+238:36 tight glyph ]
1492+238:38 tvar B
1493+238:39 tight glyph )
1494+238:40 tight glyph ]
1495+239:3 INDENT
1496+239:3 glyph ?-
1497+239:6 name args
1498+240:5 INDENT
1499+240:5 glyph [
1500+240:6 tight name xs
1501+240:9 name start
1502+240:15 name combine
1503+240:22 tight glyph ]
1504+241:7 INDENT
1505+241:7 glyph ?-
1506+241:10 name xs
1507+242:9 INDENT
1508+242:9 lit ~
1509+242:11 name start
1510+243:9 NEWLINE
1511+243:9 glyph [
1512+243:10 tight name item
1513+243:15 name rest
1514+243:19 tight glyph ]
1515+243:21 glyph (
1516+243:22 tight name combine
1517+243:30 name item
1518+243:35 glyph (
1519+243:36 tight name reel
1520+243:41 name rest
1521+243:46 name start
1522+243:52 name combine
1523+243:59 tight glyph )
1524+243:60 tight glyph )
1525+245:1 DEDENT
1526+245:1 DEDENT
1527+245:1 DEDENT
1528+245:1 DEDENT
1529+245:1 NEWLINE
1530+245:1 glyph ++
1531+245:4 name flit
1532+245:9 glyph |=
1533+245:12 name predicate
1534+245:21 tight glyph =
1535+245:22 tight glyph $-(
1536+245:25 tight tvar A
1537+245:27 glyph ?
1538+245:28 tight glyph )
1539+246:3 INDENT
1540+246:3 glyph |=
1541+246:6 name value
1542+246:11 tight glyph =
1543+246:12 tight tvar A
1544+247:5 INDENT
1545+247:5 glyph ^-
1546+247:8 glyph (
1547+247:9 tight name unit
1548+247:14 tvar A
1549+247:15 tight glyph )
1550+248:7 INDENT
1551+248:7 glyph ?-
1552+248:10 glyph (
1553+248:11 tight name predicate
1554+248:21 name value
1555+248:26 tight glyph )
1556+249:9 INDENT
1557+249:9 lit %.y
1558+249:13 glyph `
1559+249:14 tight name value
1560+250:9 NEWLINE
1561+250:9 lit %.n
1562+250:13 lit ~
1563+252:1 DEDENT
1564+252:1 DEDENT
1565+252:1 DEDENT
1566+252:1 DEDENT
1567+252:1 NEWLINE
1568+252:1 glyph ++
1569+252:4 name murn
1570+252:9 glyph |=
1571+252:12 name args
1572+252:16 tight glyph =
1573+252:17 tight glyph [
1574+252:18 tight glyph (
1575+252:19 tight name list
1576+252:24 tvar A
1577+252:25 tight glyph )
1578+252:27 glyph $-(
1579+252:30 tight tvar A
1580+252:32 glyph (
1581+252:33 tight name unit
1582+252:38 tvar B
1583+252:39 tight glyph )
1584+252:40 tight glyph )
1585+252:41 tight glyph ]
1586+253:3 INDENT
1587+253:3 glyph ?-
1588+253:6 name args
1589+254:5 INDENT
1590+254:5 glyph [
1591+254:6 tight name xs
1592+254:9 name f
1593+254:10 tight glyph ]
1594+255:7 INDENT
1595+255:7 glyph ?-
1596+255:10 name xs
1597+256:9 INDENT
1598+256:9 lit ~
1599+256:11 lit ~
1600+257:9 NEWLINE
1601+257:9 glyph [
1602+257:10 tight name item
1603+257:15 name rest
1604+257:19 tight glyph ]
1605+258:11 INDENT
1606+258:11 glyph ?-
1607+258:14 glyph (
1608+258:15 tight name f
1609+258:17 name item
1610+258:21 tight glyph )
1611+259:13 INDENT
1612+259:13 lit ~
1613+259:15 glyph (
1614+259:16 tight name murn
1615+259:21 name rest
1616+259:26 name f
1617+259:27 tight glyph )
1618+260:13 NEWLINE
1619+260:13 glyph [
1620+260:14 tight lit ~
1621+260:16 name value
1622+260:21 tight glyph ]
1623+260:23 glyph [
1624+260:24 tight name value
1625+260:30 glyph (
1626+260:31 tight name murn
1627+260:36 name rest
1628+260:41 name f
1629+260:42 tight glyph )
1630+260:43 tight glyph ]
1631+262:1 DEDENT
1632+262:1 DEDENT
1633+262:1 DEDENT
1634+262:1 DEDENT
1635+262:1 DEDENT
1636+262:1 DEDENT
1637+262:1 NEWLINE
1638+262:1 glyph ++
1639+262:4 name join
1640+262:9 glyph |=
1641+262:12 name args
1642+262:16 tight glyph =
1643+262:17 tight glyph [
1644+262:18 tight tvar A
1645+262:20 glyph (
1646+262:21 tight name list
1647+262:26 tvar A
1648+262:27 tight glyph )
1649+262:28 tight glyph ]
1650+263:3 INDENT
1651+263:3 glyph ?-
1652+263:6 name args
1653+264:5 INDENT
1654+264:5 glyph [
1655+264:6 tight name separator
1656+264:16 name xs
1657+264:18 tight glyph ]
1658+265:7 INDENT
1659+265:7 glyph ?-
1660+265:10 name xs
1661+266:9 INDENT
1662+266:9 lit ~
1663+266:11 lit ~
1664+267:9 NEWLINE
1665+267:9 glyph [
1666+267:10 tight name item
1667+267:15 name rest
1668+267:19 tight glyph ]
1669+268:11 INDENT
1670+268:11 glyph ?-
1671+268:14 name rest
1672+269:13 INDENT
1673+269:13 lit ~
1674+269:15 glyph [
1675+269:16 tight name item
1676+269:21 lit ~
1677+269:22 tight glyph ]
1678+270:13 NEWLINE
1679+270:13 glyph [
1680+270:14 tight name next
1681+270:19 name more
1682+270:23 tight glyph ]
1683+270:25 glyph [
1684+270:26 tight name item
1685+270:31 glyph [
1686+270:32 tight name separator
1687+270:42 glyph (
1688+270:43 tight name join
1689+270:48 name separator
1690+270:58 name rest
1691+270:62 tight glyph )
1692+270:63 tight glyph ]
1693+270:64 tight glyph ]
1694+272:1 DEDENT
1695+272:1 DEDENT
1696+272:1 DEDENT
1697+272:1 DEDENT
1698+272:1 DEDENT
1699+272:1 DEDENT
1700+272:1 NEWLINE
1701+272:1 glyph ++
1702+272:4 name snip
1703+272:9 glyph |=
1704+272:12 name xs
1705+272:14 tight glyph =
1706+272:15 tight glyph (
1707+272:16 tight name list
1708+272:21 tvar A
1709+272:22 tight glyph )
1710+273:3 INDENT
1711+273:3 glyph ?-
1712+273:6 name xs
1713+274:5 INDENT
1714+274:5 lit ~
1715+274:7 lit ~
1716+275:5 NEWLINE
1717+275:5 glyph [
1718+275:6 tight name item
1719+275:11 name rest
1720+275:15 tight glyph ]
1721+276:7 INDENT
1722+276:7 glyph ?-
1723+276:10 name rest
1724+277:9 INDENT
1725+277:9 lit ~
1726+277:11 lit ~
1727+278:9 NEWLINE
1728+278:9 glyph [
1729+278:10 tight name next
1730+278:15 name more
1731+278:19 tight glyph ]
1732+278:21 glyph [
1733+278:22 tight name item
1734+278:27 glyph (
1735+278:28 tight name snip
1736+278:33 name rest
1737+278:37 tight glyph )
1738+278:38 tight glyph ]
1739+280:1 DEDENT
1740+280:1 DEDENT
1741+280:1 DEDENT
1742+280:1 DEDENT
1743+280:1 NEWLINE
1744+280:1 glyph ++
1745+280:4 name rear
1746+280:9 glyph |=
1747+280:12 name xs
1748+280:14 tight glyph =
1749+280:15 tight glyph (
1750+280:16 tight name list
1751+280:21 tvar A
1752+280:22 tight glyph )
1753+281:3 INDENT
1754+281:3 glyph ?-
1755+281:6 name xs
1756+282:5 INDENT
1757+282:5 lit ~
1758+282:7 glyph !!
1759+283:5 NEWLINE
1760+283:5 glyph [
1761+283:6 tight name item
1762+283:11 name rest
1763+283:15 tight glyph ]
1764+284:7 INDENT
1765+284:7 glyph ?-
1766+284:10 name rest
1767+285:9 INDENT
1768+285:9 lit ~
1769+285:11 name item
1770+286:9 NEWLINE
1771+286:9 glyph [
1772+286:10 tight name next
1773+286:15 name more
1774+286:19 tight glyph ]
1775+286:21 glyph (
1776+286:22 tight name rear
1777+286:27 name rest
1778+286:31 tight glyph )
1779+286:32 DEDENT
1780+286:32 DEDENT
1781+286:32 DEDENT
1782+286:32 DEDENT
1783+286:32 NEWLINE
tests/golden/prelude-unit-list-transforms/tree.txtnew file+774
@@ -0,0 +1,774 @@
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+ (cast 40:7
91+ (apply 40:10 list (tvar 40:16 A))
92+ (body 41:9
93+ (branch 41:9
94+ (wing 41:12 xs)
95+ (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
96+ (arm 43:11
97+ (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
98+ (tuple 43:23
99+ (wing 43:24 item)
100+ (group 43:29
101+ (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
102+ (value 45:1 turn
103+ (gate 45:9
104+ (face 45:12 args
105+ (cell 45:17
106+ (apply 45:18 list (tvar 45:24 A))
107+ (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
108+ (body 46:3
109+ (branch 46:3
110+ (wing 46:6 args)
111+ (arm 47:5
112+ (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
113+ (body 48:7
114+ (cast 48:7
115+ (apply 48:10 list (tvar 48:16 B))
116+ (body 49:9
117+ (branch 49:9
118+ (wing 49:12 xs)
119+ (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
120+ (arm 51:11
121+ (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
122+ (tuple 51:23
123+ (group 51:24
124+ (call 51:25 (wing 51:25 f) (wing 51:27 item)))
125+ (group 51:33
126+ (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
127+ (mold 53:1 dime
128+ (cell 53:9
129+ (face 53:10 p (aura 53:12 @ta))
130+ (face 53:16 q (aura 53:18 @))))
131+ (mold 55:1 hair
132+ (cell 55:9
133+ (face 55:10 p (aura 55:12 @ud))
134+ (face 55:16 q (aura 55:18 @ud))))
135+ (mold 57:1 pint
136+ (cell 57:9
137+ (face 57:10 p
138+ (cell 57:12
139+ (face 57:13 p (aura 57:15 @))
140+ (face 57:17 q (aura 57:19 @))))
141+ (face 57:22 q
142+ (cell 57:24
143+ (face 57:25 p (aura 57:27 @))
144+ (face 57:29 q (aura 57:31 @))))))
145+ (mold 59:1 coin
146+ (union 60:3
147+ (cell 60:3
148+ (const 60:4 %$)
149+ (face 60:7 p (ref 60:9 dime)))
150+ (cell 61:3
151+ (const 61:4 %blob)
152+ (face 61:10 p (noun 61:12)))
153+ (cell 62:3
154+ (const 62:4 %many)
155+ (face 62:10 p
156+ (apply 62:12 list (ref 62:18 coin))))))
157+ (mold 64:1 pair
158+ (generic 64:9 A B
159+ (cell 64:18
160+ (face 64:19 p (tvar 64:21 A))
161+ (face 64:23 q (tvar 64:25 B)))))
162+ (mold 66:1 trel
163+ (generic 66:9 A B C
164+ (cell 66:20
165+ (face 66:21 p (tvar 66:23 A))
166+ (face 66:25 q (tvar 66:27 B))
167+ (face 66:29 r (tvar 66:31 C)))))
168+ (mold 68:1 qual
169+ (generic 68:9 A B C D
170+ (cell 68:22
171+ (face 68:23 p (tvar 68:25 A))
172+ (face 68:27 q (tvar 68:29 B))
173+ (face 68:31 r (tvar 68:33 C))
174+ (face 68:35 s (tvar 68:37 D)))))
175+ (mold 70:1 cord (aura 70:9 @t))
176+ (mold 72:1 knot (aura 72:9 @ta))
177+ (mold 74:1 tape
178+ (apply 74:9 list (aura 74:15 @tD)))
179+ (mold 76:1 path
180+ (apply 76:9 list (ref 76:15 knot)))
181+ (mold 78:1 tank
182+ (union 79:3
183+ (ref 79:3 cord)
184+ (cell 80:3
185+ (const 80:4 %leaf)
186+ (face 80:10 p (ref 80:12 tape)))
187+ (cell 81:3
188+ (const 81:4 %palm)
189+ (face 81:10 p
190+ (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
191+ (face 81:39 q
192+ (apply 81:41 list (ref 81:47 tank))))
193+ (cell 82:3
194+ (const 82:4 %rose)
195+ (face 82:10 p
196+ (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
197+ (face 82:34 q
198+ (apply 82:36 list (ref 82:42 tank))))))
199+ (mold 84:1 nail
200+ (cell 84:9
201+ (face 84:10 p (ref 84:12 hair))
202+ (face 84:17 q (ref 84:19 tape))))
203+ (mold 86:1 edge
204+ (cell 86:9
205+ (face 86:10 p (ref 86:12 hair))
206+ (face 86:17 q
207+ (apply 86:19 unit
208+ (cell 86:25
209+ (face 86:26 p (noun 86:28))
210+ (face 86:30 q (ref 86:32 nail)))))))
211+ (mold 88:1 rule
212+ (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
213+ (mold 90:1 spot
214+ (cell 90:9
215+ (face 90:10 p (ref 90:12 path))
216+ (face 90:17 q (ref 90:19 pint))))
217+ (mold 92:1 toon
218+ (union 93:3
219+ (cell 93:3
220+ (const 93:4 %0)
221+ (face 93:7 p (noun 93:9)))
222+ (cell 94:3
223+ (const 94:4 %1)
224+ (face 94:7 p (noun 94:9)))
225+ (cell 95:3
226+ (const 95:4 %2)
227+ (face 95:7 p
228+ (apply 95:9 list (ref 95:15 tank))))))
229+ (mold 97:1 like
230+ (generic 97:9 A
231+ (cell 97:16
232+ (face 97:17 p (ref 97:19 hair))
233+ (face 97:24 q
234+ (apply 97:26 unit
235+ (cell 97:32
236+ (face 97:33 p (tvar 97:35 A))
237+ (face 97:37 q (ref 97:39 nail))))))))
238+ (value 99:1 wonk
239+ (gate 99:9
240+ (face 99:12 veq
241+ (apply 99:16 like (tvar 99:22 A)))
242+ (body 100:3
243+ (branch 100:3
244+ (wing 100:6 q.veq)
245+ (arm 101:5 (lit 101:5 ~) (crash 101:7))
246+ (arm 102:5
247+ (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
248+ (wing 102:17 p.product))))))
249+ (mold 104:1 lone
250+ (generic 104:9 A
251+ (cell 104:16
252+ (face 104:17 p (tvar 104:19 A)))))
253+ (mold 106:1 lest
254+ (generic 106:9 A
255+ (cell 106:16
256+ (face 106:17 i (tvar 106:19 A))
257+ (face 106:21 t
258+ (apply 106:23 list (tvar 106:29 A))))))
259+ (mold 108:1 pole
260+ (generic 108:9 A
261+ (union 109:3
262+ (const 109:3 ~)
263+ (cell 110:3
264+ (tvar 110:4 A)
265+ (apply 110:6 pole (tvar 110:12 A))))))
266+ (mold 112:1 quip
267+ (generic 112:9 A B
268+ (cell 112:18
269+ (apply 112:19 list (tvar 112:25 A))
270+ (tvar 112:28 B))))
271+ (mold 114:1 tree
272+ (generic 114:9 A
273+ (union 115:3
274+ (const 115:3 ~)
275+ (cell 116:3
276+ (face 116:4 n (tvar 116:6 A))
277+ (face 116:8 l
278+ (apply 116:10 tree (tvar 116:16 A)))
279+ (face 116:19 r
280+ (apply 116:21 tree (tvar 116:27 A)))))))
281+ (mold 118:1 each
282+ (generic 118:9 A B
283+ (union 119:3
284+ (cell 119:3
285+ (const 119:4 %|)
286+ (face 119:7 p (tvar 119:9 B)))
287+ (cell 120:3
288+ (const 120:4 %&)
289+ (face 120:7 p (tvar 120:9 A))))))
290+ (mold 122:1 bloq (aura 122:9 @))
291+ (value 124:1 some
292+ (gate 124:9
293+ (face 124:12 item (tvar 124:17 A))
294+ (unit 124:19 (wing 124:20 item))))
295+ (value 126:1 lure
296+ (gate 126:9
297+ (face 126:12 item (tvar 126:17 A))
298+ (body 127:3
299+ (cast 127:3
300+ (apply 127:6 list (tvar 127:12 A))
301+ (tuple 127:15 (wing 127:16 item) (lit 127:21 ~))))))
302+ (value 129:1 snoc
303+ (gate 129:9
304+ (face 129:12 args
305+ (cell 129:17
306+ (apply 129:18 list (tvar 129:24 A))
307+ (tvar 129:27 A)))
308+ (body 130:3
309+ (branch 130:3
310+ (wing 130:6 args)
311+ (arm 131:5
312+ (cell 131:5 (bind 131:6 xs) (bind 131:9 item))
313+ (group 131:15
314+ (call 131:16
315+ (wing 131:16 weld)
316+ (wing 131:21 xs)
317+ (tuple 131:24 (wing 131:25 item) (lit 131:30 ~)))))))))
318+ (value 133:1 flop
319+ (gate 133:9
320+ (face 133:12 xs
321+ (apply 133:15 list (tvar 133:21 A)))
322+ (body 134:3
323+ (value 134:3 reverse-into
324+ (gate 134:19
325+ (face 134:22 args
326+ (cell 134:27
327+ (apply 134:28 list (tvar 134:34 A))
328+ (apply 134:37 list (tvar 134:43 A))))
329+ (body 135:5
330+ (branch 135:5
331+ (wing 135:8 args)
332+ (arm 136:7
333+ (cell 136:7 (bind 136:8 rest) (bind 136:13 acc))
334+ (body 137:9
335+ (branch 137:9
336+ (wing 137:12 rest)
337+ (arm 138:11 (lit 138:11 ~) (wing 138:13 acc))
338+ (arm 139:11
339+ (cell 139:11 (bind 139:12 item) (bind 139:17 more))
340+ (group 139:23
341+ (call 139:24
342+ (wing 139:24 reverse-into)
343+ (wing 139:37 more)
344+ (tuple 139:42 (wing 139:43 item) (wing 139:48 acc))))))))))))
345+ (group 140:3
346+ (call 140:4 (wing 140:4 reverse-into) (wing 140:17 xs) (lit 140:20 ~))))))
347+ (value 142:1 drop
348+ (gate 142:9
349+ (face 142:12 maybe
350+ (apply 142:18 unit (tvar 142:24 A)))
351+ (body 143:3
352+ (branch 143:3
353+ (wing 143:6 maybe)
354+ (arm 144:5 (lit 144:5 ~) (lit 144:7 ~))
355+ (arm 145:5
356+ (cell 145:5 (lit 145:6 ~) (bind 145:8 value))
357+ (tuple 145:15 (wing 145:16 value) (lit 145:22 ~)))))))
358+ (value 147:1 bind
359+ (gate 147:9
360+ (face 147:12 args
361+ (cell 147:17
362+ (apply 147:18 unit (tvar 147:24 A))
363+ (fn 147:27 (tvar 147:30 A) (tvar 147:32 B))))
364+ (body 148:3
365+ (branch 148:3
366+ (wing 148:6 args)
367+ (arm 149:5
368+ (cell 149:5 (bind 149:6 maybe) (bind 149:12 f))
369+ (cast 149:15
370+ (apply 149:18 unit (tvar 149:24 B))
371+ (body 150:7
372+ (branch 150:7
373+ (wing 150:10 maybe)
374+ (arm 151:9 (lit 151:9 ~) (lit 151:11 ~))
375+ (arm 152:9
376+ (cell 152:9 (lit 152:10 ~) (bind 152:12 value))
377+ (unit 152:19
378+ (group 152:20
379+ (call 152:21 (wing 152:21 f) (wing 152:23 value)))))))))))))
380+ (value 154:1 biff
381+ (gate 154:9
382+ (face 154:12 args
383+ (cell 154:17
384+ (apply 154:18 unit (tvar 154:24 A))
385+ (fn 154:27
386+ (tvar 154:30 A)
387+ (apply 154:32 unit (tvar 154:38 B)))))
388+ (body 155:3
389+ (branch 155:3
390+ (wing 155:6 args)
391+ (arm 156:5
392+ (cell 156:5 (bind 156:6 maybe) (bind 156:12 f))
393+ (cast 156:15
394+ (apply 156:18 unit (tvar 156:24 B))
395+ (body 157:7
396+ (branch 157:7
397+ (wing 157:10 maybe)
398+ (arm 158:9 (lit 158:9 ~) (lit 158:11 ~))
399+ (arm 159:9
400+ (cell 159:9 (lit 159:10 ~) (bind 159:12 value))
401+ (group 159:19
402+ (call 159:20 (wing 159:20 f) (wing 159:22 value))))))))))))
403+ (value 161:1 both
404+ (gate 161:9
405+ (face 161:12 args
406+ (cell 161:17
407+ (apply 161:18 unit (tvar 161:24 A))
408+ (apply 161:27 unit (tvar 161:33 B))))
409+ (body 162:3
410+ (branch 162:3
411+ (wing 162:6 args)
412+ (arm 163:5
413+ (cell 163:5 (bind 163:6 first) (bind 163:12 second))
414+ (cast 163:20
415+ (apply 163:23 unit
416+ (cell 163:29 (tvar 163:30 A) (tvar 163:32 B)))
417+ (body 164:7
418+ (branch 164:7
419+ (wing 164:10 first)
420+ (arm 165:9 (lit 165:9 ~) (lit 165:11 ~))
421+ (arm 166:9
422+ (cell 166:9 (lit 166:10 ~) (bind 166:12 a))
423+ (body 167:11
424+ (branch 167:11
425+ (wing 167:14 second)
426+ (arm 168:13 (lit 168:13 ~) (lit 168:15 ~))
427+ (arm 169:13
428+ (cell 169:13 (lit 169:14 ~) (bind 169:16 b))
429+ (unit 169:19
430+ (tuple 169:20 (wing 169:21 a) (wing 169:23 b)))))))))))))))
431+ (value 171:1 clap
432+ (gate 171:9
433+ (face 171:12 args
434+ (cell 171:17
435+ (apply 171:18 unit (tvar 171:24 A))
436+ (apply 171:27 unit (tvar 171:33 A))
437+ (fn 171:36
438+ (cell 171:39 (tvar 171:40 A) (tvar 171:42 A))
439+ (tvar 171:45 A))))
440+ (body 172:3
441+ (branch 172:3
442+ (wing 172:6 args)
443+ (arm 173:5
444+ (cell 173:5 (bind 173:6 first) (bind 173:12 second) (bind 173:19 combine))
445+ (body 174:7
446+ (branch 174:7
447+ (wing 174:10 first)
448+ (arm 175:9 (lit 175:9 ~) (wing 175:11 second))
449+ (arm 176:9
450+ (cell 176:9 (lit 176:10 ~) (bind 176:12 a))
451+ (body 177:11
452+ (branch 177:11
453+ (wing 177:14 second)
454+ (arm 178:13 (lit 178:13 ~) (wing 178:15 first))
455+ (arm 179:13
456+ (cell 179:13 (lit 179:14 ~) (bind 179:16 b))
457+ (unit 179:19
458+ (group 179:20
459+ (call 179:21 (wing 179:21 combine) (wing 179:29 a) (wing 179:31 b)))))))))))))))
460+ (value 181:1 clef
461+ (gate 181:9
462+ (face 181:12 args
463+ (cell 181:17
464+ (apply 181:18 unit (tvar 181:24 A))
465+ (apply 181:27 unit (tvar 181:33 B))
466+ (fn 181:36
467+ (cell 181:39 (tvar 181:40 A) (tvar 181:42 B))
468+ (apply 181:45 unit (tvar 181:51 C)))))
469+ (body 182:3
470+ (branch 182:3
471+ (wing 182:6 args)
472+ (arm 183:5
473+ (cell 183:5 (bind 183:6 first) (bind 183:12 second) (bind 183:19 combine))
474+ (body 184:7
475+ (branch 184:7
476+ (wing 184:10 first)
477+ (arm 185:9 (lit 185:9 ~) (lit 185:11 ~))
478+ (arm 186:9
479+ (cell 186:9 (lit 186:10 ~) (bind 186:12 a))
480+ (body 187:11
481+ (branch 187:11
482+ (wing 187:14 second)
483+ (arm 188:13 (lit 188:13 ~) (lit 188:15 ~))
484+ (arm 189:13
485+ (cell 189:13 (lit 189:14 ~) (bind 189:16 b))
486+ (group 189:19
487+ (call 189:20 (wing 189:20 combine) (wing 189:28 a) (wing 189:30 b))))))))))))))
488+ (value 191:1 skim
489+ (gate 191:9
490+ (face 191:12 args
491+ (cell 191:17
492+ (apply 191:18 list (tvar 191:24 A))
493+ (fn 191:27 (tvar 191:30 A) (flag 191:32))))
494+ (body 192:3
495+ (branch 192:3
496+ (wing 192:6 args)
497+ (arm 193:5
498+ (cell 193:5 (bind 193:6 xs) (bind 193:9 predicate))
499+ (body 194:7
500+ (branch 194:7
501+ (wing 194:10 xs)
502+ (arm 195:9 (lit 195:9 ~) (lit 195:11 ~))
503+ (arm 196:9
504+ (cell 196:9 (bind 196:10 item) (bind 196:15 rest))
505+ (body 197:11
506+ (branch 197:11
507+ (group 197:14
508+ (call 197:15 (wing 197:15 predicate) (wing 197:25 item)))
509+ (arm 198:13
510+ (lit 198:13 %.y)
511+ (tuple 198:17
512+ (wing 198:18 item)
513+ (group 198:23
514+ (call 198:24 (wing 198:24 skim) (wing 198:29 rest) (wing 198:34 predicate)))))
515+ (arm 199:13
516+ (lit 199:13 %.n)
517+ (group 199:17
518+ (call 199:18 (wing 199:18 skim) (wing 199:23 rest) (wing 199:28 predicate))))))))))))))
519+ (value 201:1 skip
520+ (gate 201:9
521+ (face 201:12 args
522+ (cell 201:17
523+ (apply 201:18 list (tvar 201:24 A))
524+ (fn 201:27 (tvar 201:30 A) (flag 201:32))))
525+ (body 202:3
526+ (branch 202:3
527+ (wing 202:6 args)
528+ (arm 203:5
529+ (cell 203:5 (bind 203:6 xs) (bind 203:9 predicate))
530+ (body 204:7
531+ (branch 204:7
532+ (wing 204:10 xs)
533+ (arm 205:9 (lit 205:9 ~) (lit 205:11 ~))
534+ (arm 206:9
535+ (cell 206:9 (bind 206:10 item) (bind 206:15 rest))
536+ (body 207:11
537+ (branch 207:11
538+ (group 207:14
539+ (call 207:15 (wing 207:15 predicate) (wing 207:25 item)))
540+ (arm 208:13
541+ (lit 208:13 %.y)
542+ (group 208:17
543+ (call 208:18 (wing 208:18 skip) (wing 208:23 rest) (wing 208:28 predicate))))
544+ (arm 209:13
545+ (lit 209:13 %.n)
546+ (tuple 209:17
547+ (wing 209:18 item)
548+ (group 209:23
549+ (call 209:24 (wing 209:24 skip) (wing 209:29 rest) (wing 209:34 predicate)))))))))))))))
550+ (value 211:1 levy
551+ (gate 211:9
552+ (face 211:12 args
553+ (cell 211:17
554+ (apply 211:18 list (tvar 211:24 A))
555+ (fn 211:27 (tvar 211:30 A) (flag 211:32))))
556+ (body 212:3
557+ (branch 212:3
558+ (wing 212:6 args)
559+ (arm 213:5
560+ (cell 213:5 (bind 213:6 xs) (bind 213:9 predicate))
561+ (body 214:7
562+ (branch 214:7
563+ (wing 214:10 xs)
564+ (arm 215:9 (lit 215:9 ~) (lit 215:11 %.y))
565+ (arm 216:9
566+ (cell 216:9 (bind 216:10 item) (bind 216:15 rest))
567+ (body 217:11
568+ (branch 217:11
569+ (group 217:14
570+ (call 217:15 (wing 217:15 predicate) (wing 217:25 item)))
571+ (arm 218:13
572+ (lit 218:13 %.y)
573+ (group 218:17
574+ (call 218:18 (wing 218:18 levy) (wing 218:23 rest) (wing 218:28 predicate))))
575+ (arm 219:13 (lit 219:13 %.n) (lit 219:17 %.n))))))))))))
576+ (value 221:1 lien
577+ (gate 221:9
578+ (face 221:12 args
579+ (cell 221:17
580+ (apply 221:18 list (tvar 221:24 A))
581+ (fn 221:27 (tvar 221:30 A) (flag 221:32))))
582+ (body 222:3
583+ (branch 222:3
584+ (wing 222:6 args)
585+ (arm 223:5
586+ (cell 223:5 (bind 223:6 xs) (bind 223:9 predicate))
587+ (body 224:7
588+ (branch 224:7
589+ (wing 224:10 xs)
590+ (arm 225:9 (lit 225:9 ~) (lit 225:11 %.n))
591+ (arm 226:9
592+ (cell 226:9 (bind 226:10 item) (bind 226:15 rest))
593+ (body 227:11
594+ (branch 227:11
595+ (group 227:14
596+ (call 227:15 (wing 227:15 predicate) (wing 227:25 item)))
597+ (arm 228:13 (lit 228:13 %.y) (lit 228:17 %.y))
598+ (arm 229:13
599+ (lit 229:13 %.n)
600+ (group 229:17
601+ (call 229:18 (wing 229:18 lien) (wing 229:23 rest) (wing 229:28 predicate))))))))))))))
602+ (value 231:1 roll
603+ (gate 231:9
604+ (face 231:12 args
605+ (cell 231:17
606+ (apply 231:18 list (tvar 231:24 A))
607+ (tvar 231:27 B)
608+ (fn 231:29
609+ (cell 231:32 (tvar 231:33 A) (tvar 231:35 B))
610+ (tvar 231:38 B))))
611+ (body 232:3
612+ (branch 232:3
613+ (wing 232:6 args)
614+ (arm 233:5
615+ (cell 233:5 (bind 233:6 xs) (bind 233:9 start) (bind 233:15 combine))
616+ (body 234:7
617+ (branch 234:7
618+ (wing 234:10 xs)
619+ (arm 235:9 (lit 235:9 ~) (wing 235:11 start))
620+ (arm 236:9
621+ (cell 236:9 (bind 236:10 item) (bind 236:15 rest))
622+ (group 236:21
623+ (call 236:22
624+ (wing 236:22 roll)
625+ (wing 236:27 rest)
626+ (group 236:32
627+ (call 236:33 (wing 236:33 combine) (wing 236:41 item) (wing 236:46 start)))
628+ (wing 236:53 combine)))))))))))
629+ (value 238:1 reel
630+ (gate 238:9
631+ (face 238:12 args
632+ (cell 238:17
633+ (apply 238:18 list (tvar 238:24 A))
634+ (tvar 238:27 B)
635+ (fn 238:29
636+ (cell 238:32 (tvar 238:33 A) (tvar 238:35 B))
637+ (tvar 238:38 B))))
638+ (body 239:3
639+ (branch 239:3
640+ (wing 239:6 args)
641+ (arm 240:5
642+ (cell 240:5 (bind 240:6 xs) (bind 240:9 start) (bind 240:15 combine))
643+ (body 241:7
644+ (branch 241:7
645+ (wing 241:10 xs)
646+ (arm 242:9 (lit 242:9 ~) (wing 242:11 start))
647+ (arm 243:9
648+ (cell 243:9 (bind 243:10 item) (bind 243:15 rest))
649+ (group 243:21
650+ (call 243:22
651+ (wing 243:22 combine)
652+ (wing 243:30 item)
653+ (group 243:35
654+ (call 243:36 (wing 243:36 reel) (wing 243:41 rest) (wing 243:46 start) (wing 243:52 combine)))))))))))))
655+ (value 245:1 flit
656+ (gate 245:9
657+ (face 245:12 predicate
658+ (fn 245:22 (tvar 245:25 A) (flag 245:27)))
659+ (body 246:3
660+ (gate 246:3
661+ (face 246:6 value (tvar 246:12 A))
662+ (body 247:5
663+ (cast 247:5
664+ (apply 247:8 unit (tvar 247:14 A))
665+ (body 248:7
666+ (branch 248:7
667+ (group 248:10
668+ (call 248:11 (wing 248:11 predicate) (wing 248:21 value)))
669+ (arm 249:9
670+ (lit 249:9 %.y)
671+ (unit 249:13 (wing 249:14 value)))
672+ (arm 250:9 (lit 250:9 %.n) (lit 250:13 ~))))))))))
673+ (value 252:1 murn
674+ (gate 252:9
675+ (face 252:12 args
676+ (cell 252:17
677+ (apply 252:18 list (tvar 252:24 A))
678+ (fn 252:27
679+ (tvar 252:30 A)
680+ (apply 252:32 unit (tvar 252:38 B)))))
681+ (body 253:3
682+ (branch 253:3
683+ (wing 253:6 args)
684+ (arm 254:5
685+ (cell 254:5 (bind 254:6 xs) (bind 254:9 f))
686+ (body 255:7
687+ (branch 255:7
688+ (wing 255:10 xs)
689+ (arm 256:9 (lit 256:9 ~) (lit 256:11 ~))
690+ (arm 257:9
691+ (cell 257:9 (bind 257:10 item) (bind 257:15 rest))
692+ (body 258:11
693+ (branch 258:11
694+ (group 258:14
695+ (call 258:15 (wing 258:15 f) (wing 258:17 item)))
696+ (arm 259:13
697+ (lit 259:13 ~)
698+ (group 259:15
699+ (call 259:16 (wing 259:16 murn) (wing 259:21 rest) (wing 259:26 f))))
700+ (arm 260:13
701+ (cell 260:13 (lit 260:14 ~) (bind 260:16 value))
702+ (tuple 260:23
703+ (wing 260:24 value)
704+ (group 260:30
705+ (call 260:31 (wing 260:31 murn) (wing 260:36 rest) (wing 260:41 f)))))))))))))))
706+ (value 262:1 join
707+ (gate 262:9
708+ (face 262:12 args
709+ (cell 262:17
710+ (tvar 262:18 A)
711+ (apply 262:20 list (tvar 262:26 A))))
712+ (body 263:3
713+ (branch 263:3
714+ (wing 263:6 args)
715+ (arm 264:5
716+ (cell 264:5 (bind 264:6 separator) (bind 264:16 xs))
717+ (body 265:7
718+ (branch 265:7
719+ (wing 265:10 xs)
720+ (arm 266:9 (lit 266:9 ~) (lit 266:11 ~))
721+ (arm 267:9
722+ (cell 267:9 (bind 267:10 item) (bind 267:15 rest))
723+ (body 268:11
724+ (branch 268:11
725+ (wing 268:14 rest)
726+ (arm 269:13
727+ (lit 269:13 ~)
728+ (tuple 269:15 (wing 269:16 item) (lit 269:21 ~)))
729+ (arm 270:13
730+ (cell 270:13 (bind 270:14 next) (bind 270:19 more))
731+ (tuple 270:25
732+ (wing 270:26 item)
733+ (tuple 270:31
734+ (wing 270:32 separator)
735+ (group 270:42
736+ (call 270:43 (wing 270:43 join) (wing 270:48 separator) (wing 270:58 rest))))))))))))))))
737+ (value 272:1 snip
738+ (gate 272:9
739+ (face 272:12 xs
740+ (apply 272:15 list (tvar 272:21 A)))
741+ (body 273:3
742+ (branch 273:3
743+ (wing 273:6 xs)
744+ (arm 274:5 (lit 274:5 ~) (lit 274:7 ~))
745+ (arm 275:5
746+ (cell 275:5 (bind 275:6 item) (bind 275:11 rest))
747+ (body 276:7
748+ (branch 276:7
749+ (wing 276:10 rest)
750+ (arm 277:9 (lit 277:9 ~) (lit 277:11 ~))
751+ (arm 278:9
752+ (cell 278:9 (bind 278:10 next) (bind 278:15 more))
753+ (tuple 278:21
754+ (wing 278:22 item)
755+ (group 278:27
756+ (call 278:28 (wing 278:28 snip) (wing 278:33 rest))))))))))))
757+ (value 280:1 rear
758+ (gate 280:9
759+ (face 280:12 xs
760+ (apply 280:15 list (tvar 280:21 A)))
761+ (body 281:3
762+ (branch 281:3
763+ (wing 281:6 xs)
764+ (arm 282:5 (lit 282:5 ~) (crash 282:7))
765+ (arm 283:5
766+ (cell 283:5 (bind 283:6 item) (bind 283:11 rest))
767+ (body 284:7
768+ (branch 284:7
769+ (wing 284:10 rest)
770+ (arm 285:9 (lit 285:9 ~) (wing 285:11 item))
771+ (arm 286:9
772+ (cell 286:9 (bind 286:10 next) (bind 286:15 more))
773+ (group 286:21
774+ (call 286:22 (wing 286:22 rear) (wing 286:27 rest))))))))))))
tests/golden/prelude-unit-list-transforms/types.txtnew file+58
@@ -0,0 +1,58 @@
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: $-([(unit A) A] A)
9+++ need: $-((unit A) A)
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
31++$ lone: not checked
32++$ lest: not checked
33++$ pole: cases proven disjoint; mold not checked
34++$ quip: not checked
35++$ tree: cases proven disjoint; mold not checked
36++$ each: cases proven disjoint; mold not checked
37++$ bloq: not checked
38+++ some: unit construction needs the standard prelude in partial inference
39+++ lure: cast mold is not supported by partial inference
40+++ snoc: sample mold is not supported by partial inference
41+++ flop: sample mold is not supported by partial inference
42+++ drop: unit branch results need unsupported inference
43+++ bind: unit construction needs the standard prelude in partial inference
44+++ biff: $-([(unit A) $-(A (unit B))] (unit B))
45+++ both: unit construction needs the standard prelude in partial inference
46+++ clap: branch pattern is not supported by partial inference
47+++ clef: branch pattern is not supported by partial inference
48+++ skim: sample mold is not supported by partial inference
49+++ skip: sample mold is not supported by partial inference
50+++ levy: sample mold is not supported by partial inference
51+++ lien: sample mold is not supported by partial inference
52+++ roll: sample mold is not supported by partial inference
53+++ reel: sample mold is not supported by partial inference
54+++ flit: unit construction needs the standard prelude in partial inference
55+++ murn: sample mold is not supported by partial inference
56+++ join: sample mold is not supported by partial inference
57+++ snip: sample mold is not supported by partial inference
58+++ rear: sample mold is not supported by partial inference
tests/golden/types-capital-distinct/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Decisions, Type variables: "Capitals, generalized per `++`"; "a different type takes a different capital".
2+tests: Different explicitly written capitals cannot be forced equal via a call or cast; their source sites are reported. Repeated spelling, independent capitals and concrete-forcing controls retain their intended behavior.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-capital-distinct/source.jibbnew file+6
@@ -0,0 +1,6 @@
1+++ repeat |= p=[A A] p
2+++ same |= p=[A A] p
3+++ independent |= p=[A B] p
4+++ bad-call |= p=[A B] (repeat p)
5+++ bad-cast |= p=[A B] ^- [A A] p
6+++ concrete |= x=A ^- @t x
tests/golden/types-capital-distinct/tokens.txtnew file+73
@@ -0,0 +1,73 @@
1+1:1 glyph ++
2+1:4 name repeat
3+1:11 glyph |=
4+1:14 name p
5+1:15 tight glyph =
6+1:16 tight glyph [
7+1:17 tight tvar A
8+1:19 tvar A
9+1:20 tight glyph ]
10+1:22 name p
11+2:1 NEWLINE
12+2:1 glyph ++
13+2:4 name same
14+2:9 glyph |=
15+2:12 name p
16+2:13 tight glyph =
17+2:14 tight glyph [
18+2:15 tight tvar A
19+2:17 tvar A
20+2:18 tight glyph ]
21+2:20 name p
22+3:1 NEWLINE
23+3:1 glyph ++
24+3:4 name independent
25+3:16 glyph |=
26+3:19 name p
27+3:20 tight glyph =
28+3:21 tight glyph [
29+3:22 tight tvar A
30+3:24 tvar B
31+3:25 tight glyph ]
32+3:27 name p
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name bad-call
36+4:13 glyph |=
37+4:16 name p
38+4:17 tight glyph =
39+4:18 tight glyph [
40+4:19 tight tvar A
41+4:21 tvar B
42+4:22 tight glyph ]
43+4:24 glyph (
44+4:25 tight name repeat
45+4:32 name p
46+4:33 tight glyph )
47+5:1 NEWLINE
48+5:1 glyph ++
49+5:4 name bad-cast
50+5:13 glyph |=
51+5:16 name p
52+5:17 tight glyph =
53+5:18 tight glyph [
54+5:19 tight tvar A
55+5:21 tvar B
56+5:22 tight glyph ]
57+5:24 glyph ^-
58+5:27 glyph [
59+5:28 tight tvar A
60+5:30 tvar A
61+5:31 tight glyph ]
62+5:33 name p
63+6:1 NEWLINE
64+6:1 glyph ++
65+6:4 name concrete
66+6:13 glyph |=
67+6:16 name x
68+6:17 tight glyph =
69+6:18 tight tvar A
70+6:20 glyph ^-
71+6:23 aura @t
72+6:26 name x
73+6:27 NEWLINE
tests/golden/types-capital-distinct/tree.txtnew file+33
@@ -0,0 +1,33 @@
1+(module
2+ (value 1:1 repeat
3+ (gate 1:11
4+ (face 1:14 p
5+ (cell 1:16 (tvar 1:17 A) (tvar 1:19 A)))
6+ (wing 1:22 p)))
7+ (value 2:1 same
8+ (gate 2:9
9+ (face 2:12 p
10+ (cell 2:14 (tvar 2:15 A) (tvar 2:17 A)))
11+ (wing 2:20 p)))
12+ (value 3:1 independent
13+ (gate 3:16
14+ (face 3:19 p
15+ (cell 3:21 (tvar 3:22 A) (tvar 3:24 B)))
16+ (wing 3:27 p)))
17+ (value 4:1 bad-call
18+ (gate 4:13
19+ (face 4:16 p
20+ (cell 4:18 (tvar 4:19 A) (tvar 4:21 B)))
21+ (group 4:24
22+ (call 4:25 (wing 4:25 repeat) (wing 4:32 p)))))
23+ (value 5:1 bad-cast
24+ (gate 5:13
25+ (face 5:16 p
26+ (cell 5:18 (tvar 5:19 A) (tvar 5:21 B)))
27+ (cast 5:24
28+ (cell 5:27 (tvar 5:28 A) (tvar 5:30 A))
29+ (wing 5:33 p))))
30+ (value 6:1 concrete
31+ (gate 6:13
32+ (face 6:16 x (tvar 6:18 A))
33+ (cast 6:20 (aura 6:23 @t) (wing 6:26 x)))))
tests/golden/types-capital-distinct/types.txtnew file+19
@@ -0,0 +1,19 @@
1+partial inference; module not checked
2+++ repeat: $-([A A] [A A])
3+++ same: $-([A A] [A A])
4+++ independent: $-([A B] [A B])
5+++ bad-call: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
6+/tests/golden/types-capital-distinct/source.jibb:4:19: first type variable
7+++ bad-call |= p=[A B] (repeat p)
8+ ^
9+/tests/golden/types-capital-distinct/source.jibb:4:21: second type variable
10+++ bad-call |= p=[A B] (repeat p)
11+ ^
12+++ bad-cast: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
13+/tests/golden/types-capital-distinct/source.jibb:5:19: first type variable
14+++ bad-cast |= p=[A B] ^- [A A] p
15+ ^
16+/tests/golden/types-capital-distinct/source.jibb:5:21: second type variable
17+++ bad-cast |= p=[A B] ^- [A A] p
18+ ^
19+++ concrete: explicit capital constraints are not supported by partial inference
tests/golden/types-generic-arity/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: Generic applications with too many or too few arguments fail closed.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-arity/source.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ carrier |$ [A] [payload=A count=@ud]
2++$ duo |$ [A B] [left=A right=B]
3+++ too-many ^- (carrier @t @p) [payload="hi" count=1]
4+++ too-few ^- (duo @t) [left="hi" right=~zod]
tests/golden/types-generic-arity/tokens.txtnew file+64
@@ -0,0 +1,64 @@
1+1:1 glyph +$
2+1:4 name carrier
3+1:12 glyph |$
4+1:15 glyph [
5+1:16 tight tvar A
6+1:17 tight glyph ]
7+1:19 glyph [
8+1:20 tight name payload
9+1:27 tight glyph =
10+1:28 tight tvar A
11+1:30 name count
12+1:35 tight glyph =
13+1:36 tight aura @ud
14+1:39 tight glyph ]
15+2:1 NEWLINE
16+2:1 glyph +$
17+2:4 name duo
18+2:8 glyph |$
19+2:11 glyph [
20+2:12 tight tvar A
21+2:14 tvar B
22+2:15 tight glyph ]
23+2:17 glyph [
24+2:18 tight name left
25+2:22 tight glyph =
26+2:23 tight tvar A
27+2:25 name right
28+2:30 tight glyph =
29+2:31 tight tvar B
30+2:32 tight glyph ]
31+3:1 NEWLINE
32+3:1 glyph ++
33+3:4 name too-many
34+3:13 glyph ^-
35+3:16 glyph (
36+3:17 tight name carrier
37+3:25 aura @t
38+3:28 aura @p
39+3:30 tight glyph )
40+3:32 glyph [
41+3:33 tight name payload
42+3:40 tight glyph =
43+3:41 tight str "hi"
44+3:46 name count
45+3:51 tight glyph =
46+3:52 tight lit 1
47+3:53 tight glyph ]
48+4:1 NEWLINE
49+4:1 glyph ++
50+4:4 name too-few
51+4:12 glyph ^-
52+4:15 glyph (
53+4:16 tight name duo
54+4:20 aura @t
55+4:22 tight glyph )
56+4:24 glyph [
57+4:25 tight name left
58+4:29 tight glyph =
59+4:30 tight str "hi"
60+4:35 name right
61+4:40 tight glyph =
62+4:41 tight lit ~zod
63+4:45 tight glyph ]
64+4:46 NEWLINE
tests/golden/types-generic-arity/tree.txtnew file+23
@@ -0,0 +1,23 @@
1+(module
2+ (mold 1:1 carrier
3+ (generic 1:12 A
4+ (cell 1:19
5+ (face 1:20 payload (tvar 1:28 A))
6+ (face 1:30 count (aura 1:36 @ud)))))
7+ (mold 2:1 duo
8+ (generic 2:8 A B
9+ (cell 2:17
10+ (face 2:18 left (tvar 2:23 A))
11+ (face 2:25 right (tvar 2:31 B)))))
12+ (value 3:1 too-many
13+ (cast 3:13
14+ (apply 3:16 carrier (aura 3:25 @t) (aura 3:28 @p))
15+ (tuple 3:32
16+ (face 3:33 payload (str 3:41 "hi"))
17+ (face 3:46 count (lit 3:52 1)))))
18+ (value 4:1 too-few
19+ (cast 4:12
20+ (apply 4:15 duo (aura 4:20 @t))
21+ (tuple 4:24
22+ (face 4:25 left (str 4:30 "hi"))
23+ (face 4:35 right (lit 4:41 ~zod))))))
tests/golden/types-generic-arity/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2++$ carrier: not checked
3++$ duo: not checked
4+++ too-many: cast mold is not supported by partial inference
5+++ too-few: cast mold is not supported by partial inference
tests/golden/types-generic-face-inference/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Faces are part of record types"; unnamed positions can take faces but two different explicit faces don't unify.
2+tests: A generic value fits a faced field with the same type variable, including union payloads and nested or repeated fields. Explicitly mismatched faces remain errors and differing-variable face propagation remains unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-face-inference/source.jibbnew file+8
@@ -0,0 +1,8 @@
1++$ choice |$ [A B]
2+ [%one value=A]
3+ [%two value=B]
4+++ make |= x=A ^- (choice A B) [%one x]
5+++ record |= x=A ^- [first=A second=A] [x x]
6+++ nested |= x=A ^- [outer=[first=A second=A] rest=A] [[x x] x]
7+++ mismatch |= x=[left=@t rest=@ud] ^- [right=@t rest=@ud] x
8+++ uncertain |= x=A ^- [first=B rest=@t] [x "hi"]
tests/golden/types-generic-face-inference/tokens.txtnew file+134
@@ -0,0 +1,134 @@
1+1:1 glyph +$
2+1:4 name choice
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar A
6+1:17 tvar B
7+1:18 tight glyph ]
8+2:3 INDENT
9+2:3 glyph [
10+2:4 tight lit %one
11+2:9 name value
12+2:14 tight glyph =
13+2:15 tight tvar A
14+2:16 tight glyph ]
15+3:3 NEWLINE
16+3:3 glyph [
17+3:4 tight lit %two
18+3:9 name value
19+3:14 tight glyph =
20+3:15 tight tvar B
21+3:16 tight glyph ]
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph ++
25+4:4 name make
26+4:9 glyph |=
27+4:12 name x
28+4:13 tight glyph =
29+4:14 tight tvar A
30+4:16 glyph ^-
31+4:19 glyph (
32+4:20 tight name choice
33+4:27 tvar A
34+4:29 tvar B
35+4:30 tight glyph )
36+4:32 glyph [
37+4:33 tight lit %one
38+4:38 name x
39+4:39 tight glyph ]
40+5:1 NEWLINE
41+5:1 glyph ++
42+5:4 name record
43+5:11 glyph |=
44+5:14 name x
45+5:15 tight glyph =
46+5:16 tight tvar A
47+5:18 glyph ^-
48+5:21 glyph [
49+5:22 tight name first
50+5:27 tight glyph =
51+5:28 tight tvar A
52+5:30 name second
53+5:36 tight glyph =
54+5:37 tight tvar A
55+5:38 tight glyph ]
56+5:40 glyph [
57+5:41 tight name x
58+5:43 name x
59+5:44 tight glyph ]
60+6:1 NEWLINE
61+6:1 glyph ++
62+6:4 name nested
63+6:11 glyph |=
64+6:14 name x
65+6:15 tight glyph =
66+6:16 tight tvar A
67+6:18 glyph ^-
68+6:21 glyph [
69+6:22 tight name outer
70+6:27 tight glyph =
71+6:28 tight glyph [
72+6:29 tight name first
73+6:34 tight glyph =
74+6:35 tight tvar A
75+6:37 name second
76+6:43 tight glyph =
77+6:44 tight tvar A
78+6:45 tight glyph ]
79+6:47 name rest
80+6:51 tight glyph =
81+6:52 tight tvar A
82+6:53 tight glyph ]
83+6:55 glyph [
84+6:56 tight glyph [
85+6:57 tight name x
86+6:59 name x
87+6:60 tight glyph ]
88+6:62 name x
89+6:63 tight glyph ]
90+7:1 NEWLINE
91+7:1 glyph ++
92+7:4 name mismatch
93+7:13 glyph |=
94+7:16 name x
95+7:17 tight glyph =
96+7:18 tight glyph [
97+7:19 tight name left
98+7:23 tight glyph =
99+7:24 tight aura @t
100+7:27 name rest
101+7:31 tight glyph =
102+7:32 tight aura @ud
103+7:35 tight glyph ]
104+7:37 glyph ^-
105+7:40 glyph [
106+7:41 tight name right
107+7:46 tight glyph =
108+7:47 tight aura @t
109+7:50 name rest
110+7:54 tight glyph =
111+7:55 tight aura @ud
112+7:58 tight glyph ]
113+7:60 name x
114+8:1 NEWLINE
115+8:1 glyph ++
116+8:4 name uncertain
117+8:14 glyph |=
118+8:17 name x
119+8:18 tight glyph =
120+8:19 tight tvar A
121+8:21 glyph ^-
122+8:24 glyph [
123+8:25 tight name first
124+8:30 tight glyph =
125+8:31 tight tvar B
126+8:33 name rest
127+8:37 tight glyph =
128+8:38 tight aura @t
129+8:40 tight glyph ]
130+8:42 glyph [
131+8:43 tight name x
132+8:45 str "hi"
133+8:49 tight glyph ]
134+8:50 NEWLINE
tests/golden/types-generic-face-inference/tree.txtnew file+56
@@ -0,0 +1,56 @@
1+(module
2+ (mold 1:1 choice
3+ (generic 1:11 A B
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %one)
7+ (face 2:9 value (tvar 2:15 A)))
8+ (cell 3:3
9+ (const 3:4 %two)
10+ (face 3:9 value (tvar 3:15 B))))))
11+ (value 4:1 make
12+ (gate 4:9
13+ (face 4:12 x (tvar 4:14 A))
14+ (cast 4:16
15+ (apply 4:19 choice (tvar 4:27 A) (tvar 4:29 B))
16+ (tuple 4:32 (lit 4:33 %one) (wing 4:38 x)))))
17+ (value 5:1 record
18+ (gate 5:11
19+ (face 5:14 x (tvar 5:16 A))
20+ (cast 5:18
21+ (cell 5:21
22+ (face 5:22 first (tvar 5:28 A))
23+ (face 5:30 second (tvar 5:37 A)))
24+ (tuple 5:40 (wing 5:41 x) (wing 5:43 x)))))
25+ (value 6:1 nested
26+ (gate 6:11
27+ (face 6:14 x (tvar 6:16 A))
28+ (cast 6:18
29+ (cell 6:21
30+ (face 6:22 outer
31+ (cell 6:28
32+ (face 6:29 first (tvar 6:35 A))
33+ (face 6:37 second (tvar 6:44 A))))
34+ (face 6:47 rest (tvar 6:52 A)))
35+ (tuple 6:55
36+ (tuple 6:56 (wing 6:57 x) (wing 6:59 x))
37+ (wing 6:62 x)))))
38+ (value 7:1 mismatch
39+ (gate 7:13
40+ (face 7:16 x
41+ (cell 7:18
42+ (face 7:19 left (aura 7:24 @t))
43+ (face 7:27 rest (aura 7:32 @ud))))
44+ (cast 7:37
45+ (cell 7:40
46+ (face 7:41 right (aura 7:47 @t))
47+ (face 7:50 rest (aura 7:55 @ud)))
48+ (wing 7:60 x))))
49+ (value 8:1 uncertain
50+ (gate 8:14
51+ (face 8:17 x (tvar 8:19 A))
52+ (cast 8:21
53+ (cell 8:24
54+ (face 8:25 first (tvar 8:31 B))
55+ (face 8:33 rest (aura 8:38 @t)))
56+ (tuple 8:42 (wing 8:43 x) (str 8:45 "hi"))))))
tests/golden/types-generic-face-inference/types.txtnew file+13
@@ -0,0 +1,13 @@
1+partial inference; module not checked
2++$ choice: cases proven disjoint; mold not checked
3+++ make: $-(A (choice A B))
4+++ record: $-(A [first=A second=A])
5+++ nested: $-(A [outer=[first=A second=A] rest=A])
6+++ mismatch: cast mold and expression type do not unify
7+/tests/golden/types-generic-face-inference/source.jibb:7:40: cast mold has type [right=@t rest=@ud]
8+++ mismatch |= x=[left=@t rest=@ud] ^- [right=@t rest=@ud] x
9+ ^
10+/tests/golden/types-generic-face-inference/source.jibb:7:60: expression has type [left=@t rest=@ud]
11+++ mismatch |= x=[left=@t rest=@ud] ^- [right=@t rest=@ud] x
12+ ^
13+++ uncertain: cast constraint is not supported by partial inference
tests/golden/types-generic-gates/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: Nonrecursive generic gate and two-parameter record molds retain independent parameter types.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-gates/source.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ mapper |$ [A B] $-(A B)
2++$ duo |$ [A B] [left=A right=B]
3+++ gate ^- (mapper @t @t) |= x=@t x
4+++ pair ^- (duo @t @p) [left="hi" right=~zod]
tests/golden/types-generic-gates/tokens.txtnew file+59
@@ -0,0 +1,59 @@
1+1:1 glyph +$
2+1:4 name mapper
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar A
6+1:17 tvar B
7+1:18 tight glyph ]
8+1:20 glyph $-(
9+1:23 tight tvar A
10+1:25 tvar B
11+1:26 tight glyph )
12+2:1 NEWLINE
13+2:1 glyph +$
14+2:4 name duo
15+2:8 glyph |$
16+2:11 glyph [
17+2:12 tight tvar A
18+2:14 tvar B
19+2:15 tight glyph ]
20+2:17 glyph [
21+2:18 tight name left
22+2:22 tight glyph =
23+2:23 tight tvar A
24+2:25 name right
25+2:30 tight glyph =
26+2:31 tight tvar B
27+2:32 tight glyph ]
28+3:1 NEWLINE
29+3:1 glyph ++
30+3:4 name gate
31+3:9 glyph ^-
32+3:12 glyph (
33+3:13 tight name mapper
34+3:20 aura @t
35+3:23 aura @t
36+3:25 tight glyph )
37+3:27 glyph |=
38+3:30 name x
39+3:31 tight glyph =
40+3:32 tight aura @t
41+3:35 name x
42+4:1 NEWLINE
43+4:1 glyph ++
44+4:4 name pair
45+4:9 glyph ^-
46+4:12 glyph (
47+4:13 tight name duo
48+4:17 aura @t
49+4:20 aura @p
50+4:22 tight glyph )
51+4:24 glyph [
52+4:25 tight name left
53+4:29 tight glyph =
54+4:30 tight str "hi"
55+4:35 name right
56+4:40 tight glyph =
57+4:41 tight lit ~zod
58+4:45 tight glyph ]
59+4:46 NEWLINE
tests/golden/types-generic-gates/tree.txtnew file+21
@@ -0,0 +1,21 @@
1+(module
2+ (mold 1:1 mapper
3+ (generic 1:11 A B
4+ (fn 1:20 (tvar 1:23 A) (tvar 1:25 B))))
5+ (mold 2:1 duo
6+ (generic 2:8 A B
7+ (cell 2:17
8+ (face 2:18 left (tvar 2:23 A))
9+ (face 2:25 right (tvar 2:31 B)))))
10+ (value 3:1 gate
11+ (cast 3:9
12+ (apply 3:12 mapper (aura 3:20 @t) (aura 3:23 @t))
13+ (gate 3:27
14+ (face 3:30 x (aura 3:32 @t))
15+ (wing 3:35 x))))
16+ (value 4:1 pair
17+ (cast 4:9
18+ (apply 4:12 duo (aura 4:17 @t) (aura 4:20 @p))
19+ (tuple 4:24
20+ (face 4:25 left (str 4:30 "hi"))
21+ (face 4:35 right (lit 4:41 ~zod))))))
tests/golden/types-generic-gates/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2++$ mapper: not checked
3++$ duo: not checked
4+++ gate: $-(@t @t)
5+++ pair: [left=@t right=@p]
tests/golden/types-generic-import-reverse/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Molds: generic molds.
2+tests: An imported two-parameter generic reverses its parameters for caller capitals and for concrete @t/@p arguments, without capturing either variable.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-import-reverse/module-trees.txtnew file+7
@@ -0,0 +1,7 @@
1+/ui/lib.jibb
2+(module
3+ (mold 1:1 reverse
4+ (generic 1:12 A B
5+ (cell 1:21
6+ (face 1:22 left (tvar 1:27 B))
7+ (face 1:29 right (tvar 1:35 A))))))
tests/golden/types-generic-import-reverse/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/types-generic-import-reverse/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1++$ reverse |$ [A B] [left=B right=A]
tests/golden/types-generic-import-reverse/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= lib /ui/lib
2+++ make |= [x=A y=B] ^- (reverse.lib A B) [left=y right=x]
3+++ concrete ^- (reverse.lib @t @p) [left=~zod right="hi"]
tests/golden/types-generic-import-reverse/tokens.txtnew file+50
@@ -0,0 +1,50 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name make
10+2:9 glyph |=
11+2:12 glyph [
12+2:13 tight name x
13+2:14 tight glyph =
14+2:15 tight tvar A
15+2:17 name y
16+2:18 tight glyph =
17+2:19 tight tvar B
18+2:20 tight glyph ]
19+2:22 glyph ^-
20+2:25 glyph (
21+2:26 tight wing reverse.lib
22+2:38 tvar A
23+2:40 tvar B
24+2:41 tight glyph )
25+2:43 glyph [
26+2:44 tight name left
27+2:48 tight glyph =
28+2:49 tight name y
29+2:51 name right
30+2:56 tight glyph =
31+2:57 tight name x
32+2:58 tight glyph ]
33+3:1 NEWLINE
34+3:1 glyph ++
35+3:4 name concrete
36+3:13 glyph ^-
37+3:16 glyph (
38+3:17 tight wing reverse.lib
39+3:29 aura @t
40+3:32 aura @p
41+3:34 tight glyph )
42+3:36 glyph [
43+3:37 tight name left
44+3:41 tight glyph =
45+3:42 tight lit ~zod
46+3:47 name right
47+3:52 tight glyph =
48+3:53 tight str "hi"
49+3:57 tight glyph ]
50+3:58 NEWLINE
tests/golden/types-generic-import-reverse/tree.txtnew file+18
@@ -0,0 +1,18 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 make
4+ (gate 2:9
5+ (cell 2:12
6+ (face 2:13 x (tvar 2:15 A))
7+ (face 2:17 y (tvar 2:19 B)))
8+ (cast 2:22
9+ (apply 2:25 reverse.lib (tvar 2:38 A) (tvar 2:40 B))
10+ (tuple 2:43
11+ (face 2:44 left (wing 2:49 y))
12+ (face 2:51 right (wing 2:57 x))))))
13+ (value 3:1 concrete
14+ (cast 3:13
15+ (apply 3:16 reverse.lib (aura 3:29 @t) (aura 3:32 @p))
16+ (tuple 3:36
17+ (face 3:37 left (lit 3:42 ~zod))
18+ (face 3:47 right (str 3:53 "hi"))))))
tests/golden/types-generic-import-reverse/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ make: $-([x=A y=B] [left=B right=A])
3+++ concrete: [left=@p right=@t]
tests/golden/types-generic-lexical-alias/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: generic molds declare parameters after `|$`.
2+tests: A non-generic alias cannot silently capture a generic caller's parameter with the same spelling; this partial checker leaves the use unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-lexical-alias/source.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ stray [field=A count=@ud]
2++$ box |$ [A] stray
3+++ example ^- (box @t) [field="hi" count=1]
tests/golden/types-generic-lexical-alias/tokens.txtnew file+35
@@ -0,0 +1,35 @@
1+1:1 glyph +$
2+1:4 name stray
3+1:10 glyph [
4+1:11 tight name field
5+1:16 tight glyph =
6+1:17 tight tvar A
7+1:19 name count
8+1:24 tight glyph =
9+1:25 tight aura @ud
10+1:28 tight glyph ]
11+2:1 NEWLINE
12+2:1 glyph +$
13+2:4 name box
14+2:8 glyph |$
15+2:11 glyph [
16+2:12 tight tvar A
17+2:13 tight glyph ]
18+2:15 name stray
19+3:1 NEWLINE
20+3:1 glyph ++
21+3:4 name example
22+3:12 glyph ^-
23+3:15 glyph (
24+3:16 tight name box
25+3:20 aura @t
26+3:22 tight glyph )
27+3:24 glyph [
28+3:25 tight name field
29+3:30 tight glyph =
30+3:31 tight str "hi"
31+3:36 name count
32+3:41 tight glyph =
33+3:42 tight lit 1
34+3:43 tight glyph ]
35+3:44 NEWLINE
tests/golden/types-generic-lexical-alias/tree.txtnew file+13
@@ -0,0 +1,13 @@
1+(module
2+ (mold 1:1 stray
3+ (cell 1:10
4+ (face 1:11 field (tvar 1:17 A))
5+ (face 1:19 count (aura 1:25 @ud))))
6+ (mold 2:1 box
7+ (generic 2:8 A (ref 2:15 stray)))
8+ (value 3:1 example
9+ (cast 3:12
10+ (apply 3:15 box (aura 3:20 @t))
11+ (tuple 3:24
12+ (face 3:25 field (str 3:31 "hi"))
13+ (face 3:36 count (lit 3:42 1))))))
tests/golden/types-generic-lexical-alias/types.txtnew file+4
@@ -0,0 +1,4 @@
1+partial inference; module not checked
2++$ stray: not checked
3++$ box: not checked
4+++ example: cast mold is not supported by partial inference
tests/golden/types-generic-local-parameter/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: generic molds name their own parameters after `|$`; gates generalize capitals per `++`.
2+tests: A body-local generic parameter spelled A stays distinct from the enclosing gate's A when the generic is instantiated at @t.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-local-parameter/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+++ make |= x=A
2+ +$ box |$ [A] [value=A count=@ud]
3+ ^- (box @t) [value="hi" count=1]
tests/golden/types-generic-local-parameter/tokens.txtnew file+37
@@ -0,0 +1,37 @@
1+1:1 glyph ++
2+1:4 name make
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 name box
10+2:10 glyph |$
11+2:13 glyph [
12+2:14 tight tvar A
13+2:15 tight glyph ]
14+2:17 glyph [
15+2:18 tight name value
16+2:23 tight glyph =
17+2:24 tight tvar A
18+2:26 name count
19+2:31 tight glyph =
20+2:32 tight aura @ud
21+2:35 tight glyph ]
22+3:3 NEWLINE
23+3:3 glyph ^-
24+3:6 glyph (
25+3:7 tight name box
26+3:11 aura @t
27+3:13 tight glyph )
28+3:15 glyph [
29+3:16 tight name value
30+3:21 tight glyph =
31+3:22 tight str "hi"
32+3:27 name count
33+3:32 tight glyph =
34+3:33 tight lit 1
35+3:34 tight glyph ]
36+3:35 DEDENT
37+3:35 NEWLINE
tests/golden/types-generic-local-parameter/tree.txtnew file+15
@@ -0,0 +1,15 @@
1+(module
2+ (value 1:1 make
3+ (gate 1:9
4+ (face 1:12 x (tvar 1:14 A))
5+ (body 2:3
6+ (mold 2:3 box
7+ (generic 2:10 A
8+ (cell 2:17
9+ (face 2:18 value (tvar 2:24 A))
10+ (face 2:26 count (aura 2:32 @ud)))))
11+ (cast 3:3
12+ (apply 3:6 box (aura 3:11 @t))
13+ (tuple 3:15
14+ (face 3:16 value (str 3:22 "hi"))
15+ (face 3:27 count (lit 3:33 1))))))))
tests/golden/types-generic-local-parameter/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ make: $-(A [value=@t count=@ud])
tests/golden/types-generic-local-scope/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: A local generic mold body mentioning an enclosing capital is not silently captured or conflated with its own parameter.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-local-scope/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+++ make |= x=A
2+ +$ box |$ [B] [outer=A inner=B]
3+ ^- (box @t) [outer=x inner="hi"]
tests/golden/types-generic-local-scope/tokens.txtnew file+37
@@ -0,0 +1,37 @@
1+1:1 glyph ++
2+1:4 name make
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 name box
10+2:10 glyph |$
11+2:13 glyph [
12+2:14 tight tvar B
13+2:15 tight glyph ]
14+2:17 glyph [
15+2:18 tight name outer
16+2:23 tight glyph =
17+2:24 tight tvar A
18+2:26 name inner
19+2:31 tight glyph =
20+2:32 tight tvar B
21+2:33 tight glyph ]
22+3:3 NEWLINE
23+3:3 glyph ^-
24+3:6 glyph (
25+3:7 tight name box
26+3:11 aura @t
27+3:13 tight glyph )
28+3:15 glyph [
29+3:16 tight name outer
30+3:21 tight glyph =
31+3:22 tight name x
32+3:24 name inner
33+3:29 tight glyph =
34+3:30 tight str "hi"
35+3:34 tight glyph ]
36+3:35 DEDENT
37+3:35 NEWLINE
tests/golden/types-generic-local-scope/tree.txtnew file+15
@@ -0,0 +1,15 @@
1+(module
2+ (value 1:1 make
3+ (gate 1:9
4+ (face 1:12 x (tvar 1:14 A))
5+ (body 2:3
6+ (mold 2:3 box
7+ (generic 2:10 B
8+ (cell 2:17
9+ (face 2:18 outer (tvar 2:24 A))
10+ (face 2:26 inner (tvar 2:32 B)))))
11+ (cast 3:3
12+ (apply 3:6 box (aura 3:11 @t))
13+ (tuple 3:15
14+ (face 3:16 outer (wing 3:22 x))
15+ (face 3:24 inner (str 3:30 "hi"))))))))
tests/golden/types-generic-local-scope/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ make: local molds need unsupported inference
tests/golden/types-generic-module/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Molds: generic molds.
2+tests: A generic record mold exported by a Jibb library is independently instantiated in its caller.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-module/module-trees.txtnew file+7
@@ -0,0 +1,7 @@
1+/ui/lib.jibb
2+(module
3+ (mold 1:1 carrier
4+ (generic 1:12 A
5+ (cell 1:19
6+ (face 1:20 payload (tvar 1:28 A))
7+ (face 1:30 count (aura 1:36 @ud))))))
tests/golden/types-generic-module/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/types-generic-module/modules/ui/lib.jibbnew file+1
@@ -0,0 +1 @@
1++$ carrier |$ [A] [payload=A count=@ud]
tests/golden/types-generic-module/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= lib /ui/lib
2+++ cord ^- (carrier.lib @t) [payload="hi" count=1]
3+++ ship ^- (carrier.lib @p) [payload=~zod count=2]
tests/golden/types-generic-module/tokens.txtnew file+39
@@ -0,0 +1,39 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name cord
10+2:9 glyph ^-
11+2:12 glyph (
12+2:13 tight wing carrier.lib
13+2:25 aura @t
14+2:27 tight glyph )
15+2:29 glyph [
16+2:30 tight name payload
17+2:37 tight glyph =
18+2:38 tight str "hi"
19+2:43 name count
20+2:48 tight glyph =
21+2:49 tight lit 1
22+2:50 tight glyph ]
23+3:1 NEWLINE
24+3:1 glyph ++
25+3:4 name ship
26+3:9 glyph ^-
27+3:12 glyph (
28+3:13 tight wing carrier.lib
29+3:25 aura @p
30+3:27 tight glyph )
31+3:29 glyph [
32+3:30 tight name payload
33+3:37 tight glyph =
34+3:38 tight lit ~zod
35+3:43 name count
36+3:48 tight glyph =
37+3:49 tight lit 2
38+3:50 tight glyph ]
39+3:51 NEWLINE
tests/golden/types-generic-module/tree.txtnew file+14
@@ -0,0 +1,14 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 cord
4+ (cast 2:9
5+ (apply 2:12 carrier.lib (aura 2:25 @t))
6+ (tuple 2:29
7+ (face 2:30 payload (str 2:38 "hi"))
8+ (face 2:43 count (lit 2:49 1)))))
9+ (value 3:1 ship
10+ (cast 3:9
11+ (apply 3:12 carrier.lib (aura 3:25 @p))
12+ (tuple 3:29
13+ (face 3:30 payload (lit 3:38 ~zod))
14+ (face 3:43 count (lit 3:49 2))))))
tests/golden/types-generic-module/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ cord: [payload=@t count=@ud]
3+++ ship: [payload=@p count=@ud]
tests/golden/types-generic-nested-scope/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: generic mold parameters are declared by `|$`.
2+tests: A nested generic's parameter named A is local to it and does not capture the caller's A; the fixed inner type stays @t while the outer type is @p.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-nested-scope/source.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ inner |$ [A] [payload=A count=@ud]
2++$ outer |$ [A] [fixed=(inner @t) bound=A]
3+++ ship ^- (outer @p) [fixed=[payload="hi" count=1] bound=~zod]
tests/golden/types-generic-nested-scope/tokens.txtnew file+56
@@ -0,0 +1,56 @@
1+1:1 glyph +$
2+1:4 name inner
3+1:10 glyph |$
4+1:13 glyph [
5+1:14 tight tvar A
6+1:15 tight glyph ]
7+1:17 glyph [
8+1:18 tight name payload
9+1:25 tight glyph =
10+1:26 tight tvar A
11+1:28 name count
12+1:33 tight glyph =
13+1:34 tight aura @ud
14+1:37 tight glyph ]
15+2:1 NEWLINE
16+2:1 glyph +$
17+2:4 name outer
18+2:10 glyph |$
19+2:13 glyph [
20+2:14 tight tvar A
21+2:15 tight glyph ]
22+2:17 glyph [
23+2:18 tight name fixed
24+2:23 tight glyph =
25+2:24 tight glyph (
26+2:25 tight name inner
27+2:31 aura @t
28+2:33 tight glyph )
29+2:35 name bound
30+2:40 tight glyph =
31+2:41 tight tvar A
32+2:42 tight glyph ]
33+3:1 NEWLINE
34+3:1 glyph ++
35+3:4 name ship
36+3:9 glyph ^-
37+3:12 glyph (
38+3:13 tight name outer
39+3:19 aura @p
40+3:21 tight glyph )
41+3:23 glyph [
42+3:24 tight name fixed
43+3:29 tight glyph =
44+3:30 tight glyph [
45+3:31 tight name payload
46+3:38 tight glyph =
47+3:39 tight str "hi"
48+3:44 name count
49+3:49 tight glyph =
50+3:50 tight lit 1
51+3:51 tight glyph ]
52+3:53 name bound
53+3:58 tight glyph =
54+3:59 tight lit ~zod
55+3:63 tight glyph ]
56+3:64 NEWLINE
tests/golden/types-generic-nested-scope/tree.txtnew file+21
@@ -0,0 +1,21 @@
1+(module
2+ (mold 1:1 inner
3+ (generic 1:10 A
4+ (cell 1:17
5+ (face 1:18 payload (tvar 1:26 A))
6+ (face 1:28 count (aura 1:34 @ud)))))
7+ (mold 2:1 outer
8+ (generic 2:10 A
9+ (cell 2:17
10+ (face 2:18 fixed
11+ (apply 2:24 inner (aura 2:31 @t)))
12+ (face 2:35 bound (tvar 2:41 A)))))
13+ (value 3:1 ship
14+ (cast 3:9
15+ (apply 3:12 outer (aura 3:19 @p))
16+ (tuple 3:23
17+ (face 3:24 fixed
18+ (tuple 3:30
19+ (face 3:31 payload (str 3:39 "hi"))
20+ (face 3:44 count (lit 3:50 1))))
21+ (face 3:53 bound (lit 3:59 ~zod))))))
tests/golden/types-generic-nested-scope/types.txtnew file+4
@@ -0,0 +1,4 @@
1+partial inference; module not checked
2++$ inner: not checked
3++$ outer: not checked
4+++ ship: [fixed=[payload=@t count=@ud] bound=@p]
tests/golden/types-generic-parameters/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: Duplicate declared parameters and an undeclared capital do not produce a valid generic type.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-parameters/source.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ duplicate |$ [A A] [left=A right=A]
2++$ undeclared |$ [A] [left=A right=B]
3+++ a ^- (duplicate @t @p) [left="hi" right=~zod]
4+++ b ^- (undeclared @t) [left="hi" right=~zod]
tests/golden/types-generic-parameters/tokens.txtnew file+64
@@ -0,0 +1,64 @@
1+1:1 glyph +$
2+1:4 name duplicate
3+1:14 glyph |$
4+1:17 glyph [
5+1:18 tight tvar A
6+1:20 tvar A
7+1:21 tight glyph ]
8+1:23 glyph [
9+1:24 tight name left
10+1:28 tight glyph =
11+1:29 tight tvar A
12+1:31 name right
13+1:36 tight glyph =
14+1:37 tight tvar A
15+1:38 tight glyph ]
16+2:1 NEWLINE
17+2:1 glyph +$
18+2:4 name undeclared
19+2:15 glyph |$
20+2:18 glyph [
21+2:19 tight tvar A
22+2:20 tight glyph ]
23+2:22 glyph [
24+2:23 tight name left
25+2:27 tight glyph =
26+2:28 tight tvar A
27+2:30 name right
28+2:35 tight glyph =
29+2:36 tight tvar B
30+2:37 tight glyph ]
31+3:1 NEWLINE
32+3:1 glyph ++
33+3:4 name a
34+3:6 glyph ^-
35+3:9 glyph (
36+3:10 tight name duplicate
37+3:20 aura @t
38+3:23 aura @p
39+3:25 tight glyph )
40+3:27 glyph [
41+3:28 tight name left
42+3:32 tight glyph =
43+3:33 tight str "hi"
44+3:38 name right
45+3:43 tight glyph =
46+3:44 tight lit ~zod
47+3:48 tight glyph ]
48+4:1 NEWLINE
49+4:1 glyph ++
50+4:4 name b
51+4:6 glyph ^-
52+4:9 glyph (
53+4:10 tight name undeclared
54+4:21 aura @t
55+4:23 tight glyph )
56+4:25 glyph [
57+4:26 tight name left
58+4:30 tight glyph =
59+4:31 tight str "hi"
60+4:36 name right
61+4:41 tight glyph =
62+4:42 tight lit ~zod
63+4:46 tight glyph ]
64+4:47 NEWLINE
tests/golden/types-generic-parameters/tree.txtnew file+23
@@ -0,0 +1,23 @@
1+(module
2+ (mold 1:1 duplicate
3+ (generic 1:14 A A
4+ (cell 1:23
5+ (face 1:24 left (tvar 1:29 A))
6+ (face 1:31 right (tvar 1:37 A)))))
7+ (mold 2:1 undeclared
8+ (generic 2:15 A
9+ (cell 2:22
10+ (face 2:23 left (tvar 2:28 A))
11+ (face 2:30 right (tvar 2:36 B)))))
12+ (value 3:1 a
13+ (cast 3:6
14+ (apply 3:9 duplicate (aura 3:20 @t) (aura 3:23 @p))
15+ (tuple 3:27
16+ (face 3:28 left (str 3:33 "hi"))
17+ (face 3:38 right (lit 3:44 ~zod)))))
18+ (value 4:1 b
19+ (cast 4:6
20+ (apply 4:9 undeclared (aura 4:21 @t))
21+ (tuple 4:25
22+ (face 4:26 left (str 4:31 "hi"))
23+ (face 4:36 right (lit 4:42 ~zod))))))
tests/golden/types-generic-parameters/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2++$ duplicate: not checked
3++$ undeclared: not checked
4+++ a: cast mold is not supported by partial inference
5+++ b: cast mold is not supported by partial inference
tests/golden/types-generic-record/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: A named generic record is independently instantiated at cord and ship types.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-record/source.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ carrier |$ [A] [payload=A count=@ud]
2+++ cord ^- (carrier @t) [payload="hi" count=1]
3+++ ship ^- (carrier @p) [payload=~zod count=2]
tests/golden/types-generic-record/tokens.txtnew file+47
@@ -0,0 +1,47 @@
1+1:1 glyph +$
2+1:4 name carrier
3+1:12 glyph |$
4+1:15 glyph [
5+1:16 tight tvar A
6+1:17 tight glyph ]
7+1:19 glyph [
8+1:20 tight name payload
9+1:27 tight glyph =
10+1:28 tight tvar A
11+1:30 name count
12+1:35 tight glyph =
13+1:36 tight aura @ud
14+1:39 tight glyph ]
15+2:1 NEWLINE
16+2:1 glyph ++
17+2:4 name cord
18+2:9 glyph ^-
19+2:12 glyph (
20+2:13 tight name carrier
21+2:21 aura @t
22+2:23 tight glyph )
23+2:25 glyph [
24+2:26 tight name payload
25+2:33 tight glyph =
26+2:34 tight str "hi"
27+2:39 name count
28+2:44 tight glyph =
29+2:45 tight lit 1
30+2:46 tight glyph ]
31+3:1 NEWLINE
32+3:1 glyph ++
33+3:4 name ship
34+3:9 glyph ^-
35+3:12 glyph (
36+3:13 tight name carrier
37+3:21 aura @p
38+3:23 tight glyph )
39+3:25 glyph [
40+3:26 tight name payload
41+3:33 tight glyph =
42+3:34 tight lit ~zod
43+3:39 name count
44+3:44 tight glyph =
45+3:45 tight lit 2
46+3:46 tight glyph ]
47+3:47 NEWLINE
tests/golden/types-generic-record/tree.txtnew file+18
@@ -0,0 +1,18 @@
1+(module
2+ (mold 1:1 carrier
3+ (generic 1:12 A
4+ (cell 1:19
5+ (face 1:20 payload (tvar 1:28 A))
6+ (face 1:30 count (aura 1:36 @ud)))))
7+ (value 2:1 cord
8+ (cast 2:9
9+ (apply 2:12 carrier (aura 2:21 @t))
10+ (tuple 2:25
11+ (face 2:26 payload (str 2:34 "hi"))
12+ (face 2:39 count (lit 2:45 1)))))
13+ (value 3:1 ship
14+ (cast 3:9
15+ (apply 3:12 carrier (aura 3:21 @p))
16+ (tuple 3:25
17+ (face 3:26 payload (lit 3:34 ~zod))
18+ (face 3:39 count (lit 3:45 2))))))
tests/golden/types-generic-record/types.txtnew file+4
@@ -0,0 +1,4 @@
1+partial inference; module not checked
2++$ carrier: not checked
3+++ cord: [payload=@t count=@ud]
4+++ ship: [payload=@p count=@ud]
tests/golden/types-generic-recursive-union/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Generic molds" are defined with `|$` after a `+$` name; type variables are capitals.
2+tests: Recursive generic and union bodies are explicitly unsupported by this bounded inference slice.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-recursive-union/source.jibbnew file+6
@@ -0,0 +1,6 @@
1++$ chain |$ [A]
2+ ~
3+ [A (chain A)]
4++$ loop |$ [A] [value=A rest=(loop A)]
5+++ a |= x=(chain @t) x
6+++ b |= x=(loop @t) x
tests/golden/types-generic-recursive-union/tokens.txtnew file+58
@@ -0,0 +1,58 @@
1+1:1 glyph +$
2+1:4 name chain
3+1:10 glyph |$
4+1:13 glyph [
5+1:14 tight tvar A
6+1:15 tight glyph ]
7+2:3 INDENT
8+2:3 lit ~
9+3:3 NEWLINE
10+3:3 glyph [
11+3:4 tight tvar A
12+3:6 glyph (
13+3:7 tight name chain
14+3:13 tvar A
15+3:14 tight glyph )
16+3:15 tight glyph ]
17+4:1 DEDENT
18+4:1 NEWLINE
19+4:1 glyph +$
20+4:4 name loop
21+4:9 glyph |$
22+4:12 glyph [
23+4:13 tight tvar A
24+4:14 tight glyph ]
25+4:16 glyph [
26+4:17 tight name value
27+4:22 tight glyph =
28+4:23 tight tvar A
29+4:25 name rest
30+4:29 tight glyph =
31+4:30 tight glyph (
32+4:31 tight name loop
33+4:36 tvar A
34+4:37 tight glyph )
35+4:38 tight glyph ]
36+5:1 NEWLINE
37+5:1 glyph ++
38+5:4 name a
39+5:6 glyph |=
40+5:9 name x
41+5:10 tight glyph =
42+5:11 tight glyph (
43+5:12 tight name chain
44+5:18 aura @t
45+5:20 tight glyph )
46+5:22 name x
47+6:1 NEWLINE
48+6:1 glyph ++
49+6:4 name b
50+6:6 glyph |=
51+6:9 name x
52+6:10 tight glyph =
53+6:11 tight glyph (
54+6:12 tight name loop
55+6:17 aura @t
56+6:19 tight glyph )
57+6:21 name x
58+6:22 NEWLINE
tests/golden/types-generic-recursive-union/tree.txtnew file+24
@@ -0,0 +1,24 @@
1+(module
2+ (mold 1:1 chain
3+ (generic 1:10 A
4+ (union 2:3
5+ (const 2:3 ~)
6+ (cell 3:3
7+ (tvar 3:4 A)
8+ (apply 3:6 chain (tvar 3:13 A))))))
9+ (mold 4:1 loop
10+ (generic 4:9 A
11+ (cell 4:16
12+ (face 4:17 value (tvar 4:23 A))
13+ (face 4:25 rest
14+ (apply 4:30 loop (tvar 4:36 A))))))
15+ (value 5:1 a
16+ (gate 5:6
17+ (face 5:9 x
18+ (apply 5:11 chain (aura 5:18 @t)))
19+ (wing 5:22 x)))
20+ (value 6:1 b
21+ (gate 6:6
22+ (face 6:9 x
23+ (apply 6:11 loop (aura 6:17 @t)))
24+ (wing 6:21 x))))
tests/golden/types-generic-recursive-union/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2++$ chain: cases proven disjoint; mold not checked
3++$ loop: not checked
4+++ a: sample mold is not supported by partial inference
5+++ b: sample mold is not supported by partial inference
tests/golden/types-generic-repeated/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: type variables are capitals; a generic mold names its parameters after `|$`.
2+tests: Repeated occurrences of one generic parameter retain the same type, accepting two cords and rejecting a cord paired with a ship.
3+expect: parses
4+expect-types: a partial inference report with the conflicting sites
tests/golden/types-generic-repeated/source.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ twin |$ [A] [left=A right=A]
2+++ good ^- (twin @t) [left="hi" right="bye"]
3+++ bad ^- (twin @t) [left="hi" right=~zod]
tests/golden/types-generic-repeated/tokens.txtnew file+47
@@ -0,0 +1,47 @@
1+1:1 glyph +$
2+1:4 name twin
3+1:9 glyph |$
4+1:12 glyph [
5+1:13 tight tvar A
6+1:14 tight glyph ]
7+1:16 glyph [
8+1:17 tight name left
9+1:21 tight glyph =
10+1:22 tight tvar A
11+1:24 name right
12+1:29 tight glyph =
13+1:30 tight tvar A
14+1:31 tight glyph ]
15+2:1 NEWLINE
16+2:1 glyph ++
17+2:4 name good
18+2:9 glyph ^-
19+2:12 glyph (
20+2:13 tight name twin
21+2:18 aura @t
22+2:20 tight glyph )
23+2:22 glyph [
24+2:23 tight name left
25+2:27 tight glyph =
26+2:28 tight str "hi"
27+2:33 name right
28+2:38 tight glyph =
29+2:39 tight str "bye"
30+2:44 tight glyph ]
31+3:1 NEWLINE
32+3:1 glyph ++
33+3:4 name bad
34+3:8 glyph ^-
35+3:11 glyph (
36+3:12 tight name twin
37+3:17 aura @t
38+3:19 tight glyph )
39+3:21 glyph [
40+3:22 tight name left
41+3:26 tight glyph =
42+3:27 tight str "hi"
43+3:32 name right
44+3:37 tight glyph =
45+3:38 tight lit ~zod
46+3:42 tight glyph ]
47+3:43 NEWLINE
tests/golden/types-generic-repeated/tree.txtnew file+18
@@ -0,0 +1,18 @@
1+(module
2+ (mold 1:1 twin
3+ (generic 1:9 A
4+ (cell 1:16
5+ (face 1:17 left (tvar 1:22 A))
6+ (face 1:24 right (tvar 1:30 A)))))
7+ (value 2:1 good
8+ (cast 2:9
9+ (apply 2:12 twin (aura 2:18 @t))
10+ (tuple 2:22
11+ (face 2:23 left (str 2:28 "hi"))
12+ (face 2:33 right (str 2:39 "bye")))))
13+ (value 3:1 bad
14+ (cast 3:8
15+ (apply 3:11 twin (aura 3:17 @t))
16+ (tuple 3:21
17+ (face 3:22 left (str 3:27 "hi"))
18+ (face 3:32 right (lit 3:38 ~zod))))))
tests/golden/types-generic-repeated/types.txtnew file+10
@@ -0,0 +1,10 @@
1+partial inference; module not checked
2++$ twin: not checked
3+++ good: [left=@t right=@t]
4+++ bad: cast mold and expression type do not unify
5+/tests/golden/types-generic-repeated/source.jibb:3:11: cast mold has type [left=@t right=@t]
6+++ bad ^- (twin @t) [left="hi" right=~zod]
7+ ^
8+/tests/golden/types-generic-repeated/source.jibb:3:21: expression has type [left=@t right=@p]
9+++ bad ^- (twin @t) [left="hi" right=~zod]
10+ ^
tests/golden/types-generic-union-alias-face/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: generic molds are applied with their arguments and faces are part of record types.
2+tests: A swapped imported alias handles concrete tagged payloads; a generic payload with the same explicit variable receives its field face; an incompatible concrete payload fails.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-alias-face/module-trees.txtnew file+11
@@ -0,0 +1,11 @@
1+/ui/base.jibb
2+(module
3+ (mold 1:1 choice
4+ (generic 1:11 V E
5+ (union 2:3
6+ (cell 2:3
7+ (const 2:4 %ok)
8+ (face 2:8 value (tvar 2:14 V)))
9+ (cell 3:3
10+ (const 3:4 %err)
11+ (face 3:9 error (tvar 3:15 E)))))))
tests/golden/types-generic-union-alias-face/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/base.jibb
tests/golden/types-generic-union-alias-face/modules/ui/base.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
tests/golden/types-generic-union-alias-face/source.jibbnew file+6
@@ -0,0 +1,6 @@
1+/= base /ui/base
2++$ relay |$ [A B] (choice.base B A)
3+++ make |= x=A ^- (relay A B) [%err x]
4+++ reveal |= v=(relay A B) v
5+++ with-text ^- (relay @t @p) [%err "hi"]
6+++ with-ship ^- (relay @t @p) [%err ~zod]
tests/golden/types-generic-union-alias-face/tokens.txtnew file+75
@@ -0,0 +1,75 @@
1+1:1 glyph /=
2+1:5 name base
3+1:10 glyph /
4+1:11 tight knot ui
5+1:13 tight glyph /
6+1:14 tight knot base
7+2:1 NEWLINE
8+2:1 glyph +$
9+2:4 name relay
10+2:10 glyph |$
11+2:13 glyph [
12+2:14 tight tvar A
13+2:16 tvar B
14+2:17 tight glyph ]
15+2:19 glyph (
16+2:20 tight wing choice.base
17+2:32 tvar B
18+2:34 tvar A
19+2:35 tight glyph )
20+3:1 NEWLINE
21+3:1 glyph ++
22+3:4 name make
23+3:9 glyph |=
24+3:12 name x
25+3:13 tight glyph =
26+3:14 tight tvar A
27+3:16 glyph ^-
28+3:19 glyph (
29+3:20 tight name relay
30+3:26 tvar A
31+3:28 tvar B
32+3:29 tight glyph )
33+3:31 glyph [
34+3:32 tight lit %err
35+3:37 name x
36+3:38 tight glyph ]
37+4:1 NEWLINE
38+4:1 glyph ++
39+4:4 name reveal
40+4:11 glyph |=
41+4:14 name v
42+4:15 tight glyph =
43+4:16 tight glyph (
44+4:17 tight name relay
45+4:23 tvar A
46+4:25 tvar B
47+4:26 tight glyph )
48+4:28 name v
49+5:1 NEWLINE
50+5:1 glyph ++
51+5:4 name with-text
52+5:14 glyph ^-
53+5:17 glyph (
54+5:18 tight name relay
55+5:24 aura @t
56+5:27 aura @p
57+5:29 tight glyph )
58+5:31 glyph [
59+5:32 tight lit %err
60+5:37 str "hi"
61+5:41 tight glyph ]
62+6:1 NEWLINE
63+6:1 glyph ++
64+6:4 name with-ship
65+6:14 glyph ^-
66+6:17 glyph (
67+6:18 tight name relay
68+6:24 aura @t
69+6:27 aura @p
70+6:29 tight glyph )
71+6:31 glyph [
72+6:32 tight lit %err
73+6:37 lit ~zod
74+6:41 tight glyph ]
75+6:42 NEWLINE
tests/golden/types-generic-union-alias-face/tree.txtnew file+24
@@ -0,0 +1,24 @@
1+(module
2+ (jibb 1:1 base /ui/base)
3+ (mold 2:1 relay
4+ (generic 2:10 A B
5+ (apply 2:19 choice.base (tvar 2:32 B) (tvar 2:34 A))))
6+ (value 3:1 make
7+ (gate 3:9
8+ (face 3:12 x (tvar 3:14 A))
9+ (cast 3:16
10+ (apply 3:19 relay (tvar 3:26 A) (tvar 3:28 B))
11+ (tuple 3:31 (lit 3:32 %err) (wing 3:37 x)))))
12+ (value 4:1 reveal
13+ (gate 4:11
14+ (face 4:14 v
15+ (apply 4:16 relay (tvar 4:23 A) (tvar 4:25 B)))
16+ (wing 4:28 v)))
17+ (value 5:1 with-text
18+ (cast 5:14
19+ (apply 5:17 relay (aura 5:24 @t) (aura 5:27 @p))
20+ (tuple 5:31 (lit 5:32 %err) (str 5:37 "hi"))))
21+ (value 6:1 with-ship
22+ (cast 6:14
23+ (apply 6:17 relay (aura 6:24 @t) (aura 6:27 @p))
24+ (tuple 6:31 (lit 6:32 %err) (lit 6:37 ~zod)))))
tests/golden/types-generic-union-alias-face/types.txtnew file+12
@@ -0,0 +1,12 @@
1+partial inference; module not checked
2++$ relay: not checked
3+++ make: $-(A (choice.base B A))
4+++ reveal: $-((choice.base A B) (choice.base A B))
5+++ with-text: (choice.base @p @t)
6+++ with-ship: cast mold and expression type do not unify
7+/tests/golden/types-generic-union-alias-face/source.jibb:6:17: cast mold
8+++ with-ship ^- (relay @t @p) [%err ~zod]
9+ ^
10+/tests/golden/types-generic-union-alias-face/source.jibb:6:31: expression
11+++ with-ship ^- (relay @t @p) [%err ~zod]
12+ ^
tests/golden/types-generic-union-alias/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: generic molds are applied with their arguments; Modules: "Everything is exported and read through the import's face".
2+tests: Generic aliases swap or repeat a union's arguments, ignore an alias parameter, and keep the original union identity; local aliases retain their scope; a forced merge of distinct capitals is reported at both sites.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-alias/source.jibbnew file+23
@@ -0,0 +1,23 @@
1++$ choice |$ [A B]
2+ [%one value=A]
3+ [%two value=B]
4++$ reverse |$ [A B] (choice B A)
5++$ repeat |$ [A] (choice A A)
6++$ extra |$ [A B] (choice A @p)
7+++ reverse-value ^- (reverse @t @p) [%one ~zod]
8+++ reverse-gate |= x=(reverse A B) x
9+++ repeat-gate |= x=(repeat A) x
10+++ repeated-call |= x=(choice A B) (repeat-gate x)
11+++ ghost-a ^- (extra @t @p) [%one "hi"]
12+++ ghost-b ^- (extra @t @ud) [%one "hi"]
13+++ use-ghost |= x=(extra @t @p) x
14+++ interchange (use-ghost ghost-b)
15+++ local |= x=A
16+ +$ alias |$ [B] (choice B @p)
17+ ^- (alias A) [%one x]
18+++ local-pass |= x=(choice A @p)
19+ +$ alias |$ [B] (choice B @p)
20+ ^- (alias A) x
21+++ local-shadow |= x=A
22+ +$ alias |$ [A] (choice A @p)
23+ ^- (alias @t) [%one "hi"]
tests/golden/types-generic-union-alias/tokens.txtnew file+248
@@ -0,0 +1,248 @@
1+1:1 glyph +$
2+1:4 name choice
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar A
6+1:17 tvar B
7+1:18 tight glyph ]
8+2:3 INDENT
9+2:3 glyph [
10+2:4 tight lit %one
11+2:9 name value
12+2:14 tight glyph =
13+2:15 tight tvar A
14+2:16 tight glyph ]
15+3:3 NEWLINE
16+3:3 glyph [
17+3:4 tight lit %two
18+3:9 name value
19+3:14 tight glyph =
20+3:15 tight tvar B
21+3:16 tight glyph ]
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph +$
25+4:4 name reverse
26+4:12 glyph |$
27+4:15 glyph [
28+4:16 tight tvar A
29+4:18 tvar B
30+4:19 tight glyph ]
31+4:21 glyph (
32+4:22 tight name choice
33+4:29 tvar B
34+4:31 tvar A
35+4:32 tight glyph )
36+5:1 NEWLINE
37+5:1 glyph +$
38+5:4 name repeat
39+5:11 glyph |$
40+5:14 glyph [
41+5:15 tight tvar A
42+5:16 tight glyph ]
43+5:18 glyph (
44+5:19 tight name choice
45+5:26 tvar A
46+5:28 tvar A
47+5:29 tight glyph )
48+6:1 NEWLINE
49+6:1 glyph +$
50+6:4 name extra
51+6:10 glyph |$
52+6:13 glyph [
53+6:14 tight tvar A
54+6:16 tvar B
55+6:17 tight glyph ]
56+6:19 glyph (
57+6:20 tight name choice
58+6:27 tvar A
59+6:29 aura @p
60+6:31 tight glyph )
61+7:1 NEWLINE
62+7:1 glyph ++
63+7:4 name reverse-value
64+7:18 glyph ^-
65+7:21 glyph (
66+7:22 tight name reverse
67+7:30 aura @t
68+7:33 aura @p
69+7:35 tight glyph )
70+7:37 glyph [
71+7:38 tight lit %one
72+7:43 lit ~zod
73+7:47 tight glyph ]
74+8:1 NEWLINE
75+8:1 glyph ++
76+8:4 name reverse-gate
77+8:17 glyph |=
78+8:20 name x
79+8:21 tight glyph =
80+8:22 tight glyph (
81+8:23 tight name reverse
82+8:31 tvar A
83+8:33 tvar B
84+8:34 tight glyph )
85+8:36 name x
86+9:1 NEWLINE
87+9:1 glyph ++
88+9:4 name repeat-gate
89+9:16 glyph |=
90+9:19 name x
91+9:20 tight glyph =
92+9:21 tight glyph (
93+9:22 tight name repeat
94+9:29 tvar A
95+9:30 tight glyph )
96+9:32 name x
97+10:1 NEWLINE
98+10:1 glyph ++
99+10:4 name repeated-call
100+10:18 glyph |=
101+10:21 name x
102+10:22 tight glyph =
103+10:23 tight glyph (
104+10:24 tight name choice
105+10:31 tvar A
106+10:33 tvar B
107+10:34 tight glyph )
108+10:36 glyph (
109+10:37 tight name repeat-gate
110+10:49 name x
111+10:50 tight glyph )
112+11:1 NEWLINE
113+11:1 glyph ++
114+11:4 name ghost-a
115+11:12 glyph ^-
116+11:15 glyph (
117+11:16 tight name extra
118+11:22 aura @t
119+11:25 aura @p
120+11:27 tight glyph )
121+11:29 glyph [
122+11:30 tight lit %one
123+11:35 str "hi"
124+11:39 tight glyph ]
125+12:1 NEWLINE
126+12:1 glyph ++
127+12:4 name ghost-b
128+12:12 glyph ^-
129+12:15 glyph (
130+12:16 tight name extra
131+12:22 aura @t
132+12:25 aura @ud
133+12:28 tight glyph )
134+12:30 glyph [
135+12:31 tight lit %one
136+12:36 str "hi"
137+12:40 tight glyph ]
138+13:1 NEWLINE
139+13:1 glyph ++
140+13:4 name use-ghost
141+13:14 glyph |=
142+13:17 name x
143+13:18 tight glyph =
144+13:19 tight glyph (
145+13:20 tight name extra
146+13:26 aura @t
147+13:29 aura @p
148+13:31 tight glyph )
149+13:33 name x
150+14:1 NEWLINE
151+14:1 glyph ++
152+14:4 name interchange
153+14:16 glyph (
154+14:17 tight name use-ghost
155+14:27 name ghost-b
156+14:34 tight glyph )
157+15:1 NEWLINE
158+15:1 glyph ++
159+15:4 name local
160+15:10 glyph |=
161+15:13 name x
162+15:14 tight glyph =
163+15:15 tight tvar A
164+16:3 INDENT
165+16:3 glyph +$
166+16:6 name alias
167+16:12 glyph |$
168+16:15 glyph [
169+16:16 tight tvar B
170+16:17 tight glyph ]
171+16:19 glyph (
172+16:20 tight name choice
173+16:27 tvar B
174+16:29 aura @p
175+16:31 tight glyph )
176+17:3 NEWLINE
177+17:3 glyph ^-
178+17:6 glyph (
179+17:7 tight name alias
180+17:13 tvar A
181+17:14 tight glyph )
182+17:16 glyph [
183+17:17 tight lit %one
184+17:22 name x
185+17:23 tight glyph ]
186+18:1 DEDENT
187+18:1 NEWLINE
188+18:1 glyph ++
189+18:4 name local-pass
190+18:15 glyph |=
191+18:18 name x
192+18:19 tight glyph =
193+18:20 tight glyph (
194+18:21 tight name choice
195+18:28 tvar A
196+18:30 aura @p
197+18:32 tight glyph )
198+19:3 INDENT
199+19:3 glyph +$
200+19:6 name alias
201+19:12 glyph |$
202+19:15 glyph [
203+19:16 tight tvar B
204+19:17 tight glyph ]
205+19:19 glyph (
206+19:20 tight name choice
207+19:27 tvar B
208+19:29 aura @p
209+19:31 tight glyph )
210+20:3 NEWLINE
211+20:3 glyph ^-
212+20:6 glyph (
213+20:7 tight name alias
214+20:13 tvar A
215+20:14 tight glyph )
216+20:16 name x
217+21:1 DEDENT
218+21:1 NEWLINE
219+21:1 glyph ++
220+21:4 name local-shadow
221+21:17 glyph |=
222+21:20 name x
223+21:21 tight glyph =
224+21:22 tight tvar A
225+22:3 INDENT
226+22:3 glyph +$
227+22:6 name alias
228+22:12 glyph |$
229+22:15 glyph [
230+22:16 tight tvar A
231+22:17 tight glyph ]
232+22:19 glyph (
233+22:20 tight name choice
234+22:27 tvar A
235+22:29 aura @p
236+22:31 tight glyph )
237+23:3 NEWLINE
238+23:3 glyph ^-
239+23:6 glyph (
240+23:7 tight name alias
241+23:13 aura @t
242+23:15 tight glyph )
243+23:17 glyph [
244+23:18 tight lit %one
245+23:23 str "hi"
246+23:27 tight glyph ]
247+23:28 DEDENT
248+23:28 NEWLINE
tests/golden/types-generic-union-alias/tree.txtnew file+86
@@ -0,0 +1,86 @@
1+(module
2+ (mold 1:1 choice
3+ (generic 1:11 A B
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %one)
7+ (face 2:9 value (tvar 2:15 A)))
8+ (cell 3:3
9+ (const 3:4 %two)
10+ (face 3:9 value (tvar 3:15 B))))))
11+ (mold 4:1 reverse
12+ (generic 4:12 A B
13+ (apply 4:21 choice (tvar 4:29 B) (tvar 4:31 A))))
14+ (mold 5:1 repeat
15+ (generic 5:11 A
16+ (apply 5:18 choice (tvar 5:26 A) (tvar 5:28 A))))
17+ (mold 6:1 extra
18+ (generic 6:10 A B
19+ (apply 6:19 choice (tvar 6:27 A) (aura 6:29 @p))))
20+ (value 7:1 reverse-value
21+ (cast 7:18
22+ (apply 7:21 reverse (aura 7:30 @t) (aura 7:33 @p))
23+ (tuple 7:37 (lit 7:38 %one) (lit 7:43 ~zod))))
24+ (value 8:1 reverse-gate
25+ (gate 8:17
26+ (face 8:20 x
27+ (apply 8:22 reverse (tvar 8:31 A) (tvar 8:33 B)))
28+ (wing 8:36 x)))
29+ (value 9:1 repeat-gate
30+ (gate 9:16
31+ (face 9:19 x
32+ (apply 9:21 repeat (tvar 9:29 A)))
33+ (wing 9:32 x)))
34+ (value 10:1 repeated-call
35+ (gate 10:18
36+ (face 10:21 x
37+ (apply 10:23 choice (tvar 10:31 A) (tvar 10:33 B)))
38+ (group 10:36
39+ (call 10:37 (wing 10:37 repeat-gate) (wing 10:49 x)))))
40+ (value 11:1 ghost-a
41+ (cast 11:12
42+ (apply 11:15 extra (aura 11:22 @t) (aura 11:25 @p))
43+ (tuple 11:29 (lit 11:30 %one) (str 11:35 "hi"))))
44+ (value 12:1 ghost-b
45+ (cast 12:12
46+ (apply 12:15 extra (aura 12:22 @t) (aura 12:25 @ud))
47+ (tuple 12:30 (lit 12:31 %one) (str 12:36 "hi"))))
48+ (value 13:1 use-ghost
49+ (gate 13:14
50+ (face 13:17 x
51+ (apply 13:19 extra (aura 13:26 @t) (aura 13:29 @p)))
52+ (wing 13:33 x)))
53+ (value 14:1 interchange
54+ (group 14:16
55+ (call 14:17 (wing 14:17 use-ghost) (wing 14:27 ghost-b))))
56+ (value 15:1 local
57+ (gate 15:10
58+ (face 15:13 x (tvar 15:15 A))
59+ (body 16:3
60+ (mold 16:3 alias
61+ (generic 16:12 B
62+ (apply 16:19 choice (tvar 16:27 B) (aura 16:29 @p))))
63+ (cast 17:3
64+ (apply 17:6 alias (tvar 17:13 A))
65+ (tuple 17:16 (lit 17:17 %one) (wing 17:22 x))))))
66+ (value 18:1 local-pass
67+ (gate 18:15
68+ (face 18:18 x
69+ (apply 18:20 choice (tvar 18:28 A) (aura 18:30 @p)))
70+ (body 19:3
71+ (mold 19:3 alias
72+ (generic 19:12 B
73+ (apply 19:19 choice (tvar 19:27 B) (aura 19:29 @p))))
74+ (cast 20:3
75+ (apply 20:6 alias (tvar 20:13 A))
76+ (wing 20:16 x)))))
77+ (value 21:1 local-shadow
78+ (gate 21:17
79+ (face 21:20 x (tvar 21:22 A))
80+ (body 22:3
81+ (mold 22:3 alias
82+ (generic 22:12 A
83+ (apply 22:19 choice (tvar 22:27 A) (aura 22:29 @p))))
84+ (cast 23:3
85+ (apply 23:6 alias (aura 23:13 @t))
86+ (tuple 23:17 (lit 23:18 %one) (str 23:23 "hi")))))))
tests/golden/types-generic-union-alias/types.txtnew file+22
@@ -0,0 +1,22 @@
1+partial inference; module not checked
2++$ choice: cases proven disjoint; mold not checked
3++$ reverse: not checked
4++$ repeat: not checked
5++$ extra: not checked
6+++ reverse-value: (choice @p @t)
7+++ reverse-gate: $-((choice A B) (choice A B))
8+++ repeat-gate: $-((choice A A) (choice A A))
9+++ repeated-call: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
10+/tests/golden/types-generic-union-alias/source.jibb:10:31: first type variable
11+++ repeated-call |= x=(choice A B) (repeat-gate x)
12+ ^
13+/tests/golden/types-generic-union-alias/source.jibb:10:33: second type variable
14+++ repeated-call |= x=(choice A B) (repeat-gate x)
15+ ^
16+++ ghost-a: (choice @t @p)
17+++ ghost-b: (choice @t @p)
18+++ use-ghost: $-((choice @t @p) (choice @t @p))
19+++ interchange: (choice @t @p)
20+++ local: $-(A (choice A @p))
21+++ local-pass: $-((choice A @p) (choice A @p))
22+++ local-shadow: $-(A (choice @t @p))
tests/golden/types-generic-union-capitals/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Decisions, Type variables: "Capitals, generalized per `++`; a capital in a local `++` shares the enclosing `++`'s variable of that name, and a different type takes a different capital".
2+tests: Distinct explicit capitals, repeated capitals, and local captures in generic-union molds. The checker rejects a forced merge of distinct capitals with both source sites; the same repeated capital remains usable.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-capitals/source.jibbnew file+17
@@ -0,0 +1,17 @@
1++$ choice |$ [A B]
2+ [%one value=A]
3+ [%two value=B]
4++$ phantom |$ [A]
5+ %yes
6+ %no
7+++ repeated |= x=(choice A A) x
8+++ independent |= x=(choice A B) x
9+++ already-same |= x=(choice A A) (repeated x)
10+++ merge-call |= x=(choice A B) (repeated x)
11+++ phantom-cast |= x=(phantom A) ^- (phantom B) x
12+++ local-merge |= x=(choice A B)
13+ ++ local |= y=(choice A A) y
14+ (local x)
15+++ captured-merge |= x=(choice A B)
16+ ++ captured |= flag=? x
17+ (repeated (captured %.y))
tests/golden/types-generic-union-capitals/tokens.txtnew file+162
@@ -0,0 +1,162 @@
1+1:1 glyph +$
2+1:4 name choice
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar A
6+1:17 tvar B
7+1:18 tight glyph ]
8+2:3 INDENT
9+2:3 glyph [
10+2:4 tight lit %one
11+2:9 name value
12+2:14 tight glyph =
13+2:15 tight tvar A
14+2:16 tight glyph ]
15+3:3 NEWLINE
16+3:3 glyph [
17+3:4 tight lit %two
18+3:9 name value
19+3:14 tight glyph =
20+3:15 tight tvar B
21+3:16 tight glyph ]
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph +$
25+4:4 name phantom
26+4:12 glyph |$
27+4:15 glyph [
28+4:16 tight tvar A
29+4:17 tight glyph ]
30+5:3 INDENT
31+5:3 lit %yes
32+6:3 NEWLINE
33+6:3 lit %no
34+7:1 DEDENT
35+7:1 NEWLINE
36+7:1 glyph ++
37+7:4 name repeated
38+7:13 glyph |=
39+7:16 name x
40+7:17 tight glyph =
41+7:18 tight glyph (
42+7:19 tight name choice
43+7:26 tvar A
44+7:28 tvar A
45+7:29 tight glyph )
46+7:31 name x
47+8:1 NEWLINE
48+8:1 glyph ++
49+8:4 name independent
50+8:16 glyph |=
51+8:19 name x
52+8:20 tight glyph =
53+8:21 tight glyph (
54+8:22 tight name choice
55+8:29 tvar A
56+8:31 tvar B
57+8:32 tight glyph )
58+8:34 name x
59+9:1 NEWLINE
60+9:1 glyph ++
61+9:4 name already-same
62+9:17 glyph |=
63+9:20 name x
64+9:21 tight glyph =
65+9:22 tight glyph (
66+9:23 tight name choice
67+9:30 tvar A
68+9:32 tvar A
69+9:33 tight glyph )
70+9:35 glyph (
71+9:36 tight name repeated
72+9:45 name x
73+9:46 tight glyph )
74+10:1 NEWLINE
75+10:1 glyph ++
76+10:4 name merge-call
77+10:15 glyph |=
78+10:18 name x
79+10:19 tight glyph =
80+10:20 tight glyph (
81+10:21 tight name choice
82+10:28 tvar A
83+10:30 tvar B
84+10:31 tight glyph )
85+10:33 glyph (
86+10:34 tight name repeated
87+10:43 name x
88+10:44 tight glyph )
89+11:1 NEWLINE
90+11:1 glyph ++
91+11:4 name phantom-cast
92+11:17 glyph |=
93+11:20 name x
94+11:21 tight glyph =
95+11:22 tight glyph (
96+11:23 tight name phantom
97+11:31 tvar A
98+11:32 tight glyph )
99+11:34 glyph ^-
100+11:37 glyph (
101+11:38 tight name phantom
102+11:46 tvar B
103+11:47 tight glyph )
104+11:49 name x
105+12:1 NEWLINE
106+12:1 glyph ++
107+12:4 name local-merge
108+12:16 glyph |=
109+12:19 name x
110+12:20 tight glyph =
111+12:21 tight glyph (
112+12:22 tight name choice
113+12:29 tvar A
114+12:31 tvar B
115+12:32 tight glyph )
116+13:3 INDENT
117+13:3 glyph ++
118+13:6 name local
119+13:12 glyph |=
120+13:15 name y
121+13:16 tight glyph =
122+13:17 tight glyph (
123+13:18 tight name choice
124+13:25 tvar A
125+13:27 tvar A
126+13:28 tight glyph )
127+13:30 name y
128+14:3 NEWLINE
129+14:3 glyph (
130+14:4 tight name local
131+14:10 name x
132+14:11 tight glyph )
133+15:1 DEDENT
134+15:1 NEWLINE
135+15:1 glyph ++
136+15:4 name captured-merge
137+15:19 glyph |=
138+15:22 name x
139+15:23 tight glyph =
140+15:24 tight glyph (
141+15:25 tight name choice
142+15:32 tvar A
143+15:34 tvar B
144+15:35 tight glyph )
145+16:3 INDENT
146+16:3 glyph ++
147+16:6 name captured
148+16:15 glyph |=
149+16:18 name flag
150+16:22 tight glyph =
151+16:23 tight glyph ?
152+16:25 name x
153+17:3 NEWLINE
154+17:3 glyph (
155+17:4 tight name repeated
156+17:13 glyph (
157+17:14 tight name captured
158+17:23 lit %.y
159+17:26 tight glyph )
160+17:27 tight glyph )
161+17:28 DEDENT
162+17:28 NEWLINE
tests/golden/types-generic-union-capitals/tree.txtnew file+68
@@ -0,0 +1,68 @@
1+(module
2+ (mold 1:1 choice
3+ (generic 1:11 A B
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %one)
7+ (face 2:9 value (tvar 2:15 A)))
8+ (cell 3:3
9+ (const 3:4 %two)
10+ (face 3:9 value (tvar 3:15 B))))))
11+ (mold 4:1 phantom
12+ (generic 4:12 A
13+ (union 5:3 (const 5:3 %yes) (const 6:3 %no))))
14+ (value 7:1 repeated
15+ (gate 7:13
16+ (face 7:16 x
17+ (apply 7:18 choice (tvar 7:26 A) (tvar 7:28 A)))
18+ (wing 7:31 x)))
19+ (value 8:1 independent
20+ (gate 8:16
21+ (face 8:19 x
22+ (apply 8:21 choice (tvar 8:29 A) (tvar 8:31 B)))
23+ (wing 8:34 x)))
24+ (value 9:1 already-same
25+ (gate 9:17
26+ (face 9:20 x
27+ (apply 9:22 choice (tvar 9:30 A) (tvar 9:32 A)))
28+ (group 9:35
29+ (call 9:36 (wing 9:36 repeated) (wing 9:45 x)))))
30+ (value 10:1 merge-call
31+ (gate 10:15
32+ (face 10:18 x
33+ (apply 10:20 choice (tvar 10:28 A) (tvar 10:30 B)))
34+ (group 10:33
35+ (call 10:34 (wing 10:34 repeated) (wing 10:43 x)))))
36+ (value 11:1 phantom-cast
37+ (gate 11:17
38+ (face 11:20 x
39+ (apply 11:22 phantom (tvar 11:31 A)))
40+ (cast 11:34
41+ (apply 11:37 phantom (tvar 11:46 B))
42+ (wing 11:49 x))))
43+ (value 12:1 local-merge
44+ (gate 12:16
45+ (face 12:19 x
46+ (apply 12:21 choice (tvar 12:29 A) (tvar 12:31 B)))
47+ (body 13:3
48+ (value 13:3 local
49+ (gate 13:12
50+ (face 13:15 y
51+ (apply 13:17 choice (tvar 13:25 A) (tvar 13:27 A)))
52+ (wing 13:30 y)))
53+ (group 14:3
54+ (call 14:4 (wing 14:4 local) (wing 14:10 x))))))
55+ (value 15:1 captured-merge
56+ (gate 15:19
57+ (face 15:22 x
58+ (apply 15:24 choice (tvar 15:32 A) (tvar 15:34 B)))
59+ (body 16:3
60+ (value 16:3 captured
61+ (gate 16:15
62+ (face 16:18 flag (flag 16:23))
63+ (wing 16:25 x)))
64+ (group 17:3
65+ (call 17:4
66+ (wing 17:4 repeated)
67+ (group 17:13
68+ (call 17:14 (wing 17:14 captured) (lit 17:23 %.y)))))))))
tests/golden/types-generic-union-capitals/types.txtnew file+34
@@ -0,0 +1,34 @@
1+partial inference; module not checked
2++$ choice: cases proven disjoint; mold not checked
3++$ phantom: cases proven disjoint; mold not checked
4+++ repeated: $-((choice A A) (choice A A))
5+++ independent: $-((choice A B) (choice A B))
6+++ already-same: $-((choice A A) (choice A A))
7+++ merge-call: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
8+/tests/golden/types-generic-union-capitals/source.jibb:10:28: first type variable
9+++ merge-call |= x=(choice A B) (repeated x)
10+ ^
11+/tests/golden/types-generic-union-capitals/source.jibb:10:30: second type variable
12+++ merge-call |= x=(choice A B) (repeated x)
13+ ^
14+++ phantom-cast: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
15+/tests/golden/types-generic-union-capitals/source.jibb:11:31: first type variable
16+++ phantom-cast |= x=(phantom A) ^- (phantom B) x
17+ ^
18+/tests/golden/types-generic-union-capitals/source.jibb:11:46: second type variable
19+++ phantom-cast |= x=(phantom A) ^- (phantom B) x
20+ ^
21+++ local-merge: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
22+/tests/golden/types-generic-union-capitals/source.jibb:12:29: first type variable
23+++ local-merge |= x=(choice A B)
24+ ^
25+/tests/golden/types-generic-union-capitals/source.jibb:12:31: second type variable
26+++ local-merge |= x=(choice A B)
27+ ^
28+++ captured-merge: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
29+/tests/golden/types-generic-union-capitals/source.jibb:15:32: first type variable
30+++ captured-merge |= x=(choice A B)
31+ ^
32+/tests/golden/types-generic-union-capitals/source.jibb:15:34: second type variable
33+++ captured-merge |= x=(choice A B)
34+ ^
tests/golden/types-generic-union-errors/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: union cases "must differ as nouns"; Tag resolution: "Tags take their union from context".
2+tests: Generic union arity, an unknown tag, mismatched payload and an overlapping instantiation do not silently succeed.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-errors/source.jibbnew file+11
@@ -0,0 +1,11 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
4++$ overlap |$ [A]
5+ A
6+ @t
7+++ few |= x=(choice @t) x
8+++ many |= x=(choice @t @p @ud) x
9+++ bad-tag ^- (choice @t @p) %missing
10+++ bad-payload ^- (choice @t @p) [%ok ~zod]
11+++ overlap-use |= x=(overlap @t) x
tests/golden/types-generic-union-errors/tokens.txtnew file+93
@@ -0,0 +1,93 @@
1+1:1 glyph +$
2+1:4 name choice
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar V
6+1:17 tvar E
7+1:18 tight glyph ]
8+2:3 INDENT
9+2:3 glyph [
10+2:4 tight lit %ok
11+2:8 name value
12+2:13 tight glyph =
13+2:14 tight tvar V
14+2:15 tight glyph ]
15+3:3 NEWLINE
16+3:3 glyph [
17+3:4 tight lit %err
18+3:9 name error
19+3:14 tight glyph =
20+3:15 tight tvar E
21+3:16 tight glyph ]
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph +$
25+4:4 name overlap
26+4:12 glyph |$
27+4:15 glyph [
28+4:16 tight tvar A
29+4:17 tight glyph ]
30+5:3 INDENT
31+5:3 tvar A
32+6:3 NEWLINE
33+6:3 aura @t
34+7:1 DEDENT
35+7:1 NEWLINE
36+7:1 glyph ++
37+7:4 name few
38+7:8 glyph |=
39+7:11 name x
40+7:12 tight glyph =
41+7:13 tight glyph (
42+7:14 tight name choice
43+7:21 aura @t
44+7:23 tight glyph )
45+7:25 name x
46+8:1 NEWLINE
47+8:1 glyph ++
48+8:4 name many
49+8:9 glyph |=
50+8:12 name x
51+8:13 tight glyph =
52+8:14 tight glyph (
53+8:15 tight name choice
54+8:22 aura @t
55+8:25 aura @p
56+8:28 aura @ud
57+8:31 tight glyph )
58+8:33 name x
59+9:1 NEWLINE
60+9:1 glyph ++
61+9:4 name bad-tag
62+9:12 glyph ^-
63+9:15 glyph (
64+9:16 tight name choice
65+9:23 aura @t
66+9:26 aura @p
67+9:28 tight glyph )
68+9:30 lit %missing
69+10:1 NEWLINE
70+10:1 glyph ++
71+10:4 name bad-payload
72+10:16 glyph ^-
73+10:19 glyph (
74+10:20 tight name choice
75+10:27 aura @t
76+10:30 aura @p
77+10:32 tight glyph )
78+10:34 glyph [
79+10:35 tight lit %ok
80+10:39 lit ~zod
81+10:43 tight glyph ]
82+11:1 NEWLINE
83+11:1 glyph ++
84+11:4 name overlap-use
85+11:16 glyph |=
86+11:19 name x
87+11:20 tight glyph =
88+11:21 tight glyph (
89+11:22 tight name overlap
90+11:30 aura @t
91+11:32 tight glyph )
92+11:34 name x
93+11:35 NEWLINE
tests/golden/types-generic-union-errors/tree.txtnew file+36
@@ -0,0 +1,36 @@
1+(module
2+ (mold 1:1 choice
3+ (generic 1:11 V E
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %ok)
7+ (face 2:8 value (tvar 2:14 V)))
8+ (cell 3:3
9+ (const 3:4 %err)
10+ (face 3:9 error (tvar 3:15 E))))))
11+ (mold 4:1 overlap
12+ (generic 4:12 A
13+ (union 5:3 (tvar 5:3 A) (aura 6:3 @t))))
14+ (value 7:1 few
15+ (gate 7:8
16+ (face 7:11 x
17+ (apply 7:13 choice (aura 7:21 @t)))
18+ (wing 7:25 x)))
19+ (value 8:1 many
20+ (gate 8:9
21+ (face 8:12 x
22+ (apply 8:14 choice (aura 8:22 @t) (aura 8:25 @p) (aura 8:28 @ud)))
23+ (wing 8:33 x)))
24+ (value 9:1 bad-tag
25+ (cast 9:12
26+ (apply 9:15 choice (aura 9:23 @t) (aura 9:26 @p))
27+ (lit 9:30 %missing)))
28+ (value 10:1 bad-payload
29+ (cast 10:16
30+ (apply 10:19 choice (aura 10:27 @t) (aura 10:30 @p))
31+ (tuple 10:34 (lit 10:35 %ok) (lit 10:39 ~zod))))
32+ (value 11:1 overlap-use
33+ (gate 11:16
34+ (face 11:19 x
35+ (apply 11:21 overlap (aura 11:30 @t)))
36+ (wing 11:34 x))))
tests/golden/types-generic-union-errors/types.txtnew file+26
@@ -0,0 +1,26 @@
1+partial inference; module not checked
2++$ choice: cases proven disjoint; mold not checked
3++$ overlap: overlapping cases; mold not checked
4+/tests/golden/types-generic-union-errors/source.jibb:5:3: first union case
5+ A
6+ ^
7+/tests/golden/types-generic-union-errors/source.jibb:6:3: overlapping case
8+ @t
9+ ^
10+++ few: sample mold is not supported by partial inference
11+++ many: sample mold is not supported by partial inference
12+++ bad-tag: (choice @t @p) has no case `%missing`
13+/tests/golden/types-generic-union-errors/source.jibb:9:15: expected union
14+++ bad-tag ^- (choice @t @p) %missing
15+ ^
16+/tests/golden/types-generic-union-errors/source.jibb:9:30: tag
17+++ bad-tag ^- (choice @t @p) %missing
18+ ^
19+++ bad-payload: cast mold and expression type do not unify
20+/tests/golden/types-generic-union-errors/source.jibb:10:19: cast mold
21+++ bad-payload ^- (choice @t @p) [%ok ~zod]
22+ ^
23+/tests/golden/types-generic-union-errors/source.jibb:10:34: expression
24+++ bad-payload ^- (choice @t @p) [%ok ~zod]
25+ ^
26+++ overlap-use: sample mold is not supported by partial inference
tests/golden/types-generic-union-escaping/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Molds: a generic mold declares its parameters after `|$`.
2+tests: A transitive value carries a generic union whose defining module is not directly visible. Its phantom arguments must not be lost to an unnamed printout; the partial printer declines this case.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-escaping/module-trees.txtnew file+16
@@ -0,0 +1,16 @@
1+/ui/base.jibb
2+(module
3+ (mold 1:1 phantom
4+ (generic 1:12 A
5+ (union 2:3 (const 2:3 %yes) (const 3:3 %no)))))
6+/ui/mid.jibb
7+(module
8+ (jibb 1:1 base /ui/base)
9+ (value 2:1 text
10+ (cast 2:9
11+ (apply 2:12 phantom.base (aura 2:26 @t))
12+ (lit 2:30 %yes)))
13+ (value 3:1 ship
14+ (cast 3:9
15+ (apply 3:12 phantom.base (aura 3:26 @p))
16+ (lit 3:30 %yes))))
tests/golden/types-generic-union-escaping/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/base.jibb
2+/ui/mid.jibb
tests/golden/types-generic-union-escaping/modules/ui/base.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ phantom |$ [A]
2+ %yes
3+ %no
tests/golden/types-generic-union-escaping/modules/ui/mid.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= base /ui/base
2+++ text ^- (phantom.base @t) %yes
3+++ ship ^- (phantom.base @p) %yes
tests/golden/types-generic-union-escaping/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/= mid /ui/mid
2+++ text-value text.mid
3+++ ship-value ship.mid
tests/golden/types-generic-union-escaping/tokens.txtnew file+15
@@ -0,0 +1,15 @@
1+1:1 glyph /=
2+1:5 name mid
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot mid
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name text-value
10+2:15 wing text.mid
11+3:1 NEWLINE
12+3:1 glyph ++
13+3:4 name ship-value
14+3:15 wing ship.mid
15+3:23 NEWLINE
tests/golden/types-generic-union-escaping/tree.txtnew file+4
@@ -0,0 +1,4 @@
1+(module
2+ (jibb 1:1 mid /ui/mid)
3+ (value 2:1 text-value (wing 2:15 text.mid))
4+ (value 3:1 ship-value (wing 3:15 ship.mid)))
tests/golden/types-generic-union-escaping/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ text-value: generic union name is not available in this scope
3+++ ship-value: generic union name is not available in this scope
tests/golden/types-generic-union-import/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Molds: recursive molds go by name and module.
2+tests: A generic union shared through two faces retains one origin and instantiated arguments, while an identically shaped mold from another module has a different origin.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-import/module-trees.txtnew file+32
@@ -0,0 +1,32 @@
1+/ui/shared.jibb
2+(module
3+ (mold 1:1 choice
4+ (generic 1:11 V E
5+ (union 2:3
6+ (cell 2:3
7+ (const 2:4 %ok)
8+ (face 2:8 value (tvar 2:14 V)))
9+ (cell 3:3
10+ (const 3:4 %err)
11+ (face 3:9 error (tvar 3:15 E))))))
12+ (value 4:1 identity
13+ (gate 4:13
14+ (face 4:16 x
15+ (apply 4:18 choice (tvar 4:26 A) (tvar 4:28 B)))
16+ (wing 4:31 x))))
17+/ui/twin.jibb
18+(module
19+ (mold 1:1 choice
20+ (generic 1:11 V E
21+ (union 2:3
22+ (cell 2:3
23+ (const 2:4 %ok)
24+ (face 2:8 value (tvar 2:14 V)))
25+ (cell 3:3
26+ (const 3:4 %err)
27+ (face 3:9 error (tvar 3:15 E))))))
28+ (value 4:1 identity
29+ (gate 4:13
30+ (face 4:16 x
31+ (apply 4:18 choice (tvar 4:26 A) (tvar 4:28 B)))
32+ (wing 4:31 x))))
tests/golden/types-generic-union-import/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/shared.jibb
2+/ui/twin.jibb
tests/golden/types-generic-union-import/modules/ui/shared.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
4+++ identity |= x=(choice A B) x
tests/golden/types-generic-union-import/modules/ui/twin.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
4+++ identity |= x=(choice A B) x
tests/golden/types-generic-union-import/source.jibbnew file+9
@@ -0,0 +1,9 @@
1+/= left /ui/shared
2+/= right /ui/shared
3+/= twin /ui/twin
4+++ from-left ^- (choice.left @t @p) [%ok "hi"]
5+++ consume |= x=(choice.right @t @p) x
6+++ same-origin (consume from-left)
7+++ different |= x=(choice.twin @t @p) x
8+++ cross-origin (different from-left)
9+++ polymorphic (identity.right from-left)
tests/golden/types-generic-union-import/tokens.txtnew file+79
@@ -0,0 +1,79 @@
1+1:1 glyph /=
2+1:5 name left
3+1:10 glyph /
4+1:11 tight knot ui
5+1:13 tight glyph /
6+1:14 tight knot shared
7+2:1 NEWLINE
8+2:1 glyph /=
9+2:5 name right
10+2:11 glyph /
11+2:12 tight knot ui
12+2:14 tight glyph /
13+2:15 tight knot shared
14+3:1 NEWLINE
15+3:1 glyph /=
16+3:5 name twin
17+3:10 glyph /
18+3:11 tight knot ui
19+3:13 tight glyph /
20+3:14 tight knot twin
21+4:1 NEWLINE
22+4:1 glyph ++
23+4:4 name from-left
24+4:14 glyph ^-
25+4:17 glyph (
26+4:18 tight wing choice.left
27+4:30 aura @t
28+4:33 aura @p
29+4:35 tight glyph )
30+4:37 glyph [
31+4:38 tight lit %ok
32+4:42 str "hi"
33+4:46 tight glyph ]
34+5:1 NEWLINE
35+5:1 glyph ++
36+5:4 name consume
37+5:12 glyph |=
38+5:15 name x
39+5:16 tight glyph =
40+5:17 tight glyph (
41+5:18 tight wing choice.right
42+5:31 aura @t
43+5:34 aura @p
44+5:36 tight glyph )
45+5:38 name x
46+6:1 NEWLINE
47+6:1 glyph ++
48+6:4 name same-origin
49+6:16 glyph (
50+6:17 tight name consume
51+6:25 name from-left
52+6:34 tight glyph )
53+7:1 NEWLINE
54+7:1 glyph ++
55+7:4 name different
56+7:14 glyph |=
57+7:17 name x
58+7:18 tight glyph =
59+7:19 tight glyph (
60+7:20 tight wing choice.twin
61+7:32 aura @t
62+7:35 aura @p
63+7:37 tight glyph )
64+7:39 name x
65+8:1 NEWLINE
66+8:1 glyph ++
67+8:4 name cross-origin
68+8:17 glyph (
69+8:18 tight name different
70+8:28 name from-left
71+8:37 tight glyph )
72+9:1 NEWLINE
73+9:1 glyph ++
74+9:4 name polymorphic
75+9:16 glyph (
76+9:17 tight wing identity.right
77+9:32 name from-left
78+9:41 tight glyph )
79+9:42 NEWLINE
tests/golden/types-generic-union-import/tree.txtnew file+27
@@ -0,0 +1,27 @@
1+(module
2+ (jibb 1:1 left /ui/shared)
3+ (jibb 2:1 right /ui/shared)
4+ (jibb 3:1 twin /ui/twin)
5+ (value 4:1 from-left
6+ (cast 4:14
7+ (apply 4:17 choice.left (aura 4:30 @t) (aura 4:33 @p))
8+ (tuple 4:37 (lit 4:38 %ok) (str 4:42 "hi"))))
9+ (value 5:1 consume
10+ (gate 5:12
11+ (face 5:15 x
12+ (apply 5:17 choice.right (aura 5:31 @t) (aura 5:34 @p)))
13+ (wing 5:38 x)))
14+ (value 6:1 same-origin
15+ (group 6:16
16+ (call 6:17 (wing 6:17 consume) (wing 6:25 from-left))))
17+ (value 7:1 different
18+ (gate 7:14
19+ (face 7:17 x
20+ (apply 7:19 choice.twin (aura 7:32 @t) (aura 7:35 @p)))
21+ (wing 7:39 x)))
22+ (value 8:1 cross-origin
23+ (group 8:17
24+ (call 8:18 (wing 8:18 different) (wing 8:28 from-left))))
25+ (value 9:1 polymorphic
26+ (group 9:16
27+ (call 9:17 (wing 9:17 identity.right) (wing 9:32 from-left)))))
tests/golden/types-generic-union-import/types.txtnew file+7
@@ -0,0 +1,7 @@
1+partial inference; module not checked
2+++ from-left: (choice.left @t @p)
3+++ consume: $-((choice.right @t @p) (choice.right @t @p))
4+++ same-origin: (choice.right @t @p)
5+++ different: $-((choice.twin @t @p) (choice.twin @t @p))
6+++ cross-origin: call constraint is not supported by partial inference
7+++ polymorphic: (choice.right @t @p)
tests/golden/types-generic-union-local/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Every union written in Jibb has a name"; Tag resolution: tags take their union from context. Generic molds are applied with their arguments.
2+tests: A two-parameter generic union resolves tagged values and constructors, exercises independent and repeated arguments across identity gates, swapped aliases, fail-closed comparison of different phantom arguments, and a phantom gate argument; an unrelated tag remains unresolved.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-local/source.jibbnew file+34
@@ -0,0 +1,34 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
4++$ phantom |$ [A]
5+ %yes
6+ %no
7++$ swapped |$ [A B] (choice B A)
8+++ text-choice ^- (choice @t @p) [%ok "hi"]
9+++ ship-choice ^- (choice @t @p) [%err ~zod]
10+++ text-constructor ^- $-(@t (choice @t @p)) |=%ok
11+++ ship-constructor ^- $-(@p (choice @t @p)) |=%err
12+++ inverse-choice ^- (choice @p @t) [%ok ~zod]
13+++ test-phantom ^- (phantom @t) %yes
14+++ phantom-gate ^- (phantom $-(@t @p)) %yes
15+++ identity |= x=(choice A B) x
16+++ repeated |= x=(choice A A) x
17+++ reverse |= x=(swapped A B) x
18+++ first (identity text-choice)
19+++ second (identity ship-choice)
20+++ third (identity inverse-choice)
21+++ repeated-call (repeated text-choice)
22+++ swap-concrete ^- (swapped @t @p) [%ok ~zod]
23+++ wrong-phantom |= x=(phantom @t) ^- (phantom @p) x
24+++ forced |= flag=?
25+ ^- (choice A @p)
26+ ?- flag
27+ %.y [%ok "hi"]
28+ %.n [%err ~zod]
29+++ pending |= flag=?
30+ ~& %orphan
31+ ^- (choice @t @p)
32+ ?- flag
33+ %.y [%ok "hi"]
34+ %.n [%err ~zod]
tests/golden/types-generic-union-local/tokens.txtnew file+297
@@ -0,0 +1,297 @@
1+1:1 glyph +$
2+1:4 name choice
3+1:11 glyph |$
4+1:14 glyph [
5+1:15 tight tvar V
6+1:17 tvar E
7+1:18 tight glyph ]
8+2:3 INDENT
9+2:3 glyph [
10+2:4 tight lit %ok
11+2:8 name value
12+2:13 tight glyph =
13+2:14 tight tvar V
14+2:15 tight glyph ]
15+3:3 NEWLINE
16+3:3 glyph [
17+3:4 tight lit %err
18+3:9 name error
19+3:14 tight glyph =
20+3:15 tight tvar E
21+3:16 tight glyph ]
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph +$
25+4:4 name phantom
26+4:12 glyph |$
27+4:15 glyph [
28+4:16 tight tvar A
29+4:17 tight glyph ]
30+5:3 INDENT
31+5:3 lit %yes
32+6:3 NEWLINE
33+6:3 lit %no
34+7:1 DEDENT
35+7:1 NEWLINE
36+7:1 glyph +$
37+7:4 name swapped
38+7:12 glyph |$
39+7:15 glyph [
40+7:16 tight tvar A
41+7:18 tvar B
42+7:19 tight glyph ]
43+7:21 glyph (
44+7:22 tight name choice
45+7:29 tvar B
46+7:31 tvar A
47+7:32 tight glyph )
48+8:1 NEWLINE
49+8:1 glyph ++
50+8:4 name text-choice
51+8:16 glyph ^-
52+8:19 glyph (
53+8:20 tight name choice
54+8:27 aura @t
55+8:30 aura @p
56+8:32 tight glyph )
57+8:34 glyph [
58+8:35 tight lit %ok
59+8:39 str "hi"
60+8:43 tight glyph ]
61+9:1 NEWLINE
62+9:1 glyph ++
63+9:4 name ship-choice
64+9:16 glyph ^-
65+9:19 glyph (
66+9:20 tight name choice
67+9:27 aura @t
68+9:30 aura @p
69+9:32 tight glyph )
70+9:34 glyph [
71+9:35 tight lit %err
72+9:40 lit ~zod
73+9:44 tight glyph ]
74+10:1 NEWLINE
75+10:1 glyph ++
76+10:4 name text-constructor
77+10:21 glyph ^-
78+10:24 glyph $-(
79+10:27 tight aura @t
80+10:30 glyph (
81+10:31 tight name choice
82+10:38 aura @t
83+10:41 aura @p
84+10:43 tight glyph )
85+10:44 tight glyph )
86+10:46 glyph |=
87+10:48 tight lit %ok
88+11:1 NEWLINE
89+11:1 glyph ++
90+11:4 name ship-constructor
91+11:21 glyph ^-
92+11:24 glyph $-(
93+11:27 tight aura @p
94+11:30 glyph (
95+11:31 tight name choice
96+11:38 aura @t
97+11:41 aura @p
98+11:43 tight glyph )
99+11:44 tight glyph )
100+11:46 glyph |=
101+11:48 tight lit %err
102+12:1 NEWLINE
103+12:1 glyph ++
104+12:4 name inverse-choice
105+12:19 glyph ^-
106+12:22 glyph (
107+12:23 tight name choice
108+12:30 aura @p
109+12:33 aura @t
110+12:35 tight glyph )
111+12:37 glyph [
112+12:38 tight lit %ok
113+12:42 lit ~zod
114+12:46 tight glyph ]
115+13:1 NEWLINE
116+13:1 glyph ++
117+13:4 name test-phantom
118+13:17 glyph ^-
119+13:20 glyph (
120+13:21 tight name phantom
121+13:29 aura @t
122+13:31 tight glyph )
123+13:33 lit %yes
124+14:1 NEWLINE
125+14:1 glyph ++
126+14:4 name phantom-gate
127+14:17 glyph ^-
128+14:20 glyph (
129+14:21 tight name phantom
130+14:29 glyph $-(
131+14:32 tight aura @t
132+14:35 aura @p
133+14:37 tight glyph )
134+14:38 tight glyph )
135+14:40 lit %yes
136+15:1 NEWLINE
137+15:1 glyph ++
138+15:4 name identity
139+15:13 glyph |=
140+15:16 name x
141+15:17 tight glyph =
142+15:18 tight glyph (
143+15:19 tight name choice
144+15:26 tvar A
145+15:28 tvar B
146+15:29 tight glyph )
147+15:31 name x
148+16:1 NEWLINE
149+16:1 glyph ++
150+16:4 name repeated
151+16:13 glyph |=
152+16:16 name x
153+16:17 tight glyph =
154+16:18 tight glyph (
155+16:19 tight name choice
156+16:26 tvar A
157+16:28 tvar A
158+16:29 tight glyph )
159+16:31 name x
160+17:1 NEWLINE
161+17:1 glyph ++
162+17:4 name reverse
163+17:12 glyph |=
164+17:15 name x
165+17:16 tight glyph =
166+17:17 tight glyph (
167+17:18 tight name swapped
168+17:26 tvar A
169+17:28 tvar B
170+17:29 tight glyph )
171+17:31 name x
172+18:1 NEWLINE
173+18:1 glyph ++
174+18:4 name first
175+18:10 glyph (
176+18:11 tight name identity
177+18:20 name text-choice
178+18:31 tight glyph )
179+19:1 NEWLINE
180+19:1 glyph ++
181+19:4 name second
182+19:11 glyph (
183+19:12 tight name identity
184+19:21 name ship-choice
185+19:32 tight glyph )
186+20:1 NEWLINE
187+20:1 glyph ++
188+20:4 name third
189+20:10 glyph (
190+20:11 tight name identity
191+20:20 name inverse-choice
192+20:34 tight glyph )
193+21:1 NEWLINE
194+21:1 glyph ++
195+21:4 name repeated-call
196+21:18 glyph (
197+21:19 tight name repeated
198+21:28 name text-choice
199+21:39 tight glyph )
200+22:1 NEWLINE
201+22:1 glyph ++
202+22:4 name swap-concrete
203+22:18 glyph ^-
204+22:21 glyph (
205+22:22 tight name swapped
206+22:30 aura @t
207+22:33 aura @p
208+22:35 tight glyph )
209+22:37 glyph [
210+22:38 tight lit %ok
211+22:42 lit ~zod
212+22:46 tight glyph ]
213+23:1 NEWLINE
214+23:1 glyph ++
215+23:4 name wrong-phantom
216+23:18 glyph |=
217+23:21 name x
218+23:22 tight glyph =
219+23:23 tight glyph (
220+23:24 tight name phantom
221+23:32 aura @t
222+23:34 tight glyph )
223+23:36 glyph ^-
224+23:39 glyph (
225+23:40 tight name phantom
226+23:48 aura @p
227+23:50 tight glyph )
228+23:52 name x
229+24:1 NEWLINE
230+24:1 glyph ++
231+24:4 name forced
232+24:11 glyph |=
233+24:14 name flag
234+24:18 tight glyph =
235+24:19 tight glyph ?
236+25:3 INDENT
237+25:3 glyph ^-
238+25:6 glyph (
239+25:7 tight name choice
240+25:14 tvar A
241+25:16 aura @p
242+25:18 tight glyph )
243+26:5 INDENT
244+26:5 glyph ?-
245+26:8 name flag
246+27:7 INDENT
247+27:7 lit %.y
248+27:11 glyph [
249+27:12 tight lit %ok
250+27:16 str "hi"
251+27:20 tight glyph ]
252+28:7 NEWLINE
253+28:7 lit %.n
254+28:11 glyph [
255+28:12 tight lit %err
256+28:17 lit ~zod
257+28:21 tight glyph ]
258+29:1 DEDENT
259+29:1 DEDENT
260+29:1 DEDENT
261+29:1 NEWLINE
262+29:1 glyph ++
263+29:4 name pending
264+29:12 glyph |=
265+29:15 name flag
266+29:19 tight glyph =
267+29:20 tight glyph ?
268+30:3 INDENT
269+30:3 glyph ~&
270+30:6 lit %orphan
271+31:5 INDENT
272+31:5 glyph ^-
273+31:8 glyph (
274+31:9 tight name choice
275+31:16 aura @t
276+31:19 aura @p
277+31:21 tight glyph )
278+32:7 INDENT
279+32:7 glyph ?-
280+32:10 name flag
281+33:9 INDENT
282+33:9 lit %.y
283+33:13 glyph [
284+33:14 tight lit %ok
285+33:18 str "hi"
286+33:22 tight glyph ]
287+34:9 NEWLINE
288+34:9 lit %.n
289+34:13 glyph [
290+34:14 tight lit %err
291+34:19 lit ~zod
292+34:23 tight glyph ]
293+34:24 DEDENT
294+34:24 DEDENT
295+34:24 DEDENT
296+34:24 DEDENT
297+34:24 NEWLINE
tests/golden/types-generic-union-local/tree.txtnew file+120
@@ -0,0 +1,120 @@
1+(module
2+ (mold 1:1 choice
3+ (generic 1:11 V E
4+ (union 2:3
5+ (cell 2:3
6+ (const 2:4 %ok)
7+ (face 2:8 value (tvar 2:14 V)))
8+ (cell 3:3
9+ (const 3:4 %err)
10+ (face 3:9 error (tvar 3:15 E))))))
11+ (mold 4:1 phantom
12+ (generic 4:12 A
13+ (union 5:3 (const 5:3 %yes) (const 6:3 %no))))
14+ (mold 7:1 swapped
15+ (generic 7:12 A B
16+ (apply 7:21 choice (tvar 7:29 B) (tvar 7:31 A))))
17+ (value 8:1 text-choice
18+ (cast 8:16
19+ (apply 8:19 choice (aura 8:27 @t) (aura 8:30 @p))
20+ (tuple 8:34 (lit 8:35 %ok) (str 8:39 "hi"))))
21+ (value 9:1 ship-choice
22+ (cast 9:16
23+ (apply 9:19 choice (aura 9:27 @t) (aura 9:30 @p))
24+ (tuple 9:34 (lit 9:35 %err) (lit 9:40 ~zod))))
25+ (value 10:1 text-constructor
26+ (cast 10:21
27+ (fn 10:24
28+ (aura 10:27 @t)
29+ (apply 10:30 choice (aura 10:38 @t) (aura 10:41 @p)))
30+ (ctor 10:46 %ok)))
31+ (value 11:1 ship-constructor
32+ (cast 11:21
33+ (fn 11:24
34+ (aura 11:27 @p)
35+ (apply 11:30 choice (aura 11:38 @t) (aura 11:41 @p)))
36+ (ctor 11:46 %err)))
37+ (value 12:1 inverse-choice
38+ (cast 12:19
39+ (apply 12:22 choice (aura 12:30 @p) (aura 12:33 @t))
40+ (tuple 12:37 (lit 12:38 %ok) (lit 12:42 ~zod))))
41+ (value 13:1 test-phantom
42+ (cast 13:17
43+ (apply 13:20 phantom (aura 13:29 @t))
44+ (lit 13:33 %yes)))
45+ (value 14:1 phantom-gate
46+ (cast 14:17
47+ (apply 14:20 phantom
48+ (fn 14:29 (aura 14:32 @t) (aura 14:35 @p)))
49+ (lit 14:40 %yes)))
50+ (value 15:1 identity
51+ (gate 15:13
52+ (face 15:16 x
53+ (apply 15:18 choice (tvar 15:26 A) (tvar 15:28 B)))
54+ (wing 15:31 x)))
55+ (value 16:1 repeated
56+ (gate 16:13
57+ (face 16:16 x
58+ (apply 16:18 choice (tvar 16:26 A) (tvar 16:28 A)))
59+ (wing 16:31 x)))
60+ (value 17:1 reverse
61+ (gate 17:12
62+ (face 17:15 x
63+ (apply 17:17 swapped (tvar 17:26 A) (tvar 17:28 B)))
64+ (wing 17:31 x)))
65+ (value 18:1 first
66+ (group 18:10
67+ (call 18:11 (wing 18:11 identity) (wing 18:20 text-choice))))
68+ (value 19:1 second
69+ (group 19:11
70+ (call 19:12 (wing 19:12 identity) (wing 19:21 ship-choice))))
71+ (value 20:1 third
72+ (group 20:10
73+ (call 20:11 (wing 20:11 identity) (wing 20:20 inverse-choice))))
74+ (value 21:1 repeated-call
75+ (group 21:18
76+ (call 21:19 (wing 21:19 repeated) (wing 21:28 text-choice))))
77+ (value 22:1 swap-concrete
78+ (cast 22:18
79+ (apply 22:21 swapped (aura 22:30 @t) (aura 22:33 @p))
80+ (tuple 22:37 (lit 22:38 %ok) (lit 22:42 ~zod))))
81+ (value 23:1 wrong-phantom
82+ (gate 23:18
83+ (face 23:21 x
84+ (apply 23:23 phantom (aura 23:32 @t)))
85+ (cast 23:36
86+ (apply 23:39 phantom (aura 23:48 @p))
87+ (wing 23:52 x))))
88+ (value 24:1 forced
89+ (gate 24:11
90+ (face 24:14 flag (flag 24:19))
91+ (body 25:3
92+ (cast 25:3
93+ (apply 25:6 choice (tvar 25:14 A) (aura 25:16 @p))
94+ (body 26:5
95+ (branch 26:5
96+ (wing 26:8 flag)
97+ (arm 27:7
98+ (lit 27:7 %.y)
99+ (tuple 27:11 (lit 27:12 %ok) (str 27:16 "hi")))
100+ (arm 28:7
101+ (lit 28:7 %.n)
102+ (tuple 28:11 (lit 28:12 %err) (lit 28:17 ~zod)))))))))
103+ (value 29:1 pending
104+ (gate 29:12
105+ (face 29:15 flag (flag 29:20))
106+ (body 30:3
107+ (trace 30:3
108+ (lit 30:6 %orphan)
109+ (body 31:5
110+ (cast 31:5
111+ (apply 31:8 choice (aura 31:16 @t) (aura 31:19 @p))
112+ (body 32:7
113+ (branch 32:7
114+ (wing 32:10 flag)
115+ (arm 33:9
116+ (lit 33:9 %.y)
117+ (tuple 33:13 (lit 33:14 %ok) (str 33:18 "hi")))
118+ (arm 34:9
119+ (lit 34:9 %.n)
120+ (tuple 34:13 (lit 34:14 %err) (lit 34:19 ~zod))))))))))))
tests/golden/types-generic-union-local/types.txtnew file+22
@@ -0,0 +1,22 @@
1+partial inference; module not checked
2++$ choice: cases proven disjoint; mold not checked
3++$ phantom: cases proven disjoint; mold not checked
4++$ swapped: not checked
5+++ text-choice: (choice @t @p)
6+++ ship-choice: (choice @t @p)
7+++ text-constructor: $-(@t (choice @t @p))
8+++ ship-constructor: $-(@p (choice @t @p))
9+++ inverse-choice: (choice @p @t)
10+++ test-phantom: (phantom @t)
11+++ phantom-gate: (phantom $-(@t @p))
12+++ identity: $-((choice A B) (choice A B))
13+++ repeated: $-((choice A A) (choice A A))
14+++ reverse: $-((choice A B) (choice A B))
15+++ first: (choice @t @p)
16+++ second: (choice @t @p)
17+++ third: (choice @p @t)
18+++ repeated-call: call constraint is not supported by partial inference
19+++ swap-concrete: (choice @p @t)
20+++ wrong-phantom: cast constraint is not supported by partial inference
21+++ forced: explicit capital constraints are not supported by partial inference
22+++ pending: tag needs context in partial inference
tests/golden/types-generic-union-transitive/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Everything is exported and read through the import's face"; Molds: generic molds.
2+tests: Concrete and generic values from a transitive alias and uses of the alias retain the underlying union origin, but the partial printer reports its unavailable name rather than hiding generic arguments.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-generic-union-transitive/module-trees.txtnew file+27
@@ -0,0 +1,27 @@
1+/ui/base.jibb
2+(module
3+ (mold 1:1 choice
4+ (generic 1:11 V E
5+ (union 2:3
6+ (cell 2:3
7+ (const 2:4 %ok)
8+ (face 2:8 value (tvar 2:14 V)))
9+ (cell 3:3
10+ (const 3:4 %err)
11+ (face 3:9 error (tvar 3:15 E)))))))
12+/ui/mid.jibb
13+(module
14+ (jibb 1:1 base /ui/base)
15+ (mold 2:1 relay
16+ (generic 2:10 A B
17+ (apply 2:19 choice.base (tvar 2:32 B) (tvar 2:34 A))))
18+ (value 3:1 sample
19+ (cast 3:11
20+ (apply 3:14 relay (aura 3:21 @t) (aura 3:24 @p))
21+ (tuple 3:28 (lit 3:29 %ok) (lit 3:33 ~zod))))
22+ (value 4:1 make
23+ (gate 4:9
24+ (face 4:12 x (tvar 4:14 A))
25+ (cast 4:16
26+ (apply 4:19 relay (tvar 4:26 A) (tvar 4:28 B))
27+ (tuple 4:31 (lit 4:32 %err) (wing 4:37 x))))))
tests/golden/types-generic-union-transitive/modules.txtnew file+2
@@ -0,0 +1,2 @@
1+/ui/base.jibb
2+/ui/mid.jibb
tests/golden/types-generic-union-transitive/modules/ui/base.jibbnew file+3
@@ -0,0 +1,3 @@
1++$ choice |$ [V E]
2+ [%ok value=V]
3+ [%err error=E]
tests/golden/types-generic-union-transitive/modules/ui/mid.jibbnew file+4
@@ -0,0 +1,4 @@
1+/= base /ui/base
2++$ relay |$ [A B] (choice.base B A)
3+++ sample ^- (relay @t @p) [%ok ~zod]
4+++ make |= x=A ^- (relay A B) [%err x]
tests/golden/types-generic-union-transitive/source.jibbnew file+5
@@ -0,0 +1,5 @@
1+/= mid /ui/mid
2+++ concrete ^- (relay.mid @t @p) [%ok ~zod]
3+++ via sample.mid
4+++ generic |= x=(relay.mid A B) x
5+++ via-generic (make.mid "hi")
tests/golden/types-generic-union-transitive/tokens.txtnew file+43
@@ -0,0 +1,43 @@
1+1:1 glyph /=
2+1:5 name mid
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot mid
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name concrete
10+2:13 glyph ^-
11+2:16 glyph (
12+2:17 tight wing relay.mid
13+2:27 aura @t
14+2:30 aura @p
15+2:32 tight glyph )
16+2:34 glyph [
17+2:35 tight lit %ok
18+2:39 lit ~zod
19+2:43 tight glyph ]
20+3:1 NEWLINE
21+3:1 glyph ++
22+3:4 name via
23+3:8 wing sample.mid
24+4:1 NEWLINE
25+4:1 glyph ++
26+4:4 name generic
27+4:12 glyph |=
28+4:15 name x
29+4:16 tight glyph =
30+4:17 tight glyph (
31+4:18 tight wing relay.mid
32+4:28 tvar A
33+4:30 tvar B
34+4:31 tight glyph )
35+4:33 name x
36+5:1 NEWLINE
37+5:1 glyph ++
38+5:4 name via-generic
39+5:16 glyph (
40+5:17 tight wing make.mid
41+5:26 str "hi"
42+5:30 tight glyph )
43+5:31 NEWLINE
tests/golden/types-generic-union-transitive/tree.txtnew file+15
@@ -0,0 +1,15 @@
1+(module
2+ (jibb 1:1 mid /ui/mid)
3+ (value 2:1 concrete
4+ (cast 2:13
5+ (apply 2:16 relay.mid (aura 2:27 @t) (aura 2:30 @p))
6+ (tuple 2:34 (lit 2:35 %ok) (lit 2:39 ~zod))))
7+ (value 3:1 via (wing 3:8 sample.mid))
8+ (value 4:1 generic
9+ (gate 4:12
10+ (face 4:15 x
11+ (apply 4:17 relay.mid (tvar 4:28 A) (tvar 4:30 B)))
12+ (wing 4:33 x)))
13+ (value 5:1 via-generic
14+ (group 5:16
15+ (call 5:17 (wing 5:17 make.mid) (str 5:26 "hi")))))
tests/golden/types-generic-union-transitive/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2+++ concrete: generic union name is not available in this scope
3+++ via: generic union name is not available in this scope
4+++ generic: generic union name is not available in this scope
5+++ via-generic: generic union name is not available in this scope
tests/golden/types-import-duplicate-mark/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Overview, Importing Hoon types: `/%` translates marks; Grammar, Molds: "Faces are part of the type".
2+tests: A mark with a duplicate face in a nested record is reported unsupported where used by the partial checker.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-import-duplicate-mark/mar/duplicate.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=[nested=[same=@t same=@ud] id=@ud]
2+++ grab |% ++ noun [nested=[same=@t same=@ud] id=@ud] --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/types-import-duplicate-mark/marks.txtnew file+1
@@ -0,0 +1 @@
1+duplicate
tests/golden/types-import-duplicate-mark/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/% %duplicate
2+++ identity |= x=duplicate x
tests/golden/types-import-duplicate-mark/tokens.txtnew file+11
@@ -0,0 +1,11 @@
1+1:1 glyph /%
2+1:5 lit %duplicate
3+2:1 NEWLINE
4+2:1 glyph ++
5+2:4 name identity
6+2:13 glyph |=
7+2:16 name x
8+2:17 tight glyph =
9+2:18 tight name duplicate
10+2:28 name x
11+2:29 NEWLINE
tests/golden/types-import-duplicate-mark/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (mark 1:1 %duplicate)
3+ (value 2:1 identity
4+ (gate 2:13
5+ (face 2:16 x (ref 2:18 duplicate))
6+ (wing 2:28 x))))
tests/golden/types-import-duplicate-mark/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ identity: sample mold is not supported by partial inference
tests/golden/types-import-duplicate-sur/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Molds: "Faces are part of the type"; Overview, Importing Hoon types: "Unused molds are skipped".
2+tests: A used imported Hoon record with duplicate sibling faces, including a nested record, is reported unsupported by the partial checker; identical names at separate nesting levels remain valid and an unselected duplicate mold is skipped.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-import-duplicate-sur/imports.txtnew file+3
@@ -0,0 +1,3 @@
1+fixture direct
2+fixture nested
3+fixture valid
tests/golden/types-import-duplicate-sur/source.jibbnew file+5
@@ -0,0 +1,5 @@
1+/- fixture
2+++ direct-id |= x=direct.fixture x
3+++ nested-id |= x=nested.fixture x
4+++ valid-id |= x=valid.fixture x
5+++ valid-read |= x=valid.fixture same.nested.x
tests/golden/types-import-duplicate-sur/sur/fixture.txtnew file+6
@@ -0,0 +1,6 @@
1+|%
2++$ direct [same=@t same=@ud]
3++$ nested [outer=[same=@t same=@ud] id=@ud]
4++$ valid [same=@t nested=[same=@ud other=@t]]
5++$ unused [same=@t same=@ud]
6+--
tests/golden/types-import-duplicate-sur/tokens.txtnew file+35
@@ -0,0 +1,35 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph ++
5+2:4 name direct-id
6+2:14 glyph |=
7+2:17 name x
8+2:18 tight glyph =
9+2:19 tight wing direct.fixture
10+2:34 name x
11+3:1 NEWLINE
12+3:1 glyph ++
13+3:4 name nested-id
14+3:14 glyph |=
15+3:17 name x
16+3:18 tight glyph =
17+3:19 tight wing nested.fixture
18+3:34 name x
19+4:1 NEWLINE
20+4:1 glyph ++
21+4:4 name valid-id
22+4:13 glyph |=
23+4:16 name x
24+4:17 tight glyph =
25+4:18 tight wing valid.fixture
26+4:32 name x
27+5:1 NEWLINE
28+5:1 glyph ++
29+5:4 name valid-read
30+5:15 glyph |=
31+5:18 name x
32+5:19 tight glyph =
33+5:20 tight wing valid.fixture
34+5:34 wing same.nested.x
35+5:47 NEWLINE
tests/golden/types-import-duplicate-sur/tree.txtnew file+18
@@ -0,0 +1,18 @@
1+(module
2+ (sur 1:1 fixture)
3+ (value 2:1 direct-id
4+ (gate 2:14
5+ (face 2:17 x (ref 2:19 direct.fixture))
6+ (wing 2:34 x)))
7+ (value 3:1 nested-id
8+ (gate 3:14
9+ (face 3:17 x (ref 3:19 nested.fixture))
10+ (wing 3:34 x)))
11+ (value 4:1 valid-id
12+ (gate 4:13
13+ (face 4:16 x (ref 4:18 valid.fixture))
14+ (wing 4:32 x)))
15+ (value 5:1 valid-read
16+ (gate 5:15
17+ (face 5:18 x (ref 5:20 valid.fixture))
18+ (wing 5:34 same.nested.x))))
tests/golden/types-import-duplicate-sur/types.txtnew file+5
@@ -0,0 +1,5 @@
1+partial inference; module not checked
2+++ direct-id: sample mold is not supported by partial inference
3+++ nested-id: sample mold is not supported by partial inference
4+++ valid-id: $-([same=@t nested=[same=@ud other=@t]] [same=@t nested=[same=@ud other=@t]])
5+++ valid-read: $-([same=@t nested=[same=@ud other=@t]] @ud)
tests/golden/types-import-mark-record/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Overview, Importing Hoon types: records and unions import from Hoon; Grammar, Imports: `/%` names a type after its mark.
2+tests: A real mark door's faced, nested record reaches partial inference, including a nested field read. A second mark retains the unnamed union in a faced field through inference.
3+expect: parses
4+expect-types: a partial report showing the nested record and the imported union field
tests/golden/types-import-mark-record/mar/choice.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=[kind=?(%on %off) id=@ud]
2+++ grab |% ++ noun [kind=?(%on %off) id=@ud] --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/types-import-mark-record/mar/note.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=[meta=[title=@t count=@ud] id=@ud]
2+++ grab |% ++ noun [meta=[title=@t count=@ud] id=@ud] --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/types-import-mark-record/marks.txtnew file+2
@@ -0,0 +1,2 @@
1+note
2+choice
tests/golden/types-import-mark-record/source.jibbnew file+5
@@ -0,0 +1,5 @@
1+/% %note
2+/% %choice
3+++ echo |= item=note item
4+++ title |= item=note title.meta.item
5+++ echo-choice |= item=choice item
tests/golden/types-import-mark-record/tokens.txtnew file+30
@@ -0,0 +1,30 @@
1+1:1 glyph /%
2+1:5 lit %note
3+2:1 NEWLINE
4+2:1 glyph /%
5+2:5 lit %choice
6+3:1 NEWLINE
7+3:1 glyph ++
8+3:4 name echo
9+3:9 glyph |=
10+3:12 name item
11+3:16 tight glyph =
12+3:17 tight name note
13+3:22 name item
14+4:1 NEWLINE
15+4:1 glyph ++
16+4:4 name title
17+4:10 glyph |=
18+4:13 name item
19+4:17 tight glyph =
20+4:18 tight name note
21+4:23 wing title.meta.item
22+5:1 NEWLINE
23+5:1 glyph ++
24+5:4 name echo-choice
25+5:16 glyph |=
26+5:19 name item
27+5:23 tight glyph =
28+5:24 tight name choice
29+5:31 name item
30+5:35 NEWLINE
tests/golden/types-import-mark-record/tree.txtnew file+15
@@ -0,0 +1,15 @@
1+(module
2+ (mark 1:1 %note)
3+ (mark 2:1 %choice)
4+ (value 3:1 echo
5+ (gate 3:9
6+ (face 3:12 item (ref 3:17 note))
7+ (wing 3:22 item)))
8+ (value 4:1 title
9+ (gate 4:10
10+ (face 4:13 item (ref 4:18 note))
11+ (wing 4:23 title.meta.item)))
12+ (value 5:1 echo-choice
13+ (gate 5:16
14+ (face 5:19 item (ref 5:24 choice))
15+ (wing 5:31 item))))
tests/golden/types-import-mark-record/types.txtnew file+4
@@ -0,0 +1,4 @@
1+partial inference; module not checked
2+++ echo: $-([meta=[title=@t count=@ud] id=@ud] [meta=[title=@t count=@ud] id=@ud])
3+++ title: $-([meta=[title=@t count=@ud] id=@ud] @t)
4+++ echo-choice: $-([kind=(%on %off) id=@ud] [kind=(%on %off) id=@ud])
tests/golden/types-import-mark/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/%` names a type after its mark; `/- todo` imports molds from a Hoon `/sur` file.
2+tests: Both runners compile a mark fixture and a `/sur` fixture, then provide their selected types to the partial checker together.
3+expect: parses
4+expect-types: a partial report with the imported mark and `/sur` atom types
tests/golden/types-import-mark/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture title
tests/golden/types-import-mark/mar/label.txtnew file+5
@@ -0,0 +1,5 @@
1+|_ a=@t
2+++ grab |% ++ noun @t --
3+++ grow |% ++ noun a --
4+++ grad %noun
5+--
tests/golden/types-import-mark/marks.txtnew file+1
@@ -0,0 +1 @@
1+label
tests/golden/types-import-mark/source.jibbnew file+4
@@ -0,0 +1,4 @@
1+/- fixture
2+/% %label
3+++ label-id |= x=label x
4+++ title-id |= x=title.fixture x
tests/golden/types-import-mark/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/types-import-mark/tokens.txtnew file+22
@@ -0,0 +1,22 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph /%
5+2:5 lit %label
6+3:1 NEWLINE
7+3:1 glyph ++
8+3:4 name label-id
9+3:13 glyph |=
10+3:16 name x
11+3:17 tight glyph =
12+3:18 tight name label
13+3:24 name x
14+4:1 NEWLINE
15+4:1 glyph ++
16+4:4 name title-id
17+4:13 glyph |=
18+4:16 name x
19+4:17 tight glyph =
20+4:18 tight wing title.fixture
21+4:32 name x
22+4:33 NEWLINE
tests/golden/types-import-mark/tree.txtnew file+11
@@ -0,0 +1,11 @@
1+(module
2+ (sur 1:1 fixture)
3+ (mark 2:1 %label)
4+ (value 3:1 label-id
5+ (gate 3:13
6+ (face 3:16 x (ref 3:18 label))
7+ (wing 3:24 x)))
8+ (value 4:1 title-id
9+ (gate 4:13
10+ (face 4:16 x (ref 4:18 title.fixture))
11+ (wing 4:32 x))))
tests/golden/types-import-mark/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ label-id: $-(@t @t)
3+++ title-id: $-(@t @t)
tests/golden/types-import-missing-mold/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/- todo` imports molds from a Hoon `/sur` file; unsupported imports are errors where used.
2+tests: The selected `/sur` fixture has no `missing` mold. The reader reports the missing name without crashing the golden runner; partial inference does not claim to check the value.
3+expect: parses
4+expect-types: partial inference reports the imported mold as unsupported
tests/golden/types-import-missing-mold/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture missing
tests/golden/types-import-missing-mold/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/- fixture
2+++ identity |= x=missing.fixture x
tests/golden/types-import-missing-mold/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ title @t
3+--
tests/golden/types-import-missing-mold/tokens.txtnew file+11
@@ -0,0 +1,11 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph ++
5+2:4 name identity
6+2:13 glyph |=
7+2:16 name x
8+2:17 tight glyph =
9+2:18 tight wing missing.fixture
10+2:34 name x
11+2:35 NEWLINE
tests/golden/types-import-missing-mold/tree.txtnew file+6
@@ -0,0 +1,6 @@
1+(module
2+ (sur 1:1 fixture)
3+ (value 2:1 identity
4+ (gate 2:13
5+ (face 2:16 x (ref 2:18 missing.fixture))
6+ (wing 2:34 x))))
tests/golden/types-import-missing-mold/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ identity: sample mold is not supported by partial inference
tests/golden/types-import-sur-record-graph/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/-` imports Hoon molds and `/=` imports Jibb modules; Molds: "Faces are part of the type".
2+tests: A Jibb library imports a nested faced Hoon record, exports a gate over it and the caller uses that gate with the faces intact. The root does not import the Hoon mold directly.
3+expect: parses
4+expect-types: a partial report with the nested record faces
tests/golden/types-import-sur-record-graph/imports.txtnew file+1
@@ -0,0 +1 @@
1+fixture entry
tests/golden/types-import-sur-record-graph/module-trees.txtnew file+7
@@ -0,0 +1,7 @@
1+/ui/lib.jibb
2+(module
3+ (sur 1:1 fixture)
4+ (value 2:1 id
5+ (gate 2:7
6+ (face 2:10 item (ref 2:15 entry.fixture))
7+ (wing 2:29 item))))
tests/golden/types-import-sur-record-graph/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/lib.jibb
tests/golden/types-import-sur-record-graph/modules/ui/lib.jibbnew file+2
@@ -0,0 +1,2 @@
1+/- fixture
2+++ id |= item=entry.fixture item
tests/golden/types-import-sur-record-graph/source.jibbnew file+2
@@ -0,0 +1,2 @@
1+/= lib /ui/lib
2+++ echo |= item=[meta=[title=@t count=@ud] id=@ud] (id.lib item)
tests/golden/types-import-sur-record-graph/sur/fixture.txtnew file+3
@@ -0,0 +1,3 @@
1+|%
2++$ entry [meta=[title=@t count=@ud] id=@ud]
3+--
tests/golden/types-import-sur-record-graph/tokens.txtnew file+32
@@ -0,0 +1,32 @@
1+1:1 glyph /=
2+1:5 name lib
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot lib
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name echo
10+2:9 glyph |=
11+2:12 name item
12+2:16 tight glyph =
13+2:17 tight glyph [
14+2:18 tight name meta
15+2:22 tight glyph =
16+2:23 tight glyph [
17+2:24 tight name title
18+2:29 tight glyph =
19+2:30 tight aura @t
20+2:33 name count
21+2:38 tight glyph =
22+2:39 tight aura @ud
23+2:42 tight glyph ]
24+2:44 name id
25+2:46 tight glyph =
26+2:47 tight aura @ud
27+2:50 tight glyph ]
28+2:52 glyph (
29+2:53 tight wing id.lib
30+2:60 name item
31+2:64 tight glyph )
32+2:65 NEWLINE
tests/golden/types-import-sur-record-graph/tree.txtnew file+13
@@ -0,0 +1,13 @@
1+(module
2+ (jibb 1:1 lib /ui/lib)
3+ (value 2:1 echo
4+ (gate 2:9
5+ (face 2:12 item
6+ (cell 2:17
7+ (face 2:18 meta
8+ (cell 2:23
9+ (face 2:24 title (aura 2:30 @t))
10+ (face 2:33 count (aura 2:39 @ud))))
11+ (face 2:44 id (aura 2:47 @ud))))
12+ (group 2:52
13+ (call 2:53 (wing 2:53 id.lib) (wing 2:60 item))))))
tests/golden/types-import-sur-record-graph/types.txtnew file+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+++ echo: $-([meta=[title=@t count=@ud] id=@ud] [meta=[title=@t count=@ud] id=@ud])
tests/golden/types-import-sur/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Imports: `/- todo` imports molds from a Hoon `/sur` file.
2+tests: a golden case supplies its own Hoon source and selected molds; both the eval and ship runners pass the reader's results into partial inference.
3+expect: parses
4+expect-types: a partial report with the imported atom and unfaced cell types
tests/golden/types-import-sur/imports.txtnew file+2
@@ -0,0 +1,2 @@
1+fixture title
2+fixture pair
tests/golden/types-import-sur/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+/- fixture
2+++ identity |= x=title.fixture x
3+++ pair-identity |= x=pair.fixture x
tests/golden/types-import-sur/sur/fixture.txtnew file+4
@@ -0,0 +1,4 @@
1+|%
2++$ title @t
3++$ pair [@ud @t]
4+--
tests/golden/types-import-sur/tokens.txtnew file+19
@@ -0,0 +1,19 @@
1+1:1 glyph /-
2+1:5 name fixture
3+2:1 NEWLINE
4+2:1 glyph ++
5+2:4 name identity
6+2:13 glyph |=
7+2:16 name x
8+2:17 tight glyph =
9+2:18 tight wing title.fixture
10+2:32 name x
11+3:1 NEWLINE
12+3:1 glyph ++
13+3:4 name pair-identity
14+3:18 glyph |=
15+3:21 name x
16+3:22 tight glyph =
17+3:23 tight wing pair.fixture
18+3:36 name x
19+3:37 NEWLINE
tests/golden/types-import-sur/tree.txtnew file+10
@@ -0,0 +1,10 @@
1+(module
2+ (sur 1:1 fixture)
3+ (value 2:1 identity
4+ (gate 2:13
5+ (face 2:16 x (ref 2:18 title.fixture))
6+ (wing 2:32 x)))
7+ (value 3:1 pair-identity
8+ (gate 3:18
9+ (face 3:21 x (ref 3:23 pair.fixture))
10+ (wing 3:36 x))))
tests/golden/types-import-sur/types.txtnew file+3
@@ -0,0 +1,3 @@
1+partial inference; module not checked
2+++ identity: $-(@t @t)
3+++ pair-identity: $-([@ud @t] [@ud @t])
tests/golden/types-list-branch/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Patterns: "Every case needs an arm or a catch-all"; Literals by context: "Where a list is expected, `[x xs]` is `x` in front of `xs`."
2+tests: List casts and known-sample calls provide context through complete loobean, unit and list branches, including recursive and nested forms; bad arms and unrelated constraints fail closed.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-list-branch/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the source-validated prelude.
tests/golden/types-list-branch/source.jibbnew file+81
@@ -0,0 +1,81 @@
1+++ copy |= xs=(list @t)
2+ ^- (list @t)
3+ ?- xs
4+ ~ ~
5+ [item rest] [item (copy rest)]
6+++ copy-reverse |= xs=(list @t)
7+ ^- (list @t)
8+ ?- xs
9+ [item rest] [item (copy-reverse rest)]
10+ ~ ~
11+++ boolean |= b=?
12+ ^- (list @t)
13+ ?- b
14+ %.y ~[]
15+ %.n ["hi" ~]
16+++ unit-branch |= x=(unit @t)
17+ ^- (list @t)
18+ ?- x
19+ ~ ~[]
20+ [~ item] [item ~]
21+++ nested |= xs=(list @t)
22+ ^- (list @t)
23+ ?- xs
24+ ~
25+ ?- %.y
26+ %.y ~[]
27+ %.n ["x" ~]
28+ [item rest] [item (copy rest)]
29+++ consume |= xs=(list @t) xs
30+++ call |= b=?
31+ (consume
32+ ?- b
33+ %.y ~[]
34+ %.n ["hi" ~]
35+++ bad-head |= b=?
36+ ^- (list @t)
37+ ?- b
38+ %.y ~[]
39+ %.n [~zod ~]
40+++ bad-tail |= b=?
41+ ^- (list @t)
42+ ?- b
43+ %.y ["hi" ~zod]
44+ %.n ~[]
45+++ pending |= b=?
46+ ~& %unknown
47+ ^- (list @t)
48+ ?- b
49+ %.y ~[]
50+ %.n ["hi" ~]
51+++ pending-null |= b=?
52+ ~& ~
53+ ^- (list @t)
54+ ?- b
55+ %.y ~[]
56+ %.n ["hi" ~]
57+++ incomplete |= xs=(list @t)
58+ ^- (list @t)
59+ ?- xs
60+ ~ ~[]
61+++ duplicate |= xs=(list @t)
62+ ^- (list @t)
63+ ?- xs
64+ ~ ~[]
65+ ~ ~[]
66+ [item rest] [item ~]
67+++ opposite |= b=?
68+ ^- (list @t)
69+ ?- b
70+ %.y [~zod ~]
71+ %.n ["hi" ~]
72+++ escape |= xs=(list @t)
73+ ^- (list @t)
74+ ?- xs
75+ ~ [item ~]
76+ [item rest] [item ~]
77+++ bad-recursive |= xs=(list @t)
78+ ^- (list @t)
79+ ?- xs
80+ ~ ~[]
81+ [item rest] [item (bad-recursive ~zod)]
tests/golden/types-list-branch/tokens.txtnew file+521
@@ -0,0 +1,521 @@
1+1:1 glyph ++
2+1:4 name copy
3+1:9 glyph |=
4+1:12 name xs
5+1:14 tight glyph =
6+1:15 tight glyph (
7+1:16 tight name list
8+1:21 aura @t
9+1:23 tight glyph )
10+2:3 INDENT
11+2:3 glyph ^-
12+2:6 glyph (
13+2:7 tight name list
14+2:12 aura @t
15+2:14 tight glyph )
16+3:5 INDENT
17+3:5 glyph ?-
18+3:8 name xs
19+4:7 INDENT
20+4:7 lit ~
21+4:9 lit ~
22+5:7 NEWLINE
23+5:7 glyph [
24+5:8 tight name item
25+5:13 name rest
26+5:17 tight glyph ]
27+5:19 glyph [
28+5:20 tight name item
29+5:25 glyph (
30+5:26 tight name copy
31+5:31 name rest
32+5:35 tight glyph )
33+5:36 tight glyph ]
34+6:1 DEDENT
35+6:1 DEDENT
36+6:1 DEDENT
37+6:1 NEWLINE
38+6:1 glyph ++
39+6:4 name copy-reverse
40+6:17 glyph |=
41+6:20 name xs
42+6:22 tight glyph =
43+6:23 tight glyph (
44+6:24 tight name list
45+6:29 aura @t
46+6:31 tight glyph )
47+7:3 INDENT
48+7:3 glyph ^-
49+7:6 glyph (
50+7:7 tight name list
51+7:12 aura @t
52+7:14 tight glyph )
53+8:5 INDENT
54+8:5 glyph ?-
55+8:8 name xs
56+9:7 INDENT
57+9:7 glyph [
58+9:8 tight name item
59+9:13 name rest
60+9:17 tight glyph ]
61+9:19 glyph [
62+9:20 tight name item
63+9:25 glyph (
64+9:26 tight name copy-reverse
65+9:39 name rest
66+9:43 tight glyph )
67+9:44 tight glyph ]
68+10:7 NEWLINE
69+10:7 lit ~
70+10:9 lit ~
71+11:1 DEDENT
72+11:1 DEDENT
73+11:1 DEDENT
74+11:1 NEWLINE
75+11:1 glyph ++
76+11:4 name boolean
77+11:12 glyph |=
78+11:15 name b
79+11:16 tight glyph =
80+11:17 tight glyph ?
81+12:3 INDENT
82+12:3 glyph ^-
83+12:6 glyph (
84+12:7 tight name list
85+12:12 aura @t
86+12:14 tight glyph )
87+13:5 INDENT
88+13:5 glyph ?-
89+13:8 name b
90+14:7 INDENT
91+14:7 lit %.y
92+14:11 glyph ~[
93+14:13 tight glyph ]
94+15:7 NEWLINE
95+15:7 lit %.n
96+15:11 glyph [
97+15:12 tight str "hi"
98+15:17 lit ~
99+15:18 tight glyph ]
100+16:1 DEDENT
101+16:1 DEDENT
102+16:1 DEDENT
103+16:1 NEWLINE
104+16:1 glyph ++
105+16:4 name unit-branch
106+16:16 glyph |=
107+16:19 name x
108+16:20 tight glyph =
109+16:21 tight glyph (
110+16:22 tight name unit
111+16:27 aura @t
112+16:29 tight glyph )
113+17:3 INDENT
114+17:3 glyph ^-
115+17:6 glyph (
116+17:7 tight name list
117+17:12 aura @t
118+17:14 tight glyph )
119+18:5 INDENT
120+18:5 glyph ?-
121+18:8 name x
122+19:7 INDENT
123+19:7 lit ~
124+19:9 glyph ~[
125+19:11 tight glyph ]
126+20:7 NEWLINE
127+20:7 glyph [
128+20:8 tight lit ~
129+20:10 name item
130+20:14 tight glyph ]
131+20:16 glyph [
132+20:17 tight name item
133+20:22 lit ~
134+20:23 tight glyph ]
135+21:1 DEDENT
136+21:1 DEDENT
137+21:1 DEDENT
138+21:1 NEWLINE
139+21:1 glyph ++
140+21:4 name nested
141+21:11 glyph |=
142+21:14 name xs
143+21:16 tight glyph =
144+21:17 tight glyph (
145+21:18 tight name list
146+21:23 aura @t
147+21:25 tight glyph )
148+22:3 INDENT
149+22:3 glyph ^-
150+22:6 glyph (
151+22:7 tight name list
152+22:12 aura @t
153+22:14 tight glyph )
154+23:5 INDENT
155+23:5 glyph ?-
156+23:8 name xs
157+24:7 INDENT
158+24:7 lit ~
159+25:9 INDENT
160+25:9 glyph ?-
161+25:12 lit %.y
162+26:11 INDENT
163+26:11 lit %.y
164+26:15 glyph ~[
165+26:17 tight glyph ]
166+27:11 NEWLINE
167+27:11 lit %.n
168+27:15 glyph [
169+27:16 tight str "x"
170+27:20 lit ~
171+27:21 tight glyph ]
172+28:7 DEDENT
173+28:7 DEDENT
174+28:7 NEWLINE
175+28:7 glyph [
176+28:8 tight name item
177+28:13 name rest
178+28:17 tight glyph ]
179+28:19 glyph [
180+28:20 tight name item
181+28:25 glyph (
182+28:26 tight name copy
183+28:31 name rest
184+28:35 tight glyph )
185+28:36 tight glyph ]
186+29:1 DEDENT
187+29:1 DEDENT
188+29:1 DEDENT
189+29:1 NEWLINE
190+29:1 glyph ++
191+29:4 name consume
192+29:12 glyph |=
193+29:15 name xs
194+29:17 tight glyph =
195+29:18 tight glyph (
196+29:19 tight name list
197+29:24 aura @t
198+29:26 tight glyph )
199+29:28 name xs
200+30:1 NEWLINE
201+30:1 glyph ++
202+30:4 name call
203+30:9 glyph |=
204+30:12 name b
205+30:13 tight glyph =
206+30:14 tight glyph ?
207+31:3 INDENT
208+31:3 glyph (
209+31:4 tight name consume
210+32:5 INDENT
211+32:5 glyph ?-
212+32:8 name b
213+33:7 INDENT
214+33:7 lit %.y
215+33:11 glyph ~[
216+33:13 tight glyph ]
217+34:7 NEWLINE
218+34:7 lit %.n
219+34:11 glyph [
220+34:12 tight str "hi"
221+34:17 lit ~
222+34:18 tight glyph ]
223+35:1 DEDENT
224+35:1 DEDENT
225+35:1 DEDENT
226+35:1 NEWLINE
227+35:1 glyph ++
228+35:4 name bad-head
229+35:13 glyph |=
230+35:16 name b
231+35:17 tight glyph =
232+35:18 tight glyph ?
233+36:3 INDENT
234+36:3 glyph ^-
235+36:6 glyph (
236+36:7 tight name list
237+36:12 aura @t
238+36:14 tight glyph )
239+37:5 INDENT
240+37:5 glyph ?-
241+37:8 name b
242+38:7 INDENT
243+38:7 lit %.y
244+38:11 glyph ~[
245+38:13 tight glyph ]
246+39:7 NEWLINE
247+39:7 lit %.n
248+39:11 glyph [
249+39:12 tight lit ~zod
250+39:17 lit ~
251+39:18 tight glyph ]
252+40:1 DEDENT
253+40:1 DEDENT
254+40:1 DEDENT
255+40:1 NEWLINE
256+40:1 glyph ++
257+40:4 name bad-tail
258+40:13 glyph |=
259+40:16 name b
260+40:17 tight glyph =
261+40:18 tight glyph ?
262+41:3 INDENT
263+41:3 glyph ^-
264+41:6 glyph (
265+41:7 tight name list
266+41:12 aura @t
267+41:14 tight glyph )
268+42:5 INDENT
269+42:5 glyph ?-
270+42:8 name b
271+43:7 INDENT
272+43:7 lit %.y
273+43:11 glyph [
274+43:12 tight str "hi"
275+43:17 lit ~zod
276+43:21 tight glyph ]
277+44:7 NEWLINE
278+44:7 lit %.n
279+44:11 glyph ~[
280+44:13 tight glyph ]
281+45:1 DEDENT
282+45:1 DEDENT
283+45:1 DEDENT
284+45:1 NEWLINE
285+45:1 glyph ++
286+45:4 name pending
287+45:12 glyph |=
288+45:15 name b
289+45:16 tight glyph =
290+45:17 tight glyph ?
291+46:3 INDENT
292+46:3 glyph ~&
293+46:6 lit %unknown
294+47:5 INDENT
295+47:5 glyph ^-
296+47:8 glyph (
297+47:9 tight name list
298+47:14 aura @t
299+47:16 tight glyph )
300+48:7 INDENT
301+48:7 glyph ?-
302+48:10 name b
303+49:9 INDENT
304+49:9 lit %.y
305+49:13 glyph ~[
306+49:15 tight glyph ]
307+50:9 NEWLINE
308+50:9 lit %.n
309+50:13 glyph [
310+50:14 tight str "hi"
311+50:19 lit ~
312+50:20 tight glyph ]
313+51:1 DEDENT
314+51:1 DEDENT
315+51:1 DEDENT
316+51:1 DEDENT
317+51:1 NEWLINE
318+51:1 glyph ++
319+51:4 name pending-null
320+51:17 glyph |=
321+51:20 name b
322+51:21 tight glyph =
323+51:22 tight glyph ?
324+52:3 INDENT
325+52:3 glyph ~&
326+52:6 lit ~
327+53:5 INDENT
328+53:5 glyph ^-
329+53:8 glyph (
330+53:9 tight name list
331+53:14 aura @t
332+53:16 tight glyph )
333+54:7 INDENT
334+54:7 glyph ?-
335+54:10 name b
336+55:9 INDENT
337+55:9 lit %.y
338+55:13 glyph ~[
339+55:15 tight glyph ]
340+56:9 NEWLINE
341+56:9 lit %.n
342+56:13 glyph [
343+56:14 tight str "hi"
344+56:19 lit ~
345+56:20 tight glyph ]
346+57:1 DEDENT
347+57:1 DEDENT
348+57:1 DEDENT
349+57:1 DEDENT
350+57:1 NEWLINE
351+57:1 glyph ++
352+57:4 name incomplete
353+57:15 glyph |=
354+57:18 name xs
355+57:20 tight glyph =
356+57:21 tight glyph (
357+57:22 tight name list
358+57:27 aura @t
359+57:29 tight glyph )
360+58:3 INDENT
361+58:3 glyph ^-
362+58:6 glyph (
363+58:7 tight name list
364+58:12 aura @t
365+58:14 tight glyph )
366+59:5 INDENT
367+59:5 glyph ?-
368+59:8 name xs
369+60:7 INDENT
370+60:7 lit ~
371+60:9 glyph ~[
372+60:11 tight glyph ]
373+61:1 DEDENT
374+61:1 DEDENT
375+61:1 DEDENT
376+61:1 NEWLINE
377+61:1 glyph ++
378+61:4 name duplicate
379+61:14 glyph |=
380+61:17 name xs
381+61:19 tight glyph =
382+61:20 tight glyph (
383+61:21 tight name list
384+61:26 aura @t
385+61:28 tight glyph )
386+62:3 INDENT
387+62:3 glyph ^-
388+62:6 glyph (
389+62:7 tight name list
390+62:12 aura @t
391+62:14 tight glyph )
392+63:5 INDENT
393+63:5 glyph ?-
394+63:8 name xs
395+64:7 INDENT
396+64:7 lit ~
397+64:9 glyph ~[
398+64:11 tight glyph ]
399+65:7 NEWLINE
400+65:7 lit ~
401+65:9 glyph ~[
402+65:11 tight glyph ]
403+66:7 NEWLINE
404+66:7 glyph [
405+66:8 tight name item
406+66:13 name rest
407+66:17 tight glyph ]
408+66:19 glyph [
409+66:20 tight name item
410+66:25 lit ~
411+66:26 tight glyph ]
412+67:1 DEDENT
413+67:1 DEDENT
414+67:1 DEDENT
415+67:1 NEWLINE
416+67:1 glyph ++
417+67:4 name opposite
418+67:13 glyph |=
419+67:16 name b
420+67:17 tight glyph =
421+67:18 tight glyph ?
422+68:3 INDENT
423+68:3 glyph ^-
424+68:6 glyph (
425+68:7 tight name list
426+68:12 aura @t
427+68:14 tight glyph )
428+69:5 INDENT
429+69:5 glyph ?-
430+69:8 name b
431+70:7 INDENT
432+70:7 lit %.y
433+70:11 glyph [
434+70:12 tight lit ~zod
435+70:17 lit ~
436+70:18 tight glyph ]
437+71:7 NEWLINE
438+71:7 lit %.n
439+71:11 glyph [
440+71:12 tight str "hi"
441+71:17 lit ~
442+71:18 tight glyph ]
443+72:1 DEDENT
444+72:1 DEDENT
445+72:1 DEDENT
446+72:1 NEWLINE
447+72:1 glyph ++
448+72:4 name escape
449+72:11 glyph |=
450+72:14 name xs
451+72:16 tight glyph =
452+72:17 tight glyph (
453+72:18 tight name list
454+72:23 aura @t
455+72:25 tight glyph )
456+73:3 INDENT
457+73:3 glyph ^-
458+73:6 glyph (
459+73:7 tight name list
460+73:12 aura @t
461+73:14 tight glyph )
462+74:5 INDENT
463+74:5 glyph ?-
464+74:8 name xs
465+75:7 INDENT
466+75:7 lit ~
467+75:9 glyph [
468+75:10 tight name item
469+75:15 lit ~
470+75:16 tight glyph ]
471+76:7 NEWLINE
472+76:7 glyph [
473+76:8 tight name item
474+76:13 name rest
475+76:17 tight glyph ]
476+76:19 glyph [
477+76:20 tight name item
478+76:25 lit ~
479+76:26 tight glyph ]
480+77:1 DEDENT
481+77:1 DEDENT
482+77:1 DEDENT
483+77:1 NEWLINE
484+77:1 glyph ++
485+77:4 name bad-recursive
486+77:18 glyph |=
487+77:21 name xs
488+77:23 tight glyph =
489+77:24 tight glyph (
490+77:25 tight name list
491+77:30 aura @t
492+77:32 tight glyph )
493+78:3 INDENT
494+78:3 glyph ^-
495+78:6 glyph (
496+78:7 tight name list
497+78:12 aura @t
498+78:14 tight glyph )
499+79:5 INDENT
500+79:5 glyph ?-
501+79:8 name xs
502+80:7 INDENT
503+80:7 lit ~
504+80:9 glyph ~[
505+80:11 tight glyph ]
506+81:7 NEWLINE
507+81:7 glyph [
508+81:8 tight name item
509+81:13 name rest
510+81:17 tight glyph ]
511+81:19 glyph [
512+81:20 tight name item
513+81:25 glyph (
514+81:26 tight name bad-recursive
515+81:40 lit ~zod
516+81:44 tight glyph )
517+81:45 tight glyph ]
518+81:46 DEDENT
519+81:46 DEDENT
520+81:46 DEDENT
521+81:46 NEWLINE
tests/golden/types-list-branch/tree.txtnew file+237
@@ -0,0 +1,237 @@
1+(module
2+ (value 1:1 copy
3+ (gate 1:9
4+ (face 1:12 xs
5+ (apply 1:15 list (aura 1:21 @t)))
6+ (body 2:3
7+ (cast 2:3
8+ (apply 2:6 list (aura 2:12 @t))
9+ (body 3:5
10+ (branch 3:5
11+ (wing 3:8 xs)
12+ (arm 4:7 (lit 4:7 ~) (lit 4:9 ~))
13+ (arm 5:7
14+ (cell 5:7 (bind 5:8 item) (bind 5:13 rest))
15+ (tuple 5:19
16+ (wing 5:20 item)
17+ (group 5:25
18+ (call 5:26 (wing 5:26 copy) (wing 5:31 rest)))))))))))
19+ (value 6:1 copy-reverse
20+ (gate 6:17
21+ (face 6:20 xs
22+ (apply 6:23 list (aura 6:29 @t)))
23+ (body 7:3
24+ (cast 7:3
25+ (apply 7:6 list (aura 7:12 @t))
26+ (body 8:5
27+ (branch 8:5
28+ (wing 8:8 xs)
29+ (arm 9:7
30+ (cell 9:7 (bind 9:8 item) (bind 9:13 rest))
31+ (tuple 9:19
32+ (wing 9:20 item)
33+ (group 9:25
34+ (call 9:26 (wing 9:26 copy-reverse) (wing 9:39 rest)))))
35+ (arm 10:7 (lit 10:7 ~) (lit 10:9 ~))))))))
36+ (value 11:1 boolean
37+ (gate 11:12
38+ (face 11:15 b (flag 11:17))
39+ (body 12:3
40+ (cast 12:3
41+ (apply 12:6 list (aura 12:12 @t))
42+ (body 13:5
43+ (branch 13:5
44+ (wing 13:8 b)
45+ (arm 14:7 (lit 14:7 %.y) (list 14:11))
46+ (arm 15:7
47+ (lit 15:7 %.n)
48+ (tuple 15:11 (str 15:12 "hi") (lit 15:17 ~)))))))))
49+ (value 16:1 unit-branch
50+ (gate 16:16
51+ (face 16:19 x
52+ (apply 16:21 unit (aura 16:27 @t)))
53+ (body 17:3
54+ (cast 17:3
55+ (apply 17:6 list (aura 17:12 @t))
56+ (body 18:5
57+ (branch 18:5
58+ (wing 18:8 x)
59+ (arm 19:7 (lit 19:7 ~) (list 19:9))
60+ (arm 20:7
61+ (cell 20:7 (lit 20:8 ~) (bind 20:10 item))
62+ (tuple 20:16 (wing 20:17 item) (lit 20:22 ~)))))))))
63+ (value 21:1 nested
64+ (gate 21:11
65+ (face 21:14 xs
66+ (apply 21:17 list (aura 21:23 @t)))
67+ (body 22:3
68+ (cast 22:3
69+ (apply 22:6 list (aura 22:12 @t))
70+ (body 23:5
71+ (branch 23:5
72+ (wing 23:8 xs)
73+ (arm 24:7
74+ (lit 24:7 ~)
75+ (body 25:9
76+ (branch 25:9
77+ (lit 25:12 %.y)
78+ (arm 26:11 (lit 26:11 %.y) (list 26:15))
79+ (arm 27:11
80+ (lit 27:11 %.n)
81+ (tuple 27:15 (str 27:16 "x") (lit 27:20 ~))))))
82+ (arm 28:7
83+ (cell 28:7 (bind 28:8 item) (bind 28:13 rest))
84+ (tuple 28:19
85+ (wing 28:20 item)
86+ (group 28:25
87+ (call 28:26 (wing 28:26 copy) (wing 28:31 rest)))))))))))
88+ (value 29:1 consume
89+ (gate 29:12
90+ (face 29:15 xs
91+ (apply 29:18 list (aura 29:24 @t)))
92+ (wing 29:28 xs)))
93+ (value 30:1 call
94+ (gate 30:9
95+ (face 30:12 b (flag 30:14))
96+ (body 31:3
97+ (group 31:3
98+ (call 31:4
99+ (wing 31:4 consume)
100+ (branch 32:5
101+ (wing 32:8 b)
102+ (arm 33:7 (lit 33:7 %.y) (list 33:11))
103+ (arm 34:7
104+ (lit 34:7 %.n)
105+ (tuple 34:11 (str 34:12 "hi") (lit 34:17 ~)))))))))
106+ (value 35:1 bad-head
107+ (gate 35:13
108+ (face 35:16 b (flag 35:18))
109+ (body 36:3
110+ (cast 36:3
111+ (apply 36:6 list (aura 36:12 @t))
112+ (body 37:5
113+ (branch 37:5
114+ (wing 37:8 b)
115+ (arm 38:7 (lit 38:7 %.y) (list 38:11))
116+ (arm 39:7
117+ (lit 39:7 %.n)
118+ (tuple 39:11 (lit 39:12 ~zod) (lit 39:17 ~)))))))))
119+ (value 40:1 bad-tail
120+ (gate 40:13
121+ (face 40:16 b (flag 40:18))
122+ (body 41:3
123+ (cast 41:3
124+ (apply 41:6 list (aura 41:12 @t))
125+ (body 42:5
126+ (branch 42:5
127+ (wing 42:8 b)
128+ (arm 43:7
129+ (lit 43:7 %.y)
130+ (tuple 43:11 (str 43:12 "hi") (lit 43:17 ~zod)))
131+ (arm 44:7 (lit 44:7 %.n) (list 44:11))))))))
132+ (value 45:1 pending
133+ (gate 45:12
134+ (face 45:15 b (flag 45:17))
135+ (body 46:3
136+ (trace 46:3
137+ (lit 46:6 %unknown)
138+ (body 47:5
139+ (cast 47:5
140+ (apply 47:8 list (aura 47:14 @t))
141+ (body 48:7
142+ (branch 48:7
143+ (wing 48:10 b)
144+ (arm 49:9 (lit 49:9 %.y) (list 49:13))
145+ (arm 50:9
146+ (lit 50:9 %.n)
147+ (tuple 50:13 (str 50:14 "hi") (lit 50:19 ~)))))))))))
148+ (value 51:1 pending-null
149+ (gate 51:17
150+ (face 51:20 b (flag 51:22))
151+ (body 52:3
152+ (trace 52:3
153+ (lit 52:6 ~)
154+ (body 53:5
155+ (cast 53:5
156+ (apply 53:8 list (aura 53:14 @t))
157+ (body 54:7
158+ (branch 54:7
159+ (wing 54:10 b)
160+ (arm 55:9 (lit 55:9 %.y) (list 55:13))
161+ (arm 56:9
162+ (lit 56:9 %.n)
163+ (tuple 56:13 (str 56:14 "hi") (lit 56:19 ~)))))))))))
164+ (value 57:1 incomplete
165+ (gate 57:15
166+ (face 57:18 xs
167+ (apply 57:21 list (aura 57:27 @t)))
168+ (body 58:3
169+ (cast 58:3
170+ (apply 58:6 list (aura 58:12 @t))
171+ (body 59:5
172+ (branch 59:5
173+ (wing 59:8 xs)
174+ (arm 60:7 (lit 60:7 ~) (list 60:9))))))))
175+ (value 61:1 duplicate
176+ (gate 61:14
177+ (face 61:17 xs
178+ (apply 61:20 list (aura 61:26 @t)))
179+ (body 62:3
180+ (cast 62:3
181+ (apply 62:6 list (aura 62:12 @t))
182+ (body 63:5
183+ (branch 63:5
184+ (wing 63:8 xs)
185+ (arm 64:7 (lit 64:7 ~) (list 64:9))
186+ (arm 65:7 (lit 65:7 ~) (list 65:9))
187+ (arm 66:7
188+ (cell 66:7 (bind 66:8 item) (bind 66:13 rest))
189+ (tuple 66:19 (wing 66:20 item) (lit 66:25 ~)))))))))
190+ (value 67:1 opposite
191+ (gate 67:13
192+ (face 67:16 b (flag 67:18))
193+ (body 68:3
194+ (cast 68:3
195+ (apply 68:6 list (aura 68:12 @t))
196+ (body 69:5
197+ (branch 69:5
198+ (wing 69:8 b)
199+ (arm 70:7
200+ (lit 70:7 %.y)
201+ (tuple 70:11 (lit 70:12 ~zod) (lit 70:17 ~)))
202+ (arm 71:7
203+ (lit 71:7 %.n)
204+ (tuple 71:11 (str 71:12 "hi") (lit 71:17 ~)))))))))
205+ (value 72:1 escape
206+ (gate 72:11
207+ (face 72:14 xs
208+ (apply 72:17 list (aura 72:23 @t)))
209+ (body 73:3
210+ (cast 73:3
211+ (apply 73:6 list (aura 73:12 @t))
212+ (body 74:5
213+ (branch 74:5
214+ (wing 74:8 xs)
215+ (arm 75:7
216+ (lit 75:7 ~)
217+ (tuple 75:9 (wing 75:10 item) (lit 75:15 ~)))
218+ (arm 76:7
219+ (cell 76:7 (bind 76:8 item) (bind 76:13 rest))
220+ (tuple 76:19 (wing 76:20 item) (lit 76:25 ~)))))))))
221+ (value 77:1 bad-recursive
222+ (gate 77:18
223+ (face 77:21 xs
224+ (apply 77:24 list (aura 77:30 @t)))
225+ (body 78:3
226+ (cast 78:3
227+ (apply 78:6 list (aura 78:12 @t))
228+ (body 79:5
229+ (branch 79:5
230+ (wing 79:8 xs)
231+ (arm 80:7 (lit 80:7 ~) (list 80:9))
232+ (arm 81:7
233+ (cell 81:7 (bind 81:8 item) (bind 81:13 rest))
234+ (tuple 81:19
235+ (wing 81:20 item)
236+ (group 81:25
237+ (call 81:26 (wing 81:26 bad-recursive) (lit 81:40 ~zod))))))))))))
tests/golden/types-list-branch/types.txtnew file+41
@@ -0,0 +1,41 @@
1+partial inference; module not checked
2+++ copy: $-((list @t) (list @t))
3+++ copy-reverse: $-((list @t) (list @t))
4+++ boolean: $-(? (list @t))
5+++ unit-branch: $-((unit @t) (list @t))
6+++ nested: $-((list @t) (list @t))
7+++ consume: $-((list @t) (list @t))
8+++ call: $-(? (list @t))
9+++ bad-head: list item does not fit its expected type
10+/tests/golden/types-list-branch/source.jibb:36:6: expected item has type @t
11+ ^- (list @t)
12+ ^
13+/tests/golden/types-list-branch/source.jibb:39:12: list item has type @p
14+ %.n [~zod ~]
15+ ^
16+++ bad-tail: list tail does not fit its expected type
17+/tests/golden/types-list-branch/source.jibb:41:6: expected list has type (list @t)
18+ ^- (list @t)
19+ ^
20+/tests/golden/types-list-branch/source.jibb:43:17: list tail has type @p
21+ %.y ["hi" ~zod]
22+ ^
23+++ pending: tag needs context in partial inference
24+++ pending-null: `~` needs context in partial inference
25+++ incomplete: branch pattern is not supported by partial inference
26+++ duplicate: branch is not supported by partial inference
27+++ opposite: list item does not fit its expected type
28+/tests/golden/types-list-branch/source.jibb:68:6: expected item has type @t
29+ ^- (list @t)
30+ ^
31+/tests/golden/types-list-branch/source.jibb:70:12: list item has type @p
32+ %.y [~zod ~]
33+ ^
34+++ escape: name is not available to partial inference
35+++ bad-recursive: call's sample and argument types do not unify
36+/tests/golden/types-list-branch/source.jibb:81:26: called gate has type $-((list @t) A)
37+ [item rest] [item (bad-recursive ~zod)]
38+ ^
39+/tests/golden/types-list-branch/source.jibb:81:40: argument has type @p
40+ [item rest] [item (bad-recursive ~zod)]
41+ ^
tests/golden/types-list-cons/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Literals by context: "Where a list is expected, `[x xs]` is `x` in front of `xs`."
2+tests: Null, term-zero tails, nested cons and list elements take context, while mismatches, unsupported cells and unrelated pending literals are reported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-list-cons/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the source-validated prelude.
tests/golden/types-list-cons/source.jibbnew file+20
@@ -0,0 +1,20 @@
1+++ empty ^- (list @t) ~
2+++ one ^- (list @t) ["a" ~]
3+++ zero-tail ^- (list @t) ["a" %$]
4+++ zero-number ^- (list @t) ["a" %0]
5+++ zero-amp ^- (list @t) ["a" %&]
6+++ multiple ^- (list @t) ["a" ["b" ~]]
7+++ nested ^- (list (list @t)) [~["a"] ~]
8+++ nested-cons ^- (list (list @t)) [["a" ~] ~]
9+++ take |= xs=(list @t) xs
10+++ call (take ["hi" ~])
11+++ bad-head ^- (list @t) [~zod ~]
12+++ bad-tail ^- (list @t) ["hi" ~zod]
13+++ faced ^- (list @t) [i="hi" t=~]
14+++ three ^- (list @t) ["a" "b" ~]
15+++ pending
16+ ~& %unknown
17+ ^- (list @t) ["hi" ~]
18+++ pending-null
19+ ~& ~
20+ ^- (list @t) ["hi" ~]
tests/golden/types-list-cons/tokens.txtnew file+217
@@ -0,0 +1,217 @@
1+1:1 glyph ++
2+1:4 name empty
3+1:10 glyph ^-
4+1:13 glyph (
5+1:14 tight name list
6+1:19 aura @t
7+1:21 tight glyph )
8+1:23 lit ~
9+2:1 NEWLINE
10+2:1 glyph ++
11+2:4 name one
12+2:8 glyph ^-
13+2:11 glyph (
14+2:12 tight name list
15+2:17 aura @t
16+2:19 tight glyph )
17+2:21 glyph [
18+2:22 tight str "a"
19+2:26 lit ~
20+2:27 tight glyph ]
21+3:1 NEWLINE
22+3:1 glyph ++
23+3:4 name zero-tail
24+3:14 glyph ^-
25+3:17 glyph (
26+3:18 tight name list
27+3:23 aura @t
28+3:25 tight glyph )
29+3:27 glyph [
30+3:28 tight str "a"
31+3:32 lit %$
32+3:34 tight glyph ]
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name zero-number
36+4:16 glyph ^-
37+4:19 glyph (
38+4:20 tight name list
39+4:25 aura @t
40+4:27 tight glyph )
41+4:29 glyph [
42+4:30 tight str "a"
43+4:34 lit %0
44+4:36 tight glyph ]
45+5:1 NEWLINE
46+5:1 glyph ++
47+5:4 name zero-amp
48+5:13 glyph ^-
49+5:16 glyph (
50+5:17 tight name list
51+5:22 aura @t
52+5:24 tight glyph )
53+5:26 glyph [
54+5:27 tight str "a"
55+5:31 lit %&
56+5:33 tight glyph ]
57+6:1 NEWLINE
58+6:1 glyph ++
59+6:4 name multiple
60+6:13 glyph ^-
61+6:16 glyph (
62+6:17 tight name list
63+6:22 aura @t
64+6:24 tight glyph )
65+6:26 glyph [
66+6:27 tight str "a"
67+6:31 glyph [
68+6:32 tight str "b"
69+6:36 lit ~
70+6:37 tight glyph ]
71+6:38 tight glyph ]
72+7:1 NEWLINE
73+7:1 glyph ++
74+7:4 name nested
75+7:11 glyph ^-
76+7:14 glyph (
77+7:15 tight name list
78+7:20 glyph (
79+7:21 tight name list
80+7:26 aura @t
81+7:28 tight glyph )
82+7:29 tight glyph )
83+7:31 glyph [
84+7:32 tight glyph ~[
85+7:34 tight str "a"
86+7:37 tight glyph ]
87+7:39 lit ~
88+7:40 tight glyph ]
89+8:1 NEWLINE
90+8:1 glyph ++
91+8:4 name nested-cons
92+8:16 glyph ^-
93+8:19 glyph (
94+8:20 tight name list
95+8:25 glyph (
96+8:26 tight name list
97+8:31 aura @t
98+8:33 tight glyph )
99+8:34 tight glyph )
100+8:36 glyph [
101+8:37 tight glyph [
102+8:38 tight str "a"
103+8:42 lit ~
104+8:43 tight glyph ]
105+8:45 lit ~
106+8:46 tight glyph ]
107+9:1 NEWLINE
108+9:1 glyph ++
109+9:4 name take
110+9:9 glyph |=
111+9:12 name xs
112+9:14 tight glyph =
113+9:15 tight glyph (
114+9:16 tight name list
115+9:21 aura @t
116+9:23 tight glyph )
117+9:25 name xs
118+10:1 NEWLINE
119+10:1 glyph ++
120+10:4 name call
121+10:9 glyph (
122+10:10 tight name take
123+10:15 glyph [
124+10:16 tight str "hi"
125+10:21 lit ~
126+10:22 tight glyph ]
127+10:23 tight glyph )
128+11:1 NEWLINE
129+11:1 glyph ++
130+11:4 name bad-head
131+11:13 glyph ^-
132+11:16 glyph (
133+11:17 tight name list
134+11:22 aura @t
135+11:24 tight glyph )
136+11:26 glyph [
137+11:27 tight lit ~zod
138+11:32 lit ~
139+11:33 tight glyph ]
140+12:1 NEWLINE
141+12:1 glyph ++
142+12:4 name bad-tail
143+12:13 glyph ^-
144+12:16 glyph (
145+12:17 tight name list
146+12:22 aura @t
147+12:24 tight glyph )
148+12:26 glyph [
149+12:27 tight str "hi"
150+12:32 lit ~zod
151+12:36 tight glyph ]
152+13:1 NEWLINE
153+13:1 glyph ++
154+13:4 name faced
155+13:10 glyph ^-
156+13:13 glyph (
157+13:14 tight name list
158+13:19 aura @t
159+13:21 tight glyph )
160+13:23 glyph [
161+13:24 tight name i
162+13:25 tight glyph =
163+13:26 tight str "hi"
164+13:31 name t
165+13:32 tight glyph =
166+13:33 tight lit ~
167+13:34 tight glyph ]
168+14:1 NEWLINE
169+14:1 glyph ++
170+14:4 name three
171+14:10 glyph ^-
172+14:13 glyph (
173+14:14 tight name list
174+14:19 aura @t
175+14:21 tight glyph )
176+14:23 glyph [
177+14:24 tight str "a"
178+14:28 str "b"
179+14:32 lit ~
180+14:33 tight glyph ]
181+15:1 NEWLINE
182+15:1 glyph ++
183+15:4 name pending
184+16:3 INDENT
185+16:3 glyph ~&
186+16:6 lit %unknown
187+17:5 INDENT
188+17:5 glyph ^-
189+17:8 glyph (
190+17:9 tight name list
191+17:14 aura @t
192+17:16 tight glyph )
193+17:18 glyph [
194+17:19 tight str "hi"
195+17:24 lit ~
196+17:25 tight glyph ]
197+18:1 DEDENT
198+18:1 DEDENT
199+18:1 NEWLINE
200+18:1 glyph ++
201+18:4 name pending-null
202+19:3 INDENT
203+19:3 glyph ~&
204+19:6 lit ~
205+20:5 INDENT
206+20:5 glyph ^-
207+20:8 glyph (
208+20:9 tight name list
209+20:14 aura @t
210+20:16 tight glyph )
211+20:18 glyph [
212+20:19 tight str "hi"
213+20:24 lit ~
214+20:25 tight glyph ]
215+20:26 DEDENT
216+20:26 DEDENT
217+20:26 NEWLINE
tests/golden/types-list-cons/tree.txtnew file+85
@@ -0,0 +1,85 @@
1+(module
2+ (value 1:1 empty
3+ (cast 1:10
4+ (apply 1:13 list (aura 1:19 @t))
5+ (lit 1:23 ~)))
6+ (value 2:1 one
7+ (cast 2:8
8+ (apply 2:11 list (aura 2:17 @t))
9+ (tuple 2:21 (str 2:22 "a") (lit 2:26 ~))))
10+ (value 3:1 zero-tail
11+ (cast 3:14
12+ (apply 3:17 list (aura 3:23 @t))
13+ (tuple 3:27 (str 3:28 "a") (lit 3:32 %$))))
14+ (value 4:1 zero-number
15+ (cast 4:16
16+ (apply 4:19 list (aura 4:25 @t))
17+ (tuple 4:29 (str 4:30 "a") (lit 4:34 %0))))
18+ (value 5:1 zero-amp
19+ (cast 5:13
20+ (apply 5:16 list (aura 5:22 @t))
21+ (tuple 5:26 (str 5:27 "a") (lit 5:31 %&))))
22+ (value 6:1 multiple
23+ (cast 6:13
24+ (apply 6:16 list (aura 6:22 @t))
25+ (tuple 6:26
26+ (str 6:27 "a")
27+ (tuple 6:31 (str 6:32 "b") (lit 6:36 ~)))))
28+ (value 7:1 nested
29+ (cast 7:11
30+ (apply 7:14 list
31+ (apply 7:20 list (aura 7:26 @t)))
32+ (tuple 7:31
33+ (list 7:32 (str 7:34 "a"))
34+ (lit 7:39 ~))))
35+ (value 8:1 nested-cons
36+ (cast 8:16
37+ (apply 8:19 list
38+ (apply 8:25 list (aura 8:31 @t)))
39+ (tuple 8:36
40+ (tuple 8:37 (str 8:38 "a") (lit 8:42 ~))
41+ (lit 8:45 ~))))
42+ (value 9:1 take
43+ (gate 9:9
44+ (face 9:12 xs
45+ (apply 9:15 list (aura 9:21 @t)))
46+ (wing 9:25 xs)))
47+ (value 10:1 call
48+ (group 10:9
49+ (call 10:10
50+ (wing 10:10 take)
51+ (tuple 10:15 (str 10:16 "hi") (lit 10:21 ~)))))
52+ (value 11:1 bad-head
53+ (cast 11:13
54+ (apply 11:16 list (aura 11:22 @t))
55+ (tuple 11:26 (lit 11:27 ~zod) (lit 11:32 ~))))
56+ (value 12:1 bad-tail
57+ (cast 12:13
58+ (apply 12:16 list (aura 12:22 @t))
59+ (tuple 12:26 (str 12:27 "hi") (lit 12:32 ~zod))))
60+ (value 13:1 faced
61+ (cast 13:10
62+ (apply 13:13 list (aura 13:19 @t))
63+ (tuple 13:23
64+ (face 13:24 i (str 13:26 "hi"))
65+ (face 13:31 t (lit 13:33 ~)))))
66+ (value 14:1 three
67+ (cast 14:10
68+ (apply 14:13 list (aura 14:19 @t))
69+ (tuple 14:23 (str 14:24 "a") (str 14:28 "b") (lit 14:32 ~))))
70+ (value 15:1 pending
71+ (body 16:3
72+ (trace 16:3
73+ (lit 16:6 %unknown)
74+ (body 17:5
75+ (cast 17:5
76+ (apply 17:8 list (aura 17:14 @t))
77+ (tuple 17:18 (str 17:19 "hi") (lit 17:24 ~)))))))
78+ (value 18:1 pending-null
79+ (body 19:3
80+ (trace 19:3
81+ (lit 19:6 ~)
82+ (body 20:5
83+ (cast 20:5
84+ (apply 20:8 list (aura 20:14 @t))
85+ (tuple 20:18 (str 20:19 "hi") (lit 20:24 ~))))))))
tests/golden/types-list-cons/types.txtnew file+29

This diff is too big to show here.

tests/golden/types-list-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-context/source.jibbnew file+17

This diff is too big to show here.

tests/golden/types-list-context/tokens.txtnew file+143

This diff is too big to show here.

tests/golden/types-list-context/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-list-context/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-list-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-list-imported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-imported/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-list-imported/sur/fixture.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-imported/tokens.txtnew file+109

This diff is too big to show here.

tests/golden/types-list-imported/tree.txtnew file+52

This diff is too big to show here.

tests/golden/types-list-imported/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-list-pattern-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-pattern-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-list-pattern-imported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-pattern-imported/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-list-pattern-imported/sur/fixture.txtnew file+5

This diff is too big to show here.

tests/golden/types-list-pattern-imported/tokens.txtnew file+66

This diff is too big to show here.

tests/golden/types-list-pattern-imported/tree.txtnew file+32

This diff is too big to show here.

tests/golden/types-list-pattern-imported/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-patterns/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-patterns/source.jibbnew file+64

This diff is too big to show here.

tests/golden/types-list-patterns/tokens.txtnew file+359

This diff is too big to show here.

tests/golden/types-list-patterns/tree.txtnew file+168

This diff is too big to show here.

tests/golden/types-list-patterns/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-list-zero-fit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-list-zero-fit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-list-zero-fit/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-list-zero-fit/tokens.txtnew file+181

This diff is too big to show here.

tests/golden/types-list-zero-fit/tree.txtnew file+91

This diff is too big to show here.

tests/golden/types-list-zero-fit/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-local-capitals/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-capitals/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-capitals/source.jibbnew file+73

This diff is too big to show here.

tests/golden/types-local-capitals/tokens.txtnew file+473

This diff is too big to show here.

tests/golden/types-local-capitals/tree.txtnew file+229

This diff is too big to show here.

tests/golden/types-local-capitals/types.txtnew file+28

This diff is too big to show here.

tests/golden/types-local-recursive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-local-recursive/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-local-recursive/source.jibbnew file+54

This diff is too big to show here.

tests/golden/types-local-recursive/tokens.txtnew file+351

This diff is too big to show here.

tests/golden/types-local-recursive/tree.txtnew file+170

This diff is too big to show here.

tests/golden/types-local-recursive/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-missing-tag-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-missing-tag-context/source.jibbnew file+17

This diff is too big to show here.

tests/golden/types-missing-tag-context/tokens.txtnew file+98

This diff is too big to show here.

tests/golden/types-missing-tag-context/tree.txtnew file+45

This diff is too big to show here.

tests/golden/types-missing-tag-context/types.txtnew file+38

This diff is too big to show here.

tests/golden/types-missing-tag-imported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-imported/imports.txtnew file+2

This diff is too big to show here.

tests/golden/types-missing-tag-imported/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-missing-tag-imported/sur/fixture.txtnew file+21

This diff is too big to show here.

tests/golden/types-missing-tag-imported/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/types-missing-tag-imported/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-missing-tag-imported/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-missing-tag-named/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-missing-tag-named/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-missing-tag-named/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-missing-tag-named/tokens.txtnew file+155

This diff is too big to show here.

tests/golden/types-missing-tag-named/tree.txtnew file+66

This diff is too big to show here.

tests/golden/types-missing-tag-named/types.txtnew file+66

This diff is too big to show here.

tests/golden/types-module-fixtures/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-fixtures/module-trees.txtnew file+13

This diff is too big to show here.

tests/golden/types-module-fixtures/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-fixtures/modules/ui/api/blog.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-fixtures/modules/ui/components/card.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-fixtures/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-fixtures/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-module-fixtures/tokens.txtnew file+62

This diff is too big to show here.

tests/golden/types-module-fixtures/tree.txtnew file+23

This diff is too big to show here.

tests/golden/types-module-fixtures/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-module-mixed/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-module-mixed/imports.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/mar/label.txtnew file+5

This diff is too big to show here.

tests/golden/types-module-mixed/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-module-mixed/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/modules/ui/helper.jibbnew file+1

This diff is too big to show here.

tests/golden/types-module-mixed/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-module-mixed/sur/fixture.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-mixed/tokens.txtnew file+29

This diff is too big to show here.

tests/golden/types-module-mixed/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-module-mixed/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-multi-call/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-multi-call/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-multi-call/source.jibbnew file+42

This diff is too big to show here.

tests/golden/types-multi-call/tokens.txtnew file+370

This diff is too big to show here.

tests/golden/types-multi-call/tree.txtnew file+169

This diff is too big to show here.

tests/golden/types-multi-call/types.txtnew file+100

This diff is too big to show here.

tests/golden/types-multi-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-multi-import/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-multi-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-multi-import/modules/ui/lib.jibbnew file+5

This diff is too big to show here.

tests/golden/types-multi-import/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-multi-import/tokens.txtnew file+43

This diff is too big to show here.

tests/golden/types-multi-import/tree.txtnew file+20

This diff is too big to show here.

tests/golden/types-multi-import/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-null-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-context/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-null-context/tokens.txtnew file+57

This diff is too big to show here.

tests/golden/types-null-context/tree.txtnew file+25

This diff is too big to show here.

tests/golden/types-null-context/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-null-overlap/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-overlap/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-null-overlap/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-null-overlap/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-null-overlap/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-null-unresolved/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-null-unresolved/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-null-unresolved/tokens.txtnew file+79

This diff is too big to show here.

tests/golden/types-null-unresolved/tree.txtnew file+34

This diff is too big to show here.

tests/golden/types-null-unresolved/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-partial-atom-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-alias/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-partial-atom-alias/tokens.txtnew file+67

This diff is too big to show here.

tests/golden/types-partial-atom-alias/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-partial-atom-alias/types.txtnew file+21

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/tree.txtnew file+42

This diff is too big to show here.

tests/golden/types-partial-atom-constraint/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-partial-atom-widening/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-atom-widening/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-partial-atom-widening/tokens.txtnew file+79

This diff is too big to show here.

tests/golden/types-partial-atom-widening/tree.txtnew file+35

This diff is too big to show here.

tests/golden/types-partial-atom-widening/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-partial-aura-family/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-aura-family/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-partial-aura-family/tokens.txtnew file+100

This diff is too big to show here.

tests/golden/types-partial-aura-family/tree.txtnew file+44

This diff is too big to show here.

tests/golden/types-partial-aura-family/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-partial-aura/about.txt+1−1

This diff is too big to show here.

tests/golden/types-partial-aura/types.txt+7−1

This diff is too big to show here.

tests/golden/types-partial-bare-atom/about.txt+4−3

This diff is too big to show here.

tests/golden/types-partial-bare-atom/types.txt+2−2

This diff is too big to show here.

tests/golden/types-partial-branch-widening/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-branch-widening/source.jibbnew file+20

This diff is too big to show here.

tests/golden/types-partial-branch-widening/tokens.txtnew file+96

This diff is too big to show here.

tests/golden/types-partial-branch-widening/tree.txtnew file+49

This diff is too big to show here.

tests/golden/types-partial-branch-widening/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-partial-conflicting-sites/types.txtnew file+23

This diff is too big to show here.

tests/golden/types-partial-decimal-default/about.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-decimal-default/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-partial-decimal-default/tokens.txtnew file+34

This diff is too big to show here.

tests/golden/types-partial-decimal-default/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-partial-decimal-default/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-partial-independent-atoms/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-local-molds/about.txtnew file+10

This diff is too big to show here.

tests/golden/types-partial-local-molds/source.jibbnew file+39

This diff is too big to show here.

tests/golden/types-partial-local-molds/tokens.txtnew file+170

This diff is too big to show here.

tests/golden/types-partial-local-molds/tree.txtnew file+80

This diff is too big to show here.

tests/golden/types-partial-local-molds/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-partial-locals/about.txtnew file+8

This diff is too big to show here.

tests/golden/types-partial-locals/source.jibbnew file+44

This diff is too big to show here.

tests/golden/types-partial-locals/tokens.txtnew file+239

This diff is too big to show here.

tests/golden/types-partial-locals/tree.txtnew file+122

This diff is too big to show here.

tests/golden/types-partial-locals/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/tree.txtnew file+44

This diff is too big to show here.

tests/golden/types-partial-many-atom-constraints/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/about.txt+2−2

This diff is too big to show here.

tests/golden/types-partial-mold-bare-aura/types.txt+1−1

This diff is too big to show here.

tests/golden/types-partial-occurs/types.txt+6

This diff is too big to show here.

tests/golden/types-partial-shared-tvar/types.txt+6

This diff is too big to show here.

tests/golden/types-partial-union-cases/types.txt+21−3

This diff is too big to show here.

tests/golden/types-partial-union-edges/about.txtnew file+3

This diff is too big to show here.

tests/golden/types-partial-union-edges/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-partial-union-edges/tokens.txtnew file+97

This diff is too big to show here.

tests/golden/types-partial-union-edges/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-partial-union-edges/types.txtnew file+15

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/about.txt+1−1

This diff is too big to show here.

tests/golden/types-partial-unresolved-tag/types.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-direct/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-direct/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-direct/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-prelude-direct/tokens.txtnew file+53

This diff is too big to show here.

tests/golden/types-prelude-direct/tree.txtnew file+25

This diff is too big to show here.

tests/golden/types-prelude-direct/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-prelude-interface/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-interface/module-trees.txtnew file+13

This diff is too big to show here.

tests/golden/types-prelude-interface/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-prelude-interface/modules/ui/left.jibbnew file+1

This diff is too big to show here.

tests/golden/types-prelude-interface/modules/ui/right.jibbnew file+1

This diff is too big to show here.

tests/golden/types-prelude-interface/source.jibbnew file+10

This diff is too big to show here.

tests/golden/types-prelude-interface/tokens.txtnew file+81

This diff is too big to show here.

tests/golden/types-prelude-interface/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-prelude-interface/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-prelude-list-functions/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-list-functions/module-trees.txtnew file+11

This diff is too big to show here.

tests/golden/types-prelude-list-functions/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-list-functions/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-prelude-list-functions/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tokens.txtnew file+183

This diff is too big to show here.

tests/golden/types-prelude-list-functions/tree.txtnew file+87

This diff is too big to show here.

tests/golden/types-prelude-list-functions/types.txtnew file+28

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tokens.txtnew file+131

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/tree.txtnew file+75

This diff is too big to show here.

tests/golden/types-prelude-unit-helpers/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-record-bound-variable/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-bound-variable/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-record-bound-variable/tokens.txtnew file+65

This diff is too big to show here.

tests/golden/types-record-bound-variable/tree.txtnew file+33

This diff is too big to show here.

tests/golden/types-record-bound-variable/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-record-cast-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-cast-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-cast-context/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-record-cast-context/tokens.txtnew file+234

This diff is too big to show here.

tests/golden/types-record-cast-context/tree.txtnew file+105

This diff is too big to show here.

tests/golden/types-record-cast-context/types.txtnew file+49

This diff is too big to show here.

tests/golden/types-record-change-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-change-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-change-generic/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-record-change-generic/tokens.txtnew file+169

This diff is too big to show here.

tests/golden/types-record-change-generic/tree.txtnew file+66

This diff is too big to show here.

tests/golden/types-record-change-generic/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-record-change/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-change/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-change/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-record-change/tokens.txtnew file+254

This diff is too big to show here.

tests/golden/types-record-change/tree.txtnew file+99

This diff is too big to show here.

tests/golden/types-record-change/types.txtnew file+42

This diff is too big to show here.

tests/golden/types-record-faces/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-faces/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-record-faces/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-record-faces/tree.txtnew file+41

This diff is too big to show here.

tests/golden/types-record-faces/types.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-import/module-trees.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-import/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-import/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-record-import/tokens.txtnew file+36

This diff is too big to show here.

tests/golden/types-record-import/tree.txtnew file+16

This diff is too big to show here.

tests/golden/types-record-import/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-local-scheme/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-local-scheme/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-record-local-scheme/tokens.txtnew file+44

This diff is too big to show here.

tests/golden/types-record-local-scheme/tree.txtnew file+20

This diff is too big to show here.

tests/golden/types-record-local-scheme/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-record-nested/tokens.txtnew file+54

This diff is too big to show here.

tests/golden/types-record-nested/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-record-nested/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-record-to-tuple/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-to-tuple/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-record-to-tuple/tokens.txtnew file+38

This diff is too big to show here.

tests/golden/types-record-to-tuple/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-record-to-tuple/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/tokens.txtnew file+90

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/tree.txtnew file+45

This diff is too big to show here.

tests/golden/types-recursion-scc-failures/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/tree.txtnew file+42

This diff is too big to show here.

tests/golden/types-recursion-scc-groups/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-import-bad/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-import/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-recursion-scc-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-import/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-recursion-scc-import/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-import/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-recursion-scc-import/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-recursion-scc-import/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-local/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-local/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-recursion-scc-local/tokens.txtnew file+80

This diff is too big to show here.

tests/golden/types-recursion-scc-local/tree.txtnew file+39

This diff is too big to show here.

tests/golden/types-recursion-scc-local/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-order/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-order/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-recursion-scc-order/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-recursion-scc-order/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-recursion-scc-shadow/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-branch/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-branch/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-recursive-branch/source.jibbnew file+103

This diff is too big to show here.

tests/golden/types-recursive-branch/tokens.txtnew file+573

This diff is too big to show here.

tests/golden/types-recursive-branch/tree.txtnew file+306

This diff is too big to show here.

tests/golden/types-recursive-branch/types.txtnew file+50

This diff is too big to show here.

tests/golden/types-recursive-gate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-gate/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-recursive-gate/tokens.txtnew file+355

This diff is too big to show here.

tests/golden/types-recursive-gate/tree.txtnew file+176

This diff is too big to show here.

tests/golden/types-recursive-gate/types.txtnew file+42

This diff is too big to show here.

tests/golden/types-recursive-sample/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-recursive-sample/source.jibbnew file+40

This diff is too big to show here.

tests/golden/types-recursive-sample/tokens.txtnew file+344

This diff is too big to show here.

tests/golden/types-recursive-sample/tree.txtnew file+161

This diff is too big to show here.

tests/golden/types-recursive-sample/types.txtnew file+40

This diff is too big to show here.

tests/golden/types-string-interpolation/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-string-interpolation/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-string-interpolation/source.jibbnew file+28

This diff is too big to show here.

tests/golden/types-string-interpolation/tokens.txtnew file+259

This diff is too big to show here.

tests/golden/types-string-interpolation/tree.txtnew file+109

This diff is too big to show here.

tests/golden/types-string-interpolation/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-tuple-context-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-tuple-context-nested/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-tuple-context-nested/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-tuple-context-nested/tokens.txtnew file+289

This diff is too big to show here.

tests/golden/types-tuple-context-nested/tree.txtnew file+140

This diff is too big to show here.

tests/golden/types-tuple-context-nested/types.txtnew file+55

This diff is too big to show here.

tests/golden/types-tuple-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-tuple-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-tuple-context/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-tuple-context/tokens.txtnew file+109

This diff is too big to show here.

tests/golden/types-tuple-context/tree.txtnew file+55

This diff is too big to show here.

tests/golden/types-tuple-context/types.txtnew file+14

This diff is too big to show here.

tests/golden/types-union-alias/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-alias/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-alias/tokens.txtnew file+23

This diff is too big to show here.

tests/golden/types-union-alias/tree.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-alias/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-context/source.jibbnew file+54

This diff is too big to show here.

tests/golden/types-union-branch-context/tokens.txtnew file+237

This diff is too big to show here.

tests/golden/types-union-branch-context/tree.txtnew file+120

This diff is too big to show here.

tests/golden/types-union-branch-context/types.txtnew file+24

This diff is too big to show here.

tests/golden/types-union-branch-pending/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-branch-pending/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-union-branch-pending/tokens.txtnew file+102

This diff is too big to show here.

tests/golden/types-union-branch-pending/tree.txtnew file+48

This diff is too big to show here.

tests/golden/types-union-branch-pending/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-constructor-shape/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-constructor-shape/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-constructor-shape/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/types-union-constructor-shape/tree.txtnew file+24

This diff is too big to show here.

tests/golden/types-union-constructor-shape/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-context-flow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-context-flow/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-union-context-flow/tokens.txtnew file+58

This diff is too big to show here.

tests/golden/types-union-context-flow/tree.txtnew file+26

This diff is too big to show here.

tests/golden/types-union-context-flow/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-finite-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite-generic/source.jibbnew file+48

This diff is too big to show here.

tests/golden/types-union-finite-generic/tokens.txtnew file+336

This diff is too big to show here.

tests/golden/types-union-finite-generic/tree.txtnew file+143

This diff is too big to show here.

tests/golden/types-union-finite-generic/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-finite-limit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite-limit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite-limit/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-union-finite-limit/tokens.txtnew file+233

This diff is too big to show here.

tests/golden/types-union-finite-limit/tree.txtnew file+89

This diff is too big to show here.

tests/golden/types-union-finite-limit/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-finite/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-finite/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-finite/source.jibbnew file+45

This diff is too big to show here.

tests/golden/types-union-finite/tokens.txtnew file+238

This diff is too big to show here.

tests/golden/types-union-finite/tree.txtnew file+110

This diff is too big to show here.

tests/golden/types-union-finite/types.txtnew file+17

This diff is too big to show here.

tests/golden/types-union-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-import/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-import/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-import/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-import/tree.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-local-pending/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-local-pending/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-local-pending/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-union-local-pending/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-local-pending/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-overlap-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap-nested/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap-nested/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-union-overlap-nested/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-union-overlap-nested/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-overlap/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-overlap/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-overlap/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-overlap/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-patterns-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns-generic/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns-generic/source.jibbnew file+36

This diff is too big to show here.

tests/golden/types-union-patterns-generic/tokens.txtnew file+255

This diff is too big to show here.

tests/golden/types-union-patterns-generic/tree.txtnew file+117

This diff is too big to show here.

tests/golden/types-union-patterns-generic/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-patterns-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns-import/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-patterns-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns-import/modules/ui/lib.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-patterns-import/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-patterns-import/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/types-union-patterns-import/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-patterns-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-patterns/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-patterns/source.jibbnew file+74

This diff is too big to show here.

tests/golden/types-union-patterns/tokens.txtnew file+336

This diff is too big to show here.

tests/golden/types-union-patterns/tree.txtnew file+152

This diff is too big to show here.

tests/golden/types-union-patterns/types.txtnew file+25

This diff is too big to show here.

tests/golden/types-union-phantom-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-phantom-generic/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-phantom-generic/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-union-phantom-generic/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-phantom-generic/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/modules/ui/lib.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-print-cross-namespace/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-distinct/module-trees.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules.txtnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/left.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/right.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/modules/ui/twin.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-distinct/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-union-print-distinct/tokens.txtnew file+87

This diff is too big to show here.

tests/golden/types-union-print-distinct/tree.txtnew file+34

This diff is too big to show here.

tests/golden/types-union-print-distinct/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-union-print-escape/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-escape/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-print-escape/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/types-union-print-escape/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-print-escape/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-print-local/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-local/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-union-print-local/tokens.txtnew file+28

This diff is too big to show here.

tests/golden/types-union-print-local/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-local/types.txtnew file+5

This diff is too big to show here.

tests/golden/types-union-print-nested/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-nested/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-union-print-nested/tokens.txtnew file+42

This diff is too big to show here.

tests/golden/types-union-print-nested/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-union-print-nested/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-same-origin/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-same-origin/module-trees.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-same-origin/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-print-same-origin/modules/ui/shared.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-same-origin/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-print-same-origin/tokens.txtnew file+35

This diff is too big to show here.

tests/golden/types-union-print-same-origin/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-print-same-origin/types.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-transitive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-print-transitive/module-trees.txtnew file+8

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules/ui/base.jibbnew file+3

This diff is too big to show here.

tests/golden/types-union-print-transitive/modules/ui/mid.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-union-print-transitive/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-print-transitive/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-print-transitive/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-singleton/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-singleton/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-union-singleton/tokens.txtnew file+130

This diff is too big to show here.

tests/golden/types-union-singleton/tree.txtnew file+53

This diff is too big to show here.

tests/golden/types-union-singleton/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-union-tag-atoms/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-tag-atoms/source.jibbnew file+5

This diff is too big to show here.

tests/golden/types-union-tag-atoms/tokens.txtnew file+30

This diff is too big to show here.

tests/golden/types-union-tag-atoms/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-tag-atoms/types.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-tags/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-tags/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-union-tags/tokens.txtnew file+34

This diff is too big to show here.

tests/golden/types-union-tags/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-union-tags/types.txtnew file+11

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-union-unresolved-flow/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-union-unresolved/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-union-unresolved/tokens.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-unresolved/tree.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-unresolved/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-unit-construction/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-construction/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-unit-construction/source.jibbnew file+29

This diff is too big to show here.

tests/golden/types-unit-construction/tokens.txtnew file+168

This diff is too big to show here.

tests/golden/types-unit-construction/tree.txtnew file+71

This diff is too big to show here.

tests/golden/types-unit-construction/types.txtnew file+32

This diff is too big to show here.

tests/golden/types-unit-context/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-unit-context/source.jibbnew file+46

This diff is too big to show here.

tests/golden/types-unit-context/tokens.txtnew file+489

This diff is too big to show here.

tests/golden/types-unit-context/tree.txtnew file+220

This diff is too big to show here.

tests/golden/types-unit-context/types.txtnew file+95

This diff is too big to show here.

tests/golden/types-unit-patterns/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-unit-patterns/source.jibbnew file+36

This diff is too big to show here.

tests/golden/types-unit-patterns/tokens.txtnew file+180

This diff is too big to show here.

tests/golden/types-unit-patterns/tree.txtnew file+88

This diff is too big to show here.

tests/golden/types-unit-patterns/types.txtnew file+13

This diff is too big to show here.

tests/importer/about.txt+18−2

This diff is too big to show here.

tests/importer/ford.txtnew file+9

This diff is too big to show here.

tests/importer/mark-gate.txtnew file+3

This diff is too big to show here.

tests/importer/mark-list.txtnew file+5

This diff is too big to show here.

tests/importer/mark-recursive.txtnew file+5

This diff is too big to show here.

tests/importer/mark.txtnew file+5

This diff is too big to show here.

tests/importer/origin-first.txtnew file+4

This diff is too big to show here.

tests/importer/origin-other.txtnew file+4

This diff is too big to show here.

tests/importer/origin-transitive.txtnew file+6

This diff is too big to show here.

tests/importer/shadow-static.txtnew file+7

This diff is too big to show here.

tests/importer/shadow.txt+3

This diff is too big to show here.

tests/importer/small.txt+60

This diff is too big to show here.

tests/importer/tree.txt+116−2

This diff is too big to show here.

tests/lib/jibb-bridge.hoon+36−2

This diff is too big to show here.

tests/lib/jibb-import-diagnostic.hoonnew file+59

This diff is too big to show here.

tests/lib/jibb-import.hoon+19−1

This diff is too big to show here.

tests/lib/jibb-mark-bridge.hoonnew file+28

This diff is too big to show here.

tests/lib/jibb-module-scope.hoonnew file+96

This diff is too big to show here.

tests/lib/jibb.hoon+1216−108

This diff is too big to show here.

tests/type-import-diagnostic/about.txtnew file+15

This diff is too big to show here.

tests/type-import-diagnostic/expected.txtnew file+109

This diff is too big to show here.

tests/type-import-diagnostic/mark.txtnew file+5

This diff is too big to show here.

tests/type-import-diagnostic/nested.txtnew file+11

This diff is too big to show here.

tests/type-import-diagnostic/source.txtnew file+13

This diff is too big to show here.

tests/type-import-diagnostic/sur.txtnew file+5

This diff is too big to show here.

tests/type-import/about.txt+18−7

This diff is too big to show here.

tests/type-import/expected.txt+84−3

This diff is too big to show here.

tests/type-import/source.txt+48

This diff is too big to show here.

tests/type-import/sur.txt+15−1

This diff is too big to show here.

tests/type-mark/about.txtnew file+7

This diff is too big to show here.

tests/type-mark/collision.txtnew file+3

This diff is too big to show here.

tests/type-mark/declared.txtnew file+2

This diff is too big to show here.

tests/type-mark/expected.txtnew file+19

This diff is too big to show here.

tests/type-mark/missing.txtnew file+1

This diff is too big to show here.

tests/type-mark/sur.txtnew file+2

This diff is too big to show here.

tests/type-module-scope/about.txtnew file+16

This diff is too big to show here.

tests/type-module-scope/expected.txtnew file+58

This diff is too big to show here.

tools/clay-fixtures+159−1

This diff is too big to show here.

tools/golden+148−19

This diff is too big to show here.

tools/golden_case.py+99

This diff is too big to show here.

tools/importer-test+11−2

This diff is too big to show here.

tools/ship+197−4

This diff is too big to show here.

tools/testdata/selftest+149

This diff is too big to show here.

tools/testdata/ship-selftest+146

This diff is too big to show here.

tools/type-import-diagnostic-testnew file+43

This diff is too big to show here.

tools/type-mark-testnew file+35

This diff is too big to show here.

tools/type-module-scope-testnew file+39

This diff is too big to show here.