on master help sign in
README.md+1−1
since splitsnapshots
unifiedsplit
@@ -42,7 +42,7 @@ tools/hoon '(golden /a/b/jibb (crip "++ main view"))'
42tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
42tools/hoon --raw --cord src=tests/golden/foo/source.jibb 'tree:(golden /a/b/jibb src)'
43```
43```
44
44
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.
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`, `tools/type-import-overlap-test`, `tools/type-import-structural-test`, `tools/type-union-source-test`, `tools/type-union-alias-overlap-test`, `tools/type-full-overlap-test`, `tools/type-generic-recursion-test`, `tools/type-generic-construction-test`, `tools/type-generic-pattern-test`, `tools/type-deferred-test`, `tools/type-deferred-resolver-test`, `tools/type-deferred-context-test`, `tools/type-empty-test`, `tools/type-cell-branch-test`, `tools/type-tlon-test`, `tools/type-mark-test`, `tools/type-poke-test` and `tools/type-api-paths-test` check importer/checker, prelude and partial API path analysis boundaries under eval; the ship suite runs the same fixtures.
46
46
47### The doc's examples
47### The doc's examples
48
48
docs/compiler.md+84−10
@@ -56,33 +56,85 @@ The core is split into chapters, `+| %name`, in this order:
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
58
58
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.
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 cell pattern of two or more binders, 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. Supported local mutually recursive gate groups also use shared monomorphic placeholders and generalize only after the group checks, preserving captured outer variables. Some proven non-gate value cycles are diagnosed; other mixed gate/value cycles, polymorphic recursion, 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. Literal heads compare by their runtime noun, so `|=%$` can construct an explicit null-, loobean-zero- or term-zero-headed case. Equal heads with distinct payloads can be selected when exactly one payload fit is proven; unknown or ambiguous alternatives remain unsupported. 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. Generic unions declared directly inside a body and recursive molds outside the source-proven slices described below remain unsupported. A directly known named union can instantiate an unconstrained generic gate sample while retaining its origin, generic arguments and faces. Unnamed, pending-tag, recursive, unknown-atom and variable-bound union origins 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. 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 and the source-bound gate-sample proof below. 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.
60+
61+A direct unshadowed prelude call can use checked source layouts when a positional argument is a directly named, already inferred root gate. For two-slot function samples, the checker can match a named update against an unnamed generic gate sample without confusing a binder face with a nested record face. Both explicitly named slots must agree; source boundaries are evidence for this fit, not a call-arity rule. The source gate and prelude annotation must be available from their checked bindings. Local or dynamic gates, aliases without direct evidence, recursive or SCC placeholder bodies, other sample shapes and unresolved call-sample variables remain unsupported by this proof. Ordinary inference remains the fallback.
62+
63+The checker retains a per-analysis index of finalized root gates and a prelude source table bound to the entire trusted prepared interface. A dependency screen avoids building the table when the root cannot use it; changing the interface invalidates it. The host remains responsible for supplying a prepared interface paired with its source. The matcher checks each slot and product in both directions with a shared substitution. Before returning its tentative proof it requires both complete call samples to normalize to closed, tag-free types, then repeats every slot check and requires the substitution and fresh-ID counter to remain unchanged. This keeps later argument or enclosing constraints from invalidating an earlier face check, and preserves pending constraints, capital checks and projection evidence. These scans and the bounded second proof add work; they do not establish a global linear-time bound.
64+
65+Before the empty-capital optimization below, single sequential eval runs including startup showed that 2,000 ordinary gates used 70.20 seconds of user CPU at baseline and 70.64 seconds with the cached source table. Fifty unsupported eligible scalar-slot calls used 24.75 and 25.71 seconds, while fifty function-slot failures used 24.15 and 25.36 seconds. Fifty successful calls took 26.56 seconds before the final stability replay and 26.99 seconds with it. These are synthetic measurements, not production performance limits.
66+
67+Restricted-number promotion only applies to written capital variables. If none are present, it returns immediately instead of traversing the environment. In one startup-inclusive pair of runs on 2,000 independent gates, output was byte-identical and user CPU fell from 71.67 to 38.26 seconds; wall time was 72.80 versus 51.66 seconds while other checks were running. This does not establish a bound for dependent modules or a complete-checker benchmark.
68+
69+A bounded source proof can also establish distinct literal heads when a union case is a one-hop application of a uniquely resolved local generic mold. It compares literal runtime nouns and checks the original mold normally before publishing an interface. The same source proof improves the partial report, which still says the mold is not checked. The new proof declines nested or qualified applications, opaque references, recursive-index states, holes and deferred obligations; other valid unions can remain unsupported. A 256-node source budget and a separate 256-entry inherited-state budget apply per attempt. They do not bound the existing pairwise union pass, parsing, atom or name sizes, or downstream checking. Prepared interfaces and inference state remain trusted inputs. `tools/type-union-source-test` and the shared ship guard exercise source resolution, reporting, rollback and these bounds. A separate positive witness can identify overlap in two-field, literal-headed cases when a unique one-hop local, one-parameter generic alias is applied to a concrete primitive payload. It compares the literal noun values and proves the payloads have a shared noun, so an empty or unknown payload is not a witness. The partial report identifies both original case sites. `infer-jibb-file-detailed` returns structured overlap evidence for the first failed mold, including the originating path, exact source, mold name and both case spans. Ordinary Jibb imports preserve a child’s evidence through source and cache checks; the legacy `infer-jibb-file` API remains a text-result adapter and renders both excerpts. Specialized API and prepared-prelude paths retain their existing generic or text-only error boundaries. This witness uses a shared 256-node source/pair budget per attempt; generic-wrapper parameter validation has a separate 256-entry cap. An unsupported earlier case may hide a later overlap. Existing pairwise union analysis, parsing, atom and name sizes, source-excerpt rendering, and downstream checking remain outside these budgets. `tools/type-union-alias-overlap-test` checks the source proof and partial report; `tools/type-full-overlap-test` checks the detailed and legacy full-module paths, source attribution and cache behavior.
70+
71+A single-arm cell pattern can bind two or more positions, with its last binder capturing the remaining tail. Duplicate and shadowed names are rejected. A definite non-cell spine fails; an intermediate union or collection that might contain a cell remains unsupported. For a known non-union cell, a separate one-arm rule also accepts structured patterns, including nested literal and wildcard positions, when the existing coverage proof establishes the whole pattern. It binds payloads with their original types and checks result context; unknown, partially covered, union or recursive spines stay unsupported.
60
72
61String 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.
73String 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
74
75+The Hoon bridge translates imported `*` as the any-noun type, directly or within supported nonrecursive cells. The reader may still decline a disjoint tagged union with a noun payload, and recursive imports containing `*` remain unsupported. It accepts an exact fork of the two loobean singletons as `?`, and each singleton separately as `%.y` or `%.n`, including inside supported faced cells. Contextual loobean literals specialize against a matching singleton by noun, including a proven singleton in a direct union; named loobean singletons do not silently widen to a distinct aura. Open `%f`, other values, and other forks containing loobean singletons remain unsupported; recursive Hoon molds containing flags can also fail closed.
76+
77+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. For syntactic tuples, ordered fit replay can identify a missing tag in a nested position; an earlier mismatch or uncertainty stops the replay instead of guessing. Existing tags whose shape or payload does not fit retain the ordinary mismatch; unresolved tags stay pending.
78+
79+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. Isolated cart-style `init` and `update` expressions infer in this fragment. The complete cart-store source fails closed because store kind and declaration scope are not yet checked.
80+
63For 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.
81For 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.
64
82
65Multi-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.
83Multi-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.
66
84
67−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 zero nested inside a single tuple argument where a list is expected also remains unsupported, rather than a definite mismatch; separate call arguments can receive list 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.
85+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. Known loobean result context can propagate through supported complete branches and binder-only cell arms, with a final directional fit; a binder-only arm over a union subject remains unsupported. A known gate with an unresolved result variable can also receive an enclosing result type before its argument is inferred, for example allowing `^- (list @t) (id ~)`; unknown callees and unresolved targets retain the conservative path. A known gate sample 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. Uncontextualized list literals also infer with a fresh element variable, including empty and nested lists; the resulting variable can generalize. Unresolved item tags and uncertain widening remain unsupported. Faced or longer cons cells, 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.
86+
87+A term-headed pair such as `gap+%s2` follows the same contextual inference as `[%gap %s2]`; its synthetic head uses the pair’s span in diagnostics.
88+
89+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`, `clap`, `clef` 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.
68
90
69A 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.
91A 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.
70
92
93+The checked inference fragment represents the empty mold `!!` explicitly. A cell with a proven-empty field is empty, while a gate returning `!!` and the empty values of `(list !!)` and `(unit !!)` remain inhabited. Supported union matches discard proven-empty cases, reject unreachable list or unit payload arms, and require a proof of reachability for fixed opaque cases. A written capital may have an inhabited instance; the existing definition-boundary checks still reject forcing it to a concrete empty type. A directly known standard `(list !!)` permits a single null arm, including in a result context. Unknown and opaque types, other one-arm list subjects, and proofs exceeding their budgets fail closed. Emptiness checks use up to 256 type-node visits per fit or list/unit reachability proof and 4,096 visits when filtering union cases. These bounds do not cover substitution walking, parsing, normalization, source lookup or repeated attempts. This is a supported checking slice, not a proof of arbitrary recursive molds or runtime execution.
94+
71−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.
95+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. When a cast or known call sample supplies a result type, a known union subject accessed by a wing, a grouped wing or a supported shallow call can propagate that context through whole-case arms and supported finite loobean refinements, including nested cell and list positions. Other partial-pattern contexts and subject forms remain unsupported. The Grammar’s `step` block infers in this fragment, but its module is not yet checked.
72
96
73A 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.
97A 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.
74
98
75−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.
99+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 recognizes a direct ordered-map call with two simple named mold operands, as in Tlon `notes.log`, after validating provenance and operand source; revisiting the same map hold fails closed. 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. For a mark whose sample is exactly a named arm of its single Ford-imported `/sur` core, it can recover a source-proved nonrecursive union, including source-location wrappers around fields; recursive or unverified fallback results remain unsupported. The reader checks explicit Hoon `$%`, `$?` and `$^` unions against the Grammar’s disjointness rule, as @iko confirmed on 2026-10-30. For an explicit `$%` with distinct literal head tags, it can also prove restricted local named payload dependencies, including bare `~` fields, re-evaluate and validate each source branch, and recover the union before Hoon collapses it. The real Tlon `notes.u-note` exercises its `[%deleted ~]` case. A bounded fallback also recovers one level of local named tagged unions inside such a union, including Tlon `notes.u-notebook` and `notes.u-notes`. Source-proved tagged unions can also be wrapped in Hoon `$~` defaults, including a downstream union using Tlon `epic.saga`; the selected source and projected branches still undergo the same provenance and disjointness checks. The tagged-source helper peels up to four consecutive default wrappers, while default wrappers encountered inside dependency proofs consume the existing semantic-node budget. A source-proved nested self-recursive union retains its named owner, including Tlon `notes.import-node`; deeper, mutually recursive or unproven cases stay unsupported. The nested source proof has a 256-visit semantic-node budget, and source-location wrapper peeling is limited to four per node; Hoon evaluation and source scans are not metered. It rejects recursive or computed dependencies, inherited same-name collisions, unsupported nested unions and proofs exceeding a shared 4,096-node budget. 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, Hoon's `%n` zero singleton as Jibb `~`, 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/type-tlon-test` and its ship counterpart exercise four real Tlon presence unions and a field read through the source-aware reader and partial checker. `tools/clay-fixtures` also passes Clay-built `/sur` molds and mark samples through the Clay-built importer and partial checker.
100+
101+An import-free Jibb library can export an opaque single-parameter recursive identity when its source has exactly two distinct term-tagged cases: a text leaf and a node containing `(list (name M))`, optionally with one `$-(@t M)` event field. A module-local index records the exact parsed source, defining path and prepared prelude interface; it is shared across that module's inference passes, and its canonical `list` must be source-backed. The normal resolver publishes an interface only after all ordinary mold and value checks succeed. Same-origin aliases retain the defining identity and independently instantiate type arguments; distinct origins remain unsupported. The opaque identity is conservatively treated as gate-bearing for numeric defaulting, and gate-freedom remains unknown. Explicit literal-headed construction uses a source-proven one-layer view: the event result receives the existing type argument and recursive children keep the defining identity. It consumes the existing shared 256-step recursive inference budget, and a per-view 4,096-visit guard bounds the new face and substitution scan; longer scans decline. These bounds do not cover parsing, existing inference, atom sizes or repeated attempts. One startup-inclusive, shared-load comparison of 100 valid and 100 invalid source definitions took 29.67 s wall / 25.14 s user CPU before this slice and 33.47 s / 26.99 s with it; the former declined all 200 while the latter inferred the valid definitions. These single runs are not a production benchmark. Matches over explicit source tags, flat binder or wildcard fields, and nonbinding catch-alls use that same one-layer view and existing binder, coverage and branch checks. Up to 128 arms are screened per attempt; longer matches decline. A single-arm match on a direct in-scope wing can report its missing case, and a contextual one-arm call subject can use a nonbinding catch-all. Recursive children retain their nominal type and arguments. Subject recognition and view validation can each scan substitutions, and the scan cap applies separately to each attempt. In one separate startup-inclusive comparison of 100 valid and 100 invalid source matches, the construction-only checker took 30.18 s wall / 29.31 s user CPU and declined all 200, while the pattern slice took 28.28 s / 27.69 s and inferred or diagnosed them. These single shared-load figures are not production benchmarks. General structural fits, whole-case binders, nested recursive patterns, uncontextualized single-arm call subjects, recursive source with imports and local recursive molds remain unsupported; the test tree does not prescribe the eventual `element` representation. Caller-supplied detached interfaces and caches retain the existing trusted-input contract.
102+
103+Self-recursive `/sur` molds can cross the bridge as opaque module-and-name identities when their supported source-aware graph passes validation, including one-argument lists containing same-origin recursive references. The real Tlon `notes.import-node` reaches this bridge; it does not unfold or construct the recursive type. Aliases, foreign references, recursive marks, unfolding, construction and field access remain unsupported; the partial printer declines recursive names that are not in scope.
104+
105+The partial checker also recognizes a source-proven Jibb recursive mold consisting of `~` and one faced cell with a fixed-aura head and direct self tail. Its identity includes the defining path and name. It unfolds this shape for supported null and cell construction and for a two-arm null/cell match; static application-path literals use the verified public `qath` alias. The internal prelude defines `qath` as a transparent knot sequence and the public prelude re-exports it. Each inference attempt has 256 unfolding and static-segment steps; parsing and separate retries are not bounded by that limit. Dynamic application-path segments, broader patterns and other recursive shapes remain unsupported. Route and static-file existence checks remain milestone 4.
106+
107+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` 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, core or proven union-overlap 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.
108+
109+For supported source-aware Hoon `$?` unions, the reader can prove a definite overlap by independently evaluating and projecting the original cases, verifying each projected head against its source tag, and finding a shared runtime noun in a pair. Its positive witness traverses faces, named nodes, forks, cells, supported atom forms and `*`; `!!`, opaque references, applications and unproved aura intersections cannot themselves establish a witness. It compares singleton noun values independently of aura, and requires inhabited positions throughout a cell. Unknown or exhausted proof remains unsupported, while existing disjoint-source recovery still handles proven distinct cases. The source screen admits at most 128 cases and 4,096 raw noun nodes; dependency checking and the pair/type witness each have their own 4,096-node budget. Hoon evaluation, projected-graph validation, chapter lookup, atom byte sizes and other type-graph walks remain outside those budgets. The error points at the Jibb use; source case locations are unavailable. This is a partial named-reader analysis, not general imported-union checking or a mark-reader overlap diagnostic.
110+
111+In single startup-inclusive runs of eight Hoon reads, a benign three-case union used 37.78 seconds of user CPU with the earlier narrow witness and 39.99 seconds with the structural witness; a repeated-head union used 39.84 and 40.97 seconds. Other checks ran concurrently, so these measurements do not establish a production bound.
112+
113+The partial report can diagnose certain non-gate value dependency cycles, including cycles through gates. It requires an explicit atom or loobean result cast and a syntactically proven dependency group with unshadowed simple samples; it identifies the value and a dependency site. Untyped results, branches, nested definitions, qualified wings and complex samples remain unsupported. The proof constructs an additional dependency graph. One 24-case recursive/generic eval run took 19.7 s with it and 18.6 s before it, including startup; these single runs do not isolate the graph cost.
76
114
77−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.
115+The source-backed `+api-path-analysis-source` is a separate partial analysis, not an API check: it resolves reachable Jibb imports and declared mark graphs and returns path and scry segments, full and diff mark identities and their types. It also checks derived-name collisions. Full and diff payloads must be direct declared mark names; typed scry parameters must be a same-name, same-aura subset of the watch parameters, and unknown or duplicate segment binders fail closed. It creates no request gates. The caller must pass a trusted prepared prelude and unchanged source-aware reader results.
78
116
79−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.
117+`+api-path-evidence-source` retains that analysis with the API source, complete prepared prelude (including reserved names), supplied reader results and resolved Jibb dependency cache. `+api-path-watchability` classifies a unique declaration as watchable or not watchable, or reports unknown when evidence is absent or ambiguous. The artifact and reader results are trusted host inputs; the host must bind them to the source versions used later. This is declaration evidence, not proof about an arbitrary request value, a checked API module, a runtime validator or an island watch.
80
118
81−`+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.
119+For a unique supported declaration, `+api-request-parts` retains that evidence with the typed path parameters in source order, the full-state reply sample, and a fold type when there is one diff mark. The fold takes the tagged diff and previous full state and returns full state. Missing or ambiguous evidence, unsupported parameter auras and multiple-diff folds fail closed. These are components for a future request gate; they do not yet fix its argument order, construct a request, or prove watchability of a value.
82
120
83−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.
121+`+api-support-analysis-source` additionally infers supported ordinary API molds and values, resolves every declared mark, and retains their source, dependency and path evidence. Unsupported helpers or marks fail closed. An unused `/-` core is not independently validated, ordinary definitions that need derived gates remain unsupported, and this result is not a checked API interface or an exported request.
84
122
123+The ordinary import resolver can infer derived request-gate types for multiple supported API paths. A case may take one typed path parameter before its reply gate, or one diff fold after the reply; a case with both, multiple parameters or diffs, or a separate scry path remains unsupported. Each reply maps the full mark type to a fresh `M` and the request result is `(ask M)`. Checked ordinary API values and molds, declared mark molds and a supported poke constructor are exported too. Every selected `/sur` core must have a directly used, successfully read mold; unselected core bindings are not independently validated, and Jibb module imports remain unsupported in this API fragment. The unchanged todo API fits this fragment.
124+
125+A call whose direct result is a known named generic union can receive a matching same-origin, same-arity result context before its arguments are inferred. This retains the ordered generic arguments and existing capital checks; pending tags, recursive or variable-bound origins and unrestricted atom cases remain conservative. Constructor fitting reports unsupported when an unresolved or opaque case could contain the requested tagged head. It keeps definite missing-case errors for proven nonmatching cases, including an explicitly atom-only faced head. The real todo callback `|=%got` can infer when an `(ask msg)` result context fixes its message union; the uncontextualized call remains unsupported.
126+
127+A two-item tuple with an explicit term, null or loobean head can receive payload context from a known union when every alternative is a literal-headed cell and its head noun is unique. The payload must be a direct wing-headed call, optionally grouped, with literal, wing or constructor arguments. The checker first retains the original inference if it already fits; otherwise it tries the contextual path once and fits the selected case and enclosing union. It declines this path if any substitution has a structural root, because a caller may have walked away variable provenance. Duplicate heads, opaque competitors and other shapes also stay conservative. The guard scans the substitution for each eligible tuple and may perform one extra shallow inference; it does not guarantee globally linear work. This lets an explicitly typed todo subscription body infer; it does not check an island or prove request watchability.
128+
129+`+gate-free-type` is a separate three-way proof over normalized checker types: it reports a gate-free result, a gate-bearing witness with its field path, or unknown. It tracks conservative inhabitance before reporting a gate in a cell, spends one shared node budget, and treats opaque recursion, open variables, unknown collection forms and `*` conservatively. Source-proven `qath` and the recognized list/unit representations have dedicated proofs. `+gate-free-mold-source` parses and resolves one named mold with a fresh active-root graph, retaining the complete prepared prelude, source bundle, trusted reader inputs, dependency cache and inferred mold. It caps classification at 256 nodes; parsing, import resolution and type inference are not covered by that cap. The host must canonicalize paths and bind trusted sources and reader results to their versions. API, store and private roots decline; other definitions and unused imported Hoon bindings are not fully checked. This is mold analysis, not a module, kind, island, watchability or runtime check, and it does not infer general gate-free constraints.
130+
131+Each case's canonical API identity and source-derived schema travel across imports in a nonrecursive graph certificate containing the exact source bundle, prelude, reserved scope and trusted reader results. Cached interfaces must match those inputs and cannot hide an active ancestor; unknown legacy entries are rebuilt from their unique supplied source. Request-bearing closures are limited to 256 paths and requests. Closed gate samples can also fit when an unnamed input slot corresponds to a named one, provided products are identical and nested value faces and ambiguous cell tails remain intact. This is type inference only: request lowering, runtime schema validation and value watchability proofs are not implemented.
132+
133+`+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. Qualified wings can also read nested fields of an imported value, instantiating that value’s scheme independently at each use; missing, ambiguous and non-record fields remain unsupported.
134+
135+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`, the doc-exact generic `cmd` union, `same`, `fall`, `need`, `bond`, `lure`, `weld`, `snoc`, `turn`, `lent`, `zing`, `flop`, `rear`, `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy`, `lien`, `cork`, `corl`, `cury`, `curr`, `lead` and `late`; unsupported entries 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. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. 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. The source-backed internal prelude defines `poke`, which the public prelude re-exports as an ordinary transparent type. A dedicated trusted internal-prelude preparation path also supplies private comparison and arithmetic schemes for the Jibb-written `gth`, `add` and `dec` wrappers. Ordinary module resolution rejects that primitive path even if a caller supplies a spoofed root or bundle. The low-level prepared interface is still trusted host input; the host must select the vendored sources and canonicalize paths. Primitive execution and shape-based jet recognition are not implemented. The Jibb-written `lth`, `gte` and `lte` gates compose the source-backed `gth` and `not` gates; supported calls infer a shared atom constraint and return `?`. Their execution and jet recognition await the backend. The source-backed `add` and `dec` wrappers use private arithmetic interfaces whose shared atom variable excludes loobeans; the partial checker preserves that constraint through supported inference and prints `where A is an atom other than ?`. The partial checker resolves the supported `poke` source shape, preserves its public name, and rejects ordinary imports of the private internal path. The Jibb-written `lent` recursively counts a list using `add`; the partial checker infers its generic list argument and `@ud` result. Its execution and jet recognition remain unverified until the backend exists. The Jibb-written `zing` concatenates homogeneous lists in order using `weld`; the checker infers `(list (list A))` to `(list A)`, including for gate elements. Hoon `zing` also accepts heterogeneous noun lists, which this type does not express. `tools/hoon --raw -f tools/testdata/zing-hoon-reference.hoon` compares an equivalent Hoon recursion with Hoon `zing` on selected finite inputs; it does not execute Jibb or verify lowering or jet recognition. The Jibb-written `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, while `((late a) b)` returns `[b a]`. The checker infers independent argument types and accepts gates as ordinary values; neither helper invokes an input gate. A Hoon translation is compared with Hoon’s helpers by `tools/hoon --raw -f tools/testdata/lead-late-hoon-reference.hoon`. This does not execute Jibb or verify lowering or jet recognition. An imported API with one mark and a matching direct `+$ poke` declaration can export a derived constructor and retain agent/mark metadata when the source representation has the supported agent case. Other API shapes, complete private module checking, root API and kind checking, stores, complete `ask` and `pure` checking, lowering and runtime effects remain unfinished. A possible store or root API declaring `+$ poke` reports that kind or scope needs unsupported inference; definite duplicate declarations and unrelated shadowing still report conflicts. Prepared interfaces and caches are trusted caller inputs; the future host and linker must ensure the private source validated during preparation is the same version used to lower derived constructors. A `*` payload may contain gates, so the fragment treats it conservatively; full gate-free checks are unfinished. 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.
136+
85−`+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.
137+`+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 and duplicate-name prelude sources fail closed. The source-taking `+prepare-prelude` and `+golden-types-with-prelude` do not supply the internal module; their `-and-internal` or `-with-internal` variants accept its source for the supported private import. 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.
86
138
87And the design notes:
139And the design notes:
88
140
@@ -93,16 +145,26 @@ And the design notes:
93| 3. The parser | Why recursive descent (the grammar is LL(2) after the layout pass), the EBNF rule by rule with the node each gives, what the EBNF leaves out and how it's filled in, spacing, and where each error points, with its message |
145| 3. The parser | Why recursive descent (the grammar is LL(2) after the layout pass), the EBNF rule by rule with the node each gives, what the EBNF leaves out and how it's filled in, spacing, and where each error points, with its message |
94| 4. Printed formats | The token, tree and error formats the golden files hold |
146| 4. Printed formats | The token, tree and error formats the golden files hold |
95
147
148+Source-backed `like` maps the product of an existing `(like A)` result while retaining its position and remaining input. The partial checker infers supported positional calls by peeling only known sample-slot faces, retaining faces belonging to values; ambiguous variable-bound spines and nested face loss remain unsupported. Backend execution remains outstanding.
149+
150+The internal prelude defines transparent `(ask M)` cases for pure, agent and store requests; the public prelude re-exports it and defines `pure` in Jibb. Preparation supplies the private module with `list.core` and `unit.core` only from validated canonical public templates. If a template is unavailable, an isolated check validates the private molds, but only molds independently inferred against the actual available templates enter the interface. The partial checker infers supported constructors and exhaustive matches; absent versus present-zero state remains distinguishable. Agent and store receiver fields carry raw nouns and cannot prove schema validity or watchability. The public prelude also defines the documented `sub` union in Jibb; supported watch payloads retain the public `(ask M)` type. A `sub` value is not itself proof that its request is watchable. Generated decoders, source-bound runtime validation, request lowering, other derived request shapes and island watch checks remain unfinished. Public prelude preparation is partial: consumers must verify that `ask` was actually exported with its source origin.
151+
152+Public identity aliases of private generic unions retain their public name when the origin, arity and argument order match exactly, including through imported values. Fixed, reordered, repeated and phantom generic aliases remain unsupported where a safe public name cannot be recovered; a fixed nongeneric alias is not printed as though it accepted type arguments.
153+
154+The partial checker reserves `proj` in module, local, sample, pattern and import bindings, including bindings inside unsupported source; a field, tag or path segment may still have that spelling. With a known expected record type, it checks selected explicit `(proj record)` calls over closed, uniquely faced records, preserving the source expression, its type, the result type and field axes in the checked interface. Imported and private-prelude dependencies retain the source needed to lower those plans. The checker does not yet lower or execute them. It supports selecting one or more fields in their original order; a single selected field keeps its face and uses one source axis. Reordered fields, unknown or open record spines, some nested contexts and recursive groups with projections remain unsupported. A directional fit of a wider faced record fails closed instead of inserting a projection, including within supported list, unit and record positions. To limit repeated work, record-spine proofs are reused along the same closed spine and stop at 1,024 fields; field boundaries and the special handling of positional calls reset the appropriate proof. Prepared interfaces and their source remain trusted host inputs.
155+
96## The tree
156## The tree
97
157
98Every node is `[%tag at=span …]`, so `+span-of` finds its span in one place; the few that aren't say so in the `%tree` chapter. The kinds of node:
158Every node is `[%tag at=span …]`, so `+span-of` finds its span in one place; the few that aren't say so in the `%tree` chapter. The kinds of node:
99
159
100- **Module**: imports (`%sur` for `/-`, `%mark` for `/%`, `%jibb` for `/=`), then definitions (`%mold` for `+$`, `%value` for `++`).
160- **Module**: imports (`%sur` for `/-`, `%mark` for `/%`, `%jibb` for `/=`), then definitions (`%mold` for `+$`, `%value` for `++`).
101- **Expressions** (`expr`): `%lit`, `%str`, `%path`, `%qath`, `%wing`, `%change`, `%pair`, `%unit`, `%group`, `%list`, `%tuple`, `%gate-wide`, `%ctor`, `%call`, `%gate`, `%cast`, `%trace`, `%branch`, `%crash`, and `%body` for an indented body, with its local definitions if it has any.
161- **Expressions** (`expr`): `%lit`, `%str`, `%path`, `%qath`, `%wing`, `%change`, `%pair`, `%unit`, `%group`, `%list`, `%tuple`, `%gate-wide`, `%ctor`, `%call`, `%gate`, `%cast`, `%trace`, `%branch`, `%crash`, and `%body` for an indented body, with its local definitions if it has any.
102−- **Molds as written** (`shape`): `%aura`, `%noun`, `%void`, `%flag`, `%const`, `%ref`, `%tvar`, `%path`, `%apply`, `%cell`, `%union`, `%fn`, `%generic`. A `%union` spans its first through last case and has no lead token; a single case is its own mold. `%generic` spans from the `|$` after a `+$` name through its body.
162+- **Molds as written** (`shape`): `%aura`, `%hole`, `%noun`, `%void`, `%flag`, `%const`, `%ref`, `%tvar`, `%path`, `%apply`, `%cell`, `%union`, `%fn`, `%generic`. A `%hole` retains the span of `_`; an inferred typed path segment retains that span separately from its enclosing segment. A `%union` spans its first through last case and has no lead token; a single case is its own mold. `%generic` spans from the `|$` after a `+$` name through its body.
103- **Samples, fields and patterns**: a sample is `%bind`, `%face`, `%pun`, `%cell` or `%bare`, since a bare name binds anywhere in a sample; a pattern is `%lit`, `%str`, `%any`, `%bind` or `%cell`.
163- **Samples, fields and patterns**: a sample is `%bind`, `%face`, `%pun`, `%cell` or `%bare`, since a bare name binds anywhere in a sample; a pattern is `%lit`, `%str`, `%any`, `%bind` or `%cell`.
104- **Literals** (`lit`) keep the form they matched, their aura and value, and their text as written, which the printers show.
164- **Literals** (`lit`) keep the form they matched, their aura and value, and their text as written, which the printers show.
105
165
166+The parser accepts type holes. The partial checker records each ordinary hole with its span and validates the obligations created in a value or local definition before generalization. A solved concrete type or an explicitly written in-scope capital resolves a hole; a later use cannot repair it. Independent decimal holes may default to `@ud` when the surrounding inferred type is gate-free; variables reachable from the environment or written capitals are protected from premature defaulting. Structural named-mold holes are diagnosed at their source, while complex named molds, inferred path segments, recursive groups with holes and unresolved constraints remain unsupported. Partial prelude and API interfaces cannot silently export unchecked holes. A separate syntax-tree pass reports duplicate names within a written record at both field sites, including in unused definitions; nested and separate records have independent scopes.
167+
106The tree keeps everything the checker needs to report an error at the code as written: open and closed brackets give the same node, but every node keeps its span.
168The tree keeps everything the checker needs to report an error at the code as written: open and closed brackets give the same node, but every node keeps its span.
107
169
108## Positions and errors
170## Positions and errors
@@ -127,3 +189,15 @@ Note 4 has examples of each.
127## Speed
189## Speed
128
190
129Starting `urbit eval` and building the library takes about 8 s. A 2,000-line module of 400 definitions then parses in about a second. Loops over definitions, arms, lines and items are tail calls, so a long module grows no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (note 3).
191Starting `urbit eval` and building the library takes about 8 s. A 2,000-line module of 400 definitions then parses in about a second. Loops over definitions, arms, lines and items are tail calls, so a long module grows no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (note 3).
192+
193+The experimental deferred constructor path can close a small import-free library transaction when ordinary resolution stalls. It retries definitions whose earlier attempts failed from their original states, retaining only successful attempts. A transaction with at most 64 definitions makes at most 4,096 attempts; it stops after a pass with no progress. This bounds the new attempt count, not each attempt's parsing, type walks or ordinary inference. Deferred definitions are restricted to simple one-component wings, literals, static strings, gates, transparent groups and empty bodies, calls, casts and a restricted boolean branch. Each successful call or cast fit must have exactly equal normalized operands so later substitutions cannot invalidate a face check. A multi-argument call also needs closed argument, sample and product types because positional face checks depend on slot boundaries and whether the result can be a cell. Other fits fail closed. A 512-node screen bounds visited expression nodes and a separate 512-node scan bounds each stability check; neither bounds mold shapes, string-piece checks, parsing, normalization, lookup, or total repeated inference. It accepts only a direct constructor callback with a closed input, records its pending fit under the source-owned inference state, and generalizes each definition against the live environment and pending constraints. Before publication it discharges and replays every edge, rejects unresolved tags or changed replay state, and checks that all molds and values are complete. The reporter reads the committed schemes for definitions added by the transaction. API and store paths, `main`, prepared preludes, imports, recursive groups, unresolved holes or written capitals, and new projection actions remain outside this path. `%grec` in the constraint or freshness scan is conservatively unsupported. This is not an island-kind, runtime, or watchability check.
194+
195+An expected cell type can supply context to both arms of a loobean branch. This slice first retains any ordinary inference that already fits. Otherwise it retries from the original state only when a syntax screen excludes nested branches, casts, gates and local bodies, and a substitution screen excludes structural bindings. Both arms must fit, their normalized results and the expected type must be closed, their result types must match, and both fits must replay without changing the final substitution or fresh-ID counter. A successful retry retains the original arm type and its written faces; a failed retry returns the original inference result. The source and substitution screens each visit at most 512 entries. This permits at most one extra attempt for an eligible branch; the screens do not bound preexisting inference, type walks, list construction, or work across separate analyses.
196+
197+In an isolated diagnostic with the real todo API and reader inputs, this cell context allowed the original update body to infer when its result type was written explicitly and experimental source-defined text helpers were supplied. The unchanged island still needs those text helpers, an actual source-backed `program` and UI interface, context propagation across definitions, island-kind checking and watchability proof. This branch change itself provides no runtime implementation or watchability evidence.
198+
199+A deferred boolean branch must use both distinct literal loobean patterns. Its subject is unified with `?`; the arms are inferred in source order without contextual retry. Equal normalized arm types are retained directly. When both written arms are direct literals that each created their own unbound pending tag, the checker can instead retain two source-owned fit obligations to a shared, monomorphic result variable. A later definition may close that variable; replay uses the ordinary literal fit, requires a closed atomic target or a union of direct constant/cell cases, and rejects faced targets and faced union cases. It replays all edges under the final substitution without adding bindings or fresh IDs. This does not support deferred list literals, union-pattern reachability, arbitrary branch expressions or prepared-prelude/imported modules. It does not establish request watchability.
200+
201+Before a fallback, the checker screens the already parsed source for a direct single-constructor call beneath groups, gates, casts or bodies without local definitions. The screen visits at most 64 AST nodes per definition and rejects sources with more than 64 definitions or 65,536 bytes. A transaction is attempted at most once per resolver or report invocation and holds at most 64 pending edges. These limits do not bound the initial parsing, ordinary resolution, normalization, or total work across separate analyses. On the pre-recursive-index snapshot, startup-inclusive synthetic 1,000-gate comparisons had baseline/candidate user times of 25.97/29.30 seconds and 26.30/27.46 seconds in reverse order. These are limited shared-load measurements, not production benchmarks. The trimmed source-backed and direct-guard fixture passed in 28.13 seconds wall and 27.53 seconds user on one run after screening; its cases include parse-success checks in the same transaction source pass. The outer resolver and reporter each parse independently, and a fallback currently parses the source again.
202+
203+A single sequential, startup-inclusive comparison against checkpoint `c96597d` measured user CPU for an unrelated stalled library at 25.04 seconds baseline and 26.32 seconds with the screened fallback; an incompatible constructor took 25.72 and 27.16 seconds; a direct constructor that the baseline declined and the candidate resolved took 24.46 and 26.79 seconds. These are small shared-load measurements, not a production benchmark. The screen was separately checked with a trapping fallback: the unrelated source skipped it, while the eligible conflicting source reached it.
docs/development.md+85−3
@@ -14,6 +14,8 @@ From the plan's Setup and ground rules, and from @iko:
14- **Push straight to `master`.** @iko reviews work in the project's chat, not in pull requests, so there are none. Run the checks below first.
14- **Push straight to `master`.** @iko reviews work in the project's chat, not in pull requests, so there are none. Run the checks below first.
15- **Keep docs/ current**: [status.md](status.md) when a milestone moves, [open-questions.md](open-questions.md) when a question is settled or found.
15- **Keep docs/ current**: [status.md](status.md) when a milestone moves, [open-questions.md](open-questions.md) when a question is settled or found.
16
16
17+The source-backed generic-union guard can be run under eval with `tools/type-union-source-test`; its `test-union-source` arm is also assembled for the fake ship. It checks a bounded partial inference slice, not general union completeness. `tools/type-union-alias-overlap-test` exercises the separate positive overlap witness and its shared ship test arm. `tools/type-full-overlap-test` checks structured full-module overlap evidence and the legacy error text under eval; both of its test arms are assembled for the fake ship.
18+
17## Setting up a machine
19## Setting up a machine
18
20
19The tools need Python 3 and `urbit` (vere) on `PATH`; the ship tools also need a fake `~zod` and click. Everything so far ran with vere 4.6 on Linux.
21The tools need Python 3 and `urbit` (vere) on `PATH`; the ship tools also need a fake `~zod` and click. Everything so far ran with vere 4.6 on Linux.
@@ -60,9 +62,45 @@ git clone https://github.com/urbit/tools /root/src/tools
60| --- | --- |
62| --- | --- |
61| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
63| `tools/golden` | Runs the golden cases under `urbit eval`: every case, or those matching `--case`; `--update` rewrites the expected outputs; `--show` prints them |
62| `tools/importer-test` | Compares the partial Hoon importer's diagnostic trees and errors with `tests/importer/tree.txt` under `urbit eval` |
64| `tools/importer-test` | Compares the partial Hoon importer's diagnostic trees and errors with `tests/importer/tree.txt` under `urbit eval` |
65+| `tools/type-import-default-test` | Compares default-wrapped union source proofs and adversarial cases under eval; the same golden runs on the ship |
63| `tools/type-import-test` | Composes the Hoon importer with the partial checker and compares `tests/type-import/expected.txt` under eval |
66| `tools/type-import-test` | Composes the Hoon importer with the partial checker and compares `tests/type-import/expected.txt` under eval |
67+| `tools/type-import-overlap-test` | Checks source-aware Hoon union overlap, provenance and proof-budget controls under eval; the same fixture runs on the ship |
68+| `tools/type-import-structural-test` | Checks multi-case and nested Hoon union overlap witnesses under eval and on the ship |
69+| `tools/type-union-source-test` | Checks bounded local generic-alias disjointness and state guards under eval and on the ship |
70+| `tools/type-union-alias-overlap-test` | Checks source-backed generic-alias overlap witnesses under eval and on the ship |
71+| `tools/type-full-overlap-test` | Checks structured full-module overlap evidence and imported-source attribution |
72+| `tools/type-tlon-test` | Runs the real Tlon presence source through the importer and partial checker, comparing `tests/type-tlon/expected.txt` under eval |
64| `tools/type-import-diagnostic-test` | Compares the structured reader diagnostic bridge report under eval |
73| `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 |
74| `tools/type-mark-test` | Checks the partial checker’s mark import boundary against `tests/type-mark/expected.txt` under eval |
75+| `tools/type-poke-test` | Checks source-backed prelude and poke-only API reports against `tests/type-poke/expected.txt` under eval |
76+| `tools/type-api-paths-test` | Checks partial API path analysis with real todo mark samples against `tests/type-api-paths/expected.txt` under eval |
77+| `tools/type-api-evidence-test` | Runs source, scope, reader-result and declaration-watchability evidence guards under eval and on the ship |
78+| `tools/type-hole-guards-test` | Runs the shared hole-defaulting and API interface guards under eval; the same checks run on the ship |
79+| `tools/type-list-alias-test` | Runs the shared prelude list-alias and provenance guards under eval and on the ship |
80+| `tools/type-generic-recursion-test` | Checks source-backed generic recursive identity and provenance under eval and on the ship |
81+| `tools/type-generic-construction-test` | Checks source-backed one-layer recursive construction, provenance and fuel under eval and on the ship |
82+| `tools/type-generic-pattern-test` | Checks source-backed recursive patterns, catch-all coverage, state and per-attempt fuel/arm limits under eval and on the ship |
83+| `tools/type-deferred-test` | Checks the bounded source-owned deferred inference transaction under eval and on the ship |
84+| `tools/type-deferred-resolver-test` | Checks deferred resolution, report consistency and atomic failure under eval and on the ship |
85+| `tools/type-deferred-context-test` | Checks deferred source order and literal branch contexts under eval and on the ship |
86+| `tools/type-cell-branch-test` | Checks closed-cell branch context, rollback and bounded retry screens under eval and on the ship |
87+| `tools/type-generic-alias-test` | Runs public/private generic union alias and provenance guards under eval and on the ship |
88+| `tools/type-positional-face-guards-test` | Runs positional-call and nested-face guards under eval and on the ship |
89+| `tools/type-qath-guards-test` | Runs source-provenance, recursive unfolding and face guards under eval and on the ship |
90+| `tools/type-todo-partial-test` | Reports partial inference of the unchanged todo island through the real API and readers under eval and on the ship |
91+| `tools/type-todo-api-test` | Exercises the actual todo API through the real Hoon readers and partial checker |
92+| `tools/type-direct-gate-test` | Checks a synthetic source-backed program report and direct gate provenance under eval and on the ship |
93+| `tools/type-closed-gate-guards-test` | Checks closed gate sample labels and face uncertainty under eval and on the ship |
94+| `tools/type-constructor-fit-guards-test` | Checks constructor-case uncertainty and known mismatches under eval and on the ship |
95+| `tools/type-nested-union-guards-test` | Checks nested tagged-union case selection and uncertainty under eval and on the ship |
96+| `tools/type-empty-test` | Checks source-backed empty molds, inhabitedness, coverage and proof budgets under eval and on the ship |
97+| `tools/type-gate-free-guards-test` | Checks bounded gate-free verdicts, inhabitation and witness paths under eval and on the ship |
98+| `tools/type-gate-free-source-test` | Checks source-backed todo mold analysis through the real readers under eval and on the ship |
99+| `tools/type-sub-guards-test` | Checks source-backed subscription mold dependencies under eval and on the ship |
100+| `tools/type-ask-guards-test` | Runs ask origin and canonical list/unit bootstrap guards under eval and on the ship |
101+| `tools/type-request-guards-test` | Runs request evidence, source consistency and cache provenance guards under eval and on the ship |
102+| `tools/type-proj-guards-test` | Runs projection evidence, name-scope and dependency guards under eval and on the ship |
103+| `tools/type-arithmetic-guards-test` | Runs restricted atom-variable, unification and projection guards under eval and on the ship |
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 |
104| `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 |
105| `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 |
68| `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 |
106| `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 |
@@ -70,6 +108,7 @@ git clone https://github.com/urbit/tools /root/src/tools
70| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
108| `tools/ship` | Runs the fake ship: `start`, `stop`, `status`, `log`, `sync <desk>`, `test`, `gen-tests`, `check-commit`, `scry`, `hoon`, `run`, `poke`, `commit`, `mount`, `unmount` |
71| `tools/testdata/selftest` | Tests `tools/golden` and `tools/hoon` against a stub library, and `tools/doc-blocks` against Markdown it writes |
109| `tools/testdata/selftest` | Tests `tools/golden` and `tools/hoon` against a stub library, and `tools/doc-blocks` against Markdown it writes |
72| `tools/testdata/ship-selftest` | Tests `tools/ship`'s test generator and runner against a stub library on the ship |
110| `tools/testdata/ship-selftest` | Tests `tools/ship`'s test generator and runner against a stub library on the ship |
111+| `tools/testdata/clay-fixtures-selftest` | Tests temporary Clay fixture cleanup and signal handling without a ship |
73
112
74`tools/golden` starts `urbit eval` once and builds the library, which takes about 8 s, then runs every case under `mule`, so a crash fails only its own case.
113`tools/golden` starts `urbit eval` once and builds the library, which takes about 8 s, then runs every case under `mule`, so a crash fails only its own case.
75
114
@@ -78,21 +117,62 @@ git clone https://github.com/urbit/tools /root/src/tools
78```
117```
79tools/golden # all cases pass
118tools/golden # all cases pass
80tools/importer-test # Hoon importer fixture projections match
119tools/importer-test # Hoon importer fixture projections match
120+tools/type-import-default-test # default-wrapped source proofs match
81tools/type-import-test # importer/checker bridge golden report matches
121tools/type-import-test # importer/checker bridge golden report matches
122+tools/type-import-overlap-test # source-aware Hoon overlap and provenance controls
123+tools/type-import-structural-test # nested and multi-case Hoon overlap controls
124+tools/type-union-source-test # local generic-alias union guards
125+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
126+tools/type-full-overlap-test # full-module overlap evidence
127+tools/type-tlon-test # real Tlon importer/checker report matches
82tools/type-import-diagnostic-test # direct structured reader diagnostics match
128tools/type-import-diagnostic-test # direct structured reader diagnostics match
83tools/type-mark-test # mark/checker bridge golden report matches
129tools/type-mark-test # mark/checker bridge golden report matches
130+tools/type-poke-test # source-backed poke/API bridge report matches
131+tools/type-api-paths-test # partial API path analysis report matches
132+tools/type-api-evidence-test # API declaration evidence guards pass
133+tools/type-hole-guards-test # hole defaulting and API guards pass
134+tools/type-list-alias-test # prelude list-alias guards pass
135+tools/type-generic-alias-test # generic union alias guards pass
136+tools/type-positional-face-guards-test # positional sample face guards pass
137+tools/type-qath-guards-test # qath source and unfolding guards pass
138+tools/type-todo-partial-test # unchanged todo partial report and reader failure controls
139+tools/type-todo-api-test # real todo API partial inference and reader guards pass
140+tools/type-direct-gate-test # direct gate source and provenance guards pass
141+tools/type-generic-recursion-test # source-backed recursive identities and provenance
142+tools/type-generic-construction-test # source-backed recursive construction and bounds
143+tools/type-generic-pattern-test # source-backed recursive patterns and bounds
144+tools/type-deferred-test # source-owned deferred inference guards
145+tools/type-deferred-resolver-test # resolver consistency and failure guards
146+tools/type-deferred-context-test # deferred source-order and branch guards
147+tools/type-cell-branch-test # contextual branch rollback and bounds
148+tools/type-closed-gate-guards-test # closed gate fit guards pass
149+tools/type-constructor-fit-guards-test # constructor fit guards pass
150+tools/type-nested-union-guards-test # nested union selector guards pass
151+tools/type-empty-test # empty mold and uninhabited-case guards pass
152+tools/type-gate-free-guards-test # bounded gate-free classifier guards pass
153+tools/type-gate-free-source-test # real todo mold analysis and source guards pass
154+tools/type-sub-guards-test # subscription source guards pass
155+tools/type-ask-guards-test # ask source and bootstrap guards pass
156+tools/type-request-guards-test # request evidence and cache guards pass
157+tools/type-proj-guards-test # projection evidence and scope guards pass
158+tools/type-arithmetic-guards-test # arithmetic constraint guards pass
84tools/type-module-scope-test # module/prelude scope golden report matches
159tools/type-module-scope-test # module/prelude scope golden report matches
85tools/hoon check-spans-test # prints <<>>
160tools/hoon check-spans-test # prints <<>>
161+tools/hoon itype-unify-test # type-unification controls pass
162+tools/hoon -f tools/testdata/zing-hoon-reference.hoon # Hoon translation agrees on four inputs
163+tools/hoon -f tools/testdata/lead-late-hoon-reference.hoon # Hoon translation agrees on selected inputs
164+tools/hoon -f tools/testdata/succ-hoon-reference.hoon # Hoon translation agrees on selected inputs
86tools/testdata/selftest # 22 checks, 0 failed
165tools/testdata/selftest # 22 checks, 0 failed
87tools/doc-blocks docs/spec # every jibb block has its case
166tools/doc-blocks docs/spec # every jibb block has its case
88tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
167tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
89tools/ship test # the cases pass as -test arms on the ship
168tools/ship test # the cases pass as -test arms on the ship
90tools/testdata/ship-selftest # when tools/ship changed
169tools/testdata/ship-selftest # when tools/ship changed
170+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
91tools/ship check-commit # when the mark or the desks changed
171tools/ship check-commit # when the mark or the desks changed
92−tools/clay-fixtures # when the my-app Hoon fixtures or importer changed
172+tools/clay-fixtures # builds example fixtures and real Tlon notes through Clay
93```
173```
94
174
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.
175+`tools/ship test` regenerates `tests/lib/jibb.hoon` and syncs the `jibb-dev` desk before it runs, so commit the regenerated file. Sync preflights and splits large deletion lists into bounded click requests, waiting for each Clay revision; a failure stops later batches. The ship self-test exercises this when switching from the full desk to a smaller fixture desk. 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. `tests/lib/jibb-tlon-bridge.hoon` and `tools/type-tlon-test` run the real Tlon presence reader/checker fixture on both. 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-poke-bridge.hoon` and `tools/type-poke-test` share the source-backed prelude and poke-only API fixture. `tests/lib/jibb-api-paths.hoon` and `tools/type-api-paths-test` share partial path analysis over the real todo marks; this does not generate request interfaces. `tests/lib/jibb-module-scope.hoon` and `tools/type-module-scope-test` compare the prelude scope report on the ship and under eval.
96
176
97## Golden cases
177## Golden cases
98
178
@@ -106,7 +186,7 @@ A case is a folder `tests/golden/<name>/` holding:
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.
186- 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.
187- 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
188
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.
189+The runners prepare the trusted vendored public and internal prelude sources once for their generated test core and share the partial interface. Preparation reserves all names present in the public source and supplies the molds and values the fragment can infer; an unsupported declaration remains reserved but unavailable. The source and 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-and-internal` accepts both sources directly; callers using `+golden-types-with-prepared-prelude` pass the unchanged result of `+prepare-prelude-with-internal`. The older source-only entry points remain available for preludes without imports. Missing or malformed sources fail closed.
110
190
111A 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.
191A 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.
112
192
@@ -133,3 +213,5 @@ Write `source.jibb` and `about.txt` by hand, run `tools/golden --update --case <
133## Commits
213## Commits
134
214
135A short subject in the imperative, then a body that says what changed and why, wrapped at 72 columns, as in `git log`. Each commit leaves every check passing.
215A short subject in the imperative, then a body that says what changed and why, wrapped at 72 columns, as in `git log`. Each commit leaves every check passing.
216+
217+`tools/type-deferred-test` exercises the bounded, source-owned constructor transaction and low-level freshness/replay guards. `tools/type-deferred-resolver-test` checks the experimental import-free library resolver, report consistency, atomic failure, and that both source orders of a late face constraint decline. These checks do not establish island-kind or watchability support.
docs/open-questions.md+24−2
@@ -18,7 +18,7 @@ On 2026-10-30, @iko adopted gate-free `eq` arguments and map and set keys, treat
18
18
19## Questions milestone 2 raises
19## Questions milestone 2 raises
20
20
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 and 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. Question 3 remains open; the field-order detail in question 32 is being clarified. The other questions are settled.
22
22
231. **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.
231. **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.
242. **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.
242. **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.
@@ -37,13 +37,35 @@ Found while writing [prompts/milestone-2.md](prompts/milestone-2.md), checking i
3715. **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`.
3715. **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`.
3816. **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.
3816. **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.
3917. **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.
3917. **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. 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.
40+18. **Settled: the value gate `like`.** On 2026-10-31, @iko chose a gate `(like convert result)` that maps the product of an existing `(like A)` result with `convert=$-(A B)`, yielding `(like B)` while preserving its position and remaining input. An absent result stays absent. The `(like A)` mold remains available in the separate mold namespace. Hoon's wet `+like` instead builds a gate that constructs a result from an input noun; the chosen Jibb value gate is an adaptation of that behavior.
4119. **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.
4119. **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.
4220. **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.
4220. **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.
4321. **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.
4321. **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.
4422. **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.
4422. **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.
4523. **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.
4523. **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
46
47+24. **Settled: how the internal prelude provides `poke`.** On 2026-10-31, @iko chose to define `poke` in the source-backed private internal prelude module and re-export it through the public prelude as an ordinary transparent type. Ordinary modules can construct and inspect its values. This settles `poke`; it does not decide the representation of `ask` or `qath`.
48+
49+25. **Settled: how the prelude provides `ask` and `qath`.** On 2026-10-31, @iko chose ordinary transparent types defined in the internal prelude and re-exported normally, as for `poke`. Callers may construct and inspect their values.
50+
51+26. **Settled: the `step` example's `at` binder.** On 2026-10-31, @iko chose to rename the `describe` pattern binder to `sent-at`, keeping Hoon's `at` in the prelude and the no-shadowing rule.
52+
53+27. **Settled: duplicate fields in a Jibb-written record.** On 2026-10-31, @iko chose to reject duplicate field names, as for imported Hoon records.
54+
55+28. **Settled: arithmetic on loobeans.** On 2026-10-31, @iko chose to reject loobean operands for arithmetic. Comparison may still accept loobeans and returns `?`. The checker needs to retain this constraint through inference, generalization and instantiation before it exports `add` or `dec`.
56+
57+29. **Settled: printing the arithmetic atom constraint.** On 2026-10-31, @iko chose `where A is an atom other than ?` for a generic arithmetic type whose atom variable excludes loobeans.
58+
59+30. **Settled: a hole inferred as a generic variable.** On 2026-10-31, @iko said a hole resolved to an explicitly written type variable counts as inferred: in `++ id |= x=A ^- _ x`, the result hole is `A`. Named molds must determine their own holes without constraints from later uses; an unconstrained hole is an error.
60+
61+31. **Settled: uses of a value with a hole.** On 2026-10-31, @iko said a value definition must determine its own holes; another definition's use cannot fix an otherwise unresolved hole. For example, `++ id |= x=_ x` remains an error even if a later definition calls `id` with a cord.
62+
63+32. **Partly settled: type-directed record projection.** On 2026-10-31, @iko chose an explicit `(proj record)` whose expected result type selects the fields. There is no automatic projection, and `proj` is reserved against definitions and imports. The result contains exactly the fields of its expected type. Whether the result may reorder fields from the source remains open.
64+
65+33. **Settled: watching a request with unknown provenance.** On 2026-10-31, @iko said an island may watch a request only if the checker proves it watchable at compile time. An unknown request, including one built or passed through a gate without sufficient evidence, is rejected rather than deferred to a runtime check.
66+
67+34. **Settled: constructors and equal noun literals.** On 2026-10-31, @iko said expressions with the same runtime representation count as equal, and cases that cannot be distinguished at runtime are rejected at compile time. Thus `|=%$` matches a case headed by `%$`, `%.y` or `~`: each is the noun 0. Cases with equal heads and overlapping payloads cannot coexist in a union.
68+
47## Grammar questions never put to the doc's author
69## Grammar questions never put to the doc's author
48
70
49In milestone 1 the parser met about thirty places where the doc could be read more than one way. Twelve went to @iko on 2026-10-30 and are rows of the Decisions tab. These were not asked. For each, the parser follows the reading below, and some are marked "(doc question)" in the library's notes. None changes what a valid program means, except where a reading makes something an error.
71In milestone 1 the parser met about thirty places where the doc could be read more than one way. Twelve went to @iko on 2026-10-30 and are rows of the Decisions tab. These were not asked. For each, the parser follows the reading below, and some are marked "(doc question)" in the library's notes. None changes what a valid program means, except where a reading makes something an error.
docs/prelude-inventory.md+14−6
@@ -4,12 +4,18 @@ This is a working inventory, not a completed prelude interface. It lists top-lev
4
4
5The source is the fake ship's `%base` `/sys/hoon.hoon` (Hoon version 135), read through Clay with `tools/ship scry /cx/=base=/sys/hoon/hoon --raw`. SHA-256: `ef538ced0877230f02ff86f9fb7a0abc6833bb1cf0e8675742b4d6ce478fcc92`. It differs in bytes from [upstream Hoon at the inspected commit](https://github.com/urbit/urbit/blob/5a187fededc4582a34fcd6055c67bb63e0917b94/pkg/arvo/sys/hoon.hoon); verify against the actual target ship when updating this inventory.
5The source is the fake ship's `%base` `/sys/hoon.hoon` (Hoon version 135), read through Clay with `tools/ship scry /cx/=base=/sys/hoon/hoon --raw`. SHA-256: `ef538ced0877230f02ff86f9fb7a0abc6833bb1cf0e8675742b4d6ce478fcc92`. It differs in bytes from [upstream Hoon at the inspected commit](https://github.com/urbit/urbit/blob/5a187fededc4582a34fcd6055c67bb63e0917b94/pkg/arvo/sys/hoon.hoon); verify against the actual target ship when updating this inventory.
6
6
7+The vendored prelude defines `poke` in its private internal module and re-exports it as a transparent type. The partial checker resolves its supported source shape and a narrow imported API constructor; complete checking of the private body, other API shapes, effect lowering and runtime execution remain unfinished. `qath` is defined there as a transparent recursive knot sequence and re-exported by the public prelude; the partial checker supports its named identity, selected construction and matching, and static application-path literals. The internal prelude also defines a transparent generic `ask` with pure, agent and store cases; the public prelude re-exports it and defines `pure`. Supported source construction and matching infer, while derived requests, source-schema validation and execution remain unfinished.
8+
9+The prelude also declares the generic `cmd` mold exactly as in Overview, Effects. The partial checker infers its five cases and independent message types in the supported examples; complete module checking and backend validation remain outstanding. The public prelude also declares `sub`; the partial checker infers supported constructions, while request watchability and execution remain outstanding.
10+
7Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold generators, and need individual inspection. Jibb's loobean `not` and Hoon's bitwise `not.bit` are distinct. Parser helpers outside 3g are excluded from the intended prelude except the specifically listed `slav` and `slaw`; the raw candidates below still need to be classified.
11Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold generators, and need individual inspection. Jibb's loobean `not` and Hoon's bitwise `not.bit` are distinct. Parser helpers outside 3g are excluded from the intended prelude except the specifically listed `slav` and `slaw`; the raw candidates below still need to be classified.
8
12
9## 1a
13## 1a
10
14
11`add`, `dec`, `div`, `dvr`, `gte`, `gth`, `lte`, `lth`, `max`, `min`, `mod`, `mul`, `sub`.
15`add`, `dec`, `div`, `dvr`, `gte`, `gth`, `lte`, `lth`, `max`, `min`, `mod`, `mul`, `sub`.
12
16
17+The source-backed `gth` gate calls a compiler-supplied private comparison interface. The partial checker accepts supported equal-aura atom arguments, including loobeans, and returns `?`; lowering, jet recognition and execution remain unfinished. The public `add` and `dec` gates are written in Jibb over private primitive interfaces. The partial checker infers a shared atom type that excludes loobeans, including through supported generic calls. The Jibb-written `lth`, `gte` and `lte` gates compose `gth` and `not`; supported calls infer a shared atom constraint and return `?`. Primitive execution and jet recognition remain unfinished.
18+
13## 1c
19## 1c
14
20
15`bite` (mold), `bloq` (mold), `each`, `gate` (mold), `list`, `lone`, `lest`, `mold` (mold), `pair`, `pole`, `qual`, `quip`, `step`, `trap`, `tree`, `trel`, `unit`.
21`bite` (mold), `bloq` (mold), `each`, `gate` (mold), `list`, `lone`, `lest`, `mold` (mold), `pair`, `pole`, `qual`, `quip`, `step`, `trap`, `tree`, `trel`, `unit`.
@@ -20,17 +26,17 @@ Hoon `+$` arms are marked **mold** below; `++` arms can be gates, doors or mold
20
26
21`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
27`biff`, `bind`, `bond`, `both`, `clap`, `clef`, `drop`, `fall`, `flit`, `hunt`, `lift`, `mate`, `need`, `some`.
22
28
23−The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The partial checker infers `fall` and `need`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation remains outstanding for all of them.
29+The following is an audit of the Hoon 135 bodies, not a completed Jibb interface. The partial checker infers `fall`, `need`, `some`, `bind`, `biff`, `bond`, `both`, `clap`, `clef`, `drop` and `flit`; the remaining written implementations have been parsed, but complete checker validation remains outstanding. Backend validation and jet recognition remain outstanding for all of them.
24
30
25| Name | Hoon behavior | Jibb status |
31| Name | Hoon behavior | Jibb status |
26| --- | --- | --- |
32| --- | --- | --- |
27| `biff` | Applies a gate returning a unit to a present value; absent stays absent. | Written |
33| `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 |
34| `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 |
35+| `bond` | Calls a fallback trap for an absent unit, otherwise returns its value. | Written and inferred as a curried gate; backend validation remains outstanding |
30| `both` | Returns a unit of both values when both units are present. | Written |
36| `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 |
37| `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 |
38| `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 |
39+| `drop` | Converts an absent unit to an empty list and a present unit to a singleton. | Written; inferred by the partial checker |
34| `fall` | Returns the value of a present unit or the supplied fallback. | Written; inferred by the partial checker |
40| `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 |
41| `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 |
42| `hunt` | Returns the only present unit or chooses between two present values with an ordering gate. | Missing |
@@ -43,7 +49,7 @@ The following is an audit of the Hoon 135 bodies, not a completed Jibb interface
43
49
44`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`.
50`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`.
45
51
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.
52+The current prelude writes `snoc`, `lure`, `flop`, `join`, `lent`, `zing`, `levy`, `lien`, `murn`, `rear`, `reel`, `roll`, `skim`, `skip`, `snip`, `turn` and `weld`. `lent` counts items by recursion and `add`; `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`, `turn`, `flop`, `rear`, `skim`, `skip`, `murn`, `join`, `snip`, `lent`, `zing`, `levy` and `lien` using the validated prelude `list` mold; other list helpers remain limited by that fragment. The result casts on `drop`, `skim`, `skip`, `murn`, `join`, `snip`, `levy` and `lien` state their existing result types without changing their bodies. `zing` concatenates homogeneous lists in order; Hoon’s raw `zing` can also flatten heterogeneous noun lists, which this Jibb type does not express. A Hoon translation agrees with Hoon `zing` on selected finite inputs; this is not Jibb execution. Backend validation and jet recognition remain outstanding for all of them.
47
53
48## 2c
54## 2c
49
55
@@ -93,6 +99,8 @@ The current prelude writes `snoc`, `lure`, `flop`, `join`, `levy`, `lien`, `murn
93
99
94`aftr`, `cork`, `corl`, `cury`, `curr`, `fore`, `head`, `same`, `succ`, `tail`, `test`, `lead`, `late`.
100`aftr`, `cork`, `corl`, `cury`, `curr`, `fore`, `head`, `same`, `succ`, `tail`, `test`, `lead`, `late`.
95
101
102+The source-backed `cork` and `corl` compose gates forward and backward, respectively; `cury` and `curr` bind the first and second item of an unfaced pair. `succ` increments an atom through `add`; the partial checker infers a shared atom type excluding loobeans. A Hoon translation agrees with Hoon on ten selected inputs; Jibb execution and jet recognition remain unverified. `lead` and `late` are curried pair constructors: `((lead a) b)` returns `[a b]`, and `((late a) b)` returns `[b a]`. Their arguments may have independent types, including gate values, and neither constructor invokes a gate. The partial checker infers their polymorphic types. A Hoon translation agrees with Hoon’s helpers on selected inputs, but this is not Jibb execution; lowering and jet recognition remain to be validated by a backend.
103+
96## 2o
104## 2o
97
105
98`jar`, `jug`, `map`, `qeu`, `set`.
106`jar`, `jug`, `map`, `qeu`, `set`.
@@ -115,7 +123,7 @@ Hoon 135's `3g` section has exactly 12 exports: ten `+$` molds (`coin`, `dime`,
115| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
123| `dime` | `[p=@ta q=@]` in Hoon. The `q` field accepts any atom, as does Jibb `@` after @iko's decision in question 15. |
116| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
124| `edge` | `[p=hair q=(unit [p=* q=nail])]`: a parsing position and either no result or a result and remaining input. |
117| `hair` | `[p=@ud q=@ud]`: a parsing position. |
125| `hair` | `[p=@ud q=@ud]`: a parsing position. |
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. |
126+| `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])]`. The Jibb value gate maps the product of an existing result and preserves its position and remaining input; the partial checker infers supported calls, while backend validation remains outstanding. |
119| `nail` | `[p=hair q=tape]`: parsing input. |
127| `nail` | `[p=hair q=tape]`: parsing input. |
120| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
128| `pint` | `[p=[p=@ q=@] q=[p=@ q=@]]` in Hoon. The four positions accept atoms independently; Jibb `@` now has the same meaning. |
121| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
129| `rule` | A gate mold `$-(nail edge)`; Hoon constructs its sample and product from the `nail` and `edge` molds. |
@@ -144,7 +152,7 @@ The following shapes can be written as Jibb declarations once their referenced p
144 [%2 p=(list tank)]
152 [%2 p=(list tank)]
145```
153```
146
154
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.
155+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 source-backed value form of `like` maps an existing result's product. Supported calls infer in the partial checker; complete checking and backend validation for `like` and `wonk` remain outstanding.
148
156
149## 4a
157## 4a
150
158
docs/prompts/milestone-2.md+9−7
@@ -49,7 +49,7 @@ And from the plan's Risks:
49
49
50## First steps
50## First steps
51
51
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. The source-backed internal module defines `poke`, `ask` and `qath`; the public prelude re-exports them as ordinary transparent types that modules can construct and inspect, as questions 24 and 25 record. Their current representations and partial checker support are described in `docs/compiler.md`.
53
53
54 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.
54 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.
552. **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.
552. **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,8 +59,9 @@ And from the plan's Risks:
59The 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.
59The 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.
60
60
61**Types and inference** (Grammar: Molds, Modules, Runes, Expressions; Decisions: Inference, Type variables, Sample names, Inline gates)
61**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 `@`, 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.
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. Explicit `proj` is a type-directed operation.
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.
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.
64+- The reserved, explicit `(proj record)` selects fields according to its expected result type. The checker records the projection and lowering evaluates the source once and builds that layout. A direct call does not insert a projection, and a module cannot define or import another `proj`.
64- 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- 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 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- 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`.
67- 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`.
@@ -68,12 +69,13 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
68- 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 ~)`.
69- 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 ~)`.
69- 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]`.
70- 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]`.
70- `!!` is the empty mold, and as an expression it has any type. `*` is the noun type, not a type variable; generic positions such as the keys in `each` and `table` use a capital. A value of a more specific noun type can be used where `*` is expected.
71- `!!` is the empty mold, and as an expression it has any type. `*` is the noun type, not a type variable; generic positions such as the keys in `each` and `table` use a capital. A value of a more specific noun type can be used where `*` is expected.
72+- `_` is an inferable hole wherever a mold can appear, including an inferred path-segment aura. A hole resolved to an explicitly named generic variable is resolved; an unconstrained hole is an error. A named mold or value definition must determine its own holes without constraints from later uses.
71−- `poke`, `ask` and `qath` are opaque, built only by derived gates, `pure` and application-path literals.
73+- `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally. Derived gates and `pure` also construct requests; application-path literals have type `qath`.
72- The Literals table gives every other literal its type: `0x1f` a `@ux`, ships `@p`, dates `@da`, durations `@dr`, `~.knot` a `@ta`, strings `@t`, `` `x `` a `(unit A)`, `~[…]` a `(list A)`, `gap+%s2` the pair `[%gap %s2]`, `/posts/~zod` a `path`, `%/blog` a `qath`.
74- The Literals table gives every other literal its type: `0x1f` a `@ux`, ships `@p`, dates `@da`, durations `@dr`, `~.knot` a `@ta`, strings `@t`, `` `x `` a `(unit A)`, `~[…]` a `(list A)`, `gap+%s2` the pair `[%gap %s2]`, `/posts/~zod` a `path`, `%/blog` a `qath`.
73
75
74**Tags, `~`, numbers and cells wait for their context** (Grammar: Tag resolution, Literals by context)
76**Tags, `~`, numbers and cells wait for their context** (Grammar: Tag resolution, Literals by context)
75- A tag or `~` gets a fresh variable and a pending constraint, checked once unification fixes the variable: against a union's cases, by shape and shared tag positions, or as a constant atom for `@tas`, `@ta`, `@` or `*`. A literal that matches nothing is "an error naming the union, such as "msg has no case %submitt"".
77- A tag or `~` gets a fresh variable and a pending constraint, checked once unification fixes the variable: against a union's cases, by shape and shared tag positions, or as a constant atom for `@tas`, `@ta`, `@` or `*`. A literal that matches nothing is "an error naming the union, such as "msg has no case %submitt"".
76−- `|=%typed` is a case's constructor: "against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. It works for cases tagged at their head; a bare tag is always a value."
78+- `|=%typed` is a case's constructor: "against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. A literal case head matches by noun value, so `|=%$` also matches `%.y` and `~` heads; a bare tag is always a value."
77- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages. A tag constraint still open when the module is checked is an error asking for a `^-`; the checker never guesses. Gate-free constraints are retained when generalized.
79- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages. A tag constraint still open when the module is checked is an error asking for a `^-`; the checker never guesses. Gate-free constraints are retained when generalized.
78- "Wing access, changes and `?-` on a type not yet known wait the same way." A change with no items, `m()`, is an error; the parser still accepts it. Patterns don't wait: they're checked against the subject's type.
80- "Wing access, changes and `?-` on a type not yet known wait the same way." A change with no items, `m()`, is an error; the parser still accepts it. Patterns don't wait: they're checked against the subject's type.
79- Number and cell literals each "takes a default when its `++` is checked": a number `@ud`, a cell a tuple. But "A number takes `@ud` only if nothing fixes its aura and its `++` isn't generic over it", so `++ inc |= n=A (add n 1)` stays generic: unlike a tag's, a number's variable doesn't stop its `++` from generalizing. A cell can also become a record or, where a list is expected, a cons.
81- Number and cell literals each "takes a default when its `++` is checked": a number `@ud`, a cell a tuple. But "A number takes `@ud` only if nothing fixes its aura and its `++` isn't generic over it", so `++ inc |= n=A (add n 1)` stays generic: unlike a tag's, a number's variable doesn't stop its `++` from generalizing. A cell can also become a record or, where a list is expected, a cons.
@@ -107,19 +109,19 @@ The rules are scattered across the tabs. This is a map of them, not a replacemen
107- "Island data and models can't hold gates; the checker names the field."
109- "Island data and models can't hold gates; the checker names the field."
108
110
109**API files, stores and derived gates** (overview: Agent APIs, Effects; Grammar: Modules)
111**API files, stores and derived gates** (overview: Agent APIs, Effects; Grammar: Modules)
110−- `/ui/api/<agent>.jibb` declares `+$ poke` and `+$ paths`; "`poke` and `paths` are declarations, not molds." "A path case is a request name, a path and a type", and "A case can name another scry path, as in `[%changes /updates (facts todos todo-update) scry=/todos]`, used only by pages." An island watching a request whose case has `scry=` has a type error.
112+- `/ui/api/<agent>.jibb` declares `+$ poke` and `+$ paths`; "`poke` and `paths` are declarations, not molds." "A path case is a request name, a path and a type", and "A case can name another scry path, as in `[%changes /updates (facts todos todo-update) scry=/todos]`, used only by pages." An island may watch a request only when the checker proves it is watchable; a separate `scry=` path or unknown watchability is a type error.
111- Each poke type gives a constructor, as `todo-action.todo`, and each path case a request, as `(todos.todo |=%got)`. A path with typed segments takes them too: the overview's `(post.api slug same)` suggests they come first. A `(facts full diff …)` case's request also takes a fold, as `$-([[%todo-update todo-update] todos] todos)`.
113- Each poke type gives a constructor, as `todo-action.todo`, and each path case a request, as `(todos.todo |=%got)`. A path with typed segments takes them too: the overview's `(post.api slug same)` suggests they come first. A `(facts full diff …)` case's request also takes a fold, as `$-([[%todo-update todo-update] todos] todos)`.
112- A store's `+$ poke` is a declaration, not a mold. A store exports a constructor per poke type and a `state` request. Clashing derived names are errors, including clashes with an import face. The checker must account for the fact that the type of `main` determines whether a module is a store.
114- A store's `+$ poke` is a declaration, not a mold. A store exports a constructor per poke type and a `state` request. Clashing derived names are errors, including clashes with an import face. The checker must account for the fact that the type of `main` determines whether a module is a store.
113
115
114**The prelude** (overview: Prelude, Layout and styling, Links and URLs, Effects)
116**The prelude** (overview: Prelude, Layout and styling, Links and URLs, Effects)
115- 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.
117- 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: `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)`.
118+- Signatures change where the Prelude table says: `clap` takes two units of one value type and a combining gate over that type; the value gate `(like convert result)` maps the product of a `(like A)` to a `(like B)`, preserving position and remaining input; 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)`.
117- 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".
119- 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".
118- 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.
120- 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.
119- 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."
121- 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."
120
122
121**Errors**
123**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 `$%`, `$?` 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.
124+- 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 case with an equal literal 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.
123- 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.
125- 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.
124- "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.
126- "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.
125- 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.
127- 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/core-language.md+2−1
@@ -71,7 +71,7 @@ axis = digit { digit } ; (* at least 1 *)
71
71
72## Lowering from Jibb
72## Lowering from Jibb
73
73
74−Types, faces and casts leave nothing behind; everything else lowers by these rules.
74+Types, faces and casts leave nothing behind. Everything else lowers by these rules.
75
75
76| Jibb | Core language |
76| Jibb | Core language |
77| --- | --- |
77| --- | --- |
@@ -82,6 +82,7 @@ Types, faces and casts leave nothing behind; everything else lowers by these rul
82| `gap+%s2` | `(cons %gap %s2)` |
82| `gap+%s2` | `(cons %gap %s2)` |
83| `/posts/~zod`, `%/blog/(slug)` | A list of knots, typed segments printed by their aura's native; the runtime adds the base path to an application path |
83| `/posts/~zod`, `%/blog/(slug)` | A list of knots, typed segments printed by their aura's native; the runtime adds the base path to an application path |
84| `title.p`, `space.theme.theme` | `slot` at the field's axis, nested for longer wings |
84| `title.p`, `space.theme.theme` | `slot` at the field's axis, nested for longer wings |
85+| `(proj record)` | Apply a `lam` to the source once; its body constructs the expected record from the required fields using `slot` and `cons`, discarding extra fields |
85| `card.card`, an import | The qualified name `components/card:card` |
86| `card.card`, an import | The qualified name `components/card:card` |
86| `m(draft=t error=~)` | One `edit` per item, in order: `(edit 7 (edit 6 m t) ~)` |
87| `m(draft=t error=~)` | One `edit` per item, in order: `(edit 7 (edit 6 m t) ~)` |
87| `f a b c` | `(app f (cons a (cons b c)))`: the arguments are the sample |
88| `f a b c` | `(app f (cons a (cons b c)))`: the arguments are the sample |
docs/spec/decisions.md+11−5
@@ -24,18 +24,21 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
24| Several open brackets | The deeper lines go to the last bracket, or the last rune's body, left open on a line, and the brackets before it close with it: `(column ~ ~[` needs no `)` | Decided 2026-10-30 |
24| Several open brackets | The deeper lines go to the last bracket, or the last rune's body, left open on a line, and the brackets before it close with it: `(column ~ ~[` needs no `)` | Decided 2026-10-30 |
25| Jibb code blocks | Labelled `jibb` in this doc; each is a golden test | Decided 2026-10-30 |
25| Jibb code blocks | Labelled `jibb` in this doc; each is a golden test | Decided 2026-10-30 |
26| Definitions | `++` for values, `+$` for molds; no `=/` | Decided |
26| Definitions | `++` for values, `+$` for molds; no `=/` | Decided |
27−| 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 |
27+| 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; constructor heads and case disjointness compare literal noun values regardless of spelling, so `%$`, `%.y` and `~` are equal and overlapping cases are errors; 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-31 |
28| Printed unnamed unions | Print the cases separated by spaces, as `%approve %deny`; this is print-only, not Jibb syntax | Decided 2026-10-30 |
28| Printed unnamed unions | Print the cases separated by spaces, as `%approve %deny`; this is print-only, not Jibb syntax | Decided 2026-10-30 |
29−| Printed type constraints | Print an atom constraint as `$-([A A] A) where A is an atom` and a gate-free constraint as `$-([A A] ?) where A contains no gates`; separate multiple clauses with commas, as `where A is an atom, B contains no gates` | Decided 2026-10-30 |
29+| Printed type constraints | Print an atom constraint as `$-([A A] A) where A is an atom`, an arithmetic atom constraint as `where A is an atom other than ?`, 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-31 |
30| Branching | `?-` only, loobeans included; exhaustive, with explicit catch-alls; covered arms are errors; failures say `!!` | Decided 2026-10-29 |
30| Branching | `?-` only, loobeans included; exhaustive, with explicit catch-alls; covered arms are errors; failures say `!!` | Decided 2026-10-29 |
31| 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 |
31| 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 |
32| Special rules | No built-ins; type-directed rules are welcome, each listed in the Grammar tab | Decided 2026-10-29 |
32| 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 `@` 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 |
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 |
34−| 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 |
34+| Effects | The library unions `cmd` and `sub`; `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally; derived gates and `pure` also construct requests; 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-31 |
35+| Poke representation | The source-backed private internal prelude module defines `poke`, and the public prelude re-exports it as an ordinary transparent type. Ordinary modules can construct and inspect its values | Decided 2026-10-31 |
35−| 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 |
36+| 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 may watch a request only when the checker proves it is watchable, so a separate scry path or unknown watchability is an error; typed segments by aura | Decided 2026-10-31 |
36| Mark names | Any name: `/%` names types after marks, and constructors poke with their type's mark; no alias marks | Decided 2026-10-26 |
37| Mark names | Any name: `/%` names types after marks, and constructors poke with their type's mark; no alias marks | Decided 2026-10-26 |
37| 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| 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`; imported `$%`, `$?` and `$^` cases must differ as nouns, and records with duplicate field names are errors where used; unused molds skipped | Decided 2026-10-30 |
39| 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 |
40+| Record fields | Duplicate field names in a Jibb-written record are an error, as they are in an imported Hoon record | Decided 2026-10-31 |
41+| Record projection | The explicit type-directed operation `proj` takes a record and uses its expected result type to select its fields; no projection is inserted automatically. `proj` is reserved and cannot be defined or imported under that name. The result has exactly the fields declared by its type | Decided 2026-10-31 |
39| Layout | Indentation; juxtaposed calls; a bracket open at line end takes one item per line, with no closer | Decided |
42| Layout | Indentation; juxtaposed calls; a bracket open at line end takes one item per line, with no closer | Decided |
40| 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 |
43| 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 |
41| Long calls | One argument per line inside parentheses | Decided |
44| Long calls | One argument per line inside parentheses | Decided |
@@ -43,6 +46,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
43| Empty mold | `!!`, with no values; the expression has any type; pages are `(element !!)`, which keeps islands out of islands | Decided 2026-10-29 |
46| Empty mold | `!!`, with no values; the expression has any type; pages are `(element !!)`, which keeps islands out of islands | Decided 2026-10-29 |
44| 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 |
47| 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 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 |
48| 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 |
49+| Partial type annotations | `_` may appear wherever a mold may appear and marks that part of the type for inference; a hole inferred as a named type variable is resolved; an unconstrained hole is an error, and a named mold or value definition must determine its own holes without constraints from later uses | Decided 2026-10-31 |
46| Loobean mold | `?`, switched with `?-` | Decided 2026-10-26 |
50| Loobean mold | `?`, switched with `?-` | Decided 2026-10-26 |
47| Defaults | None | Decided |
51| Defaults | None | Decided |
48| Modules | Records, not cores | Decided |
52| Modules | Records, not cores | Decided |
@@ -51,6 +55,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
51| Binding patterns | In `?-` arms; the last position binds the rest | Decided 2026-10-29 |
55| Binding patterns | In `?-` arms; the last position binds the rest | Decided 2026-10-29 |
52| 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 |
56| 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, 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 |
57| 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 |
58+| Loobean arithmetic | Arithmetic rejects loobean operands; comparison may accept them and returns `?` | Decided 2026-10-31 |
54| 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 |
59| 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 |
55| Refinement types | None | Decided |
60| Refinement types | None | Decided |
56| Imports | `/-`, `/%` (a mark's type, with no face) and `/=`; no `/+`; cycles are errors | Decided 2026-10-29 |
61| Imports | `/-`, `/%` (a mark's type, with no face) and `/=`; no `/+`; cycles are errors | Decided 2026-10-29 |
@@ -67,7 +72,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
67| Inputs | A message per input event, none mid-composition; controls reset to the latest view after every event; fields read-only until the island starts | Decided 2026-10-29 |
72| Inputs | A message per input event, none mid-composition; controls reset to the latest view after every event; fields read-only until the island starts | Decided 2026-10-29 |
68| Transactions | None; one poke per command | Decided |
73| Transactions | None; one poke per command | Decided |
69| Reloads | Restart from the model the page is served with | Decided 2026-10-29 |
74| Reloads | Restart from the model the page is served with | Decided 2026-10-29 |
70−| Shared state | Stores: browser agents written like API files, with `state`, `+$ poke` and `(store init update)`; the store's `+$ poke` is a declaration, not a mold; poked and watched through derived gates; one per page | Decided 2026-10-30 |
75+| Shared state | Stores: browser agents written like API files, with `state`, `+$ poke` and `(store init update)`; the store's `+$ poke` is a declaration, not a mold; derived gates provide poke constructors and state requests; one per page | Decided 2026-10-31 |
71| Subscriptions | By agent and path, shared per page; the first fact is full state, so no paths that need a scry path | Decided 2026-10-29 |
76| Subscriptions | By agent and path, shared per page; the first fact is full state, so no paths that need a scry path | Decided 2026-10-29 |
72| Apps | One island under a catch-all route, given the path by `pure`; `%url` delivers the path on every change; in-section links act as `go`; focus moves to the first heading | Decided 2026-10-29 |
77| Apps | One island under a catch-all route, given the path by `pure`; `%url` delivers the path on every change; in-section links act as `go`; focus moves to the first heading | Decided 2026-10-29 |
73| Layout vocabulary | Jibb's elements and theme tokens; the stylesheet comes from the theme alone; chars and fill are inline; `[%fill n]` below 1 counts as 1 | Decided 2026-10-29 |
78| Layout vocabulary | Jibb's elements and theme tokens; the stylesheet comes from the theme alone; chars and fill are inline; `[%fill n]` below 1 counts as 1 | Decided 2026-10-29 |
@@ -77,6 +82,7 @@ The choices behind the Language tab, made on 2026-10-23; a later date marks a re
77| 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 |
82| 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 |
78| Data layer | Hoon's nouns: units, treaps, loobeans | Decided |
83| 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` 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 |
84| 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 |
85+| `like` | The `(like A)` mold remains available; the value gate `like` maps the product of an existing `(like A)` with a gate `$-(A B)`, preserving the position and remaining input, and returns `(like B)` | Decided 2026-10-31 |
80| Wire format | Noun channels; Jibb's own noun codec in the browser | Decided 2026-10-29 |
86| Wire format | Noun channels; Jibb's own noun codec in the browser | Decided 2026-10-29 |
81| 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 |
87| 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 |
82| Private pages | Served by the host per request and never cached; non-owners go to the login page | Decided 2026-10-29 |
88| 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+15−13
@@ -91,7 +91,7 @@ Imports come first:
91/= card /ui/components/card :: a Jibb module
91/= card /ui/components/card :: a Jibb module
92```
92```
93
93
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.
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 callers need not write those details. API modules re-export their `/%` types, not `/-` faces or `/=` modules. Import cycles are errors.
95
95
96## Modules
96## Modules
97
97
@@ -102,7 +102,7 @@ A file is a module: imports, then definitions.
102- Molds and values have separate namespaces, told apart by position: `todo-action.todo` is a mold and its constructor, `todos.todo` a mold and a request.
102- Molds and values have separate namespaces, told apart by position: `todo-action.todo` is a mold and its constructor, `todos.todo` a mold and a request.
103- `main`'s type decides the kind: `(element !!)` a page; `(page R D)` a page with data, from parameters `R` to data `D`; `(program D X M)` an island, with data, model and messages; `(store S)` a store with state `S`. They're built by `(page load view)`, `(program init update view subs)` and `(store init update)`. A module without `main` is a library.
103- `main`'s type decides the kind: `(element !!)` a page; `(page R D)` a page with data, from parameters `R` to data `D`; `(program D X M)` an island, with data, model and messages; `(store S)` a store with state `S`. They're built by `(page load view)`, `(program init update view subs)` and `(store init update)`. A module without `main` is a library.
104- Everything is exported and read through the import's face, as `card.card`. The prelude keeps private helpers in a separate internal module; it imports them without exposing them.
104- Everything is exported and read through the import's face, as `card.card`. The prelude keeps private helpers in a separate internal module; it imports them without exposing them.
105−- An API module, `/ui/api/<agent>.jibb`, also exports derived gates: a constructor per `poke` type, adding the agent and mark, and a request per `paths` case, taking a reply over full state, plus a fold for `(facts full diff …)`. An island that watches a request whose case has a separate `scry=` path has a type error. A store's `+$ poke` is a declaration, not a mold; a store exports a constructor per `poke` type and a `state` request. Clashing derived names are errors, including a derived name that clashes with an import face.
105+- An API module, `/ui/api/<agent>.jibb`, also exports derived gates: a constructor per `poke` type, adding the agent and mark, and a request per `paths` case, taking a reply over full state, plus a fold for `(facts full diff …)`. An island may watch a request only when the checker proves it is watchable. A request whose case has a separate `scry=` path, or whose watchability cannot be proved, is a type error. A store's `+$ poke` is a declaration, not a mold; a store exports a constructor per `poke` type and a `state` request. Clashing derived names are errors, including a derived name that clashes with an import face.
106
106
107Names the host reads, by file:
107Names the host reads, by file:
108
108
@@ -118,28 +118,30 @@ Every other name is free.
118
118
119## Molds
119## Molds
120
120
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.
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. Records can also be projected explicitly, as described below.
122
122
123+- **Partial annotations**: `_` may appear wherever a mold may appear. It marks a part of the type for the checker to infer, so a type annotation can specify only the parts it needs to. A hole inferred to be a named type variable is resolved: in `++ id |= x=A ^- _ x`, the result hole is `A`. An unconstrained hole is an error. A named mold or value definition must determine its own holes: `+$ box [item=_]` and `++ id |= x=_ x` do not determine their holes, and later uses cannot fix them.
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.
124+- **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`. Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not. Comparison may take loobeans and returns `?`.
124- **Constants**: `%add`, `~` and the loobeans have one value each.
125- **Constants**: `%add`, `~` and the loobeans have one value each.
125−- **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.
126+- **Records and tuples**: `[text=@t done=?]`, `[@t ?]`. An empty `[]` is an error. Duplicate field names in a record are 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. The explicit type-directed operation `(proj record)` selects fields from its argument according to the expected result type: `^- [x=@ud y=@ud] (proj wider)`, or `(f (proj wider))` when `f` expects that record. The source is evaluated once, and the result contains exactly the fields in the expected layout. No projection is inserted for a direct call. `proj` is reserved: a module cannot define or import another name `proj`. A record too long for one line can leave its `[` open, with one field per deeper line, as an expression's bracket does.
126- **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.
127- **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.
127- **Containers**: `(list A)`, `(unit A)`, `(set A)`, `(map K V)`, `(mop K V)`, `(qeu A)`, `(jar K V)`, `(jug K V)`.
128- **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 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.
129- **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.
129−- **Paths**: `/todos` is constant, `/` empty, and `/todo/[id=@ud]` typed by aura. `%/blog/(slug)` is an `qath`, checked against routes and static files.
130+- **Paths**: `/todos` is constant, `/` empty, and `/todo/[id=@ud]` typed by aura. A typed segment may use `_` for an inferred aura; it still must resolve to an aura that the path rules can print and parse. `%/blog/(slug)` is an `qath`, checked against routes and static files.
130- **Generic molds**: `+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name.
131- **Generic molds**: `+$ result |$ [V E]` with cases below; `|$` goes only right after a `+$`'s name.
131- **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**: `!!`.
132- **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**: `!!`.
132−- **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`.
133+- **Pokes**: `poke` is defined in the source-backed private internal prelude module and re-exported by the public prelude as an ordinary transparent type. Ordinary modules can construct and inspect its values.
134+- **Effect and application-path types**: `poke`, `ask` and `qath` are transparent types, defined in the internal prelude and re-exported normally; callers can construct and inspect their values. Derived gates and `pure` also construct requests, and application-path literals have type `qath`. `(facts full diff …)` appears only in an API file's `paths`.
133- **Identity**: recursive molds go by name and module.
135- **Identity**: recursive molds go by name and module.
134
136
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.
137+`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`; an arithmetic atom constraint that excludes loobeans prints as `where A is an atom other than ?`. 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.
136
138
137## Tag resolution
139## Tag resolution
138
140
139A tag literal or `~` gets a fresh type variable and a pending constraint: the variable must become a union with a matching case, or an atom type the term fits. A mold that isn't a union counts as a union of one case, for tags and for `|=%tag`: `[%go "x"]` fits `+$ go [%go url=@t]`, and `|=%typed` works against `$-(@t M)` when `M` is `[%typed text=@t]`. Once unification fixes the variable, each constraint is checked against the union's cases or, for `@tas`, `@ta`, `@` or `*`, makes the tag that constant atom. A literal that matches nothing is an error naming the union, such as "msg has no case %submitt".
141A tag literal or `~` gets a fresh type variable and a pending constraint: the variable must become a union with a matching case, or an atom type the term fits. A mold that isn't a union counts as a union of one case, for tags and for `|=%tag`: `[%go "x"]` fits `+$ go [%go url=@t]`, and `|=%typed` works against `$-(@t M)` when `M` is `[%typed text=@t]`. Once unification fixes the variable, each constraint is checked against the union's cases or, for `@tas`, `@ta`, `@` or `*`, makes the tag that constant atom. A literal that matches nothing is an error naming the union, such as "msg has no case %submitt".
140
142
141- A constraint records the literal's shape, such as `[@t %draft]`, and matches cases by shape and shared tag positions; a literal in a field position is checked against that field.
143- A constraint records the literal's shape, such as `[@t %draft]`, and matches cases by shape and shared tag positions; a literal in a field position is checked against that field.
142−- `|=%typed` is a case's constructor: against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. It works for cases tagged at their head; a bare tag is always a value.
144+- `|=%typed` is a case's constructor: against `$-(@t M)` it is `|=(t [%typed t])`, requiring `M` to have a case `[%typed @t]`. It works for cases whose head is a literal with the same noun as the tag, regardless of how that literal is written: `|=%$` also constructs a case headed by `%.y` or `~`, since each is the noun 0. A bare tag is always a value.
143- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages, so islands resolve their own tags. The inferred gate-free constraint is retained when a type variable is generalized.
145- A variable constrained by tag resolution, and any it mentions, doesn't generalize; it stays open until something in the module fixes it. An island's `main` fixes its messages, so islands resolve their own tags. The inferred gate-free constraint is retained when a type variable is generalized.
144- A constraint still open when its module is checked is an error asking for a `^-`; the checker never guesses. Library helpers can cast, as in `^- (list attr)`.
146- A constraint still open when its module is checked is an error asking for a `^-`; the checker never guesses. Library helpers can cast, as in `^- (list attr)`.
145- Wing access, changes and `?-` on a type not yet known wait the same way.
147- Wing access, changes and `?-` on a type not yet known wait the same way.
@@ -210,7 +212,7 @@ Tags can sit anywhere in a case, and a case can carry several:
210 [%move %left n] "left {n}"
212 [%move %left n] "left {n}"
211 [%move %right n] "right {n}"
213 [%move %right n] "right {n}"
212 [t %draft] t
214 [t %draft] t
213− [t %sent at] t
215+ [t %sent sent-at] t
214 %stop "stop"
216 %stop "stop"
215```
217```
216
218
@@ -260,7 +262,7 @@ rune = "|=" field ( expr | body )
260 | "?-" expr INDENT arm { NEWLINE arm } DEDENT ;
262 | "?-" expr INDENT arm { NEWLINE arm } DEDENT ;
261arm = pattern ( expr | body ) ; (* every case covered; see Patterns *)
263arm = pattern ( expr | body ) ; (* every case covered; see Patterns *)
262
264
263−mold = aura | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
265+mold = aura | "_" | "*" | "!!" | "?" | "~" | term | loobean | ref | typevar
264 | pathmold
266 | pathmold
265 | "(" ref mold { mold } ")" | "(" ref { mold } mlines
267 | "(" ref mold { mold } ")" | "(" ref { mold } mlines
266 | "[" field { field } "]" | "[" { field } flines
268 | "[" field { field } "]" | "[" { field } flines
@@ -269,7 +271,7 @@ field = [ name "=" ] mold | "=" name ; (* =msg is msg=msg *)
269mlines = INDENT mold { NEWLINE mold } DEDENT ; (* a mold's ( left open *)
271mlines = INDENT mold { NEWLINE mold } DEDENT ; (* a mold's ( left open *)
270flines = INDENT field { NEWLINE field } DEDENT ; (* a mold's [ left open *)
272flines = INDENT field { NEWLINE field } DEDENT ; (* a mold's [ left open *)
271pathmold = "/" [ segment { "/" segment } ] ;
273pathmold = "/" [ segment { "/" segment } ] ;
272−segment = knot | "[" name "=" aura "]" ;
274+segment = knot | "[" name "=" ( aura | "_" ) "]" ;
273
275
274pattern = term | number | string | ship | loobean | "~" | "*" | name
276pattern = term | number | string | ship | loobean | "~" | "*" | name
275 | "[" pattern { pattern } "]" ;
277 | "[" pattern { pattern } "]" ;
@@ -339,4 +341,4 @@ knot = { lower | digit | "-" | "." | "~" | "_" } ;
339 button "Add" %add
341 button "Add" %add
340```
342```
341
343
342−A store is written like an API file: `state`, `+$ poke` and `(store init update)`. Islands poke it with derived constructors and watch it with `(state.cart |=%got)`, whose first fact is the current state and each later fact the next. It runs in the browser, shared by the page's islands.
344+A store is written like an API file: `state`, `+$ poke` and `(store init update)`. Islands can poke it with derived constructors and watch it with `(state.cart |=%got)`, whose first fact is the current state and each later fact the next. It runs in the browser, shared by the page's islands.
docs/spec/overview.md+5−3
@@ -78,7 +78,7 @@ Unused molds are skipped, so unsupported constructs elsewhere in a `/sur` file a
78
78
79## Prelude
79## Prelude
80
80
81−Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/prelude`; an island's bundle carries only what it uses. The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out. Jetted prelude 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 (Core language). Private helpers and low-level primitives live in a separate internal prelude module, imported without exposing them; foundational public gates are implemented in Jibb on top of those primitives. The prelude also holds `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, and the layout elements and molds.
81+Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/prelude`; an island's bundle carries only what it uses. The exported inventory includes all names from the Hoon library sections listed below, excluding the groups explicitly left out. Jetted prelude 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 (Core language). Private helpers and low-level primitives live in a separate internal prelude module, imported without exposing them; foundational public gates are implemented in Jibb on top of those primitives. This source-backed internal module defines `poke`; the public prelude re-exports it as an ordinary transparent type, so ordinary modules can construct and inspect its values. The prelude also holds `eq`, `not`, `page`, `program`, `store`, `pure`, `island`, and the layout elements and molds.
82
82
83| Group | Hoon | Jibb |
83| Group | Hoon | Jibb |
84| --- | --- | --- |
84| --- | --- | --- |
@@ -97,6 +97,8 @@ Hoon's standard library regrouped, written in Jibb and vendored as `/lib/jibb/pr
97| Parsers | [4d](https://docs.urbit.org/hoon/stdlib/4d)–[4i](https://docs.urbit.org/hoon/stdlib/4i), parser helpers in 4j and 4l | Left out, except the explicitly listed `slav` and `slaw` |
97| Parsers | [4d](https://docs.urbit.org/hoon/stdlib/4d)–[4i](https://docs.urbit.org/hoon/stdlib/4i), parser helpers in 4j and 4l | Left out, except the explicitly listed `slav` and `slaw` |
98| The rest | [1b](https://docs.urbit.org/hoon/stdlib/1b), [2p](https://docs.urbit.org/hoon/stdlib/2p), [3d](https://docs.urbit.org/hoon/stdlib/3d), [3f](https://docs.urbit.org/hoon/stdlib/3f), [4c](https://docs.urbit.org/hoon/stdlib/4c), [4n](https://docs.urbit.org/hoon/stdlib/4n), [4o](https://docs.urbit.org/hoon/stdlib/4o), [5a](https://docs.urbit.org/hoon/stdlib/5a)–[5f](https://docs.urbit.org/hoon/stdlib/5f) | Left out; `jam`, `cue` and `fein` run inside the runtime |
98| The rest | [1b](https://docs.urbit.org/hoon/stdlib/1b), [2p](https://docs.urbit.org/hoon/stdlib/2p), [3d](https://docs.urbit.org/hoon/stdlib/3d), [3f](https://docs.urbit.org/hoon/stdlib/3f), [4c](https://docs.urbit.org/hoon/stdlib/4c), [4n](https://docs.urbit.org/hoon/stdlib/4n), [4o](https://docs.urbit.org/hoon/stdlib/4o), [5a](https://docs.urbit.org/hoon/stdlib/5a)–[5f](https://docs.urbit.org/hoon/stdlib/5f) | Left out; `jam`, `cue` and `fein` run inside the runtime |
99
99
100+The prelude's `(like A)` mold describes a result with a product of type `A`. Its value gate `(like convert result)` maps a present product with `convert=$-(A B)` and returns `(like B)`, preserving the position and remaining input; an absent result stays absent.
101+
100Maps are Hoon's trees on both sides, so equal maps are equal nouns. Requests check incoming maps and sets with `apt`.
102Maps are Hoon's trees on both sides, so equal maps are equal nouns. Requests check incoming maps and sets with `apt`.
101
103
102## The Elm architecture on Urbit
104## The Elm architecture on Urbit
@@ -150,9 +152,9 @@ Loads and renders run in Nock.
150 [%url reply=$-(path M)]
152 [%url reply=$-(path M)]
151```
153```
152
154
153−- `poke` and `ask` are opaque, built only by derived gates and `pure`. A constructor such as `(todo-action.todo [%add draft.m])` checks its value and supplies the agent and mark, so one island can poke several agents. The agent's mark rechecks on the ship; a nack's `tang` reaches the reply as text. Store constructors poke the store in the browser.
155+- `poke`, `ask` and `qath` are transparent types defined in the internal prelude and re-exported normally. Derived gates and `pure` also construct requests. A derived poke constructor such as `(todo-action.todo [%add draft.m])` checks its value and supplies the agent and mark, so one island can poke several agents. The agent's mark rechecks on the ship; a nack's `tang` reaches the reply as text. Store constructors poke the store in the browser.
154- A request such as `(todos.todo |=%got)` comes from a declared path or a store's `state`; its reply always gets full state. A path with diffs also takes a fold, `(changes.todo |=%got apply)`, which the runtime applies first. Facts are checked; a bad one crashes the reply, which counts as a crashed `update`.
156- A request such as `(todos.todo |=%got)` comes from a declared path or a store's `state`; its reply always gets full state. A path with diffs also takes a fold, `(changes.todo |=%got apply)`, which the runtime applies first. Facts are checked; a bad one crashes the reply, which counts as a crashed `update`.
155−- Islands read agents only by watching. A watch's first fact must be full state, so watching a request whose path case has a separate `scry=` path is a type error in an island. The runtime acks facts, rewatches after a kick or a dropped connection and reseeds from the first fact; a refused watch shows the crash notice.
157+- Islands read agents only by watching. A watch's first fact must be full state, so watching a request whose path case has a separate `scry=` path is a type error in an island. The checker must prove a request is watchable; unknown watchability is also a type error. The runtime acks facts, rewatches after a kick or a dropped connection and reseeds from the first fact; a refused watch shows the crash notice.
156- Watches match by agent and path, timers by gap, and the newest reply is always used. After each `update`, `subs` is diffed to start and stop watches and timers. `%now` and `%every` give the time, `%who` the owner's `@p` from `/~/name`; `%wait` is a one-shot delay.
158- Watches match by agent and path, timers by gap, and the newest reply is always used. After each `update`, `subs` is diffed to start and stop watches and timers. `%now` and `%every` give the time, `%who` the owner's `@p` from `/~/name`; `%wait` is a one-shot delay.
157
159
158Inputs send a message per `input` event, and one per IME composition, so validation runs as you type; only commands reach the ship. After every event, controls reset to the latest view, so a toggle whose poke fails unchecks. A field's text is rewritten only when it differs, which keeps the caret. Fields are read-only until their island starts.
160Inputs send a message per `input` event, and one per IME composition, so validation runs as you type; only commands reach the ship. After every event, controls reset to the latest view, so a toggle whose poke fails unchecks. A field's text is rewritten only when it differs, which keeps the caret. Fields are read-only until their island starts.
docs/status.md+141−8
@@ -19,9 +19,59 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
19
19
20## Milestone 2: in progress
20## Milestone 2: in progress
21
21
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. 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 zero nested inside a single tuple argument where a list is expected remains unsupported rather than a definite mismatch. 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.
22+The parser accepts `_` in mold positions and typed path segments, retaining each hole’s span. The partial checker tracks ordinary annotation holes through inference and requires each value or local definition to resolve its own holes before generalization. A hole can resolve to a concrete type or an explicitly written in-scope type variable; later uses cannot fix an unresolved definition. Independent decimal holes can default, but captured variables are not defaulted prematurely. Structural named molds with an unresolved hole report its site. Complex mold forms, inferred path segments, mutual recursive groups and other unsupported constraints still fail closed, and the fragment does not claim the module is checked. A syntax-tree pass rejects duplicate field names within each written record and reports both sites. The repository spec now records that `ask` and `qath` are transparent; complete request checking remains outstanding.
23
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.
24+On 2026-10-31, @iko chose explicit, result-directed `(proj record)` to construct a record with exactly the expected fields, and reserved `proj` against definitions and imports. The partial checker handles selected explicit calls with known, closed record types, records field-selection evidence for later lowering, and reserves the name across source bindings. Reordered fields, some nested contexts and several open or recursive cases remain unsupported; lowering and execution are not implemented yet. The field-order question remains open.
25+
26+The internal prelude also defines `qath` as a transparent recursive knot sequence, re-exported by the public prelude. The partial checker recognizes its source identity, supports selected null/cell construction and matching, and types static application-path literals. Construction and matching for other recursive shapes, broader patterns and dynamic application-path segments remain unsupported. A 256-step limit applies per inference attempt, not to parsing or retries; checking routes and static files remains milestone 4.
27+
28+The checker also recognizes a limited source-proven generic recursive tree in an import-free defining module. Its nominal identity retains the defining path, mold name and type arguments, including across supported imports and aliases. With a known expected type it can construct supported tagged cases by checking one source-proven layer at a time. Flat matches with explicit tags or nonbinding catch-alls also work for these source-proven trees, as does a missing-case diagnostic for a supported single-arm match. At most 128 arms are screened per attempt; whole-case binders and nested patterns remain unsupported. Broader pattern matching, general structural fits and gate-free proof remain unsupported; this is not yet the prelude's `element` implementation or island checking. The source index uses fixed-shape checks during mold collection. Each construction or supported pattern attempt has 256 unfolding steps and at most 4,096 face and substitution visits per scan; pattern subject recognition and view validation can each scan separately. Parsing, other inference and retries remain outside those limits. A single startup-inclusive comparison of 1,000 ordinary gates produced identical reports and used 29.12 seconds of user CPU before the shared-resolver refactor and 28.55 seconds after it, with other work running; it is not a general performance bound.
29+
30+A bounded local source proof recognizes a narrow class of generic-alias union cases with different literal heads, then applies the ordinary mold checks. Nested or qualified aliases and several open states remain unsupported, including a valid alias used during the deferred transaction; the partial report states that the mold itself has not been checked. `tools/type-union-source-test` exercises the source and state bounds and failure paths under eval and on the ship. A separate bounded witness now reports proven collisions between supported literal-headed aliases, with both original case sites; unknown payload intersections still decline. The detailed full-module result now carries the first failed mold’s source-bound overlap evidence, including through ordinary Jibb imports; the legacy text result renders both case excerpts. Specialized API and prelude paths remain limited. The shared guards pass under eval and on the ship.
31+
32+The checker can experimentally discharge a narrowly scoped direct-constructor constraint while resolving an import-free library without a prepared prelude. It preserves independent generalized schemes and publishes only after all source molds, values, and recorded constraints close. API/store paths, `main`, imports, prepared preludes, recursive groups, open constraints, projection actions, and `%grec` in the constraint graph remain unsupported by this route. The fallback also declines source shapes outside its bounded direct-call screen. It does not yet typecheck the unchanged todo island or establish watchability.
33+
34+Closed cell context can now flow through a bounded loobean branch while preserving the inferred value faces and original failed-inference behavior. Open or structurally uncertain substitutions and nested retry shapes remain unsupported. This does not by itself provide the missing text and UI prelude definitions, cross-definition context, island-kind checks, or watchability evidence needed by the unchanged todo island.
35+
36+The internal prelude defines a transparent generic `ask` with pure, agent and store cases, re-exported alongside the Jibb-written `pure` gate. The partial checker infers supported constructors and exhaustive matches. Agent and store receivers operate on raw nouns; their fields do not prove schema validity or watchability. The public prelude now defines the documented source-backed `sub` union; supported `%watch` payloads retain the public `(ask M)` type. Constructing a `sub` does not prove that its request is watchable. Request lowering, checked decoding, runtime validation and island watch checking remain unimplemented.
37+
38+Known same-origin generic-union result context can now constrain a call before its arguments are inferred. An unresolved or opaque constructor target stays unsupported rather than producing a definite mismatch; proven missing tags still report errors. A todo request with explicit `(ask msg)` context can infer `|=%got`; its uncontextualized form remains unsupported. A two-item literal-headed tuple can receive payload context from a known union of uniquely headed literal cells when its payload is a shallow wing-headed call with literal, wing or constructor arguments. Existing inference takes precedence when it fits; otherwise the checker tries the contextual path once. It conservatively declines that path when any substitution has a structural root, as well as for duplicate or opaque competitors. The guard scans substitutions per eligible tuple and may add one shallow inference; no global linear-time bound is claimed. This allows an explicitly typed todo subscription body to infer, but does not check the island or prove request watchability.
39+
40+A separate source-backed analysis can prove one named mold gate-free, report a definite gate with a field path, or return unknown. It retains the prepared prelude, source bundle, reader results and resolved imports; the actual todo model proves gate-free, while a callback field reports its path and `*` remains unknown. Its classifier is capped at 256 nodes, not the surrounding parse and import work. API, store and private roots are unsupported, and the artifact does not check a module or island, infer generalized constraints, or prove watchability.
41+
42+The partial checker can also match a directly named, checked root gate against a generic gate sample in a direct, unshadowed source-backed prelude call. It uses the written two-slot sample layouts to preserve nested record faces, then requires the complete call samples to be closed and tag-free and repeats the fit under the final substitution. The proof falls back to existing inference for unavailable or ambiguous source layouts, local or dynamic gates, aliases, recursive placeholders and open generic caller types. It preserves written-capital checks and projection evidence; it does not add `program`, check islands or prove request watchability. Prepared prelude source and interface remain a trusted pair.
43+
44+The API path analyzer can retain its source, complete prepared prelude, reader results and resolved dependencies as evidence, and classify a unique declaration as watchable, not watchable or unknown. It does not yet prove the provenance of request values or check island subscriptions. Prepared artifacts and reader results remain trusted host inputs.
45+
46+For a unique supported path declaration, the request-parts analysis derives ordered typed path parameters, a full-state reply sample and a fold type for one diff mark. Multiple diffs and unsupported or ambiguous evidence fail closed. By itself it does not create request gates or establish watchability of values.
47+
48+A separate supporting-definition analysis infers supported ordinary API molds and values and resolves all declared marks, retaining their source and dependency evidence. It fails closed on unsupported helpers or marks; unused `/-` cores are not independently validated, and definitions depending on derived gates remain unsupported. This does not check or export the whole API.
49+
50+Ordinary imports can infer derived request-gate types for multiple supported API paths. A case may take one typed segment before the reply or one diff fold after it; the unchanged todo API's plain, typed and diff requests infer, including a named closed fold. Checked ordinary API definitions, mark molds and a supported poke constructor are exported. Each `/sur` core must have a directly used, successfully read mold; unselected bindings are not independently validated. Jibb module imports, scry paths, multiple parameters or diffs and a parameter together with a fold remain unsupported. Source-qualified request evidence and exact trusted graph inputs survive transitive imports and cached interfaces, while stale or ambiguous evidence fails closed. This is a type-only interface: request execution, schema validation and proof that a request value is watchable remain unimplemented. In one loaded-machine run, the real-todo eval took 195.83 s wall and 67.83 s user CPU; the prior prototype took 111.81 s wall and 64.60 s user. Both include Hoon compilation and reader setup and overlapped other work, so they are not isolated checker benchmarks.
51+
52+The Hoon reader's tagged-union source proof also handles `$~` default wrappers. A shared eval and ship golden exercises the unmodified Tlon `epic.saga` mold as a named payload in a labeled downstream extension, alongside overlap, recursive, shadow and malformed-wrapper controls. The tagged-source helper peels at most four consecutive defaults; defaults inside dependency proofs spend the existing semantic-node budget. Other unverified nested unions and dependencies remain unsupported.
53+
54+The repository spec records the subsequent type-system and prelude decisions, including the chosen `like` result-mapping gate; 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 Hoon `*` in supported nonrecursive molds, selected Hoon atoms, term singletons, the null singleton, the two loobean singletons and their exact fork, 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, including Tlon `notes.import-node` with list-wrapped self references, cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, including a source-proved nonrecursive union from a single Ford-imported `/sur` core, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, including source-validated named operands such as Tlon `notes.log`, 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. Tagged `$%` cases can additionally use restricted local named payload molds, bare `~` fields and one level of local named tagged unions, as in real Tlon `notes`, with bounded source proof; unsupported or ambiguous dependencies fail closed. 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, detects missing sources and cycles, and resolves nested fields of imported values with independent scheme instantiation. The source-backed internal prelude defines `poke` and the public prelude re-exports it as a transparent type. A dedicated trusted preparation path supplies private comparison and arithmetic schemes to the Jibb-written `gth`, `add` and `dec` wrappers; ordinary imports cannot access them. The public `add` and `dec` wrappers use private arithmetic interfaces; supported inference preserves the shared atom constraint that excludes loobeans. Primitive execution, jet recognition and length remain unfinished. The partial checker resolves its supported source shape and rejects ordinary imports of the private path. An imported API with one mark and a matching direct `+$ poke` declaration can export a constructor and retain agent/mark metadata when the representation has the supported agent case. A separate partial analysis resolves supported API path declarations and their full and diff mark types, including the todo paths; it does not by itself create requests or check an API module. Ordinary imports additionally infer the supported multi-path request-gate types described above. Complete private module checking, other API shapes, request lowering, root API and kind checking, stores, complete `ask` and `pure` checking and runtime effects remain unfinished. A possible store or root API with `+$ poke` reports unsupported kind or scope, while definite duplicates and unrelated shadowing still report conflicts. The prelude includes the doc-exact generic `cmd` union; 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. Known loobean result context also propagates through supported complete branches and binder-only cell arms; binder-only arms over union subjects remain unsupported. A directly known named union can instantiate an unconstrained generic gate sample with its origin, generic arguments and faces preserved; unnamed, pending, recursive and variable-bound cases remain unsupported. A known gate with an unresolved result variable can receive a known enclosing result type before its arguments are inferred; unknown calls and unresolved targets remain conservative. 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. Supported local mutually recursive gate groups also use shared monomorphic placeholders and generalize only after the group checks, preserving captured outer variables. A bounded dependency proof reports certain non-gate cycles through values and gates when an explicit atom or loobean result cast and simple unshadowed expressions establish the cycle. Other mixed gate/value cycles, polymorphic recursion, 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. A single-arm cell pattern accepts two or more binders, the last capturing the remaining tail; duplicate and shadowed binders are rejected. A structured single-arm pattern also works for a known non-union cell when coverage is proven, including nested literal and wildcard positions. Intermediate union or collection tails, nested patterns, wildcards and faced records remain unsupported. 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 and some complex two-arm subjects remain unsupported. A cast or known call sample can supply result context through whole-case arms and supported finite loobean refinements for a known union accessed by a wing, a grouped wing or a supported shallow call, including nested cell and list positions; other partial-pattern contexts and subject forms 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. Ordered fit replay can identify a missing tag nested in a syntactic tuple, stopping at an earlier mismatch or uncertainty. 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. Isolated cart-style `init` and `update` expressions infer, while the complete cart-store fails closed because its kind and declaration scope remain unchecked. Uncontextualized list literals infer a fresh element type, including empty and nested lists, with independently generalized uses. Unresolved item tags and uncertain widening remain unsupported. 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`, `clap`, `clef` 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. Literal singleton heads compare by runtime noun, so `|=%$` also matches explicit null- and loobean-zero-headed cases. When equal heads have disjoint payloads, the constructor selects a uniquely proven compatible payload; unknown and ambiguous candidates remain unsupported. 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. 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; 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 agreed shared-type `clap`; supported calls infer, while backend validation remains outstanding, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
55+
56+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`, `bond`, `lure`, `weld`, `snoc`, `turn` and `lent`. 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. The same validated template is available when prelude mold aliases are prepared, so supported direct and transitive aliases can use it. 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. The source-only `+prepare-prelude` rejects empty, malformed, conflicting or import-bearing source; `+prepare-prelude-with-internal` also accepts the supported private internal import. Prepared values are trusted and must come unchanged from the matching preparation arm. When canonical public list or unit templates are missing or altered, independently inferred private molds remain available, while molds that depend on those templates do not. 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.
57+
58+The prelude has a Jibb-written `succ` gate that increments through `add`; partial inference retains its arithmetic atom constraint. A Hoon translation agrees with Hoon on ten selected inputs. Jibb execution and jet recognition remain unverified.
59+
60+The prelude has Jibb-written curried `lead` and `late` pair constructors, inferred with independent argument types including gate values. Their focused golden passes under eval and on the ship, and a Hoon-reference comparison covers operand order. Jibb backend execution remains unverified.
61+
62+The prelude also has a Jibb-written `zing` that concatenates homogeneous lists via `weld`. Its focused golden infers empty, nested text, ship, generic and gate-element lists and reports a non-list error; the same golden passes on the ship. A Hoon translation agrees with Hoon `zing` on selected finite inputs, not on Jibb execution. Hoon’s raw helper additionally accepts heterogeneous noun lists, which the Jibb signature does not express. Backend lowering and jet recognition remain unverified.
63+
64+The experimental deferred constructor transaction conservatively declines tuples, most branches, field reads, nonidentical successful call/cast fits, and multi-argument calls with open argument, sample or result types. This prevents a later substitution from invalidating an earlier face-propagation check; cases requiring deferred structural fits remain unsupported. It can retry source definitions after later dependencies become available, and a two-arm boolean branch can retain separately owned literal-result obligations until a later closed context resolves them. Faced targets or union cases, list literals and general union-pattern branches remain unsupported.
65+
66+The checked inference slice now represents `!!`, proves empty cell positions and filters proven-empty union cases. List and unit payload arms whose elements are empty are rejected as unreachable; fixed opaque cases fail closed when reachability is unknown. The new shared guard covers checked interfaces, partial diagnostics and proof budgets. Its shared guard runs under eval and on the ship.
67+
68+An eval and ship fixture now reports partial inference for the unchanged todo island with its real API and Hoon readers. It verifies that the source fixtures match `my-app` and exercises missing or duplicate imports; the report does not claim the module or island has been checked. The prelude also has a Jibb-written recursive `lent` whose supported generic calls infer `@ud`. Execution and shape-based jet recognition remain future backend work. Nested union tests check equal runtime nouns, different nested tags, empty fields and unknown inhabitation.
69+
70+The prelude now writes `lth`, `gte` and `lte` in Jibb using `gth` and `not`. Supported generic and concrete calls infer, including loobeans; mismatched explicit auras fail. Execution, jet recognition and complete import checking remain unfinished.
71+
72+The Hoon reader can prove overlaps among supported original `$?` source cases, including nested cells and unions with more than two cases, and report them at a Jibb use site. It evaluates each case independently and compares runtime noun values. Other overlaps, Hoon case locations and mark-reader overlap diagnostics remain unfinished. The source screen allows at most 128 cases and 4,096 source noun nodes; dependency checking and pairwise witness analysis each have a separate 4,096-node budget. These budgets do not bound chapter lookup, Hoon evaluation or graph walks.
73+
74+Restricted-number promotion now skips an environment scan when a definition has no written capitals. In a single startup-inclusive pair on 2,000 independent gates, output was identical and user CPU fell from 71.67 to 38.26 seconds; wall time was 72.80 versus 51.66 seconds with other checks running. This is a partial-inference measurement, not a complete checker or a bound on dependent modules.
25
75
26## Milestone 1: parser and mark
76## Milestone 1: parser and mark
27
77
@@ -39,9 +89,9 @@ What the plan asks for, and where it is:
39
89
40Besides the plan's list:
90Besides the plan's list:
41
91
42−- 529 golden cases: 313 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.
92+- 658 golden cases: 438 that parse and 220 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 529-case corpus passed under `urbit eval` in 64.5 s. The fake ship passed all 535 tests, including the importer, importer/checker and mark/checker bridges, module scope and unification checks, with 33.2 s for sync and 37.6 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.
93+- The 658-case corpus passed under `urbit eval` in 116.7 s while other checks were running. The fake ship passed all 704 tests, including the source-overlap, structural-overlap, generic-union source and alias-overlap, full-module overlap, deferred-context, generic-recursion, generic-construction, generic-pattern, deferred-inference, empty-mold and cell-branch fixtures, importer, importer/checker and mark/checker bridges, module scope, unification, hole, qath, ask, default-wrapper importer, projection, arithmetic, generic-alias, positional-face, API-evidence, request, closed-gate, todo API, constructor, sub, nested-union, gate-free and direct-gate guards and the unchanged todo report. Desk sync took 107.6 s while other checks were running. The importer golden compares 221 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.
94+- `tools/testdata/selftest` (22 checks), `tools/testdata/ship-selftest` and `tools/testdata/clay-fixtures-selftest` test the tools themselves; the last checks temporary Clay fixture cleanup and signal handling without a ship.
45- 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.
95- 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.
46- 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).
96- 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).
47
97
@@ -95,25 +145,108 @@ Besides the plan's list:
95| 98c19cd | 2026-10-30 | Infer known-aura string interpolation |
145| 98c19cd | 2026-10-30 | Infer known-aura string interpolation |
96| ddba633 | 2026-10-30 | Infer top-level mutually recursive gates |
146| ddba633 | 2026-10-30 | Infer top-level mutually recursive gates |
97| 9f1517e | 2026-10-30 | Infer whole-case union patterns and prelude `turn` |
147| 9f1517e | 2026-10-30 | Infer whole-case union patterns and prelude `turn` |
98−| This change | 2026-10-31 | Match finite boolean refinements of union cases |
148+| 9dd35c8 | 2026-10-31 | Match finite boolean refinements of union cases |
149+| 54852d4 | 2026-10-31 | Contextualize tuple calls and infer known record changes |
150+| 0bc5113 | 2026-10-31 | Contextualize record initializers and infer unit construction |
151+| 264a436 | 2026-10-31 | Contextualize unit payloads in casts, calls and nested values |
152+| a140383 | 2026-10-31 | Report missing union tags and infer prelude unit helpers |
153+| d69cc52 | 2026-10-31 | Infer longer cell binder patterns and prelude unit helpers |
154+| ae35005 | 2026-10-31 | Import source-verified tagged Hoon unions |
155+| c8f894a | 2026-10-31 | Report nested missing tags and contextualize union branch results |
156+| ef2ea71 | 2026-10-31 | Import Hoon null singleton cases |
157+| 67f900e | 2026-10-31 | Infer local mutual gates and uncontextualized lists |
158+| 7ff15f1 | 2026-10-31 | Contextualize finite union patterns and record the initial poke decision |
159+| c790a9f | 2026-10-31 | Expose transparent `poke` from the internal prelude |
160+| ef4772a | 2026-10-31 | Bridge imported loobeans and loobean singletons |
161+| ad46655 | 2026-10-31 | Bridge selected imported any-noun molds |
162+| beada10 | 2026-10-31 | Import source-proved Ford mark unions, analyze API paths and infer list helpers |
163+| e28f7be | 2026-10-31 | Diagnose proven non-gate cycles and import Tlon null-payload union cases |
164+| fd2f288 | 2026-10-31 | Infer qualified fields of imported values |
165+| ed9291e | 2026-10-31 | Infer term-headed pairs and function helpers, and import nested named unions |
166+| ad0265e | 2026-10-31 | Infer proven single-case patterns and the prelude command union |
167+| 413b12b | 2026-10-31 | Propagate known result context into generic calls and batch ship deletions |
168+| c690076 | 2026-10-31 | Propagate loobean context, infer predicate helpers, and import named ordered-map operands |
169+| 0bf6178 | 2026-10-31 | Bridge recursive Tlon lists and prepare a private comparison interface |
170+| 4e472b5 | 2026-10-31 | Pass known named unions through polymorphic gates |
171+| e3e184f | 2026-10-31 | Parse type holes, reject duplicate written record fields, and extend partial union inference and imports |
172+| 80e221a | 2026-10-31 | Infer supported annotation holes and prelude list aliases |
173+| ba1fec4 | 2026-10-31 | Add the curried `bond` prelude gate |
174+| 0ea700d | 2026-10-31 | Infer a source-defined recursive `qath` subset and record the explicit `proj` decision |
175+| 75f5952 | 2026-10-31 | Check a subset of explicit `proj` calls and retain their lowering evidence |
176+| cf17925 | 2026-10-31 | Infer supported single-field projections |
177+| 1a891e2 | 2026-10-31 | Infer source-backed addition and decrement without loobean operands; record the watchability decision |
178+| 81af5fd | 2026-10-31 | Preserve public names of identity-generic union aliases and record the `like` decision |
179+| 640a442 | 2026-10-31 | Add the source-backed `like` result mapper and infer supported positional calls |
180+| 445a0a1 | 2026-10-31 | Retain source-backed API path evidence and classify declarations |
181+| f69493d | 2026-10-31 | Derive supported request components from API declarations |
182+| f0f6954 | 2026-10-31 | Analyze supported API helper definitions and declared marks |
183+| 3f55af7 | 2026-10-31 | Define source-backed transparent ask and pure |
184+| ae1ec26 | 2026-10-31 | Prove selected default-wrapped Hoon unions from source |
185+| dde791c | 2026-10-31 | Infer a source-backed request-gate type through ordinary imports |
186+| a1c5f35 | 2026-10-31 | Infer supported multi-path requests and named closed folds |
187+| 911ca0c | 2026-10-31 | Propagate union context, define subscriptions and match literal nouns |
188+| 72acdb3 | 2026-10-31 | Infer selected nested union payloads from context |
189+| 706035c | 2026-10-31 | Analyze gate-free source molds with field witnesses |
190+| 651b8ec | 2026-10-31 | Match source-proven gate samples in direct calls |
191+| cc8e389 | 2026-10-31 | Add source-backed list length and real todo regression |
192+| 4da6891 | 2026-10-31 | Add source-backed comparisons and nested Hoon union controls |
193+| 09db390 | 2026-10-31 | Skip unnecessary inference environment scans |
194+| 179d717 | 2026-10-31 | Diagnose source-proven Hoon union overlaps |
195+| 142f2e2 | 2026-10-31 | Prove structural overlaps across Hoon union cases |
196+| c96597d | 2026-10-31 | Track source-proven generic recursive identities |
197+| 190a9d5 | 2026-10-31 | Add source-backed list flattening |
198+| d9d51e6 | 2026-10-31 | Check source-proven recursive tree construction |
199+| 30b0a9e | 2026-10-31 | Match source-proven recursive tree cases |
200+| 72d85ab | 2026-10-31 | Add bounded deferred inference and expand runtime equality coverage |
201+| 22f3788 | 2026-10-31 | Check empty molds and propagate closed cell context into branches |
202+| 341bcb4 | 2026-10-31 | Keep deferred fits stable under later substitutions |
203+| b93a94b | 2026-10-31 | Prove local generic-alias union tags and add successor |
204+| 2826c93 | 2026-10-31 | Report generic-alias overlaps and retain deferred branch contexts |
205+| This change | 2026-10-31 | Preserve full-module overlap source evidence |
99
206
100## Checking it
207## Checking it
101
208
102On a machine set up as [development.md](development.md) says:
209On a machine set up as [development.md](development.md) says:
103
210
104```
211```
105−tools/golden # 529 cases under urbit eval
212+tools/golden # 658 cases under urbit eval
106tools/importer-test # the Hoon importer fixture projection
213tools/importer-test # the Hoon importer fixture projection
214+tools/type-import-default-test # default-wrapped source proof golden
107tools/type-import-test # the importer/checker bridge fixture
215tools/type-import-test # the importer/checker bridge fixture
216+tools/type-import-overlap-test # source-aware Hoon overlap and provenance fixture
217+tools/type-import-structural-test # structural overlap and multi-case source fixture
218+tools/type-union-source-test # local generic-alias union guards
219+tools/type-union-alias-overlap-test # local generic-alias overlap diagnostics
220+tools/type-full-overlap-test # full-module overlap evidence
221+tools/type-tlon-test # the real Tlon reader/checker fixture
108tools/type-mark-test # the mark/checker bridge fixture
222tools/type-mark-test # the mark/checker bridge fixture
223+tools/type-poke-test # the source-backed poke/API fixture
224+tools/type-api-evidence-test # API declaration evidence guards
225+tools/type-api-paths-test # partial API path metadata fixture
226+tools/type-hole-guards-test # hole defaulting and API interface guards
227+tools/type-list-alias-test # prelude list-alias guards
228+tools/type-generic-alias-test # generic union alias guards
229+tools/type-generic-recursion-test # source-proven generic recursion guards
230+tools/type-generic-construction-test # source-proven recursive construction guards
231+tools/type-generic-pattern-test # source-proven recursive pattern guards
232+tools/type-deferred-test # source-owned deferred inference guards
233+tools/type-deferred-resolver-test # resolver consistency and failure guards
234+tools/type-deferred-context-test # deferred source-order and branch guards
235+tools/type-empty-test # empty molds and coverage guards
236+tools/type-cell-branch-test # branch context and rollback guards
237+tools/type-positional-face-guards-test # positional sample face guards
238+tools/type-qath-guards-test # qath source and unfolding guards
239+tools/type-ask-guards-test # ask source and bootstrap guards
240+tools/type-proj-guards-test # projection evidence and scope guards
109tools/type-module-scope-test # module and prelude scope fixture
241tools/type-module-scope-test # module and prelude scope fixture
110tools/hoon check-spans-test # prints <<>> when the span checker works
242tools/hoon check-spans-test # prints <<>> when the span checker works
111tools/testdata/selftest # the tools themselves
243tools/testdata/selftest # the tools themselves
112tools/doc-blocks docs/spec # the doc's examples are golden cases
244tools/doc-blocks docs/spec # the doc's examples are golden cases
113tools/ship start
245tools/ship start
114tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
246tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
115−tools/ship test # the same 529 cases as -test arms on the ship
247+tools/ship test # the same 658 cases as -test arms on the ship
116tools/testdata/ship-selftest
248tools/testdata/ship-selftest
249+tools/testdata/clay-fixtures-selftest # scratch fixture cleanup without a ship
117tools/ship check-commit # |commit stores .jibb files
250tools/ship check-commit # |commit stores .jibb files
118tools/clay-fixtures # example /sur files and marks build through Clay
251tools/clay-fixtures # example /sur files and marks build through Clay
119```
252```
jibb-dev/lib/jibb-import.hoon+791−21
@@ -8,7 +8,8 @@
8:: Hoon's %hold nodes retain the generator's Hoon and its bound arguments.
8:: Hoon's %hold nodes retain the generator's Hoon and its bound arguments.
9:: Comparing that Hoon to the standard generators identifies collections
9:: Comparing that Hoon to the standard generators identifies collections
10:: before they expand into trees. Recursive holds are tracked by identity;
10:: before they expand into trees. Recursive holds are tracked by identity;
11−:: a repeated named hold becomes a module-qualified reference.
11+:: a repeated named hold becomes a module-qualified reference. A proven
12+:: nested self-recursive tagged union retains its own named boundary.
12::
13::
13:: A direct $^ is read from its original branches and accepted only when
14:: A direct $^ is read from its original branches and accepted only when
14:: their imported shapes prove disjoint. A single nested $^ in a
15:: their imported shapes prove disjoint. A single nested $^ in a
@@ -24,9 +25,10 @@
24:: the other fields are fixed atoms or collections of static atoms;
25:: the other fields are fixed atoms or collections of static atoms;
25:: other source shapes fail closed.
26:: other source shapes fail closed.
26::
27::
27−:: The checker has a small bridge for successful unfaced atom and cell
28+:: The partial checker bridges supported nouns, atoms, cells, faces,
28−:: results; it rejects other importer shapes. Failures return %|; no
29+:: proven forks and collections, and keeps proven recursive roots nominal.
30+:: Unsupported shapes fail closed. Reader failures return %|; no partial
29−:: partial tree is returned as success.
31+:: tree is returned as success.
30::
32::
31|%
33|%
32+$ imported
34+$ imported
@@ -37,6 +39,7 @@
37 [%cell head=imported tail=imported]
39 [%cell head=imported tail=imported]
38 [%face name=term body=imported]
40 [%face name=term body=imported]
39 [%fork cases=(list imported)]
41 [%fork cases=(list imported)]
42+ [%named module=term name=term body=imported]
40 [%apply name=term args=(list imported)]
43 [%apply name=term args=(list imported)]
41 [%ref module=term name=term]
44 [%ref module=term name=term]
42 [%bad reason=@t]
45 [%bad reason=@t]
@@ -44,7 +47,7 @@
44 ==
47 ==
45+$ import-diagnostic
48+$ import-diagnostic
46 $% [%ok value=imported]
49 $% [%ok value=imported]
47− [%invalid code=?(%aura %core) message=@t]
50+ [%invalid code=?(%aura %core %overlap) message=@t]
48 [%unsupported message=@t]
51 [%unsupported message=@t]
49 ==
52 ==
50+$ signatures (list [name=term code=hoon])
53+$ signatures (list [name=term code=hoon])
@@ -76,6 +79,445 @@
76 ^- (each imported @t)
79 ^- (each imported @t)
77 (read-with module name typ ~)
80 (read-with module name typ ~)
78::
81::
82+:: When Hoon's expanded type has lost source cases, inspect the exact
83+:: selected local arm. Restrict this fallback to distinct literal head tags
84+:: and proven-safe dependencies, then verify each projected branch again.
85++$ tagged-case [tag=@ branch=spec]
86+:: Clay and eval expose different versions of the spec union. Inspect help
87+:: and source-location wrappers as nouns before checking their contained spec.
88+++ source-gist-tail
89+ |= raw=*
90+ ^- (unit *)
91+ ?: ?=([%gist [%help *] *] raw) `+.+.raw
92+ ?: ?=([%dbug * *] raw) `+.+.raw
93+ ~
94+::
95+:: Bound metadata work separately from semantic source-node visits.
96+++ source-unwrap
97+ |= [raw=* left=@ud]
98+ ^- (unit *)
99+ =/ wrapper=(unit *) (source-gist-tail raw)
100+ ?~ wrapper `raw
101+ ?: =(left 0) ~
102+ $(raw u.wrapper, left (dec left))
103+::
104+++ tagged-term
105+ |= leaf=spec
106+ ^- (unit @)
107+ =/ plain=(unit *) (source-unwrap leaf 4)
108+ ?~ plain ~
109+ ?. ?=([%leaf %tas @] u.plain) ~
110+ `+.+.u.plain
111+::
112+++ tagged-head
113+ |= branch=spec
114+ ^- (unit @)
115+ =/ plain=(unit *) (source-unwrap branch 4)
116+ ?~ plain ~
117+ =. branch ;;(spec u.plain)
118+ ?+ branch ~
119+ [%bccl *]
120+ ?~ t.p.branch ~
121+ (tagged-term i.p.branch)
122+ ==
123+::
124+++ tagged-cases
125+ |= [cases=(list spec) tags=(list @)]
126+ ^- (unit (list tagged-case))
127+ ?~ cases `~
128+ ?: |((has-spec-cell-union i.cases) (has-spec-general-union i.cases)) ~
129+ =/ tag=(unit @) (tagged-head i.cases)
130+ ?~ tag ~
131+ ?: (lien tags |=(x=@ =(x u.tag))) ~
132+ =/ rest $(cases t.cases, tags [u.tag tags])
133+ ?~ rest ~
134+ `[[u.tag i.cases] u.rest]
135+
136+::
137+:: Bound the new $? branch screen independently of the existing $% path.
138+:: Count raw noun nodes across all cases, and cap pairwise tag comparisons.
139+++ bounded-no-spec-unions
140+ |= [h=* fuel=@ud]
141+ ^- (unit @ud)
142+ ?: =(fuel 0) ~
143+ =. fuel (dec fuel)
144+ ?@ h `fuel
145+ ?: ?=([%bckt ^ ^] h) ~
146+ ?: ?=([%bcwt [^ [^ *]]] h) ~
147+ ?: ?=([%bccn [^ [^ *]]] h) ~
148+ =/ left=(unit @ud) $(h -.h)
149+ ?~ left ~
150+ $(h +.h, fuel u.left)
151+++ tagged-bounded-cases
152+ |= [cases=(list spec) tags=(list @) fuel=@ud left=@ud]
153+ ^- (unit (list tagged-case))
154+ ?~ cases `~
155+ ?: =(left 0) ~
156+ =/ remaining=(unit @ud) (bounded-no-spec-unions i.cases fuel)
157+ ?~ remaining ~
158+ =/ tag=(unit @) (tagged-head i.cases)
159+ ?~ tag ~
160+ ?: (lien tags |=(x=@ =(x u.tag))) ~
161+ =/ rest $(cases t.cases, tags [u.tag tags], fuel u.remaining, left (dec left))
162+ ?~ rest ~
163+ `[[u.tag i.cases] u.rest]
164+::
165+:: Benign source annotations have different typed representations on
166+:: Clay and under eval. Inspect the wrapper as a noun, and validate the
167+:: contained Hoon before examining an arm.
168+++ source-note-tail
169+ |= raw=*
170+ ^- (unit *)
171+ ?: ?=([%note [%help *] *] raw) `+.+.raw
172+ ?: ?=([%dbug * *] raw) `+.+.raw
173+ ~
174+::
175+++ source-note-unwrap
176+ |= [raw=* left=@ud]
177+ ^- (unit *)
178+ =/ wrapper=(unit *) (source-note-tail raw)
179+ ?~ wrapper `raw
180+ ?: =(left 0) ~
181+ $(raw u.wrapper, left (dec left))
182+::
183+:: A bounded $~ source wrapper changes the default, not the mold.
184+:: Each annotation chain and default chain is separately bounded.
185+++ tagged-default-union
186+ |= [body=spec left=@ud]
187+ ^- (unit spec)
188+ =/ plain=(unit *) (source-unwrap body 4)
189+ ?~ plain ~
190+ =. body ;;(spec u.plain)
191+ ?. ?=([%bcsg *] body) `body
192+ ?: =(left 0) ~
193+ $(body q.body, left (dec left))
194+::
195+++ tagged-source-code
196+ |= [code=hoon name=term]
197+ ^- (unit (list tagged-case))
198+ =/ found=(unit spec) (local-mold-spec code name)
199+ ?~ found ~
200+ =/ body=(unit spec) (tagged-default-union u.found 4)
201+ ?~ body ~
202+ ?- u.body
203+ [%bccn *]
204+ =/ cases=(list spec) p.u.body
205+ ?~ cases ~
206+ ?~ t.cases ~
207+ (tagged-cases cases ~)
208+ [%bcwt *]
209+ =/ cases=(list spec) p.u.body
210+ ?~ cases ~
211+ ?~ t.cases ~
212+ (tagged-bounded-cases cases ~ 4.096 128)
213+ * ~
214+ ==
215+::
216+:: Source proof for dependencies of an explicitly tagged union. Only
217+:: simple local molds, standard collections and distinct term enums are
218+:: accepted; computed molds, nested cell unions and cycles fail closed.
219+:: One shared fuel budget bounds repeated visits through acyclic aliases;
220+:: exhaustion or an inherited same-name arm leaves the result unsupported.
221+++ local-arm-source
222+ |= [cor=type name=term]
223+ ^- (unit hoon)
224+ ?. ?=([%core *] cor) ~
225+ =/ chapters=(map term tome) q.r.q.cor
226+ =/ all=(list [term tome]) ~(tap by chapters)
227+ ?: (lien all |=(e=[term tome] &(!=(-.e %$) (chapter-unsafe +.e name)))) ~
228+ =/ chapter=(unit tome) (~(get by chapters) %$)
229+ ?~ chapter ~
230+ (chapter-source u.chapter name)
231+::
232+++ local-mold-spec
233+ |= [code=hoon name=term]
234+ ^- (unit spec)
235+ =/ plain=(unit *) (source-note-unwrap code 4)
236+ ?~ plain ~
237+ =. code ;;(hoon u.plain)
238+ ?+ code ~
239+ [%ktcl *]
240+ ?. ?=([%name * *] p.code) ~
241+ ?. =(name p.p.code) ~
242+ `q.p.code
243+ ==
244+::
245+++ safe-source-enum
246+ |= [cases=(list spec) seen=(list @) fuel=@ud]
247+ ^- (unit @ud)
248+ ?~ cases `fuel
249+ ?: =(fuel 0) ~
250+ =/ tag=(unit @) (tagged-term i.cases)
251+ ?~ tag ~
252+ ?: (lien seen |=(n=@ =(n u.tag))) ~
253+ $(cases t.cases, seen [u.tag seen], fuel (dec fuel))
254+::
255+++ safe-source-specs-mode
256+ |= [xs=(list spec) cor=type seen=(list term) fuel=@ud allow-nested=?]
257+ ^- (unit @ud)
258+ ?~ xs `fuel
259+ =/ left=(unit @ud) (safe-source-spec-mode i.xs cor seen fuel allow-nested)
260+ ?~ left ~
261+ $(xs t.xs, fuel u.left)
262+::
263+++ safe-source-name-mode
264+ |= [name=term cor=type seen=(list term) fuel=@ud allow-nested=?]
265+ ^- (unit @ud)
266+ :: Permit a direct root revisit or one proven nested self-revisit.
267+ :: Mutual cycles and inherited same-name bindings remain unavailable.
268+ ?: (lien seen |=(x=term =(name x)))
269+ ?. ?=([%core *] cor) ~
270+ ?. (scope-safe p.cor name) ~
271+ ?: =(seen ~[name]) `fuel
272+ ?. allow-nested ~
273+ ?. ?=([* [* ~]] seen) ~
274+ ?. =(i.seen name) ~
275+ =/ selected=(unit hoon) (local-arm-source cor name)
276+ ?~ selected ~
277+ =/ cases=(unit (list tagged-case)) (tagged-source-code u.selected name)
278+ ?~ cases ~
279+ `fuel
280+ =/ arm=(unit hoon) (local-arm-source cor name)
281+ ?~ arm
282+ ?. &(|(=(name %ship) =(name %path)) (scope-safe cor name)) ~
283+ `fuel
284+ ?. ?=([%core *] cor) ~
285+ ?. (scope-safe p.cor name) ~
286+ =/ body=(unit spec) (local-mold-spec u.arm name)
287+ ?~ body ~
288+ (safe-source-spec-mode u.body cor [name seen] fuel allow-nested)
289+::
290+++ safe-source-spec-mode
291+ |= [shape=spec cor=type seen=(list term) fuel=@ud allow-nested=?]
292+ ^- (unit @ud)
293+ =/ plain=(unit *) (source-unwrap shape 4)
294+ ?~ plain ~
295+ =. shape ;;(spec u.plain)
296+ ?: =(fuel 0) ~
297+ =. fuel (dec fuel)
298+ ?+ shape ~
299+ [%base *] ?:(|(?=([%atom *] p.shape) =(%flag p.shape) =(%null p.shape)) `fuel ~)
300+ [%leaf *] `fuel
301+ [%bcsg *] $(shape q.shape)
302+ [%bcts *] ?@ p.shape $(shape q.shape)
303+ ~
304+ [%bccl *] (safe-source-specs-mode p.shape cor seen fuel allow-nested)
305+ [%bccn *]
306+ :: A source proof may cross one named union dependency. Deeper
307+ :: named unions stay unsupported to bound recursive reprojection.
308+ ?. allow-nested ~
309+ ?. ?=([* [* ~]] seen) ~
310+ =/ cases=(unit (list tagged-case)) (tagged-cases p.shape ~)
311+ ?~ cases ~
312+ ?~ u.cases ~
313+ ?~ t.u.cases ~
314+ (safe-source-tagged-fuel-mode u.cases cor seen fuel allow-nested)
315+ [%bcwt *] (safe-source-enum p.shape ~ fuel)
316+ [%like *]
317+ ?. ?=([@ ~] p.shape) ~
318+ ?. ?=(~ q.shape) ~
319+ (safe-source-name-mode i.p.shape cor seen fuel allow-nested)
320+ [%make *]
321+ =/ wing=(unit term) (source-single-wing p.shape)
322+ ?~ wing ~
323+ =/ n=term u.wing
324+ ?. (lien `(list term)`~[%map %set %qeu %list %unit %jar %jug] |=(x=term =(x n))) ~
325+ ?. (scope-safe cor n) ~
326+ (safe-source-specs-mode q.shape cor seen fuel allow-nested)
327+ ==
328+::
329+++ safe-source-tagged-fuel-mode
330+ |= [cases=(list tagged-case) cor=type seen=(list term) fuel=@ud allow-nested=?]
331+ ^- (unit @ud)
332+ ?~ cases `fuel
333+ =/ left=(unit @ud) (safe-source-spec-mode branch.i.cases cor seen fuel allow-nested)
334+ ?~ left ~
335+ $(cases t.cases, fuel u.left)
336+::
337+++ safe-source-name
338+ |= [name=term cor=type seen=(list term) fuel=@ud]
339+ ^- (unit @ud)
340+ (safe-source-name-mode name cor seen fuel &)
341+::
342+++ safe-source-tagged
343+ |= [cases=(list tagged-case) cor=type seen=(list term) fuel=@ud]
344+ ^- ?
345+ ?=(^ (safe-source-tagged-fuel-mode cases cor seen fuel &))
346+::
347+++ tagged-union-fallback
348+ |= [module=term name=term cor=type]
349+ ^- (unit (each imported @t))
350+ ?. ?=([%core *] cor) ~
351+ =/ chapters=(map term tome) q.r.q.cor
352+ =/ other=(list [term tome]) ~(tap by chapters)
353+ ?: (lien other |=(e=[term tome] &(!=(-.e %$) (chapter-unsafe +.e name)))) ~
354+ =/ chapter=(unit tome) (~(get by chapters) %$)
355+ ?~ chapter ~
356+ =/ selected=(unit hoon) (chapter-source u.chapter name)
357+ ?~ selected ~
358+ =/ cases (tagged-source-code u.selected name)
359+ ?~ cases ~
360+ :: Preserve the original budget when no nested union recovery is needed.
361+ =/ plain=? ?=(^ (safe-source-tagged-fuel-mode u.cases cor ~[name] 4.096 |))
362+ ?. |(plain (safe-source-tagged u.cases cor ~[name] 256)) ~
363+ =/ tried=(each (list type) tang)
364+ (mule |.((turn u.cases |=(c=tagged-case (~(play ut cor) [%kttr branch.c])))))
365+ ?. ?=([%& *] tried) ~
366+ :: Record the selected hold before projecting branches so an exact
367+ :: recursive revisit can retain its independently verified origin.
368+ =/ selected-type=(each type tang)
369+ (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
370+ ?. ?=([%& *] selected-type) ~
371+ =/ projected=(each (list imported) tang)
372+ (mule |.((turn p.tried |=(t=type (walk module t catalog ~[[p.selected-type [~ name]]] `cor)))))
373+ ?. ?=([%& *] projected) ~
374+ ?^ (first-bads p.projected) ~
375+ ?. (all-disjoint p.projected) ~
376+ =/ xs=(list tagged-case) u.cases
377+ =/ ys=(list imported) p.projected
378+ |-
379+ ?~ xs
380+ ?^ ys ~
381+ `[%& [%fork (sort p.projected |=(pair=[imported imported] (dor -.pair +.pair)))]]
382+ ?~ ys ~
383+ ?. ?=([%cell [%atom %tas [~ @]] *] i.ys) ~
384+ ?. =(tag.i.xs u.value.head.i.ys) ~
385+ $(xs t.xs, ys t.ys)
386+
387+::
388+:: Unlike the disjoint-reader fallback, source overlap may have repeated
389+:: tags. Bound both raw case traversal and the number of pair attempts.
390+++ overlap-source-cases
391+ |= [cases=(list spec) fuel=@ud left=@ud]
392+ ^- (unit (list tagged-case))
393+ ?~ cases `~
394+ ?: =(left 0) ~
395+ =/ remaining=(unit @ud) (bounded-no-spec-unions i.cases fuel)
396+ ?~ remaining ~
397+ =/ tag=(unit @) (tagged-head i.cases)
398+ ?~ tag ~
399+ =/ rest $(cases t.cases, fuel u.remaining, left (dec left))
400+ ?~ rest ~
401+ `[[u.tag i.cases] u.rest]
402+++ overlap-repeated-tag
403+ |= cases=(list tagged-case)
404+ ^- ?
405+ ?~ cases |
406+ ?: (lien t.cases |=(c=tagged-case =(tag.c tag.i.cases))) &
407+ $(cases t.cases)
408+++ overlap-projections-match
409+ |= [xs=(list tagged-case) ys=(list imported)]
410+ ^- ?
411+ ?~ xs ?=(~ ys)
412+ ?~ ys |
413+ ?. ?=([%cell [%atom %tas [~ @]] *] i.ys) |
414+ ?. =(tag.i.xs u.value.head.i.ys) |
415+ $(xs t.xs, ys t.ys)
416+++ overlap-source-witness
417+ |= [module=term name=term cor=type]
418+ ^- ?
419+ ?. ?=([%core *] cor) |
420+ =/ selected=(unit hoon) (local-arm-source cor name)
421+ ?~ selected |
422+ =/ shape=(unit spec) (local-mold-spec u.selected name)
423+ ?~ shape |
424+ =/ body=(unit spec) (tagged-default-union u.shape 4)
425+ ?~ body |
426+ ?. ?=([%bcwt *] u.body) |
427+ =/ cases=(unit (list tagged-case)) (overlap-source-cases p.u.body 4.096 128)
428+ ?~ cases |
429+ ?. (overlap-repeated-tag u.cases) |
430+ ?. ?=(^ (safe-source-tagged-fuel-mode u.cases cor ~[name] 4.096 |)) |
431+ =/ tried=(each (list type) tang)
432+ (mule |.((turn u.cases |=(c=tagged-case (~(play ut cor) [%kttr branch.c])))))
433+ ?. ?=([%& *] tried) |
434+ =/ projected=(each (list imported) tang)
435+ (mule |.((turn p.tried |=(t=type (walk module t catalog ~ `cor)))))
436+ ?. ?=([%& *] projected) |
437+ ?^ (first-bads p.projected) |
438+ ?. (overlap-projections-match u.cases p.projected) |
439+ =/ witness=(unit overlap-proof-result) (overlap-case-pairs p.projected 4.096)
440+ ?~ witness |
441+ found.u.witness
442+::
443+:: Positive overlap evidence only: false means no proof, not disjointness.
444+:: Fuel is shared across all examined nodes and sibling alternatives.
445++$ overlap-proof-result [found=? left=@ud]
446+++ overlap-known-atom
447+ |= aura=term
448+ ^- ?
449+ (lien `(list term)`~[%t %tas %ud %f] |=(n=term =(n aura)))
450+++ overlap-inhabited-list
451+ |= [xs=(list imported) fuel=@ud]
452+ ^- (unit overlap-proof-result)
453+ ?~ xs `[| fuel]
454+ ?: =(0 fuel) ~
455+ =/ one=(unit overlap-proof-result) (overlap-inhabited i.xs (dec fuel))
456+ ?~ one ~
457+ ?: found.u.one one
458+ $(xs t.xs, fuel left.u.one)
459+++ overlap-inhabited
460+ |= [x=imported fuel=@ud]
461+ ^- (unit overlap-proof-result)
462+ ?: =(0 fuel) ~
463+ =. fuel (dec fuel)
464+ ?- x
465+ [%noun *] `[& fuel]
466+ [%void *] `[| fuel]
467+ [%atom *] `[|(?=(^ value.x) (overlap-known-atom aura.x)) fuel]
468+ [%face *] $(x body.x)
469+ [%named *] $(x body.x)
470+ [%fork *] (overlap-inhabited-list cases.x fuel)
471+ [%cell *]
472+ =/ a=(unit overlap-proof-result) $(x head.x)
473+ ?~ a ~
474+ ?. found.u.a a
475+ $(x tail.x, fuel left.u.a)
476+ * `[| fuel]
477+ ==
478+++ overlap-pair-list
479+ |= [xs=(list imported) y=imported fuel=@ud]
480+ ^- (unit overlap-proof-result)
481+ ?~ xs `[| fuel]
482+ ?: =(0 fuel) ~
483+ =/ p=(unit overlap-proof-result) (overlap-pair i.xs y (dec fuel))
484+ ?~ p ~
485+ ?: found.u.p p
486+ $(xs t.xs, fuel left.u.p)
487+++ overlap-pair
488+ |= [a=imported b=imported fuel=@ud]
489+ ^- (unit overlap-proof-result)
490+ ?: =(0 fuel) ~
491+ =. fuel (dec fuel)
492+ ?: ?=([%face *] a) $(a body.a)
493+ ?: ?=([%face *] b) $(b body.b)
494+ ?: ?=([%named *] a) $(a body.a)
495+ ?: ?=([%named *] b) $(b body.b)
496+ ?: ?=([%fork *] a) (overlap-pair-list cases.a b fuel)
497+ ?: ?=([%fork *] b) (overlap-pair-list cases.b a fuel)
498+ ?: ?=([%noun *] a) (overlap-inhabited b fuel)
499+ ?: ?=([%noun *] b) (overlap-inhabited a fuel)
500+ ?: &(?=([%cell *] a) ?=([%cell *] b))
501+ =/ p=(unit overlap-proof-result) $(a head.a, b head.b)
502+ ?~ p ~
503+ ?. found.u.p p
504+ $(a tail.a, b tail.b, fuel left.u.p)
505+ ?. &(?=([%atom *] a) ?=([%atom *] b)) `[| fuel]
506+ ?^ value.a
507+ ?^ value.b `[=(u.value.a u.value.b) fuel]
508+ `[&(=(u.value.a 0) (overlap-known-atom aura.b)) fuel]
509+ ?^ value.b `[&(=(u.value.b 0) (overlap-known-atom aura.a)) fuel]
510+ `[&((overlap-known-atom aura.a) (overlap-known-atom aura.b)) fuel]
511+++ overlap-case-pairs
512+ |= [xs=(list imported) fuel=@ud]
513+ ^- (unit overlap-proof-result)
514+ ?~ xs `[| fuel]
515+ ?: =(0 fuel) ~
516+ =/ p=(unit overlap-proof-result) (overlap-pair-list t.xs i.xs (dec fuel))
517+ ?~ p ~
518+ ?: found.u.p p
519+ $(xs t.xs, fuel left.u.p)
520+::
79:: +read-mold-in: accept the /sur core as provenance. The core must be
521:: +read-mold-in: accept the /sur core as provenance. The core must be
80:: built against zuse or validated Ford imports, and its selected arm
522:: built against zuse or validated Ford imports, and its selected arm
81:: must be this type. Unknown subject shapes fail closed.
523:: must be this type. Unknown subject shapes fail closed.
@@ -90,9 +532,15 @@
90 [%| (crip "Hoon mold `{(trip name)}` is not declared")]
532 [%| (crip "Hoon mold `{(trip name)}` is not declared")]
91 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
533 ?. =(typ (~(play ut cor) (ream (cat 3 '*' name))))
92 [%| 'Hoon module provenance does not match the selected mold']
534 [%| 'Hoon module provenance does not match the selected mold']
535+ =/ overlap=(each ? tang) (mule |.((overlap-source-witness module name cor)))
536+ ?: &(?=(%& -.overlap) p.overlap) [%| 'Hoon union cases overlap']
93 =/ result (read-with module name typ [~ cor])
537 =/ result (read-with module name typ [~ cor])
94− ?. ?=([%& *] result) result
538+ ?: ?=([%& *] result) result
539+ =/ fallback=(each (unit (each imported @t)) tang)
540+ (mule |.((tagged-union-fallback module name cor)))
541+ ?: ?=(%| -.fallback) result
95− result
542+ ?~ p.fallback result
543+ u.p.fallback
96::
544::
97:: +read-named is the source-aware entry point for callers that have
545:: +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
546:: not selected a Hoon type yet. Check the core and the local arm
@@ -121,6 +569,41 @@
121:: A mark door's payload is [sample build-subject]. Its outer sample
569:: A mark door's payload is [sample build-subject]. Its outer sample
122:: face names the door sample, not the imported mark type. Collection
570:: face names the door sample, not the imported mark type. Collection
123:: lookup for the sample happened against the pre-door build subject.
571:: lookup for the sample happened against the pre-door build subject.
572+:: Fallback for a mark whose sample is exactly one arm of its only
573+:: Ford-imported /sur core. Source validation remains in read-mold-in.
574+:: Recursive results need a separate mark-origin/interface design.
575+++ mark-has-ref
576+ |= node=imported
577+ ^- ?
578+ ?- node
579+ [%ref *] &
580+ [%named *] $(node body.node)
581+ [%face *] $(node body.node)
582+ [%cell *] |($(node head.node) $(node tail.node))
583+ [%fork *] (lien cases.node |=(child=imported (mark-has-ref child)))
584+ [%apply *] (lien args.node |=(child=imported (mark-has-ref child)))
585+ * |
586+ ==
587+::
588+++ mark-union-fallback
589+ |= [raw=type context=type]
590+ ^- (unit (each imported @t))
591+ ?. ?=([%cell [%face @ [%core *]] *] context) ~
592+ ?. =(q.context -:!>(..zuse)) ~
593+ =/ alias=term p.p.context
594+ =/ core=type q.p.context
595+ ?. ?=([%hold *] raw) ~
596+ =/ name=(unit term) (hold-name q.raw)
597+ ?~ name ~
598+ =/ selected=(each type tang)
599+ (mule |.((~(play ut core) (ream (cat 3 '*' u.name)))))
600+ ?. ?=([%& *] selected) ~
601+ ?. =(p.selected raw) ~
602+ =/ result=(each imported @t) (read-mold-in alias u.name raw core)
603+ ?. ?=([%& [%fork *]] result) ~
604+ ?: (mark-has-ref p.result) ~
605+ `result
606+::
124++ read-mark
607++ read-mark
125 |= [name=term cor=type]
608 |= [name=term cor=type]
126 ^- (each imported @t)
609 ^- (each imported @t)
@@ -131,8 +614,12 @@
131 =/ sample=type p.p.cor
614 =/ sample=type p.p.cor
132 =/ raw=type ?:(?=([%face *] sample) q.sample sample)
615 =/ raw=type ?:(?=([%face *] sample) q.sample sample)
133 =/ result (read-with name name raw [~ q.p.cor])
616 =/ result (read-with name name raw [~ q.p.cor])
134− ?. ?=([%& *] result) result
617+ ?: ?=([%& *] result) result
618+ =/ fallback=(each (unit (each imported @t)) tang)
619+ (mule |.((mark-union-fallback raw q.p.cor)))
135− result
620+ ?: ?=(%| -.fallback) result
621+ ?~ p.fallback result
622+ u.p.fallback
136::
623::
137++ read-named-diagnostic
624++ read-named-diagnostic
138 |= [module=term name=term cor=type]
625 |= [module=term name=term cor=type]
@@ -147,6 +634,8 @@
147 [%unsupported p.result]
634 [%unsupported p.result]
148 =/ selected=(each type tang) (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
635 =/ selected=(each type tang) (mule |.((~(play ut cor) (ream (cat 3 '*' name)))))
149 ?. ?=(%& -.selected) [%unsupported p.result]
636 ?. ?=(%& -.selected) [%unsupported p.result]
637+ =/ overlap=(each ? tang) (mule |.((overlap-source-witness module name cor)))
638+ ?: &(?=(%& -.overlap) p.overlap) [%invalid %overlap 'Hoon union cases overlap']
150 =/ again=(each imported tang) (mule |.((walk module p.selected catalog ~ [~ cor])))
639 =/ again=(each imported tang) (mule |.((walk module p.selected catalog ~ [~ cor])))
151 ?. ?=(%& -.again) [%unsupported p.result]
640 ?. ?=(%& -.again) [%unsupported p.result]
152 =/ evidence=(unit import-diagnostic) (first-invalid p.again)
641 =/ evidence=(unit import-diagnostic) (first-invalid p.again)
@@ -609,6 +1098,8 @@
609 ^- ?
1098 ^- ?
610 ?: ?=([%face *] a) $(a body.a)
1099 ?: ?=([%face *] a) $(a body.a)
611 ?: ?=([%face *] b) $(b body.b)
1100 ?: ?=([%face *] b) $(b body.b)
1101+ ?: ?=([%named *] a) $(a body.a)
1102+ ?: ?=([%named *] b) $(b body.b)
612 ?: ?=([%fork *] a)
1103 ?: ?=([%fork *] a)
613 (levy cases.a |=(item=imported (disjoint item b)))
1104 (levy cases.a |=(item=imported (disjoint item b)))
614 ?: ?=([%fork *] b)
1105 ?: ?=([%fork *] b)
@@ -663,6 +1154,32 @@
663 ?. (arm-map-valid +.chapter) ~
1154 ?. (arm-map-valid +.chapter) ~
664 [~ (arm-map-has +.chapter target)]
1155 [~ (arm-map-has +.chapter target)]
665::
1156::
1157+:: Return a unique source arm from either validated tome wrapper. Walk
1158+:: the noun map rather than relying on fields that differ on Clay.
1159+++ arm-map-sources
1160+ |= [m=* target=term]
1161+ ^- (list hoon)
1162+ ?@ m ~
1163+ =/ kv=* -.m
1164+ =/ children=* +.m
1165+ =/ found=(list hoon) ?:(=(-.kv target) ~[;;(hoon +.kv)] ~)
1166+ (weld found (weld $(m -.children) $(m +.children)))
1167+::
1168+++ chapter-source
1169+ |= [chapter=* target=term]
1170+ ^- (unit hoon)
1171+ ?: (arm-map-valid chapter) (unique-arm-source chapter target)
1172+ ?@ chapter ~
1173+ ?. (arm-map-valid +.chapter) ~
1174+ (unique-arm-source +.chapter target)
1175+::
1176+++ unique-arm-source
1177+ |= [arms=* target=term]
1178+ ^- (unit hoon)
1179+ =/ sources=(list hoon) (arm-map-sources arms target)
1180+ ?. ?=([* ~] sources) ~
1181+ `i.sources
1182+::
666++ chapter-unsafe
1183++ chapter-unsafe
667 |= [chapter=* target=term]
1184 |= [chapter=* target=term]
668 ^- ?
1185 ^- ?
@@ -705,17 +1222,46 @@
705 ?@ src |
1222 ?@ src |
706 |($(src -.src) $(src +.src))
1223 |($(src -.src) $(src +.src))
707::
1224::
1225+:: Clay can wrap each call component in source-location metadata.
1226+:: Peel only those wrappers; malformed casts are trapped by +mop-specs.
1227+++ mop-source-code
1228+ |= code=hoon
1229+ ^- hoon
1230+ =/ plain=(unit *) (source-unwrap code 4)
1231+ ?~ plain !!
1232+ ;;(hoon u.plain)
1233+::
1234+++ source-single-wing
1235+ |= raw=*
1236+ ^- (unit term)
1237+ =/ plain=(unit *) (source-unwrap raw 4)
1238+ ?~ plain ~
1239+ ?. ?=([%wing [@ ~]] u.plain) ~
1240+ `;;(term -.+.u.plain)
1241+::
708++ mop-specs-raw
1242++ mop-specs-raw
709 |= body=hoon
1243 |= body=hoon
710 ^- (unit [key=spec value=spec])
1244 ^- (unit [key=spec value=spec])
1245+ =. body (mop-source-code body)
711 ?. ?=([%cncl *] body) ~
1246 ?. ?=([%cncl *] body) ~
712 ?. ?=([%tsgr *] p.body) ~
1247 ?. ?=([%tsgr *] p.body) ~
713− =/ b=hoon q.p.body
1248+ =/ b=hoon (mop-source-code q.p.body)
714 ?. ?=([%cncl *] b) ~
1249 ?. ?=([%cncl *] b) ~
1250+ =/ call=hoon (mop-source-code p.b)
715− ?. ?=([%cncl *] p.b) ~
1251+ ?. ?=([%cncl *] call) ~
716− ?. ?=([%wing *] p.p.b) ~
1252+ =/ w=(unit term) (source-single-wing p.call)
717− ?. =(p.p.p.b ~[%mop]) ~
1253+ ?~ w ~
1254+ ?. =(u.w %mop) ~
1255+ =/ raw=* q.call
1256+ =/ wings=(unit [key=spec value=spec])
1257+ ?. ?=([* [* ~]] raw) ~
1258+ =/ a=(unit term) (source-single-wing -.raw)
1259+ =/ b=(unit term) (source-single-wing -.+.raw)
1260+ ?~ a ~
1261+ ?~ b ~
1262+ [~ [[%like ~[u.a] ~] [%like ~[u.b] ~]]]
1263+ ?^ wings wings
718− =/ specs=(list spec) ;;((list spec) q.p.b)
1264+ =/ specs=(list spec) ;;((list spec) raw)
719 ?. ?=([* [* ~]] specs) ~
1265 ?. ?=([* [* ~]] specs) ~
720 [~ [i.specs i.t.specs]]
1266 [~ [i.specs i.t.specs]]
721::
1267::
@@ -925,6 +1471,49 @@
925 ?~ args [%bad unsupported]
1471 ?~ args [%bad unsupported]
926 [%apply name.out u.args]
1472 [%apply name.out u.args]
927::
1473::
1474+:: A nested named tagged union may be recovered only if its hold is
1475+:: exactly the selected arm of this core. Provenance and all original
1476+:: source cases are checked by the same fallback as a top-level arm.
1477+++ nested-tagged-union
1478+ |= [module=term typ=type context=(unit type)]
1479+ ^- (unit imported)
1480+ ?~ context ~
1481+ ?. ?=([%core *] u.context) ~
1482+ ?. ?=([%hold *] typ) ~
1483+ =/ n=(unit term) (hold-name q.typ)
1484+ ?~ n ~
1485+ :: The outer proof has a shared budget. Bound each nested re-proof as
1486+ :: well, so rebuilding a shared source DAG cannot grow without limit.
1487+ =/ source=(unit hoon) (local-arm-source u.context u.n)
1488+ ?~ source ~
1489+ =/ cases=(unit (list tagged-case)) (tagged-source-code u.source u.n)
1490+ ?~ cases ~
1491+ ?. (safe-source-tagged u.cases u.context ~[u.n] 256) ~
1492+ =/ selected=(each type tang)
1493+ (mule |.((~(play ut u.context) (ream (cat 3 '*' u.n)))))
1494+ ?. ?=([%& *] selected) ~
1495+ ?. =(p.selected typ) ~
1496+ =/ attempt=(each (unit (each imported @t)) tang)
1497+ (mule |.((tagged-union-fallback module u.n u.context)))
1498+ ?. ?=([%& *] attempt) ~
1499+ ?~ p.attempt ~
1500+ ?. ?=([%& [%fork *]] u.p.attempt) ~
1501+ `p.u.p.attempt
1502+::
1503+:: Keep the proven owner boundary when a nested union refers to itself.
1504+++ contains-named-ref
1505+ |= [node=imported module=term name=term]
1506+ ^- ?
1507+ ?- node
1508+ [%ref *] &(=(module module.node) =(name name.node))
1509+ [%named *] |
1510+ [%face *] $(node body.node)
1511+ [%cell *] |($(node head.node) $(node tail.node))
1512+ [%fork *] (lien cases.node |=(child=imported (contains-named-ref child module name)))
1513+ [%apply *] (lien args.node |=(child=imported (contains-named-ref child module name)))
1514+ * |
1515+ ==
1516+::
928++ walk
1517++ walk
929 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
1518 |= [module=term typ=type sig=signatures seen=visiting context=(unit type)]
930 ^- imported
1519 ^- imported
@@ -949,6 +1538,19 @@
949 [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
1538 [%fork (sort cases |=(pair=[imported imported] (dor -.pair +.pair)))]
950 [%hint *] $(typ q.typ)
1539 [%hint *] $(typ q.typ)
951 [%hold *]
1540 [%hold *]
1541+ =/ prior=(unit (unit term)) (find-seen typ seen)
1542+ ?^ prior
1543+ ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
1544+ =/ origin (ref-origin module u.u.prior typ context)
1545+ ?~ origin [%bad 'a recursive Hoon mold needs unambiguous source provenance']
1546+ [%ref u.origin u.u.prior]
1547+ =/ nested=(unit imported) (nested-tagged-union module typ context)
1548+ ?^ nested
1549+ ?: ?=(~ seen) u.nested
1550+ =/ name=(unit term) (hold-name q.typ)
1551+ ?~ name u.nested
1552+ ?. (contains-named-ref u.nested module u.name) u.nested
1553+ [%named module u.name u.nested]
952 ?: &(?=([%tsls [%note * *] *] q.typ) |((has-spec-cell-union q.typ) (has-spec-general-union q.typ)))
1554 ?: &(?=([%tsls [%note * *] *] q.typ) |((has-spec-cell-union q.typ) (has-spec-general-union q.typ)))
953 =/ nm (hold-name q.typ)
1555 =/ nm (hold-name q.typ)
954 (collection-union typ module sig [[typ nm] seen] context)
1556 (collection-union typ module sig [[typ nm] seen] context)
@@ -965,12 +1567,6 @@
965 =/ second=type (~(play ut p.typ) (ream '*value'))
1567 =/ second=type (~(play ut p.typ) (ream '*value'))
966 [%apply name ~[first-import $(typ second)]]
1568 [%apply name ~[first-import $(typ second)]]
967 [%apply name ~[first-import]]
1569 [%apply name ~[first-import]]
968− =/ prior=(unit (unit term)) (find-seen typ seen)
969− ?^ prior
970− ?~ u.prior [%bad 'an anonymous recursive Hoon mold cannot be named']
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]
974 =/ nm (hold-name q.typ)
1570 =/ nm (hold-name q.typ)
975 ?: =(nm [~ %vase]) [%bad 'a Hoon type named vase needs source provenance']
1571 ?: =(nm [~ %vase]) [%bad 'a Hoon type named vase needs source provenance']
976 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
1572 ?: &((source-uses q.typ %jar) !(alias-safe context %jar))
@@ -981,7 +1577,8 @@
981 [%bad 'Hoon collection provenance is unavailable or shadowed']
1577 [%bad 'Hoon collection provenance is unavailable or shadowed']
982 =/ mop (mop-arguments typ)
1578 =/ mop (mop-arguments typ)
983 ?^ mop
1579 ?^ mop
1580+ :: An exact revisit fails closed without guessing a name.
984− [%apply %mop ~[$(typ key.u.mop) $(typ value.u.mop)]]
1581+ [%apply %mop ~[$(typ key.u.mop, seen [[typ ~] seen]) $(typ value.u.mop, seen [[typ ~] seen])]]
985 ?: (source-uses q.typ %mop)
1582 ?: (source-uses q.typ %mop)
986 =/ checked-names=(list term) ~[%map %set %qeu %list %unit]
1583 =/ checked-names=(list term) ~[%map %set %qeu %list %unit]
987 ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
1584 ?: (lien checked-names |=(n=term &((source-uses q.typ n) !(alias-safe context n))))
@@ -1075,6 +1672,7 @@
1075 [%bad *] [~ reason.out]
1672 [%bad *] [~ reason.out]
1076 [%invalid *] [~ reason.out]
1673 [%invalid *] [~ reason.out]
1077 [%face *] $(out body.out)
1674 [%face *] $(out body.out)
1675+ [%named *] $(out body.out)
1078 [%cell *]
1676 [%cell *]
1079 =/ err $(out head.out)
1677 =/ err $(out head.out)
1080 ?~ err $(out tail.out)
1678 ?~ err $(out tail.out)
@@ -1102,6 +1700,7 @@
1102 [%bad *] `[%unsupported reason.out]
1700 [%bad *] `[%unsupported reason.out]
1103 [%invalid *] `[%invalid code.out reason.out]
1701 [%invalid *] `[%invalid code.out reason.out]
1104 [%face *] $(out body.out)
1702 [%face *] $(out body.out)
1703+ [%named *] $(out body.out)
1105 [%cell *]
1704 [%cell *]
1106 =/ first $(out head.out)
1705 =/ first $(out head.out)
1107 ?~ first $(out tail.out)
1706 ?~ first $(out tail.out)
@@ -1254,6 +1853,7 @@
1254 [%cell *] "[{(show-import head.out)} {(show-import tail.out)}]"
1853 [%cell *] "[{(show-import head.out)} {(show-import tail.out)}]"
1255 [%face *] "{(trip name.out)}={(show-import body.out)}"
1854 [%face *] "{(trip name.out)}={(show-import body.out)}"
1256 [%fork *] "(union {(show-imports cases.out)})"
1855 [%fork *] "(union {(show-imports cases.out)})"
1856+ [%named *] "(named {(trip name.out)}.{(trip module.out)} {(show-import body.out)})"
1257 [%apply *] "({(trip name.out)} {(show-imports args.out)})"
1857 [%apply *] "({(trip name.out)} {(show-imports args.out)})"
1258 [%ref *] "{(trip name.out)}.{(trip module.out)}"
1858 [%ref *] "{(trip name.out)}.{(trip module.out)}"
1259 [%bad *] "error: {(trip reason.out)}"
1859 [%bad *] "error: {(trip reason.out)}"
@@ -1307,6 +1907,67 @@
1307 =/ source=hoon original(q.p (decorate-union-source q.p.original))
1907 =/ source=hoon original(q.p (decorate-union-source q.p.original))
1308 (read-mold %small name typ(q source))
1908 (read-mold %small name typ(q source))
1309::
1909::
1910+:: Test debug metadata at the spec boundary without assuming that the
1911+:: eval version of Hoon's spec mold itself includes Clay's %dbug tag.
1912+++ debug-spec-fixture
1913+ ^- tape
1914+ =/ location=* [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1915+ =/ wrapped=* [%dbug location [%leaf %tas %x]]
1916+ =/ got=(unit *) (source-gist-tail wrapped)
1917+ ?~ got "debug wrapper missing"
1918+ =/ leaf=(each spec tang) (mule |.(;;(spec u.got)))
1919+ ?. ?=([%& [%leaf %tas %x]] leaf) "debug leaf not recovered"
1920+ =/ branch=spec [%bccl ~[p.leaf [%base [%atom %t]]]]
1921+ ?^ (tagged-cases ~[branch branch] ~) "duplicate tags accepted"
1922+ =/ broken=(unit *) (source-gist-tail [%dbug location 42])
1923+ ?~ broken "debug wrapper missing"
1924+ =/ invalid=(each spec tang) (mule |.(;;(spec u.broken)))
1925+ ?: ?=(%& -.invalid) "malformed spec accepted"
1926+ "valid wrapper; duplicate and malformed rejected"
1927+::
1928+:: The same named-operand call with Clay-style source-location wrappers.
1929+++ debug-mop-fixture
1930+ |= cor=type
1931+ ^- tape
1932+ =/ typ=type (~(play ut cor) (ream '*mop-wing-valid'))
1933+ ?> ?=([%hold *] typ)
1934+ =/ original=hoon q.typ
1935+ ?> ?=([%tsls [%note * *] *] original)
1936+ =/ body=hoon q.p.original
1937+ ?> ?=([%cncl *] body)
1938+ ?> ?=([%tsgr *] p.body)
1939+ =/ b=hoon q.p.body
1940+ ?> ?=([%cncl *] b)
1941+ =/ call=hoon p.b
1942+ ?> ?=([%cncl *] call)
1943+ ?> ?=([* [* ~]] q.call)
1944+ =/ at=spot [/tests/importer/synthetic/hoon [[1 1] [1 2]]]
1945+ =/ inner=hoon call(p [%dbug at p.call], q ~[[%dbug at i.q.call] [%dbug at i.t.q.call]])
1946+ =/ outer=hoon body(p p.body(q b(p [%dbug at inner])))
1947+ =/ mixed=hoon body(p p.body(q b(p inner)))
1948+ =/ multi=hoon body(p p.body(q b(p call(p [%dbug at [%wing ~[%one %two]]]))))
1949+ =/ plain=(unit [key=spec value=spec]) (mop-specs body)
1950+ ?~ plain "unwrapped mop not recognized"
1951+ ?. =((mop-specs [%dbug at outer]) plain) "wrapped mop not recognized"
1952+ ?. =((mop-specs mixed) plain) "mixed mop not recognized"
1953+ ?^ (mop-specs multi) "multi-segment callee accepted"
1954+ ?^ (mop-specs [%dbug at [%sand %ud 42]]) "malformed call accepted"
1955+ ?^ (source-single-wing [%dbug at 42]) "malformed wing accepted"
1956+ ?^ (source-single-wing [%dbug at [%wing ~[%one %two]]]) "multi-segment operand accepted"
1957+ =/ four=* [%dbug at [%dbug at [%dbug at [%dbug at [%wing ~[%mop]]]]]]
1958+ =/ five=* [%dbug at four]
1959+ ?~ (source-single-wing four) "four wrappers rejected"
1960+ ?^ (source-single-wing five) "wrapper limit exceeded"
1961+ ?~ (source-note-unwrap four 4) "four note wrappers rejected"
1962+ ?^ (source-note-unwrap five 4) "note wrapper limit exceeded"
1963+ =/ selected=(unit hoon) (local-arm-source cor %tag-valid)
1964+ ?~ selected "selected union not found"
1965+ =/ arm-four=hoon [%dbug at [%dbug at [%dbug at [%dbug at u.selected]]]]
1966+ =/ arm-five=hoon [%dbug at arm-four]
1967+ ?~ (tagged-source-code arm-four %tag-valid) "four wrapped selected arms rejected"
1968+ ?^ (tagged-source-code arm-five %tag-valid) "selected arm wrapper limit exceeded"
1969+ "wrapped and mixed calls accepted; malformed, multi-segment and excessive wrappers rejected"
1970+::
1310:: Synthetic nodes test each part of the direct collection-call proof.
1971:: Synthetic nodes test each part of the direct collection-call proof.
1311++ collection-wrapper-fixture
1972++ collection-wrapper-fixture
1312 ^- tape
1973 ^- tape
@@ -1352,6 +2013,19 @@
1352 =/ mark-rec-core=type -:(ride fp mark-rec)
2013 =/ mark-rec-core=type -:(ride fp mark-rec)
1353 =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
2014 =/ mark-gate-core=type -:(ride -:!>(..zuse) mark-gate)
1354 =/ mark-basic-core=type -:(ride -:!>(..zuse) mark-basic)
2015 =/ mark-basic-core=type -:(ride -:!>(..zuse) mark-basic)
2016+ =/ make-mark
2017+ |= [field=@t scope=type]
2018+ ^- type
2019+ -:(ride scope (crip "|_ a={(trip field)}\0a++ grab |% ++ noun a --\0a++ grow |% ++ noun a --\0a++ grad %noun\0a--\0a"))
2020+ =/ mark-union-core=type (make-mark 'mark-flag-valid:small' fp)
2021+ =/ mark-overlap-core=type (make-mark 'mark-flag-overlap:small' fp)
2022+ =/ mark-hidden-core=type (make-mark 'mark-flag-hidden:small' fp)
2023+ =/ mark-signed-core=type (make-mark 'signed:small' fp)
2024+ =/ mark-callable-core=type (make-mark 'gate-test:small' fp)
2025+ =/ extra-subject=type [%cell [%face %other other] fp]
2026+ =/ mark-extra-core=type (make-mark 'mark-flag-valid:small' extra-subject)
2027+ =/ other-hold=type (~(play ut other) (ream '*chain'))
2028+ =/ recursive-hold=type (~(play ut sc) (ream '*chain'))
1355 =/ fake-vase=type -:(ride -:!>(..zuse) '|%\0a+$ vase @ud\0a--\0a')
2029 =/ fake-vase=type -:(ride -:!>(..zuse) '|%\0a+$ vase @ud\0a--\0a')
1356 =/ spoof=(unit import-diagnostic)
2030 =/ spoof=(unit import-diagnostic)
1357 (first-invalid [%bad 'signed and float auras cannot be imported'])
2031 (first-invalid [%bad 'signed and float auras cannot be imported'])
@@ -1366,6 +2040,30 @@
1366 =/ distinct=type -:(ride distinct-parent origin-first)
2040 =/ distinct=type -:(ride distinct-parent origin-first)
1367 =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
2041 =/ trans-amb-parent=type [%cell [%face %intermediate fc] [%cell [%face %second sc] -:!>(..zuse)]]
1368 =/ trans-amb=type -:(ride trans-amb-parent origin-trans)
2042 =/ trans-amb=type -:(ride trans-amb-parent origin-trans)
2043+ =/ tag-child=@t
2044+ '|%\0a+$ tag-invalid-cell @t\0a+$ choice $%([%ok a=tag-invalid-cell] [%err a=@ud])\0a--\0a'
2045+ =/ tag-collision=type -:(ride [%cell [%face %base sc] -:!>(..zuse)] tag-child)
2046+ =/ tag-clean=type -:(ride [%cell [%face %base other] -:!>(..zuse)] tag-child)
2047+ =/ tag-zuse=@t
2048+ '|%\0a+$ ship @t\0a+$ path @ud\0a+$ choice $%([%ok who=ship] [%err where=path])\0a--\0a'
2049+ =/ tag-zuse-core=type -:(ride -:!>(..zuse) tag-zuse)
2050+ =/ nest-parent-src=@t
2051+ '|%\0a+$ tag-nest-inner $%([%foreign @t] [%foreign @t])\0a--\0a'
2052+ =/ nest-parent=type -:(ride -:!>(..zuse) nest-parent-src)
2053+ =/ nest-child-src=@t
2054+ '|%\0a+$ tag-nest-inner $%([%left @t] [%right @ud])\0a+$ tag-nest-middle $%([%one x=tag-nest-inner] [%two ~])\0a--\0a'
2055+ =/ nest-collision=type -:(ride [%cell [%face %base nest-parent] -:!>(..zuse)] nest-child-src)
2056+ =/ self-parent=type
2057+ -:(ride -:!>(..zuse) '|%\0a+$ tag-self ?(%same %same)\0a--\0a')
2058+ =/ self-child=@t
2059+ '|%\0a+$ tag-self $%([%branch children=(list tag-self)] [%leaf value=@t])\0a--\0a'
2060+ =/ self-collision=type -:(ride [%cell [%face %tag-self self-parent] -:!>(..zuse)] self-child)
2061+ =/ self-other=type
2062+ -:(ride -:!>(..zuse) '|%\0a+$ tag-self $%([%branch children=(list tag-self)] [%leaf value=@ud])\0a--\0a')
2063+ =/ mop-ford-parent=type
2064+ -:(ride -:!>(..zuse) '|%\0a+$ value ?(%same %same)\0a--\0a')
2065+ =/ mop-ford-child=type
2066+ -:(ride [%cell [%face %value mop-ford-parent] -:!>(..zuse)] '|%\0a+$ key @ud\0a+$ value @t\0a+$ mm ((mop key value) lte)\0a--\0a')
1369 =/ sample
2067 =/ sample
1370 |= name=term
2068 |= name=term
1371 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
2069 (read-mold-in %small name (~(play ut sc) (ream (cat 3 '*' name))) sc)
@@ -1403,6 +2101,15 @@
1403 (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
2101 (crip "nested-static-mop: {(show-result (sample %nested-static-mop))}")
1404 (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
2102 (crip "collection-siblings: {(show-result (sample %collection-siblings))}")
1405 (crip "dynamic-sibling-mop: {(show-result (sample %dynamic-sibling-mop))}")
2103 (crip "dynamic-sibling-mop: {(show-result (sample %dynamic-sibling-mop))}")
2104+ (crip "mark-flag-source: {(show-result (read-named %small %mark-flag-valid sc))}")
2105+ (crip "mark-flag-union: {(show-result (read-mark %flag-union mark-union-core))}")
2106+ (crip "mark-flag-overlap: {(show-result (read-mark %flag-overlap mark-overlap-core))}")
2107+ (crip "mark-flag-hidden: {(show-result (read-mark %flag-hidden mark-hidden-core))}")
2108+ (crip "mark-flag-signed: {(show-result (read-mark %flag-signed mark-signed-core))}")
2109+ (crip "mark-flag-callable: {(show-result (read-mark %flag-callable mark-callable-core))}")
2110+ (crip "mark-flag-extra: {(show-result (read-mark %flag-extra mark-extra-core))}")
2111+ (crip "mark-flag-other-hold: {?~((mark-union-fallback other-hold fp) "unsupported" "BAD")}")
2112+ (crip "mark-flag-recursive-fallback: {?~((mark-union-fallback recursive-hold fp) "unsupported" "BAD")}")
1406 (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
2113 (crip "mark-record: {(show-result (read-mark %todo-item mark-core))}")
1407 (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
2114 (crip "mark-recursive: {(show-result (read-mark %recursive mark-rec-core))}")
1408 (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
2115 (crip "mark-gate: {(show-result (read-mark %bad mark-gate-core))}")
@@ -1427,11 +2134,22 @@
1427 (crip "shadow-list-mop: {(show-result (read-mold-in %shadow-static %bad (~(play ut xc) (ream '*bad')) xc))}")
2134 (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))}")
2135 (crip "named-mop: {(show-result (sample %named-mop))}")
1429 (crip "mop-list: {(show-result (sample %mop-list))}")
2136 (crip "mop-list: {(show-result (sample %mop-list))}")
2137+ (crip "mop-wing-valid: {(show-result (sample %mop-wing-valid))}")
2138+ (crip "mop-wing-invalid-key: {(show-result (sample %mop-wing-invalid-key))}")
2139+ (crip "mop-wing-invalid-key-alias: {(show-result (sample %mop-wing-invalid-key-alias))}")
2140+ (crip "mop-wing-invalid-value: {(show-result (sample %mop-wing-invalid-value))}")
2141+ (crip "mop-wing-invalid-value-alias: {(show-result (sample %mop-wing-invalid-value-alias))}")
2142+ (crip "mop-wing-rec-key: {(show-result (sample %mop-wing-rec-key))}")
2143+ (crip "mop-wing-rec-value: {(show-result (sample %mop-wing-rec-value))}")
2144+ (crip "mop-wing-shadow: {(show-result (read-named %shadow %mmw hc))}")
2145+ (crip "mop-wing-ford-collision: {(show-result (read-named %child %mm mop-ford-child))}")
2146+ (crip "mop-wing-debug: {(debug-mop-fixture sc)}")
1430 (crip "signed: {(show-result (sample %signed))}")
2147 (crip "signed: {(show-result (sample %signed))}")
1431 (crip "float: {(show-result (sample %float))}")
2148 (crip "float: {(show-result (sample %float))}")
1432 (crip "gate: {(show-result (sample %gate-test))}")
2149 (crip "gate: {(show-result (sample %gate-test))}")
1433 (crip "vase: {(show-result vase)}")
2150 (crip "vase: {(show-result vase)}")
1434 (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
2151 (crip "failed-branch: {(show-result (read-mold %external %bad bad-branch-fixture))}")
2152+ (crip "debug-spec: {debug-spec-fixture}")
1435 (crip "debug-union: {(show-result (debug-union-fixture sc %action))}")
2153 (crip "debug-union: {(show-result (debug-union-fixture sc %action))}")
1436 (crip "debug-union-overlap: {(show-result (debug-union-fixture sc %explicit-wut-overlap))}")
2154 (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))}")
2155 (crip "debug-nested-cell: {(show-result (debug-union-fixture sc %nested-valid-cell))}")
@@ -1526,6 +2244,58 @@
1526 (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
2244 (crip "missing-arm: {(show-result (read-mold-in %small %missing [%atom %ud ~] sc))}")
1527 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
2245 (crip "wrong-provenance: {(show-result (read-mold-in %small %action (~(play ut sc) (ream '*items')) sc))}")
1528 (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
2246 (crip "unverified-subject: {(show-result (read-mold-in %std %jar (~(play ut -:!>(..zuse)) (ream '*(jar @ud @t)')) -:!>(..zuse)))}")
2247+ (crip "tag-ford-collision: {(show-result (read-named %child %choice tag-collision))}")
2248+ (crip "tag-ford-clean: {(show-result (read-named %child %choice tag-clean))}")
2249+ (crip "tag-zuse-local: {(show-result (read-named %child %choice tag-zuse-core))}")
2250+ (crip "tag-nest-inner: {(show-result (sample %tag-nest-inner))}")
2251+ (crip "tag-nest-middle: {(show-result (sample %tag-nest-middle))}")
2252+ (crip "tag-nest-diamond: {(show-result (sample %tag-nest-diamond))}")
2253+ (crip "tag-nest-deep: {(show-result (sample %tag-nest-deep))}")
2254+ (crip "tag-nest-hidden: {(show-result (sample %tag-nest-hidden))}")
2255+ (crip "tag-nest-overlap: {(show-result (sample %tag-nest-overlap))}")
2256+ (crip "tag-nest-recursive: {(show-result (sample %tag-nest-recursive-outer))}")
2257+ (crip "tag-nest-rec-list: {(show-result (sample %tag-nest-rec-list-outer))}")
2258+ (crip "tag-nest-rec-repeat: {(show-result (sample %tag-nest-rec-repeat))}")
2259+ (crip "tag-nest-rec-duplicate: {(show-result (sample %tag-nest-rec-bad-outer))}")
2260+ (crip "tag-nest-rec-hidden: {(show-result (sample %tag-nest-rec-hidden-outer))}")
2261+ (crip "tag-nest-rec-mutual: {(show-result (sample %tag-nest-rec-mutual-outer))}")
2262+ (crip "tag-nest-rec-outer-overlap: {(show-result (sample %tag-nest-rec-outer-overlap))}")
2263+ (crip "tag-nest-rec-owner: {?:(&((contains-named-ref [%ref %small %tag-self] %small %tag-self) !(contains-named-ref [%named %small %other [%ref %small %tag-self]] %small %tag-self)) "yes" "wrong")}")
2264+ (crip "tag-nest-many: {(show-result (sample %tag-nest-many))}")
2265+ (crip "tag-nest-shadow: {(show-result (read-named %shadow-static %tag-nest-shadow xc))}")
2266+ (crip "tag-nest-wrong-hold: {?~((nested-tagged-union %small (~(play ut other) (ream '*chain')) `sc) "unsupported" "BAD")}")
2267+ (crip "tag-nest-ford-collision: {(show-result (read-named %outer %tag-nest-middle nest-collision))}")
2268+ (crip "tag-self: {(show-result (sample %tag-self))}")
2269+ (crip "tag-self-tail: {(show-result (sample %tag-self-tail))}")
2270+ (crip "tag-self-duplicate: {(show-result (sample %tag-self-duplicate))}")
2271+ (crip "tag-self-hidden: {(show-result (sample %tag-self-hidden))}")
2272+ (crip "tag-self-indirect: {(show-result (sample %tag-self-indirect))}")
2273+ (crip "tag-mutual-a: {(show-result (sample %tag-mutual-a))}")
2274+ (crip "tag-mutual-b: {(show-result (sample %tag-mutual-b))}")
2275+ (crip "tag-self-pair: {(show-result (sample %tag-self-pair))}")
2276+ (crip "tag-self-ford-collision: {(show-result (read-named %child %tag-self self-collision))}")
2277+ (crip "tag-self-wrong-core: {(show-result (read-mold-in %other %tag-self (~(play ut sc) (ream '*tag-self')) self-other))}")
2278+ (crip "tag-flat-large: {?:(&(?=(~ (safe-source-name-mode %tag-fuel-7 sc ~ 256 |)) ?=(^ (safe-source-name-mode %tag-fuel-7 sc ~ 4.096 |)) ?=([%& *] (sample %tag-flat-large))) "supported above 256" "BAD")}")
2279+ (crip "tag-null-good: {(show-result (sample %tag-null-good))}")
2280+ (crip "tag-null-duplicate: {(show-result (sample %tag-null-duplicate))}")
2281+ (crip "tag-null-hidden: {(show-result (sample %tag-null-hidden))}")
2282+ (crip "tag-valid: {(show-result (sample %tag-valid))}")
2283+ (crip "tag-duplicate: {(show-result (sample %tag-duplicate))}")
2284+ (crip "tag-collapsed: {(show-result (sample %tag-collapsed))}")
2285+ (crip "tag-invalid-direct: {(show-result (sample %tag-invalid-direct))}")
2286+ (crip "tag-invalid-alias: {(show-result (sample %tag-invalid-alias))}")
2287+ (crip "tag-invalid-list: {(show-result (sample %tag-invalid-list))}")
2288+ (crip "tag-enum-good: {(show-result (sample %tag-enum-good))}")
2289+ (crip "tag-enum-bad: {(show-result (sample %tag-enum-bad))}")
2290+ (crip "tag-nested-good: {(show-result (sample %tag-nested-good))}")
2291+ (crip "tag-shadow-jar: {(show-result (read-named %shadow-static %tag-shadow-jar xc))}")
2292+ (crip "tag-shadow-jug: {(show-result (read-named %shadow-static %tag-shadow-jug xc))}")
2293+ (crip "tag-fuel-small: {?:(?=(^ (safe-source-name %tag-fuel-2 sc ~ 64)) "yes" "no")}")
2294+ (crip "tag-fuel-large: {?:(?=(~ (safe-source-name %tag-fuel-11 sc ~ 64)) "rejected" "wrong")}")
2295+ (crip "presence-action-1: {(show-result (present %action-1))}")
2296+ (crip "presence-command-1: {(show-result (present %command-1))}")
2297+ (crip "presence-update-1: {(show-result (present %update-1))}")
2298+ (crip "presence-response-1: {(show-result (present %response-1))}")
1529 (crip "presence-topic: {(show-result (present %topic))}")
2299 (crip "presence-topic: {(show-result (present %topic))}")
1530 (crip "presence-timing: {(show-result (present %timing))}")
2300 (crip "presence-timing: {(show-result (present %timing))}")
1531 (crip "presence-places: {(show-result (present %places))}")
2301 (crip "presence-places: {(show-result (present %places))}")
jibb-dev/lib/jibb.hoon+5178−257
@@ -874,7 +874,7 @@
874 %'~[' %'|=(' %'$-(' :: openers
874 %'~[' %'|=(' %'$-(' :: openers
875 %'%/' %'/' :: paths
875 %'%/' %'/' :: paths
876 %'+' %'`' %'=' :: pair, unit, face
876 %'+' %'`' %'=' :: pair, unit, face
877− %'*' %'?' :: noun, loobean mold
877+ %'*' %'?' %'_' :: noun, loobean, type hole
878 %'++' %'+$' %'|=' %'|$' :: runes
878 %'++' %'+$' %'|=' %'|$' :: runes
879 %'^-' %'~&' %'?-' %'!!' :: runes
879 %'^-' %'~&' %'?-' %'!!' :: runes
880 %'/-' %'/%' %'/=' :: imports
880 %'/-' %'/%' %'/=' :: imports
@@ -1016,6 +1016,7 @@
1016 [%const at=span =lit] :: ~ %add %.y
1016 [%const at=span =lit] :: ~ %add %.y
1017 [%ref at=span names=(list term)] :: state item.todo
1017 [%ref at=span names=(list term)] :: state item.todo
1018 [%tvar at=span name=@t] :: M
1018 [%tvar at=span name=@t] :: M
1019+ [%hole at=span ~] :: _
1019 [%path at=span segs=(list pseg)] :: / /todos /todo/[id=@ud]
1020 [%path at=span segs=(list pseg)] :: / /todos /todo/[id=@ud]
1020 [%apply at=span ref=(list term) args=(list shape)] :: (list @t)
1021 [%apply at=span ref=(list term) args=(list shape)] :: (list @t)
1021 [%cell at=span fields=(list field)] :: [text=@t done=?]
1022 [%cell at=span fields=(list field)] :: [text=@t done=?]
@@ -1024,9 +1025,9 @@
1024 [%generic at=span vars=(list @t) body=shape] :: +$ name |$ [M] …
1025 [%generic at=span vars=(list @t) body=shape] :: +$ name |$ [M] …
1025 ==
1026 ==
1026::
1027::
1027−:: +pseg: a path mold's segment, a knot or [name=aura]
1028+:: +pseg: a path mold's segment, a knot, [name=aura], or [name=_]
1028::
1029::
1029−+$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta])
1030++$ pseg $%([%knot p=@ta] [%typed at=span name=term aura=@ta] [%inferred at=span name=term hole-at=span])
1030::
1031::
1031+| %api
1032+| %api
1032::
1033::
@@ -1295,6 +1296,7 @@
1295 (emit 1 %'=')
1296 (emit 1 %'=')
1296 ?: =('`' a) (emit 1 %'`')
1297 ?: =('`' a) (emit 1 %'`')
1297 ?: =('*' a) (emit 1 %'*')
1298 ?: =('*' a) (emit 1 %'*')
1299+ ?: =('_' a) (emit 1 %'_')
1298 ?: =('~' a)
1300 ?: =('~' a)
1299 ?: =('[' b) (emit 2 %'~[')
1301 ?: =('[' b) (emit 2 %'~[')
1300 ?: =('&' b) (emit 2 %'~&')
1302 ?: =('&' b) (emit 2 %'~&')
@@ -1670,14 +1672,14 @@
1670:: What may begin each place the parser reads (section 3, Errors):
1672:: What may begin each place the parser reads (section 3, Errors):
1671:: an expression a-z 0-9 " ( [ ~ % / ` | ^ ? !
1673:: an expression a-z 0-9 " ( [ ~ % / ` | ^ ? !
1672:: an operand a-z 0-9 " ( [ ~ % / ` | !
1674:: an operand a-z 0-9 " ( [ ~ % / ` | !
1673−:: a mold a-z A-Z @ * ! ? ~ % / ( [ $
1675+:: a mold a-z A-Z @ * ! ? ~ % / ( [ $ _
1674:: a pattern a-z 0-9 " ~ % * [
1676:: a pattern a-z 0-9 " ~ % * [
1675:: and what may go tight after an operand: . ( + = after a name, a
1677:: and what may go tight after an operand: . ( + = after a name, a
1676:: closer ) ] }, or the : of a comment
1678:: closer ) ] }, or the : of a comment
1677::
1679::
1678++ expr-mask 0x57ff.ffff.4800.0000.83ff.8126.0000.0000
1680++ expr-mask 0x57ff.ffff.4800.0000.83ff.8126.0000.0000
1679++ operand-mask 0x57ff.ffff.0800.0000.03ff.8126.0000.0000
1681++ operand-mask 0x57ff.ffff.0800.0000.03ff.8126.0000.0000
1680−++ mold-mask 0x47ff.fffe.0fff.ffff.8000.8532.0000.0000
1682+++ mold-mask 0x47ff.fffe.8fff.ffff.8000.8532.0000.0000
1681++ bar-mask 0x1000.0000.0000.0000.0000.0000.0000.0000
1683++ bar-mask 0x1000.0000.0000.0000.0000.0000.0000.0000
1682++ pattern-mask 0x47ff.fffe.0800.0000.03ff.0424.0000.0000
1684++ pattern-mask 0x47ff.fffe.0800.0000.03ff.0424.0000.0000
1683++ after-mask 0x2000.0000.2000.0000.2400.4b00.0000.0000
1685++ after-mask 0x2000.0000.2000.0000.2400.4b00.0000.0000
@@ -2107,6 +2109,7 @@
2107 ?- -.s
2109 ?- -.s
2108 %knot (weld "/" (trip p.s))
2110 %knot (weld "/" (trip p.s))
2109 %typed "/[{(trip name.s)}=@{(trip aura.s)}]"
2111 %typed "/[{(trip name.s)}=@{(trip aura.s)}]"
2112+ %inferred "/[{(trip name.s)}=_]"
2110 ==
2113 ==
2111::
2114::
2112++ show-tvars
2115++ show-tvars
@@ -2318,6 +2321,7 @@
2318 %const (nod "const" at.s (show-lit lit.s) ~)
2321 %const (nod "const" at.s (show-lit lit.s) ~)
2319 %ref (nod "ref" at.s (show-names names.s) ~)
2322 %ref (nod "ref" at.s (show-names names.s) ~)
2320 %tvar (nod "tvar" at.s (trip name.s) ~)
2323 %tvar (nod "tvar" at.s (trip name.s) ~)
2324+ %hole (nod "hole" at.s "" ~)
2321 %path (nod "path" at.s (show-psegs segs.s) ~)
2325 %path (nod "path" at.s (show-psegs segs.s) ~)
2322 %apply (nod "apply" at.s (show-names ref.s) (turn args.s sexp-shape))
2326 %apply (nod "apply" at.s (show-names ref.s) (turn args.s sexp-shape))
2323 %cell (nod "cell" at.s "" (turn fields.s sexp-field))
2327 %cell (nod "cell" at.s "" (turn fields.s sexp-field))
@@ -3842,6 +3846,7 @@
3842 %'*' [%& [%noun at.t ~] t.ts]
3846 %'*' [%& [%noun at.t ~] t.ts]
3843 %'!!' [%& [%void at.t ~] t.ts]
3847 %'!!' [%& [%void at.t ~] t.ts]
3844 %'?' [%& [%flag at.t ~] t.ts]
3848 %'?' [%& [%flag at.t ~] t.ts]
3849+ %'_' [%& [%hole at.t ~] t.ts]
3845 [%name *] [%& [%ref at.t ~[p.lex.t]] t.ts]
3850 [%name *] [%& [%ref at.t ~[p.lex.t]] t.ts]
3846 [%wing *] [%& [%ref at.t p.lex.t] t.ts]
3851 [%wing *] [%& [%ref at.t p.lex.t] t.ts]
3847 [%tvar *] [%& [%tvar at.t p.lex.t] t.ts]
3852 [%tvar *] [%& [%tvar at.t p.lex.t] t.ts]
@@ -4058,7 +4063,7 @@
4058 ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
4063 ?: &(?=(^ nex) tight.i.nex) (bad nex "a path segment")
4059 (bad-space i.after nex "a path segment")
4064 (bad-space i.after nex "a path segment")
4060 ::
4065 ::
4061− :: +read-pseg: a path mold's segment, a knot or [name=aura] with no
4066+ :: +read-pseg: a path mold's knot, [name=aura], or [name=_] with no
4062 :: spaces, and where it ends
4067 :: spaces, and where it ends
4063 ::
4068 ::
4064 ++ read-pseg
4069 ++ read-pseg
@@ -4075,13 +4080,16 @@
4075 ?: |(?=(~ r2) !tight.i.r2) (bad-space i.r1 r2 "`=`")
4080 ?: |(?=(~ r2) !tight.i.r2) (bad-space i.r1 r2 "`=`")
4076 ?. ?=([[* * %'='] *] r2) (bad-in r2 "`=`" tis-mask)
4081 ?. ?=([[* * %'='] *] r2) (bad-in r2 "`=`" tis-mask)
4077 =/ r3=(list token) t.r2
4082 =/ r3=(list token) t.r2
4078− ?: |(?=(~ r3) !tight.i.r3) (bad-space i.r2 r3 "an aura")
4083+ ?: |(?=(~ r3) !tight.i.r3) (bad-space i.r2 r3 "an aura or type hole")
4079− ?. ?=([[* * [%aura *]] *] r3) (bad-in r3 "an aura" pat-mask)
4084+ ?. ?=([[* * ?([%aura *] %'_')] *] r3) (bad-in r3 "an aura or type hole" (con pat-mask (bex 95)))
4080 =/ r4=(list token) t.r3
4085 =/ r4=(list token) t.r3
4081 ?: |(?=(~ r4) !tight.i.r4) (bad-space i.r3 r4 "`]`")
4086 ?: |(?=(~ r4) !tight.i.r4) (bad-space i.r3 r4 "`]`")
4082 ?. ?=([[* * %']'] *] r4) (bad-in r4 "`]`" ser-mask)
4087 ?. ?=([[* * %']'] *] r4) (bad-in r4 "`]`" ser-mask)
4083 =/ at=span [beg.at.op end.at.i.r4]
4088 =/ at=span [beg.at.op end.at.i.r4]
4089+ =/ seg=pseg
4090+ ?: ?=(%'_' lex.i.r3) [%inferred at p.lex.i.r1 at.i.r3]
4084− [%& [[%typed at p.lex.i.r1 p.lex.i.r3] end.at.i.r4] t.r4]
4091+ [%typed at p.lex.i.r1 p.lex.i.r3]
4092+ [%& [seg end.at.i.r4] t.r4]
4085 --
4093 --
4086::
4094::
4087+| %span-check
4095+| %span-check
@@ -4465,6 +4473,7 @@
4465 %const [%const at.s ~[%lit] %one ~]
4473 %const [%const at.s ~[%lit] %one ~]
4466 %ref [%ref at.s ~[%name %wing] %one ~]
4474 %ref [%ref at.s ~[%name %wing] %one ~]
4467 %tvar [%tvar at.s ~[%tvar] %one ~]
4475 %tvar [%tvar at.s ~[%tvar] %one ~]
4476+ %hole [%hole at.s ~[%'_'] %one ~]
4468 %apply [%apply at.s ~[%'('] %shut (turn args.s outline-shape)]
4477 %apply [%apply at.s ~[%'('] %shut (turn args.s outline-shape)]
4469 %cell [%cell at.s ~[%'['] %shut (turn fields.s outline-sample)]
4478 %cell [%cell at.s ~[%'['] %shut (turn fields.s outline-sample)]
4470 ::
4479 ::
@@ -4473,8 +4482,11 @@
4473 %+ murn segs.s
4482 %+ murn segs.s
4474 |= g=pseg
4483 |= g=pseg
4475 ^- (unit outline)
4484 ^- (unit outline)
4485+ ?- -.g
4486+ %knot ~
4476− ?. ?=(%typed -.g) ~
4487+ %typed `[%typed at.g ~[%'['] %shut ~]
4477− `[%typed at.g ~[%'['] %shut ~]
4488+ %inferred `[%typed at.g ~[%'['] %shut ~[[%hole hole-at.g ~[%'_'] %one ~]]]
4489+ ==
4478 [%path at.s ~[%'/'] %run ks]
4490 [%path at.s ~[%'/'] %run ks]
4479 ::
4491 ::
4480 %union
4492 %union
@@ -4534,6 +4546,8 @@
4534 [%path [1 9] [1 9] [1 21]]
4546 [%path [1 9] [1 9] [1 21]]
4535 [%face [1 7] [1 7] [1 21]]
4547 [%face [1 7] [1 7] [1 21]]
4536 ==
4548 ==
4549+ :: an inferred path aura's hole spanning its = as well
4550+ ['+$ x /a/[id=_]' ~[[%hole [1 13] [1 12] [1 14]]]]
4537 :: an import's path cut short
4551 :: an import's path cut short
4538 ['/= c /ui/c' ~[[%jibb [1 1] [1 1] [1 11]]]]
4552 ['/= c /ui/c' ~[[%jibb [1 1] [1 1] [1 11]]]]
4539 :: brackets that close with the deeper lines, cut at their line's
4553 :: brackets that close with the deeper lines, cut at their line's
@@ -4593,6 +4607,8 @@
4593:: Atom constraints tied to an explicit capital or an inferred sample
4607:: Atom constraints tied to an explicit capital or an inferred sample
4594:: are generalized and printed. Other aura variables remain unsupported until
4608:: are generalized and printed. Other aura variables remain unsupported until
4595:: their defaulting and inferred generalization are implemented.
4609:: their defaulting and inferred generalization are implemented.
4610+:: Restricted-number promotion considers written capitals only; if there
4611+:: are none, it skips the otherwise unnecessary environment traversal.
4596:: Bare @ is a separate unrestricted atom type. A directional fit check
4612:: 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
4613:: permits concrete atoms to widen to it, never the reverse. A fit that
4598:: needs a not-yet-implemented constraint remains unsupported. Named unions
4614:: needs a not-yet-implemented constraint remains unsupported. Named unions
@@ -4600,18 +4616,64 @@
4600:: from their display name. Generic cases must be disjoint for all arguments.
4616:: from their display name. Generic cases must be disjoint for all arguments.
4601:: Unnamed union printing is informational; it is not Jibb syntax.
4617:: Unnamed union printing is informational; it is not Jibb syntax.
4602::
4618::
4619+:: `proj` is a reserved, type-directed operation, not an ordinary gate.
4620+:: The supported fragment selects uniquely faced fields from a known record
4621+:: in source order (reordering is a doc question). It records the original
4622+:: call, source and target types, and source axes with its definition;
4623+:: A single selected field keeps its face and uses one source axis.
4624+:: Checked module interfaces retain that evidence and their source, including
4625+:: the private prelude dependency. A later lowerer must replace the call by
4626+:: an inline gate applied to the operand once; no lowering is implemented yet.
4627+:: Ordinary fits never insert a projection. Unknown or variable-origin record
4628+:: spines, nested projected fields and projections in
4629+:: recursive groups remain unsupported. Directional fits bound faced-spine
4630+:: proofs to fewer than 1,024 cells; the projection planner has a separate
4631+:: 4,096-step bound. These are inference limits, not language limits.
4632+::
4633+:: Supported API imports derive request-gate types atomically for multiple
4634+:: paths, including one typed segment or one diff fold per case. Their checked
4635+:: ordinary definitions, mark molds and supported poke constructor are also
4636+:: exported. A selected /sur mold is checked through its trusted reader result;
4637+:: unused cores and other bindings are not independently validated. APIs
4638+:: with /= imports, separate scry paths, multiple parameters or diffs, or a
4639+:: parameter together with a fold remain unsupported. The unchanged todo API
4640+:: fits this fragment, including named closed fold gates.
4641+::
4642+:: Each case's source-derived schema and canonical API identity travel in a
4643+:: dependency closure bound to the exact supplied bundle, prelude, scope and
4644+:: trusted reader results. Unknown cached entries are rebuilt. Request-bearing
4645+:: closures are limited to 256 source paths and requests. This is type
4646+:: inference only: no request lowering, runtime schema validator or proof that
4647+:: an arbitrary ask value is watchable is supplied.
4648+::
4649+:: A closed gate sample may omit one outer face from a known input slot when
4650+:: its product is identical. Distinct written names, nested value faces,
4651+:: ambiguous cell tails and raw-variable-origin fits retain their prior rules.
4652+::
4653+:: In one synthetic eval of a 48-module deep and 48-module wide request-free
4654+:: graph, baseline versus certificate inference took 21.53 s versus 23.10 s
4655+:: elapsed (21.10 s versus 22.34 s CPU), including startup. The deep cache's
4656+:: jam grew from 2,402 to 4,209 bytes (+1,807 bytes). These single-run figures
4657+:: are not production memory or performance benchmarks.
4658+::
4603+$ itype
4659+$ itype
4604 $~ [%var 0]
4660 $~ [%var 0]
4605 $% [%var id=@ud]
4661 $% [%var id=@ud]
4606 [%avar id=@ud]
4662 [%avar id=@ud]
4663+ [%rvar id=@ud]
4607 [%nvar id=@ud]
4664 [%nvar id=@ud]
4665+ [%rnvar id=@ud]
4608 [%atom aura=@ta]
4666 [%atom aura=@ta]
4609 [%any-atom ~]
4667 [%any-atom ~]
4610 [%flag ~]
4668 [%flag ~]
4669+ [%noun ~]
4670+ [%empty ~]
4611 [%tag id=@ud literal=lit constructor=?]
4671 [%tag id=@ud literal=lit constructor=?]
4612 [%const literal=lit]
4672 [%const literal=lit]
4613 [%collection name=term args=(list itype)]
4673 [%collection name=term args=(list itype)]
4614 [%recursive module=term name=term label=(unit @t)]
4674 [%recursive module=term name=term label=(unit @t)]
4675+ [%jrec at=path name=term label=(unit @t) head=term aura=@ta tail=term]
4676+ [%grec at=path name=term label=(unit @t) proof=shape args=(list itype)]
4615 [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4677 [%union cases=(list itype) origin=(unit [at=path name=term]) label=(unit @t) args=(list itype)]
4616 [%face name=term body=itype]
4678 [%face name=term body=itype]
4617 [%fn sample=itype product=itype]
4679 [%fn sample=itype product=itype]
@@ -4635,21 +4697,117 @@
4635 %var
4697 %var
4636 =/ found=(unit itype) (itype-lookup id.t sub)
4698 =/ found=(unit itype) (itype-lookup id.t sub)
4637 ?~ found t
4699 ?~ found t
4700+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4638 $(t u.found)
4701 $(t u.found)
4639 %avar
4702 %avar
4640 =/ found=(unit itype) (itype-lookup id.t sub)
4703 =/ found=(unit itype) (itype-lookup id.t sub)
4641 ?~ found t
4704 ?~ found t
4705+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4706+ $(t u.found)
4707+ %rvar
4708+ =/ found=(unit itype) (itype-lookup id.t sub)
4709+ ?~ found t
4710+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4642 $(t u.found)
4711 $(t u.found)
4643 %nvar
4712 %nvar
4644 =/ found=(unit itype) (itype-lookup id.t sub)
4713 =/ found=(unit itype) (itype-lookup id.t sub)
4645 ?~ found t
4714 ?~ found t
4715+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4716+ $(t u.found)
4717+ %rnvar
4718+ =/ found=(unit itype) (itype-lookup id.t sub)
4719+ ?~ found t
4720+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4646 $(t u.found)
4721 $(t u.found)
4647 %tag
4722 %tag
4648 =/ found=(unit itype) (itype-lookup id.t sub)
4723 =/ found=(unit itype) (itype-lookup id.t sub)
4649 ?~ found t
4724 ?~ found t
4725+ ?: &(|(?=(%rvar -.u.found) ?=(%rnvar -.u.found)) =(id.t +.u.found)) u.found
4650 $(t u.found)
4726 $(t u.found)
4651 ==
4727 ==
4652::
4728::
4729+:: Prove only emptiness; unknown types are never treated as empty.
4730+:: A shared node budget bounds each proof attempt.
4731+++ itype-empty-cases
4732+ |= [xs=(list itype) sub=isub fuel=@ud]
4733+ ^- (unit [empty=? left=@ud])
4734+ ?~ xs `[& fuel]
4735+ =/ first=(unit [empty=? left=@ud]) (itype-empty-proof i.xs sub fuel)
4736+ ?~ first ~
4737+ ?. empty.u.first `[| left.u.first]
4738+ $(xs t.xs, fuel left.u.first)
4739+++ itype-empty-proof
4740+ |= [typ=itype sub=isub fuel=@ud]
4741+ ^- (unit [empty=? left=@ud])
4742+ ?: =(0 fuel) ~
4743+ =. fuel (dec fuel)
4744+ =. typ (itype-walk typ sub)
4745+ ?- -.typ
4746+ %empty `[& fuel]
4747+ %face $(typ body.typ)
4748+ %cell
4749+ =/ left=(unit [empty=? left=@ud]) $(typ hed.typ)
4750+ ?~ left ~
4751+ ?: empty.u.left `[& left.u.left]
4752+ $(typ tal.typ, fuel left.u.left)
4753+ %union (itype-empty-cases cases.typ sub fuel)
4754+ * `[| fuel]
4755+ ==
4756+:: Prove reachability separately from emptiness. An unresolved fixed
4757+:: recursive type is not presumed inhabited. A written, still-unconstrained
4758+:: capital is existentially inhabited for pattern reachability; the normal
4759+:: definition-boundary checks reject subsequently constrained capitals.
4760+++ itype-inhabited-cases
4761+ |= [xs=(list itype) sub=isub caps=icaps fuel=@ud pending=?]
4762+ ^- (unit [result=?(%yes %no %unknown) left=@ud])
4763+ ?~ xs `[?:(pending %unknown %no) fuel]
4764+ =/ first=(unit [result=?(%yes %no %unknown) left=@ud])
4765+ (itype-inhabited-proof i.xs sub caps fuel)
4766+ ?~ first ~
4767+ ?: =(%yes result.u.first) first
4768+ $(xs t.xs, fuel left.u.first, pending |(pending =(%unknown result.u.first)))
4769+++ itype-inhabited-proof
4770+ |= [typ=itype sub=isub caps=icaps fuel=@ud]
4771+ ^- (unit [result=?(%yes %no %unknown) left=@ud])
4772+ ?: =(0 fuel) ~
4773+ =. fuel (dec fuel)
4774+ =. typ (itype-walk typ sub)
4775+ ?- -.typ
4776+ %empty `[%no fuel]
4777+ ?(%atom %any-atom %flag %const %noun %avar %rvar %nvar %rnvar %fn %jrec) `[%yes fuel]
4778+ %var
4779+ ?: (lien caps |=(c=icap (hole-same-variable typ (itype-walk [%var id.c] sub)))) `[%yes fuel]
4780+ `[%unknown fuel]
4781+ %face $(typ body.typ)
4782+ %cell
4783+ =/ head=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ hed.typ)
4784+ ?~ head ~
4785+ ?: =(%no result.u.head) head
4786+ =/ tail=(unit [result=?(%yes %no %unknown) left=@ud]) $(typ tal.typ, fuel left.u.head)
4787+ ?~ tail ~
4788+ ?: =(%no result.u.tail) tail
4789+ ?: |(=(%unknown result.u.head) =(%unknown result.u.tail)) `[%unknown left.u.tail]
4790+ `[%yes left.u.tail]
4791+ %union (itype-inhabited-cases cases.typ sub caps fuel |)
4792+ %collection
4793+ ?. &(|(=(%list name.typ) =(%unit name.typ)) ?=([* ~] args.typ)) `[%unknown fuel]
4794+ `[%yes fuel]
4795+ %grec ?:((grec-tree-proof name.typ proof.typ) `[%yes fuel] `[%unknown fuel])
4796+ * `[%unknown fuel]
4797+ ==
4798+++ itype-live-cases
4799+ |= [xs=(list itype) sub=isub caps=icaps fuel=@ud]
4800+ ^- (unit (list itype))
4801+ ?~ xs `~
4802+ =/ first=(unit [result=?(%yes %no %unknown) left=@ud])
4803+ (itype-inhabited-proof i.xs sub caps fuel)
4804+ ?~ first ~
4805+ ?: =(%unknown result.u.first) ~
4806+ =/ rest=(unit (list itype)) $(xs t.xs, fuel left.u.first)
4807+ ?~ rest ~
4808+ ?: =(%no result.u.first) rest
4809+ `[i.xs u.rest]
4810+::
4653++ itype-occurs
4811++ itype-occurs
4654 |= [n=@ud t=itype sub=isub]
4812 |= [n=@ud t=itype sub=isub]
4655 ^- ?
4813 ^- ?
@@ -4657,14 +4815,20 @@
4657 ?- -.t
4815 ?- -.t
4658 %var =(n id.t)
4816 %var =(n id.t)
4659 %avar =(n id.t)
4817 %avar =(n id.t)
4818+ %rvar =(n id.t)
4660 %nvar =(n id.t)
4819 %nvar =(n id.t)
4820+ %rnvar =(n id.t)
4661 %atom |
4821 %atom |
4662 %any-atom |
4822 %any-atom |
4663 %flag |
4823 %flag |
4824+ %noun |
4825+ %empty |
4664 %tag =(n id.t)
4826 %tag =(n id.t)
4665 %const |
4827 %const |
4666 %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4828 %union |((lien cases.t |=(c=itype (itype-occurs n c sub))) (lien args.t |=(c=itype (itype-occurs n c sub))))
4667 %recursive |
4829 %recursive |
4830+ %jrec |
4831+ %grec (lien args.t |=(c=itype (itype-occurs n c sub)))
4668 %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4832 %collection (lien args.t |=(c=itype (itype-occurs n c sub)))
4669 %face $(t body.t)
4833 %face $(t body.t)
4670 %fn |($(t sample.t) $(t product.t))
4834 %fn |($(t sample.t) $(t product.t))
@@ -4683,6 +4847,11 @@
4683 =. a (itype-walk a sub)
4847 =. a (itype-walk a sub)
4684 =. b (itype-walk b sub)
4848 =. b (itype-walk b sub)
4685 ?: =(a b) `sub
4849 ?: =(a b) `sub
4850+ ?: &(?=(%grec -.a) ?=(%grec -.b))
4851+ ?. &(=(at.a at.b) =(name.a name.b)) ~
4852+ (itype-unify-args args.a args.b sub)
4853+ ?: &(?=(%jrec -.a) ?=(%jrec -.b))
4854+ ?:(&(=(at.a at.b) =(name.a name.b) =(head.a head.b) =(aura.a aura.b) =(tail.a tail.b)) `sub ~)
4686 ?: &(?=(%recursive -.a) ?=(%recursive -.b))
4855 ?: &(?=(%recursive -.a) ?=(%recursive -.b))
4687 ?:(&(=(module.a module.b) =(name.a name.b)) `sub ~)
4856 ?:(&(=(module.a module.b) =(name.a name.b)) `sub ~)
4688 ?: &(?=(%union -.a) ?=(%union -.b))
4857 ?: &(?=(%union -.a) ?=(%union -.b))
@@ -4699,6 +4868,32 @@
4699 ?: ?=(%var -.b)
4868 ?: ?=(%var -.b)
4700 ?: (itype-occurs id.b a sub) ~
4869 ?: (itype-occurs id.b a sub) ~
4701 `[[id.b a] sub]
4870 `[[id.b a] sub]
4871+ :: Arithmetic's aura variable excludes loobeans; decimal literals
4872+ :: remain defaultable until a later constraint makes them concrete.
4873+ ?: &(?=(%nvar -.a) ?=(%rvar -.b))
4874+ `[[id.b [%rnvar id.a]] [id.a [%rnvar id.a]] sub]
4875+ ?: &(?=(%rvar -.a) ?=(%nvar -.b))
4876+ `[[id.a [%rnvar id.b]] [id.b [%rnvar id.b]] sub]
4877+ ?: &(?=(%rnvar -.a) ?=(%rvar -.b)) `[[id.b a] sub]
4878+ ?: &(?=(%rvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4879+ ?: &(?=(%rnvar -.a) ?=(%nvar -.b)) `[[id.b a] sub]
4880+ ?: &(?=(%nvar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4881+ ?: &(?=(%rnvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4882+ ?: &(?=(%avar -.a) ?=(%rnvar -.b)) `[[id.a b] sub]
4883+ ?: ?=(%rnvar -.a)
4884+ ?. |(?=(%rnvar -.b) ?=(%atom -.b)) ~
4885+ `[[id.a b] sub]
4886+ ?: ?=(%rnvar -.b)
4887+ ?. ?=(%atom -.a) ~
4888+ `[[id.b a] sub]
4889+ ?: &(?=(%avar -.a) ?=(%rvar -.b)) `[[id.a b] sub]
4890+ ?: &(?=(%rvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4891+ ?: ?=(%rvar -.a)
4892+ ?. |(?=(%rvar -.b) ?=(%atom -.b)) ~
4893+ `[[id.a b] sub]
4894+ ?: ?=(%rvar -.b)
4895+ ?. ?=(%atom -.a) ~
4896+ `[[id.b a] sub]
4702 :: The narrower decimal constraint survives a match with an atom
4897 :: The narrower decimal constraint survives a match with an atom
4703 :: variable; decimal syntax alone does not make it a loobean.
4898 :: variable; decimal syntax alone does not make it a loobean.
4704 ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
4899 ?: &(?=(%nvar -.a) ?=(%avar -.b)) `[[id.b a] sub]
@@ -4753,14 +4948,20 @@
4753 ?- -.t
4948 ?- -.t
4754 %var |
4949 %var |
4755 %avar |
4950 %avar |
4951+ %rvar |
4756 %nvar |
4952 %nvar |
4953+ %rnvar |
4757 %atom |
4954 %atom |
4758 %any-atom &
4955 %any-atom &
4759 %flag |
4956 %flag |
4957+ %noun |
4958+ %empty |
4760 %tag |
4959 %tag |
4761 %const |
4960 %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))))
4961 %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 |
4962 %recursive |
4963+ %jrec |
4964+ %grec (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4764 %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4965 %collection (lien args.t |=(c=itype (itype-has-any-atom c sub)))
4765 %face $(t body.t)
4966 %face $(t body.t)
4766 %fn |($(t sample.t) $(t product.t))
4967 %fn |($(t sample.t) $(t product.t))
@@ -4823,14 +5024,20 @@
4823 ?- -.typ
5024 ?- -.typ
4824 %var |
5025 %var |
4825 %avar |
5026 %avar |
5027+ %rvar |
4826 %nvar |
5028 %nvar |
5029+ %rnvar |
4827 %atom &
5030 %atom &
4828 %any-atom &
5031 %any-atom &
4829 %flag &
5032 %flag &
5033+ %noun |
5034+ %empty |
4830 %tag &
5035 %tag &
4831 %const &
5036 %const &
4832 %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
5037 %union |((lien cases.typ |=(c=itype (itype-has-fixed-atom c))) (lien args.typ |=(c=itype (itype-has-fixed-atom c))))
4833 %recursive |
5038 %recursive |
5039+ %jrec |
5040+ %grec (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4834 %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
5041 %collection (lien args.typ |=(c=itype (itype-has-fixed-atom c)))
4835 %face $(typ body.typ)
5042 %face $(typ body.typ)
4836 %fn |($(typ sample.typ) $(typ product.typ))
5043 %fn |($(typ sample.typ) $(typ product.typ))
@@ -4859,6 +5066,7 @@
4859 ^- ?
5066 ^- ?
4860 =. t (itype-walk t sub)
5067 =. t (itype-walk t sub)
4861 ?- -.t
5068 ?- -.t
5069+ %grec (lien args.t |=(c=itype (itype-has-face c sub)))
4862 %collection (lien args.t |=(c=itype (itype-has-face c sub)))
5070 %collection (lien args.t |=(c=itype (itype-has-face c sub)))
4863 %face &
5071 %face &
4864 %cell |($(t hed.t) $(t tal.t))
5072 %cell |($(t hed.t) $(t tal.t))
@@ -4866,6 +5074,42 @@
4866 * |
5074 * |
4867 ==
5075 ==
4868::
5076::
5077+:: Closed function samples may omit a slot face, but a known name must
5078+:: match another known name. Keep nested value faces and require exact
5079+:: invariant compatibility; a faced tail against a cell is ambiguous.
5080+++ itype-closed-slot-match
5081+ |= [a=itype b=itype]
5082+ ^- ?
5083+ ?: &(?=(%face -.a) ?=(%face -.b))
5084+ ?. =(name.a name.b) |
5085+ ?=(^ (itype-unify body.a body.b ~))
5086+ ?: ?=(%face -.a) ?=(^ (itype-unify body.a b ~))
5087+ ?: ?=(%face -.b) ?=(^ (itype-unify a body.b ~))
5088+ ?=(^ (itype-unify a b ~))
5089+++ itype-closed-sample-match
5090+ |= [a=itype b=itype fuel=@ud]
5091+ ^- ?
5092+ ?: =(0 fuel) |
5093+ ?. &(?=(%cell -.a) ?=(%cell -.b)) |
5094+ ?. (itype-closed-slot-match hed.a hed.b) |
5095+ =/ x=itype tal.a
5096+ =/ y=itype tal.b
5097+ ?: &(?=(%cell -.x) ?=(%cell -.y))
5098+ ?=(^ (itype-unify x y ~))
5099+ ?: |(&(?=(%face -.x) ?=(%cell -.y)) &(?=(%cell -.x) ?=(%face -.y))) |
5100+ (itype-closed-slot-match x y)
5101+++ itype-closed-gates-match
5102+ |= [a=itype b=itype]
5103+ ^- ?
5104+ ?. &(?=(%fn -.a) ?=(%fn -.b)) |
5105+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) |
5106+ ?. =(product.a product.b) |
5107+ ?^ (itype-vars a) |
5108+ ?^ (itype-vars b) |
5109+ ?: |((itype-has-tag a) (itype-has-tag b)) |
5110+ ?. (itype-closed-sample-match sample.a sample.b 1.024) |
5111+ ?=(^ (itype-unify product.a product.b ~))
5112+::
4869++ itype-face-asym-collection-args
5113++ itype-face-asym-collection-args
4870 |= [as=(list itype) bs=(list itype) sub=isub]
5114 |= [as=(list itype) bs=(list itype) sub=isub]
4871 ^- ?
5115 ^- ?
@@ -4879,12 +5123,15 @@
4879 ^- ?
5123 ^- ?
4880 =. a (itype-walk a sub)
5124 =. a (itype-walk a sub)
4881 =. b (itype-walk b sub)
5125 =. b (itype-walk b sub)
5126+ ?: &(?=(%grec -.a) ?=(%grec -.b))
5127+ ?. &(=(at.a at.b) =(name.a name.b)) |
5128+ (itype-face-asym-collection-args args.a args.b sub)
4882 ?: &(?=(%collection -.a) ?=(%collection -.b))
5129 ?: &(?=(%collection -.a) ?=(%collection -.b))
4883 ?. =(name.a name.b) |
5130 ?. =(name.a name.b) |
4884 (itype-face-asym-collection-args args.a args.b sub)
5131 (itype-face-asym-collection-args args.a args.b sub)
4885 ?: &(?=(%face -.a) ?=(%face -.b)) $(a body.a, b body.b)
5132 ?: &(?=(%face -.a) ?=(%face -.b)) $(a body.a, b body.b)
4886− ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%avar -.b) ?=(%nvar -.b))
5133+ ?: ?=(%face -.a) !|(?=(%var -.b) ?=(%avar -.b) ?=(%rvar -.b) |(?=(%nvar -.b) ?=(%rnvar -.b)))
4887− ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%avar -.a) ?=(%nvar -.a))
5134+ ?: ?=(%face -.b) !|(?=(%var -.a) ?=(%avar -.a) ?=(%rvar -.a) |(?=(%nvar -.a) ?=(%rnvar -.a)))
4888 ?: &(?=(%cell -.a) ?=(%cell -.b)) |($(a hed.a, b hed.b) $(a tal.a, b tal.b))
5135 ?: &(?=(%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))
5136 ?: &(?=(%fn -.a) ?=(%fn -.b)) |($(a sample.a, b sample.b) $(a product.a, b product.b))
4890 |
5137 |
@@ -4907,6 +5154,30 @@
4907 [%cell $(actual hed.actual, expected hed.expected) $(actual tal.actual, expected tal.expected)]
5154 [%cell $(actual hed.actual, expected hed.expected) $(actual tal.actual, expected tal.expected)]
4908 expected
5155 expected
4909::
5156::
5157+:: Positional call arguments do not write the sample's enclosing field
5158+:: labels. Ignore one raw sample-slot face per written argument while
5159+:: checking value faces as usual. An unknown or variable-bound cell spine
5160+:: cannot justify this distinction, so keep the existing conservative guard.
5161+++ itype-positional-slot-face-asym
5162+ |= [actual=itype expected=itype sub=isub]
5163+ ^- ?
5164+ ?: &(?=(%fn -.actual) ?=(%fn -.expected) (itype-closed-gates-match actual expected)) |
5165+ (itype-face-asym actual expected sub)
5166+::
5167+++ itype-positional-face-asym
5168+ |= [args=(list expr) actual=itype expected=itype sub=isub]
5169+ ^- ?
5170+ ?~ args &
5171+ ?~ t.args
5172+ =/ slot=itype expected
5173+ =? slot ?=(%face -.slot) body.slot
5174+ (itype-positional-slot-face-asym actual slot sub)
5175+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) &
5176+ =/ slot=itype hed.expected
5177+ =? slot ?=(%face -.slot) body.slot
5178+ ?: (itype-positional-slot-face-asym hed.actual slot sub) &
5179+ $(args t.args, actual tal.actual, expected tal.expected)
5180+::
4910++ itype-output-may-be-cell
5181++ itype-output-may-be-cell
4911 |= [t=itype sub=isub]
5182 |= [t=itype sub=isub]
4912 ^- ?
5183 ^- ?
@@ -4916,6 +5187,9 @@
4916 %cell &
5187 %cell &
4917 %union &
5188 %union &
4918 %recursive &
5189 %recursive &
5190+ %jrec &
5191+ %grec &
5192+ %noun &
4919 %collection &
5193 %collection &
4920 %face $(t body.t)
5194 %face $(t body.t)
4921 %fn |($(t sample.t) $(t product.t))
5195 %fn |($(t sample.t) $(t product.t))
@@ -4944,6 +5218,7 @@
4944 ^- ?
5218 ^- ?
4945 ?- -.t
5219 ?- -.t
4946 %tag &
5220 %tag &
5221+ %grec (lien args.t |=(c=itype (itype-has-tag c)))
4947 %collection (lien args.t |=(c=itype (itype-has-tag c)))
5222 %collection (lien args.t |=(c=itype (itype-has-tag c)))
4948 %face $(t body.t)
5223 %face $(t body.t)
4949 %fn |($(t sample.t) $(t product.t))
5224 %fn |($(t sample.t) $(t product.t))
@@ -4957,6 +5232,7 @@
4957 ^- ?
5232 ^- ?
4958 ?- -.t
5233 ?- -.t
4959 %union &
5234 %union &
5235+ %grec (lien args.t |=(c=itype (itype-has-union c)))
4960 %collection (lien args.t |=(c=itype (itype-has-union c)))
5236 %collection (lien args.t |=(c=itype (itype-has-union c)))
4961 %face $(t body.t)
5237 %face $(t body.t)
4962 %fn |($(t sample.t) $(t product.t))
5238 %fn |($(t sample.t) $(t product.t))
@@ -4975,6 +5251,7 @@
4975 %union
5251 %union
4976 ?: &(?=(~ label.t) ?=(^ args.t)) &
5252 ?: &(?=(~ label.t) ?=(^ args.t)) &
4977 (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5253 (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-generic c)))
5254+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-generic c))))
4978 %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
5255 %collection (lien args.t |=(c=itype (itype-has-hidden-generic c)))
4979 %face $(t body.t)
5256 %face $(t body.t)
4980 %fn |($(t sample.t) $(t product.t))
5257 %fn |($(t sample.t) $(t product.t))
@@ -4987,6 +5264,8 @@
4987 ^- ?
5264 ^- ?
4988 ?- -.t
5265 ?- -.t
4989 %recursive &
5266 %recursive &
5267+ %jrec &
5268+ %grec &
4990 %collection (lien args.t |=(c=itype (itype-has-recursive c)))
5269 %collection (lien args.t |=(c=itype (itype-has-recursive c)))
4991 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
5270 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-recursive c)))
4992 %face $(t body.t)
5271 %face $(t body.t)
@@ -5000,6 +5279,8 @@
5000 ^- ?
5279 ^- ?
5001 ?- -.t
5280 ?- -.t
5002 %recursive ?=(~ label.t)
5281 %recursive ?=(~ label.t)
5282+ %jrec ?=(~ label.t)
5283+ %grec |(?=(~ label.t) (lien args.t |=(c=itype (itype-has-hidden-recursive c))))
5003 %collection (lien args.t |=(c=itype (itype-has-hidden-recursive c)))
5284 %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)))
5285 %union (lien (weld args.t cases.t) |=(c=itype (itype-has-hidden-recursive c)))
5005 %face $(t body.t)
5286 %face $(t body.t)
@@ -5027,34 +5308,107 @@
5027 $(cases t.cases, good `trial)
5308 $(cases t.cases, good `trial)
5028 ==
5309 ==
5029::
5310::
5030−:: A constructor needs a case with its tag at the head and a payload
5311+:: A constructor needs a case whose head has the same literal noun as its
5031−:: compatible with the expected gate sample. Other case forms do not
5312+:: tag. An unresolved or opaque case may reveal one later, so it cannot
5032−:: identify a constructor.
5313+:: prove a mismatch or a unique match. A broad atom mold is not a case.
5033::
5314::
5034++ itype-fit-ctor-cases
5315++ itype-fit-ctor-cases
5035 |= [tag=lit sample=itype cases=(list itype) sub=isub next=@ud]
5316 |= [tag=lit sample=itype cases=(list itype) sub=isub next=@ud]
5036 ^- ifit
5317 ^- ifit
5037 =/ found=(unit ifit) ~
5318 =/ found=(unit ifit) ~
5319+ =/ pending=? |
5038 |-
5320 |-
5321+ ?~ cases
5322+ ?: pending [%unknown ~]
5039− ?~ cases ?~(found [%bad ~] u.found)
5323+ ?~ found [%bad ~]
5324+ u.found
5325+ =/ raw=itype i.cases
5326+ ?: ?=(%var -.raw)
5327+ $(cases t.cases, pending &)
5040− =/ c=itype (itype-walk i.cases sub)
5328+ =/ c=itype (itype-walk raw sub)
5329+ ?: ?=(?(%var %tag %recursive %jrec %grec %union %face) -.c)
5330+ $(cases t.cases, pending &)
5041 ?. ?=(%cell -.c) $(cases t.cases)
5331 ?. ?=(%cell -.c) $(cases t.cases)
5042− =/ head=itype (itype-walk hed.c sub)
5332+ =/ raw-head=itype hed.c
5333+ ?: ?=(%var -.raw-head)
5334+ $(cases t.cases, pending &)
5335+ =/ head=itype (itype-walk raw-head sub)
5336+ :: A single faced, explicitly atom-only head cannot be the tag case.
5337+ :: Do not follow variables or peel nested faces for this negative proof.
5338+ ?: ?=(%face -.head)
5339+ ?: ?=(?(%atom %any-atom %flag %avar %rvar %nvar %rnvar) -.body.head)
5340+ $(cases t.cases)
5341+ $(cases t.cases, pending &)
5342+ ?: ?=(?(%var %tag %recursive %jrec %grec %union) -.head)
5343+ $(cases t.cases, pending &)
5043 ?. ?=(%const -.head) $(cases t.cases)
5344 ?. ?=(%const -.head) $(cases t.cases)
5044− ?. =(%term form.literal.head) $(cases t.cases)
5045 ?. =(val.literal.head val.tag) $(cases t.cases)
5345 ?. =(val.literal.head val.tag) $(cases t.cases)
5046− ?^ found [%unknown ~]
5346+ :: Equal heads can have disjoint payloads. Test each from the original
5347+ :: substitution; a unique success is usable only with no unknown rival.
5047 =/ trial=ifit (itype-fit sample tal.c sub next)
5348 =/ trial=ifit (itype-fit sample tal.c sub next)
5349+ ?- -.trial
5350+ %bad $(cases t.cases)
5351+ %unknown $(cases t.cases, pending &)
5352+ %ok
5353+ ?^ found [%unknown ~]
5048− $(cases t.cases, found `trial)
5354+ $(cases t.cases, found `trial)
5355+ ==
5049::
5356::
5050++ itype-fit
5357++ itype-fit
5051 |= [actual=itype expected=itype sub=isub next=@ud]
5358 |= [actual=itype expected=itype sub=isub next=@ud]
5052 ^- ifit
5359 ^- ifit
5360+ =/ result=ifit (itype-fit-inner actual expected sub next | |)
5361+ ?: ?=(%ok -.result) result
5362+ =/ source=itype (itype-walk actual sub)
5363+ ?. ?=(?(%empty %face %cell %union) -.source) result
5364+ =/ empty=(unit [empty=? left=@ud]) (itype-empty-proof actual sub 256)
5365+ ?~ empty [%unknown ~]
5366+ ?: empty.u.empty [%ok sub next]
5367+ result
5368+++ itype-fit-inner
5369+ |= [actual=itype expected=itype sub=isub next=@ud skip-width=? spine-proof=?]
5370+ ^- ifit
5371+ ?: &(!skip-width ?=(%cell -.actual) ?=(%cell -.expected) |((width-spine-exhausted actual 1.024) (width-spine-exhausted expected 1.024)))
5372+ [%unknown ~]
5373+ =/ known=(unit [source=iwfields target=iwfields])
5374+ ?: skip-width ~
5375+ (width-known-shape actual expected sub)
5376+ =/ too-wide=? ?~(known | (gth (lent order.source.u.known) (lent order.target.u.known)))
5377+ ?: too-wide [%unknown ~]
5378+ =/ spine-checked=? |(spine-proof ?=(^ known))
5053 =/ uncertain=?
5379 =/ uncertain=?
5054− |(?=(%var -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%var -.expected) ?=(%avar -.expected) ?=(%nvar -.expected))
5380+ |(?=(%var -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%var -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)))
5381+ =/ actual-open=?
5382+ |(?=(%var -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))
5055 =. actual (itype-walk actual sub)
5383 =. actual (itype-walk actual sub)
5056 =. expected (itype-walk expected sub)
5384 =. expected (itype-walk expected sub)
5057 ?: =(actual expected) [%ok sub next]
5385 ?: =(actual expected) [%ok sub next]
5386+ ?: &(?=(%empty -.expected) |(?=(%cell -.actual) ?=(%face -.actual) ?=(%union -.actual) ?=(%grec -.actual) ?=(%recursive -.actual))) [%unknown ~]
5387+ :: The relation of the source loobean mold to explicit @f is not yet
5388+ :: established. Keep it unsupported rather than asserting a mismatch.
5389+ ?: &(?=(%flag -.actual) ?=(%atom -.expected) =(%f aura.expected)) [%unknown ~]
5390+ :: Any value can be used where a noun is expected. An unresolved
5391+ :: bare tag is fixed as a constant; a constructor still needs a gate.
5392+ ?: ?=(%noun -.expected)
5393+ ?: ?=(%tag -.actual)
5394+ ?: constructor.actual [%unknown ~]
5395+ [%ok [[id.actual expected] sub] next]
5396+ [%ok sub next]
5397+ :: An arbitrary noun is not known to fit a narrower type.
5398+ ?: &(?=(%noun -.actual) !?=(%var -.expected)) [%unknown ~]
5399+ ?: &(!uncertain ?=(%grec -.actual) ?=(%face -.expected)) $(expected body.expected)
5400+ ?: &(!uncertain ?=(%face -.actual) ?=(%grec -.expected)) $(actual body.actual)
5401+ ?: &(?=(%grec -.actual) ?=(%grec -.expected))
5402+ ?. &(=(at.actual at.expected) =(name.actual name.expected)) [%unknown ~]
5403+ =/ matched=(unit isub) (itype-unify-args args.actual args.expected sub)
5404+ ?~ matched [%unknown ~]
5405+ [%ok u.matched next]
5406+ ?: &(|(?=(%grec -.actual) ?=(%grec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5407+ ?: &(!uncertain ?=(%jrec -.actual) ?=(%face -.expected)) $(expected body.expected)
5408+ ?: &(!uncertain ?=(%face -.actual) ?=(%jrec -.expected)) $(actual body.actual)
5409+ ?: &(?=(%jrec -.actual) ?=(%jrec -.expected))
5410+ ?:(&(=(at.actual at.expected) =(name.actual name.expected) =(head.actual head.expected) =(aura.actual aura.expected) =(tail.actual tail.expected)) [%ok sub next] [%bad ~])
5411+ ?: &(|(?=(%jrec -.actual) ?=(%jrec -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5058 ?: &(?=(%recursive -.actual) ?=(%recursive -.expected))
5412 ?: &(?=(%recursive -.actual) ?=(%recursive -.expected))
5059 ?:(&(=(module.actual module.expected) =(name.actual name.expected)) [%ok sub next] [%bad ~])
5413 ?:(&(=(module.actual module.expected) =(name.actual name.expected)) [%ok sub next] [%bad ~])
5060 ?: &(|(?=(%recursive -.actual) ?=(%recursive -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
5414 ?: &(|(?=(%recursive -.actual) ?=(%recursive -.expected)) !|(?=(%var -.actual) ?=(%var -.expected))) [%unknown ~]
@@ -5066,8 +5420,21 @@
5066 =/ unified=(unit isub) (itype-unify-args args.actual args.expected sub)
5420 =/ unified=(unit isub) (itype-unify-args args.actual args.expected sub)
5067 ?^ unified [%ok u.unified next]
5421 ?^ unified [%ok u.unified next]
5068 [%unknown ~]
5422 [%unknown ~]
5423+ :: A known union can instantiate an unconstrained sample directly;
5424+ :: preserve unknown results for variable-bound union origins.
5425+ ?: &(!actual-open ?=(%union -.actual) ?=(%var -.expected))
5426+ ?~ origin.actual [%unknown ~]
5427+ =/ normalized=itype (itype-normalize actual sub)
5428+ ?: |((itype-has-tag normalized) (itype-has-recursive normalized) (itype-has-any-atom actual sub)) [%unknown ~]
5429+ =/ unified=(unit isub) (itype-unify actual expected sub)
5430+ ?~ unified [%unknown ~]
5431+ [%ok u.unified next]
5432+ :: A concrete union value in a tuple may acquire the expected field's
5433+ :: face. A variable-bound union still needs face propagation support.
5434+ ?: &(!uncertain ?=(%union -.actual) ?=(%face -.expected))
5435+ $(expected body.expected)
5069 ?: ?=(%union -.actual) [%unknown ~]
5436 ?: ?=(%union -.actual) [%unknown ~]
5070− ?: &(?=(%union -.expected) |(?=(%avar -.actual) ?=(%nvar -.actual))) [%unknown ~]
5437+ ?: &(?=(%union -.expected) |(?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)))) [%unknown ~]
5071 ?: &(?=(%union -.expected) !?=(%var -.actual))
5438 ?: &(?=(%union -.expected) !?=(%var -.actual))
5072 (itype-fit-cases actual cases.expected sub next)
5439 (itype-fit-cases actual cases.expected sub next)
5073 ?: ?=(%tag -.actual)
5440 ?: ?=(%tag -.actual)
@@ -5075,7 +5442,7 @@
5075 =/ u=(unit isub) (itype-unify actual expected sub)
5442 =/ u=(unit isub) (itype-unify actual expected sub)
5076 ?~ u [%bad ~]
5443 ?~ u [%bad ~]
5077 [%ok u.u next]
5444 [%ok u.u next]
5078− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5445+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5079 ?: ?=(%face -.expected) $(expected body.expected)
5446 ?: ?=(%face -.expected) $(expected body.expected)
5080 ?: constructor.actual
5447 ?: constructor.actual
5081 ?. ?=(%fn -.expected) [%bad ~]
5448 ?. ?=(%fn -.expected) [%bad ~]
@@ -5103,13 +5470,17 @@
5103 =/ u=(unit isub) (itype-unify actual expected sub)
5470 =/ u=(unit isub) (itype-unify actual expected sub)
5104 ?~ u [%bad ~]
5471 ?~ u [%bad ~]
5105 [%ok u.u next]
5472 [%ok u.u next]
5106− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5473+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5107 ?: ?=(%face -.expected) $(expected body.expected)
5474 ?: ?=(%face -.expected) $(expected body.expected)
5108 ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5475 ?: &(?=(%collection -.expected) =(%list name.expected) =(0 val.literal.actual))
5109 [%unknown ~]
5476 [%unknown ~]
5110 ?: ?=(%const -.expected)
5477 ?: ?=(%const -.expected)
5111 ?:(=(val.literal.actual val.literal.expected) [%ok sub next] [%bad ~])
5478 ?:(=(val.literal.actual val.literal.expected) [%ok sub next] [%bad ~])
5112 ?: ?=(%atom -.expected)
5479 ?: ?=(%atom -.expected)
5480+ :: A loobean singleton must not silently widen into another aura.
5481+ ?: =(%loobean form.literal.actual)
5482+ ?: =(%f aura.expected) [%unknown ~]
5483+ [%bad ~]
5113 ?: |(=(%tas aura.expected) =(%ta aura.expected)) [%ok sub next]
5484 ?: |(=(%tas aura.expected) =(%ta aura.expected)) [%ok sub next]
5114 [%bad ~]
5485 [%bad ~]
5115 ?: ?=(%flag -.expected)
5486 ?: ?=(%flag -.expected)
@@ -5117,8 +5488,14 @@
5117 ?: ?=(%any-atom -.expected) [%ok sub next]
5488 ?: ?=(%any-atom -.expected) [%ok sub next]
5118 [%bad ~]
5489 [%bad ~]
5119 ?: &(uncertain (itype-face-asym actual expected sub)) [%unknown ~]
5490 ?: &(uncertain (itype-face-asym actual expected sub)) [%unknown ~]
5491+ :: A known face labels the same noun. Peel it before applying the
5492+ :: directional unrestricted-atom rule, preserving raw-variable guards.
5493+ ?: &(!uncertain ?=(%any-atom -.actual) ?=(%face -.expected))
5494+ $(expected body.expected, skip-width |, spine-proof |)
5495+ ?: &(!uncertain ?=(%any-atom -.expected) ?=(%face -.actual))
5496+ $(actual body.actual, skip-width |, spine-proof |)
5120 ?: ?=(%any-atom -.expected)
5497 ?: ?=(%any-atom -.expected)
5121− ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%nvar -.actual) ?=(%flag -.actual)) [%ok sub next]
5498+ ?: |(?=(%atom -.actual) ?=(%avar -.actual) ?=(%rvar -.actual) |(?=(%nvar -.actual) ?=(%rnvar -.actual)) ?=(%flag -.actual)) [%ok sub next]
5122 ?: ?=(%var -.actual)
5499 ?: ?=(%var -.actual)
5123 =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
5500 =/ unified=(unit isub) (itype-unify actual [%avar next] sub)
5124 ?~ unified [%bad ~]
5501 ?~ unified [%bad ~]
@@ -5129,16 +5506,16 @@
5129 =/ unified=(unit isub) (itype-unify actual expected sub)
5506 =/ unified=(unit isub) (itype-unify actual expected sub)
5130 ?~ unified [%bad ~]
5507 ?~ unified [%bad ~]
5131 [%ok u.unified next]
5508 [%ok u.unified next]
5132− ?: |(?=(%avar -.expected) ?=(%nvar -.expected)) [%unknown ~]
5509+ ?: |(?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected))) [%unknown ~]
5133 [%bad ~]
5510 [%bad ~]
5134 ?: &(?=(%atom -.actual) ?=(%atom -.expected))
5511 ?: &(?=(%atom -.actual) ?=(%atom -.expected))
5135 ?: (aura-prefix aura.expected aura.actual) [%ok sub next]
5512 ?: (aura-prefix aura.expected aura.actual) [%ok sub next]
5136 ?: &((aura-prefix aura.actual aura.expected) uncertain) [%unknown ~]
5513 ?: &((aura-prefix aura.actual aura.expected) uncertain) [%unknown ~]
5137 [%bad ~]
5514 [%bad ~]
5138 ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5515 ?: &(?=(%cell -.actual) ?=(%cell -.expected))
5139− =/ first=ifit $(actual hed.actual, expected hed.expected)
5516+ =/ first=ifit $(actual hed.actual, expected hed.expected, skip-width |, spine-proof |)
5140 ?. ?=(%ok -.first) first
5517 ?. ?=(%ok -.first) first
5141− $(actual tal.actual, expected tal.expected, sub sub.first, next next.first)
5518+ $(actual tal.actual, expected tal.expected, sub sub.first, next next.first, skip-width spine-checked, spine-proof spine-checked)
5142 :: A field may add a face to an occurrence of the very same type
5519 :: A field may add a face to an occurrence of the very same type
5143 :: variable. Binding that variable to a face around itself would fail
5520 :: variable. Binding that variable to a face around itself would fail
5144 :: the occurs check, but its underlying type has already matched.
5521 :: the occurs check, but its underlying type has already matched.
@@ -5160,9 +5537,10 @@
5160 [%ok u.unified next]
5537 [%ok u.unified next]
5161 ?: &(?=(%face -.actual) ?=(%face -.expected))
5538 ?: &(?=(%face -.actual) ?=(%face -.expected))
5162 ?. =(name.actual name.expected) [%bad ~]
5539 ?. =(name.actual name.expected) [%bad ~]
5163− $(actual body.actual, expected body.expected)
5540+ $(actual body.actual, expected body.expected, skip-width |, spine-proof |)
5164− ?: ?=(%face -.actual) $(actual body.actual)
5541+ ?: ?=(%face -.actual) $(actual body.actual, skip-width |, spine-proof |)
5165− ?: ?=(%face -.expected) $(expected body.expected)
5542+ ?: ?=(%face -.expected) $(expected body.expected, skip-width |, spine-proof |)
5543+ ?: &(!uncertain (itype-closed-gates-match actual expected)) [%ok sub next]
5166 ?: (itype-face-asym actual expected sub) [%unknown ~]
5544 ?: (itype-face-asym actual expected sub) [%unknown ~]
5167 ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
5545 ?: |((itype-has-any-atom actual sub) (itype-has-any-atom expected sub))
5168 [%unknown ~]
5546 [%unknown ~]
@@ -5238,7 +5616,18 @@
5238+$ ischeme [typ=itype vars=(list @ud)]
5616+$ ischeme [typ=itype vars=(list @ud)]
5239+$ ienv (list [name=term scheme=ischeme])
5617+$ ienv (list [name=term scheme=ischeme])
5240+$ imold-types (list [name=term template=ischeme])
5618+$ imold-types (list [name=term template=ischeme])
5241−+$ ifile [values=ienv molds=imold-types at=path]
5619++$ iderived [name=term agent=term mark=term]
5620++$ iwidth-definition [name=term original=expr typ=itype sub=isub projections=(list iwprojection)]
5621++$ iwidth-dependency [at=path source=(unit @t) definitions=(list iwidth-definition)]
5622+:: Nonrecursive request evidence is compiler-owned metadata, not a property
5623+:: of an arbitrary ask value. Reader graphs and source inputs are trusted.
5624++$ irequest-evidence
5625+ [api-at=path name=term path=iapi-path-typed api-source=@t public-source=@t internal-source=@t prelude-values=(list term) prelude-molds=(list term) externals=iexternals marks=imark-externals]
5626+:: A unit distinguishes a verified empty closure from a detached legacy file.
5627+:: The opaque prelude is an exact trusted input, not a recursive interface mold.
5628++$ irequest-graph
5629+ [paths=(set path) requests=(list irequest-evidence) bundle-input=* prelude-input=* prelude-values=(list term) prelude-molds=(list term) externals=iexternals marks=imark-externals]
5630++$ ifile [values=ienv molds=imold-types at=path derived=(list iderived) elaborations=(list iwidth-definition) dependencies=(list iwidth-dependency) source=(unit @t) graph=(unit irequest-graph)]
5242+$ ijimports (list [face=term interface=ifile])
5631+$ ijimports (list [face=term interface=ifile])
5243+$ icap [name=@t id=@ud at=span]
5632+$ icap [name=@t id=@ud at=span]
5244+$ icaps (list icap)
5633+$ icaps (list icap)
@@ -5248,7 +5637,170 @@
5248:: This core has no Ford dependencies; unrecognized payloads fail closed.
5637:: This core has no Ford dependencies; unrecognized payloads fail closed.
5249+$ iexternals (list [module=term name=term result=*])
5638+$ iexternals (list [module=term name=term result=*])
5250+$ imark-externals (list [mark=term result=*])
5639+$ imark-externals (list [mark=term result=*])
5640+:: Hole obligations survive discarded expressions until their owning
5641+:: definition has inferred; their source spans support unresolved reports.
5642++$ ihole [id=@ud at=span]
5643+:: Recursive-mold unfolding spends fuel in the threaded inference state.
5644+:: Retries can restart from an earlier state, so this bounds an attempt,
5645+:: not all parsing or module-checking work.
5646+:: Experimental: only closed, uniquely faced records have known axes.
5647++$ iwfield [name=term axis=@ud typ=itype]
5648++$ iwfields [order=(list iwfield) index=(map term iwfield)]
5649++$ iwstep [name=term axis=@ud]
5650++$ iwidth-result [steps=(list iwstep) sub=isub next=@ud]
5651++$ iwprojection [at=span original=expr source=itype target=itype steps=(list iwstep)]
5652+++ width-scan
5653+ |= [typ=itype sub=isub axis=@ud fuel=@ud]
5654+ ^- (unit iwfields)
5655+ =/ order=(list iwfield) ~
5656+ =/ index=(map term iwfield) *(map term iwfield)
5657+ |-
5658+ ?: =(0 fuel) ~
5659+ ?: |(?=(%var -.typ) ?=(%avar -.typ) ?=(%rvar -.typ) ?=(%nvar -.typ) ?=(%rnvar -.typ)) ~
5660+ ?: ?=(%face -.typ)
5661+ =/ entry=iwfield [name.typ axis body.typ]
5662+ ?: ?=(^ (~(get by index) name.entry)) ~
5663+ `[(flop [entry order]) (~(put by index) name.entry entry)]
5664+ ?. ?=(%cell -.typ) ~
5665+ =/ head=itype hed.typ
5666+ ?: |(?=(%var -.head) ?=(%avar -.head) ?=(%rvar -.head) ?=(%nvar -.head) ?=(%rnvar -.head)) ~
5667+ ?. ?=(%face -.head) ~
5668+ =/ entry=iwfield [name.head (mul 2 axis) body.head]
5669+ ?: ?=(^ (~(get by index) name.entry)) ~
5670+ $(typ tal.typ, axis +((mul 2 axis)), fuel (dec fuel), order [entry order], index (~(put by index) name.entry entry))
5671+++ width-in-order
5672+ |= [source=(list iwfield) target=(list iwfield)]
5673+ ^- ?
5674+ ?~ target &
5675+ ?~ source |
5676+ ?: =(name.i.source name.i.target) $(source t.source, target t.target)
5677+ $(source t.source)
5678+++ width-fit-fields
5679+ |= [source=(map term iwfield) target=(list iwfield) sub=isub next=@ud]
5680+ ^- (unit iwidth-result)
5681+ ?~ target `[~ sub next]
5682+ =/ found=(unit iwfield) (~(get by source) name.i.target)
5683+ ?~ found ~
5684+ =/ fit=ifit (itype-fit typ.u.found typ.i.target sub next)
5685+ ?. ?=(%ok -.fit) ~
5686+ =/ rest=(unit iwidth-result) $(target t.target, sub sub.fit, next next.fit)
5687+ ?~ rest ~
5688+ `[[[name.i.target axis.u.found] steps.u.rest] sub.u.rest next.u.rest]
5689+++ width-spine-exhausted
5690+ |= [t=itype fuel=@ud]
5691+ ^- ?
5692+ ?: =(0 fuel) &
5693+ ?. ?=(%cell -.t) |
5694+ ?. ?=(%face -.hed.t) |
5695+ $(t tal.t, fuel (dec fuel))
5696+++ width-known-shape
5697+ |= [actual=itype expected=itype sub=isub]
5698+ ^- (unit [source=iwfields target=iwfields])
5699+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5700+ =/ source=(unit iwfields) (width-scan actual sub 1 1.024)
5701+ =/ target=(unit iwfields) (width-scan expected sub 1 1.024)
5702+ ?~ source ~
5703+ ?~ target ~
5704+ `[u.source u.target]
5705+::
5706+++ width-shape
5707+ |= [actual=itype expected=itype sub=isub]
5708+ ^- (unit [source=iwfields target=iwfields])
5709+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
5710+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5711+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5712+ ?~ source ~
5713+ ?~ target ~
5714+ ?. (gth (lent order.u.source) (lent order.u.target)) ~
5715+ `[u.source u.target]
5716+++ width-proj-shape
5717+ |= [actual=itype expected=itype sub=isub]
5718+ ^- (unit [source=iwfields target=iwfields])
5719+ ?. &(|(?=(%cell -.actual) ?=(%face -.actual)) |(?=(%cell -.expected) ?=(%face -.expected))) ~
5720+ =/ source=(unit iwfields) (width-scan actual sub 1 4.096)
5721+ =/ target=(unit iwfields) (width-scan expected sub 1 4.096)
5722+ ?~ source ~
5723+ ?~ target ~
5724+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
5725+ `[u.source u.target]
5726+::
5727+++ width-project
5728+ |= [shape=[source=iwfields target=iwfields] sub=isub next=@ud]
5729+ ^- (unit iwidth-result)
5730+ ?. (width-in-order order.source.shape order.target.shape) ~
5731+ (width-fit-fields index.source.shape order.target.shape sub next)
5732+::
5733+:: Provisional, globally budgeted gate-free proof. %no includes a
5734+:: gate-bearing witness; an uninhabited sibling could invalidate it.
5735+:: Input types must be resolved and normalized under valid substitutions,
5736+:: from trusted source-backed interfaces and reader results. Collection
5737+:: list/unit names rely on their existing identity invariant; this arm
5738+:: does not validate fabricated internal types.
5739++$ igf-segment
5740+ $% [%field name=term]
5741+ [%head ~]
5742+ [%tail ~]
5743+ [%item ~]
5744+ [%case index=@ud]
5745+ ==
5746++$ igate-free [verdict=?(%yes %no %unknown) inhabited=? left=@ud path=(unit (list igf-segment))]
5747+++ gate-free-types
5748+ |= [types=(list itype) fuel=@ud path=(list igf-segment) index=@ud]
5749+ ^- igate-free
5750+ ?~ types [%yes | fuel ~]
5751+ ?: =(0 fuel) [%unknown | 0 ~]
5752+ =/ first=igate-free (gate-free-type i.types fuel [[%case index] path])
5753+ ?: =(%no verdict.first) first
5754+ =/ rest=igate-free $(types t.types, fuel left.first, index +(index))
5755+ ?: =(%no verdict.rest) rest
5756+ =/ inhabited=? |(inhabited.first inhabited.rest)
5757+ ?: |(=(%unknown verdict.first) =(%unknown verdict.rest)) [%unknown inhabited left.rest ~]
5758+ [%yes inhabited left.rest ~]
5759+++ gate-free-type
5760+ |= [typ=itype fuel=@ud path=(list igf-segment)]
5761+ ^- igate-free
5762+ ?: =(0 fuel) [%unknown | 0 ~]
5763+ =. fuel (dec fuel)
5764+ ?- -.typ
5765+ %fn [%no & fuel `(flop path)]
5766+ %atom [%yes & fuel ~]
5767+ %any-atom [%yes & fuel ~]
5768+ %flag [%yes & fuel ~]
5769+ %const [%yes & fuel ~]
5770+ %face $(typ body.typ, path [[%field name.typ] path])
5771+ %cell
5772+ =/ head=igate-free $(typ hed.typ, path [[%head ~] path])
5773+ =/ tail=igate-free $(typ tal.typ, fuel left.head, path [[%tail ~] path])
5774+ =/ inhabited=? &(inhabited.head inhabited.tail)
5775+ ?: |(&(=(%yes verdict.head) !inhabited.head) &(=(%yes verdict.tail) !inhabited.tail)) [%yes | left.tail ~]
5776+ ?: &(=(%no verdict.head) inhabited.tail) head(left left.tail)
5777+ ?: &(=(%no verdict.tail) inhabited.head) tail
5778+ ?: |(!=(%yes verdict.head) !=(%yes verdict.tail)) [%unknown inhabited left.tail ~]
5779+ [%yes inhabited left.tail ~]
5780+ %collection
5781+ ?. |(=(%list name.typ) =(%unit name.typ)) [%unknown | fuel ~]
5782+ ?. ?=([* ~] args.typ) [%unknown | fuel ~]
5783+ =/ item=igate-free $(typ i.args.typ, path [[%item ~] path])
5784+ item(inhabited &)
5785+ %union
5786+ ?~ cases.typ [%unknown | fuel ~]
5787+ (gate-free-types cases.typ fuel path 0)
5788+ %noun [%unknown & fuel ~]
5789+ %empty [%yes | fuel ~]
5790+ %var [%unknown | fuel ~]
5791+ %avar [%yes & fuel ~]
5792+ %rvar [%yes & fuel ~]
5793+ %nvar [%yes & fuel ~]
5794+ %rnvar [%yes & fuel ~]
5795+ %tag [%unknown | fuel ~]
5796+ %recursive [%unknown | fuel ~]
5797+ %jrec [%yes & fuel ~]
5798+ %grec [%unknown | fuel ~]
5799+ ==
5800+::
5801++$ igate-prelude-evidence [iface=ifile gates=(map term def)]
5802++$ dgo [left=itype right=itype at=span context=span]
5251−+$ 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)]
5803++$ 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) holes=(list ihole) jrec-fuel=@ud projections=(list iwprojection) gate-defs=(map term def) head-evidence=(unit igate-prelude-evidence) grec-index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)]) defer=(unit ~) obligations=(list dgo)]
5252+$ idiag [msg=tape sites=(list [at=span note=tape])]
5804+$ idiag [msg=tape sites=(list [at=span note=tape])]
5253+$ iresult (each [typ=itype state=istate] idiag)
5805+$ iresult (each [typ=itype state=istate] idiag)
5254+$ isample-result (each [typ=itype env=ienv state=istate] tape)
5806+$ isample-result (each [typ=itype env=ienv state=istate] tape)
@@ -5268,6 +5820,7 @@
5268 |= [t=itype sub=isub]
5820 |= [t=itype sub=isub]
5269 ^- itype
5821 ^- itype
5270 =. t (itype-walk t sub)
5822 =. t (itype-walk t sub)
5823+ ?: ?=(%grec -.t) t(args (turn args.t |=(c=itype (itype-normalize c sub))))
5271 ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5824 ?: ?=(%collection -.t) [%collection name.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5272 ?: ?=(%union -.t)
5825 ?: ?=(%union -.t)
5273 [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
5826 [%union (turn cases.t |=(c=itype (itype-normalize c sub))) origin.t label.t (turn args.t |=(c=itype (itype-normalize c sub)))]
@@ -5284,6 +5837,8 @@
5284:: generalize an aura from its sample, which requires constraint analysis
5837:: generalize an aura from its sample, which requires constraint analysis
5285:: beyond this fragment; leave those cases unresolved.
5838:: beyond this fragment; leave those cases unresolved.
5286::
5839::
5840+:: This helper only controls decimal defaulting in visible types. A noun
5841+:: may contain gates and is not proof of a gate-free value.
5287++ itype-has-gate
5842++ itype-has-gate
5288 |= t=itype
5843 |= t=itype
5289 ^- ?
5844 ^- ?
@@ -5291,6 +5846,8 @@
5291 %fn &
5846 %fn &
5292 %cell |($(t hed.t) $(t tal.t))
5847 %cell |($(t hed.t) $(t tal.t))
5293 %recursive |
5848 %recursive |
5849+ %jrec |
5850+ %grec &
5294 %collection (lien args.t |=(c=itype (itype-has-gate c)))
5851 %collection (lien args.t |=(c=itype (itype-has-gate c)))
5295 %face $(t body.t)
5852 %face $(t body.t)
5296 %union (lien cases.t |=(c=itype (itype-has-gate c)))
5853 %union (lien cases.t |=(c=itype (itype-has-gate c)))
@@ -5298,10 +5855,14 @@
5298 %const |
5855 %const |
5299 %var |
5856 %var |
5300 %avar |
5857 %avar |
5858+ %rvar |
5301 %nvar |
5859 %nvar |
5860+ %rnvar |
5302 %atom |
5861 %atom |
5303 %any-atom |
5862 %any-atom |
5304 %flag |
5863 %flag |
5864+ %noun |
5865+ %empty |
5305 ==
5866 ==
5306::
5867::
5307++ default-decimals
5868++ default-decimals
@@ -5310,26 +5871,136 @@
5310 ?: (itype-has-gate t) t
5871 ?: (itype-has-gate t) t
5311 ?- -.t
5872 ?- -.t
5312 %nvar [%atom %ud]
5873 %nvar [%atom %ud]
5874+ %rnvar [%atom %ud]
5875+ %grec t(args (turn args.t |=(c=itype (default-decimals c))))
5313 %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5876 %collection [%collection name.t (turn args.t |=(c=itype (default-decimals c)))]
5314 %face [%face name.t $(t body.t)]
5877 %face [%face name.t $(t body.t)]
5315 %cell [%cell $(t hed.t) $(t tal.t)]
5878 %cell [%cell $(t hed.t) $(t tal.t)]
5316 * t
5879 * t
5317 ==
5880 ==
5318::
5881::
5882+:: A hole is solved only by a fully determined type or a written
5883+:: in-scope type variable. Ordinary fresh variables are not evidence.
5884+:: Compare representatives after substitution, since unification can
5885+:: orient a written capital toward the hole rather than the reverse.
5886+++ hole-variable-id
5887+ |= t=itype
5888+ ^- (unit @ud)
5889+ ?- -.t
5890+ %var `id.t
5891+ %avar `id.t
5892+ %rvar `id.t
5893+ %nvar `id.t
5894+ %rnvar `id.t
5895+ %tag `id.t
5896+ * ~
5897+ ==
5898+++ hole-same-variable
5899+ |= [a=itype b=itype]
5900+ ^- ?
5901+ =/ x=(unit @ud) (hole-variable-id a)
5902+ ?~ x |
5903+ =/ y=(unit @ud) (hole-variable-id b)
5904+ ?~ y |
5905+ =(u.x u.y)
5906+++ hole-known
5907+ |= [t=itype state=istate]
5908+ ^- ?
5909+ =. t (itype-walk t sub.state)
5910+ ?- -.t
5911+ ?(%var %avar %rvar %nvar %rnvar)
5912+ ?: (lien caps.state |=(c=icap (hole-same-variable t (itype-walk [%var id.c] sub.state)))) &
5913+ (lien params.state |=(p=[name=@t typ=itype] (hole-same-variable t (itype-walk typ.p sub.state))))
5914+ %tag |
5915+ %any-atom &
5916+ %union &((levy cases.t |=(c=itype (hole-known c state))) (levy args.t |=(c=itype (hole-known c state))))
5917+ %grec (levy args.t |=(c=itype (hole-known c state)))
5918+ %collection (levy args.t |=(c=itype (hole-known c state)))
5919+ %face $(t body.t)
5920+ %fn &($(t sample.t) $(t product.t))
5921+ %cell &($(t hed.t) $(t tal.t))
5922+ * &
5923+ ==
5924+++ promote-restricted-numbers
5925+ |= [state=istate env=ienv]
5926+ ^- istate
5927+ :: With no written capitals, there is nothing to promote.
5928+ ?~ caps.state state
5929+ =/ ids=(list @ud) (turn caps.state |=(c=icap id.c))
5930+ =/ free=(list @ud) (free-env-vars env sub.state)
5931+ |-
5932+ ?~ ids state
5933+ =/ t=itype (itype-walk [%var i.ids] sub.state)
5934+ ?: &(?=(%rnvar -.t) !(lien free |=(n=@ud =(n +.t))))
5935+ $(ids t.ids, state state(sub [[+.t [%rvar +.t]] sub.state]))
5936+ $(ids t.ids)
5937+::
5938+++ default-hole-numbers
5939+ |= [all=(list ihole) prior=(list ihole) state=istate env=ienv permit=?]
5940+ ^- istate
5941+ :: Do not default a named capital or a variable captured from env.
5942+ ?. permit state
5943+ ?: =(all prior) state
5944+ ?~ all state
5945+ =/ t=itype (itype-walk [%var id.i.all] sub.state)
5946+ =/ free=(list @ud) (free-env-vars env sub.state)
5947+ =? state &(?=(?(%nvar %rnvar) -.t) !(hole-known t state) !(lien free |=(id=@ud =(id id.t))))
5948+ state(sub [[id.t [%atom %ud]] sub.state])
5949+ $(all t.all)
5950+::
5951+:: Only obligations created inside this definition belong to it.
5952+++ holes-created
5953+ |= [all=(list ihole) prior=(list ihole)]
5954+ ^- (list ihole)
5955+ ?: =(all prior) ~
5956+ ?~ all ~
5957+ [i.all $(all t.all)]
5958+++ hole-uncertain
5959+ |= [t=itype state=istate]
5960+ ^- ?
5961+ =. t (itype-walk t sub.state)
5962+ ?- -.t
5963+ ?(%tag %nvar %rnvar %avar %rvar) !(hole-known t state)
5964+ %union |((lien cases.t |=(c=itype (hole-uncertain c state))) (lien args.t |=(c=itype (hole-uncertain c state))))
5965+ %grec (lien args.t |=(c=itype (hole-uncertain c state)))
5966+ %collection (lien args.t |=(c=itype (hole-uncertain c state)))
5967+ %face $(t body.t)
5968+ %fn |($(t sample.t) $(t product.t))
5969+ %cell |($(t hed.t) $(t tal.t))
5970+ * |
5971+ ==
5972+::
5973+++ unresolved-hole
5974+ |= [all=(list ihole) prior=(list ihole) state=istate]
5975+ ^- (unit idiag)
5976+ =/ work=(list ihole) (flop (holes-created all prior))
5977+ |-
5978+ ?~ work ~
5979+ ?: (hole-known [%var id.i.work] state) $(work t.work)
5980+ ?: (hole-uncertain [%var id.i.work] state)
5981+ `["type hole needs unsupported inference" ~[[at.i.work "type hole"]]]
5982+ `["type hole needs a determined type" ~[[at.i.work "unresolved type hole"]]]
5983+::
5319++ itype-vars
5984++ itype-vars
5320 |= t=itype
5985 |= t=itype
5321 ^- (list @ud)
5986 ^- (list @ud)
5322 ?- -.t
5987 ?- -.t
5323 %var ~[id.t]
5988 %var ~[id.t]
5324 %avar ~[id.t]
5989 %avar ~[id.t]
5990+ %rvar ~[id.t]
5325 %nvar ~[id.t]
5991 %nvar ~[id.t]
5992+ %rnvar ~[id.t]
5326 %atom ~
5993 %atom ~
5327 %any-atom ~
5994 %any-atom ~
5328 %flag ~
5995 %flag ~
5996+ %noun ~
5997+ %empty ~
5329 %tag ~
5998 %tag ~
5330 %const ~
5999 %const ~
5331 %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
6000 %union (zing (turn (weld args.t cases.t) |=(c=itype (itype-vars c))))
5332 %recursive ~
6001 %recursive ~
6002+ %jrec ~
6003+ %grec (zing (turn args.t |=(c=itype (itype-vars c))))
5333 %collection (zing (turn args.t |=(c=itype (itype-vars c))))
6004 %collection (zing (turn args.t |=(c=itype (itype-vars c))))
5334 %face $(t body.t)
6005 %face $(t body.t)
5335 %fn (weld $(t sample.t) $(t product.t))
6006 %fn (weld $(t sample.t) $(t product.t))
@@ -5357,17 +6028,29 @@
5357 =/ found=(unit itype) (itype-lookup id.t ren)
6028 =/ found=(unit itype) (itype-lookup id.t ren)
5358 ?~ found t
6029 ?~ found t
5359 u.found
6030 u.found
6031+ %rvar
6032+ =/ found=(unit itype) (itype-lookup id.t ren)
6033+ ?~ found t
6034+ u.found
5360 %nvar
6035 %nvar
5361 =/ found=(unit itype) (itype-lookup id.t ren)
6036 =/ found=(unit itype) (itype-lookup id.t ren)
5362 ?~ found t
6037 ?~ found t
5363 u.found
6038 u.found
6039+ %rnvar
6040+ =/ found=(unit itype) (itype-lookup id.t ren)
6041+ ?~ found t
6042+ u.found
5364 %atom t
6043 %atom t
5365 %any-atom t
6044 %any-atom t
5366 %flag t
6045 %flag t
6046+ %noun t
6047+ %empty t
5367 %tag t
6048 %tag t
5368 %const t
6049 %const t
5369 %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
6050 %union [%union (turn cases.t |=(c=itype (itype-rename c ren))) origin.t label.t (turn args.t |=(c=itype (itype-rename c ren)))]
5370 %recursive t
6051 %recursive t
6052+ %jrec t
6053+ %grec t(args (turn args.t |=(c=itype (itype-rename c ren))))
5371 %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
6054 %collection [%collection name.t (turn args.t |=(c=itype (itype-rename c ren)))]
5372 %face [%face name.t $(t body.t)]
6055 %face [%face name.t $(t body.t)]
5373 %fn [%fn $(t sample.t) $(t product.t)]
6056 %fn [%fn $(t sample.t) $(t product.t)]
@@ -5383,19 +6066,50 @@
5383 ?- -.t
6066 ?- -.t
5384 %var |
6067 %var |
5385 %avar =(n id.t)
6068 %avar =(n id.t)
6069+ %rvar =(n id.t)
5386 %nvar =(n id.t)
6070 %nvar =(n id.t)
6071+ %rnvar =(n id.t)
5387 %atom |
6072 %atom |
5388 %any-atom |
6073 %any-atom |
5389 %flag |
6074 %flag |
6075+ %noun |
6076+ %empty |
5390 %tag |
6077 %tag |
5391 %const |
6078 %const |
5392 %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
6079 %union |((lien cases.t |=(c=itype (itype-var-is-atom n c))) (lien args.t |=(c=itype (itype-var-is-atom n c))))
5393 %recursive |
6080 %recursive |
6081+ %jrec |
6082+ %grec (lien args.t |=(c=itype (itype-var-is-atom n c)))
5394 %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
6083 %collection (lien args.t |=(c=itype (itype-var-is-atom n c)))
5395 %face $(t body.t)
6084 %face $(t body.t)
5396 %fn |($(t sample.t) $(t product.t))
6085 %fn |($(t sample.t) $(t product.t))
5397 %cell |($(t hed.t) $(t tal.t))
6086 %cell |($(t hed.t) $(t tal.t))
5398 ==
6087 ==
6088+++ itype-var-is-restricted
6089+ |= [n=@ud t=itype]
6090+ ^- ?
6091+ ?- -.t
6092+ %var |
6093+ %avar |
6094+ %rvar =(n id.t)
6095+ %nvar |
6096+ %rnvar |
6097+ %atom |
6098+ %any-atom |
6099+ %flag |
6100+ %noun |
6101+ %empty |
6102+ %tag |
6103+ %const |
6104+ %union |((lien cases.t |=(c=itype (itype-var-is-restricted n c))) (lien args.t |=(c=itype (itype-var-is-restricted n c))))
6105+ %recursive |
6106+ %jrec |
6107+ %grec (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6108+ %collection (lien args.t |=(c=itype (itype-var-is-restricted n c)))
6109+ %face $(t body.t)
6110+ %fn |($(t sample.t) $(t product.t))
6111+ %cell |($(t hed.t) $(t tal.t))
6112+ ==
5399::
6113::
5400:: Canonical numbering makes printed variables independent of the order
6114:: Canonical numbering makes printed variables independent of the order
5401:: the unifier happened to allocate intermediates.
6115:: the unifier happened to allocate intermediates.
@@ -5407,7 +6121,7 @@
5407 =/ n=@ud 0
6121 =/ n=@ud 0
5408 |-
6122 |-
5409 ?~ vars (itype-rename t ren)
6123 ?~ vars (itype-rename t ren)
5410− =/ replacement=itype ?:((itype-var-is-atom i.vars t) [%avar n] [%var n])
6124+ =/ replacement=itype ?:((itype-var-is-restricted i.vars t) [%rvar n] ?:((itype-var-is-atom i.vars t) [%avar n] [%var n]))
5411 $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
6125 $(vars t.vars, ren [[i.vars replacement] ren], n +(n))
5412::
6126::
5413++ instantiate-scheme
6127++ instantiate-scheme
@@ -5418,11 +6132,11 @@
5418 |-
6132 |-
5419 ?~ vars [(itype-rename typ.scheme ren) state]
6133 ?~ vars [(itype-rename typ.scheme ren) state]
5420 =/ replacement=itype
6134 =/ replacement=itype
5421− ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state])
6135+ ?:((itype-var-is-restricted i.vars typ.scheme) [%rvar next.state] ?:((itype-var-is-atom i.vars typ.scheme) [%avar next.state] [%var next.state]))
5422 :: A generalized atom variable is a valid origin for re-generalizing
6136 :: A generalized atom variable is a valid origin for re-generalizing
5423 :: an alias, just as a sample binder is.
6137 :: an alias, just as a sample binder is.
5424 =/ st=istate state(next +(next.state))
6138 =/ st=istate state(next +(next.state))
5425− =? binders.st ?=(%avar -.replacement) [next.state binders.state]
6139+ =? binders.st |(?=(%avar -.replacement) ?=(%rvar -.replacement)) [next.state binders.state]
5426 $(vars t.vars, ren [[i.vars replacement] ren], state st)
6140 $(vars t.vars, ren [[i.vars replacement] ren], state st)
5427::
6141::
5428++ icap-lookup
6142++ icap-lookup
@@ -5493,6 +6207,11 @@
5493 ?. ?=([%ref @ @] node) ~
6207 ?. ?=([%ref @ @] node) ~
5494 ?. &(=(module +<.node) =(name +>.node)) ~
6208 ?. &(=(module +<.node) =(name +>.node)) ~
5495 `[[%unknown ~] &]
6209 `[[%unknown ~] &]
6210+ %apply
6211+ ?. ?=([%apply %list [* ~]] node) ~
6212+ =/ item $(node -.+>.node)
6213+ ?~ item ~
6214+ `[[%or ~[[%atom `0] [%cell pat.u.item [%unknown ~]]]] has.u.item]
5496 %face
6215 %face
5497 ?. ?=([%face @ *] node) ~
6216 ?. ?=([%face @ *] node) ~
5498 ?. (jibb-face-name +<.node) ~
6217 ?. (jibb-face-name +<.node) ~
@@ -5547,6 +6266,10 @@
5547 %cell ?:(?=([%cell * *] node) (imported-record-faces-valid node ~) |)
6266 %cell ?:(?=([%cell * *] node) (imported-record-faces-valid node ~) |)
5548 %fork (imported-faces-valid-list +.node)
6267 %fork (imported-faces-valid-list +.node)
5549 %apply ?:(?=([%apply @ *] node) (imported-faces-valid-list +>.node) |)
6268 %apply ?:(?=([%apply @ *] node) (imported-faces-valid-list +>.node) |)
6269+ %named
6270+ ?. ?=([%named @ @ *] node) |
6271+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6272+ (imported-faces-valid body.n)
5550 ==
6273 ==
5551::
6274::
5552++ imported-faces-valid-list
6275++ imported-faces-valid-list
@@ -5578,7 +6301,19 @@
5578 ^- (unit itype)
6301 ^- (unit itype)
5579 ?@ node ~
6302 ?@ node ~
5580 ?+ -.node ~
6303 ?+ -.node ~
6304+ %noun ?:(=(node [%noun ~]) `[%noun ~] ~)
5581 %atom
6305 %atom
6306+ :: A Hoon loobean singleton is one of the two Jibb loobeans.
6307+ ?: ?=([%atom %f [~ @]] node)
6308+ =/ value=@ +>+.node
6309+ ?. |(=(value 0) =(value 1)) ~
6310+ =/ printed=@t ?:(=(value 0) '%.y' '%.n')
6311+ `[%const [%loobean %f value printed]]
6312+ :: Hoon's null singleton is the same noun as Jibb's `~` mold.
6313+ :: Other non-term singleton atoms remain unsupported here.
6314+ ?: ?=([%atom %n [~ @]] node)
6315+ ?. =(0 +>+.node) ~
6316+ `[%const [%null %n 0 '~']]
5582 ?: ?=([%atom %tas [~ @]] node)
6317 ?: ?=([%atom %tas [~ @]] node)
5583 =/ value=@ +>+.node
6318 =/ value=@ +>+.node
5584 ?. |(=(value 0) (jibb-face-name value)) ~
6319 ?. |(=(value 0) (jibb-face-name value)) ~
@@ -5588,6 +6323,15 @@
5588 =/ aura=@ta (@ta +<.node)
6323 =/ aura=@ta (@ta +<.node)
5589 ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
6324 ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
5590 `[%atom aura]
6325 `[%atom aura]
6326+ %named
6327+ ?. ?=([%named @ @ *] node) ~
6328+ =/ n=[%named module=@ name=@ body=*] ;;([%named module=@ name=@ body=*] node)
6329+ ?. &((jibb-face-name module.n) (jibb-face-name name.n)) ~
6330+ ?. ?=([%fork *] body.n) ~
6331+ =/ proof=(unit irec-pattern) (rec-pattern body.n (@tas module.n) (@tas name.n))
6332+ ?~ proof ~
6333+ ?. has.u.proof ~
6334+ `[%recursive (@tas module.n) (@tas name.n) `(crip "{(trip name.n)}.{(trip module.n)}")]
5591 %apply
6335 %apply
5592 ?. ?=([%apply @ *] node) ~
6336 ?. ?=([%apply @ *] node) ~
5593 =/ name=term (@tas +<.node)
6337 =/ name=term (@tas +<.node)
@@ -5601,10 +6345,15 @@
5601 ?. =(arity (lent u.args)) ~
6345 ?. =(arity (lent u.args)) ~
5602 `[%collection name u.args]
6346 `[%collection name u.args]
5603 %fork
6347 %fork
6348+ :: Hoon's ordinary ? mold is the fork of its two %f singletons.
6349+ =/ raw=* +.node
6350+ ?: |(=(raw ~[[%atom %f `0] [%atom %f `1]]) =(raw ~[[%atom %f `1] [%atom %f `0]]))
6351+ `[%flag ~]
5604− =/ cases=(unit (list itype)) (import-to-itypes +.node)
6352+ =/ cases=(unit (list itype)) (import-to-itypes raw)
5605 ?~ cases ~
6353 ?~ cases ~
5606 ?~ u.cases ~
6354 ?~ u.cases ~
5607 ?~ t.u.cases ~
6355 ?~ t.u.cases ~
6356+ ?: (import-has-loobean-singleton u.cases) ~
5608 ?. (import-cases-disjoint u.cases) ~
6357 ?. (import-cases-disjoint u.cases) ~
5609 `[%union u.cases ~ ~ ~]
6358 `[%union u.cases ~ ~ ~]
5610 %face
6359 %face
@@ -5623,6 +6372,20 @@
5623 `[%cell u.left u.right]
6372 `[%cell u.left u.right]
5624 ==
6373 ==
5625::
6374::
6375+++ import-direct-loobean
6376+ |= t=itype
6377+ ^- ?
6378+ ?: ?=(%face -.t) $(t body.t)
6379+ ?: ?=(%union -.t) (import-has-loobean-singleton cases.t)
6380+ ?=([%const [%loobean *]] t)
6381+::
6382+++ import-has-loobean-singleton
6383+ |= cases=(list itype)
6384+ ^- ?
6385+ ?~ cases |
6386+ ?: (import-direct-loobean i.cases) &
6387+ $(cases t.cases)
6388+::
5626++ import-to-itypes
6389++ import-to-itypes
5627 |= nodes=*
6390 |= nodes=*
5628 ^- (unit (list itype))
6391 ^- (unit (list itype))
@@ -5637,7 +6400,10 @@
5637 |= typ=itype
6400 |= typ=itype
5638 ^- upat
6401 ^- upat
5639 ?- -.typ
6402 ?- -.typ
6403+ %noun [%all ~]
6404+ %empty [%empty ~]
5640 %atom [%atom ~]
6405 %atom [%atom ~]
6406+ %flag [%or ~[[%atom `0] [%atom `1]]]
5641 %const [%atom `val.literal.typ]
6407 %const [%atom `val.literal.typ]
5642 %face $(typ body.typ)
6408 %face $(typ body.typ)
5643 %cell [%cell $(typ hed.typ) $(typ tal.typ)]
6409 %cell [%cell $(typ hed.typ) $(typ tal.typ)]
@@ -5732,25 +6498,85 @@
5732 ?:(=(`origin origin.typ.template) `name.i.molds $(molds t.molds))
6498 ?:(=(`origin origin.typ.template) `name.i.molds $(molds t.molds))
5733 $(molds t.molds)
6499 $(molds t.molds)
5734::
6500::
6501+:: A prelude union alias is a display name, not a new union identity. An
6502+:: identity-generic alias can carry the origin's arguments only when the
6503+:: origin, arity and ordered parameters match. Swapped, repeated, fixed
6504+:: or phantom parameters cannot be printed that way and remain unsupported
6505+:: when their only available name is private. A nongeneric alias of a
6506+:: generic instantiation cannot be printed with the origin's arguments.
6507+++ identity-union-parameters
6508+ |= [vars=(list @ud) args=(list itype)]
6509+ ^- ?
6510+ ?~ vars ?=(~ args)
6511+ ?~ args |
6512+ ?. =([%var i.vars] i.args) |
6513+ $(vars t.vars, args t.args)
6514+++ prelude-union-alias
6515+ |= [origin=[at=path name=term] args=(list itype) molds=imold-types]
6516+ ^- (unit term)
6517+ ?~ molds ~
6518+ =/ template=ischeme template.i.molds
6519+ ?. ?=(%union -.typ.template) $(molds t.molds)
6520+ ?. =(`origin origin.typ.template) $(molds t.molds)
6521+ ?~ vars.template
6522+ ?^ args $(molds t.molds)
6523+ ?:(=(args args.typ.template) `name.i.molds $(molds t.molds))
6524+ ?: &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args)))
6525+ `name.i.molds
6526+ $(molds t.molds)
6527+::
5735−:: Only names exported by this directly imported module are visible through
6528+:: Names exported by the directly imported module are visible through its
5736−:: its face. Other origins retain identity but print as unnamed unions.
6529+:: face; a matching prelude alias is also visible without a qualifier.
6530+::
6531+++ jrec-alias
6532+ |= [origin=path name=term molds=imold-types]
6533+ ^- (unit term)
6534+ ?~ molds ~
6535+ =/ template=ischeme template.i.molds
6536+ ?: &(?=(~ vars.template) ?=(%jrec -.typ.template) =(at.typ.template origin) =(name.typ.template name)) `name.i.molds
6537+ $(molds t.molds)
6538+::
6539+++ grec-visible-alias
6540+ |= [origin=path name=term proof=shape args=(list itype) molds=imold-types]
6541+ ^- (unit term)
6542+ ?~ molds ~
6543+ =/ template=ischeme template.i.molds
6544+ ?. ?=(%grec -.typ.template) $(molds t.molds)
6545+ ?. &(=(at.typ.template origin) =(name.typ.template name) =(proof.typ.template proof)) $(molds t.molds)
6546+ ?. &((identity-union-parameters vars.template args.typ.template) =((lent vars.template) (lent args))) $(molds t.molds)
6547+ `name.i.molds
5737::
6548::
5738++ itype-in-import
6549++ itype-in-import
5739− |= [t=itype iface=ifile face=term]
6550+ |= [t=itype iface=ifile face=term prelude=(unit ifile)]
5740 ^- itype
6551 ^- itype
5741 ?- -.t
6552 ?- -.t
5742 %union
6553 %union
5743 =/ label=(unit @t)
6554 =/ label=(unit @t)
5744 ?~ origin.t ~
6555 ?~ origin.t ~
5745 ?: =(at.u.origin.t /lib/jibb/prelude/jibb) `name.u.origin.t
6556 ?: =(at.u.origin.t /lib/jibb/prelude/jibb) `name.u.origin.t
6557+ =/ public=(unit term)
6558+ ?~ prelude ~
6559+ (prelude-union-alias u.origin.t args.t molds.u.prelude)
6560+ ?^ public `u.public
5746 =/ alias=(unit term) ~
6561 =/ alias=(unit term) ~
5747 =? alias &(=(at.u.origin.t at.iface) ?=(^ (find-jibb-mold name.u.origin.t iface))) `name.u.origin.t
6562 =? alias &(=(at.u.origin.t at.iface) ?=(^ (find-jibb-mold name.u.origin.t iface))) `name.u.origin.t
5748 =? alias ?=(~ alias) (imported-union-alias u.origin.t molds.iface)
6563 =? alias ?=(~ alias) (imported-union-alias u.origin.t molds.iface)
5749 ?~ alias ~
6564 ?~ alias ~
5750 `(crip "{(trip u.alias)}.{(trip face)}")
6565 `(crip "{(trip u.alias)}.{(trip face)}")
5751− [%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)))]
6566+ [%union (turn cases.t |=(c=itype (itype-in-import c iface face prelude))) origin.t label (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
5752 %recursive [%recursive module.t name.t ~]
6567 %recursive [%recursive module.t name.t ~]
6568+ %grec
6569+ =/ public=(unit term) ?~(prelude ~ (grec-visible-alias at.t name.t proof.t args.t molds.u.prelude))
6570+ =/ alias=(unit term) ?~(public (grec-visible-alias at.t name.t proof.t args.t molds.iface) public)
6571+ =/ label=(unit @t) ?~(alias ~ ?~(public `(crip "{(trip u.alias)}.{(trip face)}") `u.alias))
6572+ t(label label, args (turn args.t |=(c=itype (itype-in-import c iface face prelude))))
6573+ %jrec
6574+ =/ public=(unit term) ?~(prelude ~ (jrec-alias at.t name.t molds.u.prelude))
6575+ ?^ public t(label `u.public)
6576+ =/ alias=(unit term) (jrec-alias at.t name.t molds.iface)
6577+ ?~ alias t(label ~)
6578+ t(label `(crip "{(trip u.alias)}.{(trip face)}"))
5753− %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face)))]
6579+ %collection [%collection name.t (turn args.t |=(c=itype (itype-in-import c iface face prelude)))]
5754 %face [%face name.t $(t body.t)]
6580 %face [%face name.t $(t body.t)]
5755 %fn [%fn $(t sample.t) $(t product.t)]
6581 %fn [%fn $(t sample.t) $(t product.t)]
5756 %cell [%cell $(t hed.t) $(t tal.t)]
6582 %cell [%cell $(t hed.t) $(t tal.t)]
@@ -5823,9 +6649,66 @@
5823 =/ rest=[params=iparams vars=(list @ud) next=@ud] $(names t.names, next +(next))
6649 =/ rest=[params=iparams vars=(list @ud) next=@ud] $(names t.names, next +(next))
5824 [[[i.names [%var next]] params.rest] [next vars.rest] next.rest]
6650 [[[i.names [%var next]] params.rest] [next vars.rest] next.rest]
5825::
6651::
6652+:: Recognize a unique top-level source mold with exactly a null case and a
6653+:: faced atom-headed cell whose faced tail names that same mold. Its Jibb
6654+:: path and name provide nominal identity. Other recursive shapes fail closed;
6655+:: construction and matching expose the proven shape one layer at a time.
6656+++ simple-source-recursive
6657+ |= [name=term sh=shape state=istate]
6658+ ^- (unit itype)
6659+ ?. (lien top-molds.state |=(n=term =(n name))) ~
6660+ =/ original=(unit shape) (find-simple-mold name molds.state)
6661+ ?~ original ~
6662+ ?. =(u.original sh) ~
6663+ ?. ?=(%union -.sh) ~
6664+ =/ cs=(list shape) cases.sh
6665+ ?~ cs ~
6666+ ?~ t.cs ~
6667+ ?^ t.t.cs ~
6668+ ?. ?=(%const -.i.cs) ~
6669+ ?. =(%null form.lit.i.cs) ~
6670+ ?. ?=(%cell -.i.t.cs) ~
6671+ =/ fs=(list field) fields.i.t.cs
6672+ ?~ fs ~
6673+ ?~ t.fs ~
6674+ ?^ t.t.fs ~
6675+ ?. ?=(%face -.i.fs) ~
6676+ ?. ?=(%aura -.shape.i.fs) ~
6677+ ?. !=(0 aura.shape.i.fs) ~
6678+ ?. ?=(%face -.i.t.fs) ~
6679+ ?. !=(name.i.fs name.i.t.fs) ~
6680+ =/ tail=shape shape.i.t.fs
6681+ ?. ?=(%ref -.tail) ~
6682+ ?. =(names.tail ~[name]) ~
6683+ `[%jrec at.state name `name name.i.fs aura.shape.i.fs name.i.t.fs]
6684+::
6685+++ simple-source-generic-recursive
6686+ |= [name=term sh=shape args=(list itype) state=istate]
6687+ ^- (unit itype)
6688+ ?. ?=(%generic -.sh) ~
6689+ ?. ?=([@ ~] vars.sh) ~
6690+ ?. ?=([* ~] args) ~
6691+ ?~ grec-index.state ~
6692+ ?. =(at.u.grec-index.state at.state) ~
6693+ ?~ prelude.state ~
6694+ ?. =(prelude.u.grec-index.state u.prelude.state) ~
6695+ =/ proof=(unit shape) (~(get by shapes.u.grec-index.state) name)
6696+ ?~ proof ~
6697+ ?. =(u.proof sh) ~
6698+ `[%grec at.state name `name sh args]
6699+::
6700+
5826++ infer-mold-template
6701++ infer-mold-template
5827 |= [sh=shape state=istate]
6702 |= [sh=shape state=istate]
5828 ^- (unit [template=ischeme state=istate])
6703 ^- (unit [template=ischeme state=istate])
6704+ =/ generic=(unit itype)
6705+ ?. ?=([@ ~] active.state) ~
6706+ (simple-source-generic-recursive i.active.state sh ~[[%var next.state]] state)
6707+ ?^ generic `[[u.generic ~[next.state]] state(next +(next.state))]
6708+ =/ direct=(unit itype)
6709+ ?. ?=([@ ~] active.state) ~
6710+ (simple-source-recursive i.active.state sh state)
6711+ ?^ direct `[[u.direct ~] state]
5829 ?: ?=(%generic -.sh)
6712 ?: ?=(%generic -.sh)
5830 ?~ vars.sh ~
6713 ?~ vars.sh ~
5831 ?. (distinct-params vars.sh) ~
6714 ?. (distinct-params vars.sh) ~
@@ -5833,17 +6716,19 @@
5833 =/ out=(unit [typ=itype state=istate])
6716 =/ out=(unit [typ=itype state=istate])
5834 (infer-simple-shape body.sh state(next next.fresh, params params.fresh, in-mold &))
6717 (infer-simple-shape body.sh state(next next.fresh, params params.fresh, in-mold &))
5835 ?~ out ~
6718 ?~ out ~
6719+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
5836 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.sh) ?=(~ origin.typ.u.out)) ~
6720 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.sh) ?=(~ origin.typ.u.out)) ~
5837 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.sh))
6721 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.sh))
5838 typ.u.out(args (turn vars.fresh |=(n=@ud `itype`[%var n])))
6722 typ.u.out(args (turn vars.fresh |=(n=@ud `itype`[%var n])))
5839 =/ used=(list @ud) (itype-vars typ.u.out)
6723 =/ used=(list @ud) (itype-vars typ.u.out)
5840 ?. (levy used |=(n=@ud (lien vars.fresh |=(p=@ud =(p n))))) ~
6724 ?. (levy used |=(n=@ud (lien vars.fresh |=(p=@ud =(p n))))) ~
5841− `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state)]
6725+ `[[typ.u.out vars.fresh] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
5842 =/ out=(unit [typ=itype state=istate])
6726 =/ out=(unit [typ=itype state=istate])
5843 (infer-simple-shape sh state(params ~, in-mold &))
6727 (infer-simple-shape sh state(params ~, in-mold &))
5844 ?~ out ~
6728 ?~ out ~
6729+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
5845 ?: ?=(^ (itype-vars typ.u.out)) ~
6730 ?: ?=(^ (itype-vars typ.u.out)) ~
5846− `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state)]
6731+ `[[typ.u.out ~] state.u.out(params params.state, in-mold in-mold.state, holes holes.state)]
5847::
6732::
5848:: A direct imported reference may carry definite reader evidence. Only
6733:: A direct imported reference may carry definite reader evidence. Only
5849:: uniquely supplied, declared inputs are used; unsupported data stay generic.
6734:: uniquely supplied, declared inputs are used; unsupported data stay generic.
@@ -5877,7 +6762,7 @@
5877 ?~ found ~
6762 ?~ found ~
5878 ?^ t.found ~
6763 ?^ t.found ~
5879 result.i.found
6764 result.i.found
5880− ?. ?=([%invalid ?(%aura %core) @] raw) ~
6765+ ?. ?=([%invalid ?(%aura %core %overlap) @] raw) ~
5881 `["{(trip +>.raw)}" ~[[at.sh "invalid imported mold"]]]
6766 `["{(trip +>.raw)}" ~[[at.sh "invalid imported mold"]]]
5882::
6767::
5883:: Replay only the shape branches whose evaluation order we can prove.
6768:: Replay only the shape branches whose evaluation order we can prove.
@@ -5946,16 +6831,24 @@
5946 |= [sh=shape state=istate]
6831 |= [sh=shape state=istate]
5947 ^- (unit [typ=itype state=istate])
6832 ^- (unit [typ=itype state=istate])
5948 ?- -.sh
6833 ?- -.sh
6834+ %hole `[[%var next.state] state(next +(next.state), holes [[next.state at.sh] holes.state])]
5949 %aura
6835 %aura
5950 ?: =(0 aura.sh) `[[%any-atom ~] state]
6836 ?: =(0 aura.sh) `[[%any-atom ~] state]
5951 `[[%atom aura.sh] state]
6837 `[[%atom aura.sh] state]
5952 %flag `[[%flag ~] state]
6838 %flag `[[%flag ~] state]
6839+ %noun `[[%noun ~] state]
6840+ %void `[[%empty ~] state]
5953 %const
6841 %const
5954− ?. |(=(%term form.lit.sh) =(%null form.lit.sh)) ~
6842+ ?. |(=(%term form.lit.sh) =(%null form.lit.sh) =(%loobean form.lit.sh)) ~
6843+ ?: &(=(%loobean form.lit.sh) !|(=(0 val.lit.sh) =(1 val.lit.sh))) ~
5955 `[[%const lit.sh] state]
6844 `[[%const lit.sh] state]
5956 %union
6845 %union
5957 =/ pairs=(list upair) (union-pairs cases.sh molds.state)
6846 =/ pairs=(list upair) (union-pairs cases.sh molds.state)
6847+ ?: (lien pairs |=(p=upair =(%overlap relation.p))) ~
6848+ =/ source-proof=?
5958− ?. (levy pairs |=(p=upair =(%disjoint relation.p))) ~
6849+ ?: (levy pairs |=(p=upair =(%disjoint relation.p))) &
6850+ &((union-source-state-safe state 256) (union-source-distinct-tags cases.sh molds.state 256))
6851+ ?. source-proof ~
5959 =/ cs=(unit [types=(list itype) state=istate]) (infer-shape-args cases.sh state)
6852 =/ cs=(unit [types=(list itype) state=istate]) (infer-shape-args cases.sh state)
5960 ?~ cs ~
6853 ?~ cs ~
5961 `[[%union types.u.cs ~ ~ ~] state.u.cs]
6854 `[[%union types.u.cs ~ ~ ~] state.u.cs]
@@ -5976,7 +6869,7 @@
5976 =/ found=(unit ischeme) (find-jibb-mold n u.iface)
6869 =/ found=(unit ischeme) (find-jibb-mold n u.iface)
5977 ?~ found ~
6870 ?~ found ~
5978 ?^ vars.u.found ~
6871 ?^ vars.u.found ~
5979− `[(itype-in-import typ.u.found u.iface i.t.names.sh) state]
6872+ `[(itype-in-import typ.u.found u.iface i.t.names.sh prelude.state) state]
5980 =/ found=(unit itype)
6873 =/ found=(unit itype)
5981 (find-imported-mold i.t.names.sh n externals.state surs.state)
6874 (find-imported-mold i.t.names.sh n externals.state surs.state)
5982 ?~ found ~
6875 ?~ found ~
@@ -5995,10 +6888,13 @@
5995 ?~ prelude-entry ~
6888 ?~ prelude-entry ~
5996 ?^ vars.u.prelude-entry ~
6889 ?^ vars.u.prelude-entry ~
5997 `[typ.u.prelude-entry state]
6890 `[typ.u.prelude-entry state]
6891+ =/ direct=(unit itype) (simple-source-recursive n u.found state)
6892+ ?^ direct `[u.direct state]
5998 =/ out=(unit [typ=itype state=istate])
6893 =/ out=(unit [typ=itype state=istate])
5999 $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6894 $(sh u.found, state state(active [n active.state], in-mold &, params ~))
6000 ?~ out ~
6895 ?~ out ~
6896+ ?^ (unresolved-hole holes.state.u.out holes.state state.u.out) ~
6001− `[(label-direct-union typ.u.out u.found n state) state.u.out(active active.state, in-mold in-mold.state, params params.state)]
6897+ `[(label-direct-union typ.u.out u.found n state) state.u.out(active active.state, in-mold in-mold.state, params params.state, holes holes.state)]
6002 %apply
6898 %apply
6003 ?~ ref.sh ~
6899 ?~ ref.sh ~
6004 =/ args=(unit [types=(list itype) state=istate]) (infer-shape-args args.sh state)
6900 =/ args=(unit [types=(list itype) state=istate]) (infer-shape-args args.sh state)
@@ -6013,7 +6909,7 @@
6013 ?~ vars.u.template ~
6909 ?~ vars.u.template ~
6014 =/ applied=(unit itype) (template-apply u.template types.u.args)
6910 =/ applied=(unit itype) (template-apply u.template types.u.args)
6015 ?~ applied ~
6911 ?~ applied ~
6016− `[(itype-in-import u.applied u.iface i.t.ref.sh) state.u.args]
6912+ `[(itype-in-import u.applied u.iface i.t.ref.sh prelude.state.u.args) state.u.args]
6017 ?: (lien active.state.u.args |=(x=term =(x n))) ~
6913 ?: (lien active.state.u.args |=(x=term =(x n))) ~
6018 =/ found=(unit shape) (find-simple-mold n molds.state.u.args)
6914 =/ found=(unit shape) (find-simple-mold n molds.state.u.args)
6019 ?~ found
6915 ?~ found
@@ -6026,17 +6922,20 @@
6026 ?~ applied ~
6922 ?~ applied ~
6027 `[u.applied state.u.args]
6923 `[u.applied state.u.args]
6028 ?. ?=(%generic -.u.found) ~
6924 ?. ?=(%generic -.u.found) ~
6925+ =/ grec=(unit itype) (simple-source-generic-recursive n u.found types.u.args state.u.args)
6926+ ?^ grec `[u.grec state.u.args]
6029 ?. (distinct-params vars.u.found) ~
6927 ?. (distinct-params vars.u.found) ~
6030 =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6928 =/ params=(unit iparams) (bind-params vars.u.found types.u.args)
6031 ?~ params ~
6929 ?~ params ~
6032 =/ out=(unit [typ=itype state=istate])
6930 =/ out=(unit [typ=itype state=istate])
6033 $(sh body.u.found, state state.u.args(active [n active.state.u.args], in-mold &, params u.params))
6931 $(sh body.u.found, state state.u.args(active [n active.state.u.args], in-mold &, params u.params))
6034 ?~ out ~
6932 ?~ out ~
6933+ ?^ (unresolved-hole holes.state.u.out holes.state.u.args state.u.out) ~
6035 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.u.found) ?=(~ origin.typ.u.out)) ~
6934 ?: &(?=(%union -.typ.u.out) !?=(%union -.body.u.found) ?=(~ origin.typ.u.out)) ~
6036 ?: &(?=(%union -.typ.u.out) ?=(%union -.body.u.found) !(lien top-molds.state.u.args |=(x=term =(x n)))) ~
6935 ?: &(?=(%union -.typ.u.out) ?=(%union -.body.u.found) !(lien top-molds.state.u.args |=(x=term =(x n)))) ~
6037 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.u.found))
6936 =? typ.u.out &(?=(%union -.typ.u.out) ?=(%union -.body.u.found))
6038 (label-direct-union typ.u.out(args types.u.args) u.found n state.u.args)
6937 (label-direct-union typ.u.out(args types.u.args) u.found n state.u.args)
6039− `[typ.u.out state.u.out(active active.state.u.args, in-mold in-mold.state.u.args, params params.state.u.args)]
6938+ `[typ.u.out state.u.out(active active.state.u.args, in-mold in-mold.state.u.args, params params.state.u.args, holes holes.state.u.args)]
6040 %tvar
6939 %tvar
6041 =/ param=(unit itype) (iparam-lookup name.sh params.state)
6940 =/ param=(unit itype) (iparam-lookup name.sh params.state)
6042 ?^ param `[u.param state]
6941 ?^ param `[u.param state]
@@ -6076,12 +6975,12 @@
6076 ^- isample-result
6975 ^- isample-result
6077 ?- -.s
6976 ?- -.s
6078 %bind
6977 %bind
6079− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6978+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6080 [%| "sample shadows a name"]
6979 [%| "sample shadows a name"]
6081 =/ t=itype [%var next.state]
6980 =/ t=itype [%var next.state]
6082 [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
6981 [%& t [[name.s [t ~]] env] state(next +(next.state), binders [next.state binders.state])]
6083 %face
6982 %face
6084− ?: |(?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6983+ ?: |(=(name.s %proj) ?=(^ (ienv-lookup name.s env)) (lien globals.state |=(x=term =(x name.s))))
6085 [%| "sample shadows a name"]
6984 [%| "sample shadows a name"]
6086 =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6985 =/ t=(unit [typ=itype state=istate]) (infer-simple-shape shape.s state)
6087 ?~ t [%| "sample mold is not supported by partial inference"]
6986 ?~ t [%| "sample mold is not supported by partial inference"]
@@ -6119,8 +7018,8 @@
6119 [%& [%cell ht typ.p.tail] env.p.tail state.p.tail]
7018 [%& [%cell ht typ.p.tail] env.p.tail state.p.tail]
6120::
7019::
6121:: Local definitions generalize only variables outside their enclosing
7020:: Local definitions generalize only variables outside their enclosing
6122−:: environment and explicit-capital scope. Single self-recursive gates
7021+:: environment and explicit-capital scope. Recursive gate groups use
6123−:: use a monomorphic placeholder; mutually recursive groups stay unsupported.
7022+:: monomorphic placeholders while their bodies are checked.
6124::
7023::
6125+$ ilocal-result (each [env=ienv state=istate] idiag)
7024+$ ilocal-result (each [env=ienv state=istate] idiag)
6126++ free-env-vars
7025++ free-env-vars
@@ -6149,6 +7048,7 @@
6149 |-
7048 |-
6150 ?~ ds &
7049 ?~ ds &
6151 ?: ?=(%mold -.i.ds) $(ds t.ds)
7050 ?: ?=(%mold -.i.ds) $(ds t.ds)
7051+ ?: =(name.i.ds %proj) |
6152 ?. (unique-value-name name.i.ds names) |
7052 ?. (unique-value-name name.i.ds names) |
6153 ?: ?=(^ (ienv-lookup name.i.ds env)) |
7053 ?: ?=(^ (ienv-lookup name.i.ds env)) |
6154 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
7054 ?: (lien globals.state |=(n=term =(n name.i.ds))) |
@@ -6172,6 +7072,7 @@
6172 |-
7072 |-
6173 ?~ locals &
7073 ?~ locals &
6174 =/ n=term name.i.locals
7074 =/ n=term name.i.locals
7075+ ?: =(n %proj) |
6175 ?. (unique-value-name n names) |
7076 ?. (unique-value-name n names) |
6176 ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
7077 ?: (lien molds.state |=(m=[name=term body=shape] =(n name.m))) |
6177 ?: (lien marks.state |=(m=term =(n m))) |
7078 ?: (lien marks.state |=(m=term =(n m))) |
@@ -6336,7 +7237,13 @@
6336 |-
7237 |-
6337 ?~ ds
7238 ?~ ds
6338 ?~ remaining [%& env state]
7239 ?~ remaining [%& env state]
7240+ ?. progressed
7241+ =/ pending=(list def) (flop remaining)
7242+ =/ groups=icomponents (graph-components pending (global-value-names pending))
7243+ =/ grouped=(unit [rest=(list def) env=ienv state=istate])
7244+ (try-local-group pending groups env state)
6339− ?. progressed [%| ["local definitions need unsupported inference" ~]]
7245+ ?~ grouped [%| ["local definitions need unsupported inference" ~]]
7246+ $(ds rest.u.grouped, remaining ~, env env.u.grouped, state state.u.grouped, progressed |)
6340 $(ds (flop remaining), remaining ~, progressed |)
7247 $(ds (flop remaining), remaining ~, progressed |)
6341 =/ d=def i.ds
7248 =/ d=def i.ds
6342 ?> ?=(%value -.d)
7249 ?> ?=(%value -.d)
@@ -6345,6 +7252,11 @@
6345 =/ retried=? ?=(%| -.inferred)
7252 =/ retried=? ?=(%| -.inferred)
6346 =? inferred retried (infer-recursive-gate d env local-state)
7253 =? inferred retried (infer-recursive-gate d env local-state)
6347 ?: ?=(%| -.inferred) $(ds t.ds, remaining [d remaining])
7254 ?: ?=(%| -.inferred) $(ds t.ds, remaining [d remaining])
7255+ ?: !=(obligations.state.p.inferred obligations.state) [%| ["deferred local definition needs unsupported inference" ~]]
7256+ =. state.p.inferred (promote-restricted-numbers state.p.inferred env)
7257+ =. state.p.inferred (default-hole-numbers holes.state.p.inferred holes.state state.p.inferred env !(itype-has-gate (itype-normalize typ.p.inferred sub.state.p.inferred)))
7258+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.inferred holes.state state.p.inferred)
7259+ ?^ hole [%| u.hole]
6348 =/ merged=(unit [first=icap second=icap])
7260 =/ merged=(unit [first=icap second=icap])
6349 (merged-capitals caps.state.p.inferred sub.state.p.inferred)
7261 (merged-capitals caps.state.p.inferred sub.state.p.inferred)
6350 ?^ merged
7262 ?^ merged
@@ -6360,7 +7272,28 @@
6360 (weld (free-env-vars env sub.state.p.inferred) (free-cap-vars caps.state sub.state.p.inferred))
7272 (weld (free-env-vars env sub.state.p.inferred) (free-cap-vars caps.state sub.state.p.inferred))
6361 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
7273 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
6362 =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
7274 =. vars (skim vars |=(n=@ud !(lien free |=(f=@ud =(f n)))))
6363− $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state), progressed &)
7275+ $(ds t.ds, env [[name.d [typ vars]] env], state state.p.inferred(caps caps.state, holes holes.state), progressed &)
7276+::
7277+:: Try complete cyclic local groups after individual definitions stall.
7278+:: Components with non-gates or unresolved constraints stay unavailable.
7279+::
7280+++ try-local-group
7281+ |= [ds=(list def) groups=icomponents env=ienv state=istate]
7282+ ^- (unit [rest=(list def) env=ienv state=istate])
7283+ ?~ groups ~
7284+ =/ names=(list term) i.groups
7285+ ?. (gth (lent names) 1) $(groups t.groups)
7286+ =/ members=(list def)
7287+ (skim ds |=(d=def &(?=(%value -.d) (lien names |=(n=term =(n name.d))))))
7288+ ?. =((lent members) (lent names)) $(groups t.groups)
7289+ =/ result=ilocal-result (infer-gate-group members env state)
7290+ ?: ?=(%| -.result) $(groups t.groups)
7291+ =/ rest=(list def)
7292+ (skim ds |=(d=def !(lien names |=(n=term =(n name.d)))))
7293+ =/ more=(unit [rest=(list def) env=ienv state=istate])
7294+ $(ds rest, groups t.groups, env env.p.result, state state.p.result)
7295+ ?^ more more
7296+ `[rest env.p.result state.p.result]
6364::
7297::
6365:: Read only fields of a known record. Unresolved field constraints and
7298:: Read only fields of a known record. Unresolved field constraints and
6366:: ambiguous repeated faces are outside this fragment. Imported record
7299:: ambiguous repeated faces are outside this fragment. Imported record
@@ -6383,17 +7316,29 @@
6383 ^- iresult
7316 ^- iresult
6384 =/ reverse=(list term) (flop names)
7317 =/ reverse=(list term) (flop names)
6385 ?~ reverse [%| ["empty wing" ~]]
7318 ?~ reverse [%| ["empty wing" ~]]
6386− =/ scheme=(unit ischeme) (ienv-lookup i.reverse env)
7319+ =/ iface=(unit ifile) (find-jibb-interface i.reverse jimports.state)
6387− ?~ scheme [%| ["field access is not supported by partial inference" ~]]
6388− =/ inst=[typ=itype state=istate] (instantiate-scheme u.scheme state)
6389 =/ fields=(list term) t.reverse
7320 =/ fields=(list term) t.reverse
7321+ ?~ fields [%| ["field access is not supported by partial inference" ~]]
7322+ =/ scheme=(unit ischeme)
7323+ ?~ iface
7324+ (ienv-lookup i.reverse env)
7325+ (ienv-lookup i.fields values.u.iface)
7326+ ?~ scheme
7327+ ?^ iface [%| ["module member is not available to partial inference" ~]]
7328+ [%| ["field access is not supported by partial inference" ~]]
7329+ =/ inst=[typ=itype state=istate]
7330+ ?~ iface (instantiate-scheme u.scheme state)
7331+ =/ imported=ischeme u.scheme
7332+ =. typ.imported (itype-in-import typ.imported u.iface i.reverse prelude.state)
7333+ (instantiate-scheme imported state)
7334+ =/ remaining=(list term) ?~(iface fields t.fields)
6390 =/ typ=itype typ.inst
7335 =/ typ=itype typ.inst
6391 |-
7336 |-
6392− ?~ fields [%& typ state.inst]
7337+ ?~ remaining [%& typ state.inst]
6393− =/ found=(list itype) (record-fields-named i.fields typ sub.state.inst)
7338+ =/ found=(list itype) (record-fields-named i.remaining typ sub.state.inst)
6394 ?~ found [%| ["field is not available to partial inference" ~]]
7339 ?~ found [%| ["field is not available to partial inference" ~]]
6395 ?^ t.found [%| ["field name is ambiguous in partial inference" ~]]
7340 ?^ t.found [%| ["field name is ambiguous in partial inference" ~]]
6396− $(fields t.fields, typ i.found)
7341+ $(remaining t.remaining, typ i.found)
6397::
7342::
6398:: Propagate a known union or list through supported loobean, unit and list
7343:: Propagate a known union or list through supported loobean, unit and list
6399:: branches. Empty bodies and groups are transparent; bodies with definitions
7344:: branches. Empty bodies and groups are transparent; bodies with definitions
@@ -6417,6 +7362,8 @@
6417 ?: &(?=(%collection -.expected) =(%list name.expected) (context-list-expression e))
7362 ?: &(?=(%collection -.expected) =(%list name.expected) (context-list-expression e))
6418 (infer-list-context e expected env state context)
7363 (infer-list-context e expected env state context)
6419 ?: ?=(%branch -.e)
7364 ?: ?=(%branch -.e)
7365+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[expected context])
7366+ ?^ empty-list u.empty-list
6420 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
7367 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
6421 ?~ t.arms.e [%| ["branch pattern is not supported by partial inference" ~]]
7368 ?~ t.arms.e [%| ["branch pattern is not supported by partial inference" ~]]
6422 ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
7369 ?^ t.t.arms.e [%| ["branch is not supported by partial inference" ~]]
@@ -6448,10 +7395,17 @@
6448 ?: ?=(%unknown -.fit)
7395 ?: ?=(%unknown -.fit)
6449 ?: &(?=(%collection -.expected) =(%list name.expected))
7396 ?: &(?=(%collection -.expected) =(%list name.expected))
6450 [%| ["branch list constraint is not supported by partial inference" ~]]
7397 [%| ["branch list constraint is not supported by partial inference" ~]]
7398+ ?: ?=(%flag -.expected) [%| ["branch loobean constraint is not supported by partial inference" ~]]
6451 [%| ["branch union constraint is not supported by partial inference" ~]]
7399 [%| ["branch union constraint is not supported by partial inference" ~]]
6452 ?: ?=(%bad -.fit)
7400 ?: ?=(%bad -.fit)
7401+ =/ missing=(unit idiag) (missing-union-tag e expected sub.state.p.value context)
7402+ ?^ missing [%| u.missing]
7403+ =/ nested=(unit idiag) (nested-missing-tag e typ.p.value expected sub.state.p.value next.state.p.value context)
7404+ ?^ nested [%| u.nested]
6453 ?: &(?=(%collection -.expected) =(%list name.expected))
7405 ?: &(?=(%collection -.expected) =(%list name.expected))
6454 [%| ["branch arm does not fit its expected list" ~[[context "expected list"] [(span-of e) "branch arm"]]]]
7406 [%| ["branch arm does not fit its expected list" ~[[context "expected list"] [(span-of e) "branch arm"]]]]
7407+ ?: ?=(%flag -.expected)
7408+ [%| ["branch arm does not fit its expected loobean" ~[[context "expected loobean"] [(span-of e) "branch arm"]]]]
6455 [%| ["branch arm does not fit its expected union" ~[[context "expected union"] [(span-of e) "branch arm"]]]]
7409 [%| ["branch arm does not fit its expected union" ~[[context "expected union"] [(span-of e) "branch arm"]]]]
6456 [%& expected state.p.value(sub sub.fit, next next.fit)]
7410 [%& expected state.p.value(sub sub.fit, next next.fit)]
6457::
7411::
@@ -6516,23 +7470,37 @@
6516 [%| ["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)]]]]
7470 [%| ["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)]]]]
6517 [%& target state.p.tail(sub sub.fit, next next.fit)]
7471 [%& target state.p.tail(sub sub.fit, next next.fit)]
6518::
7472::
7473+++ infer-open-list-items
7474+ |= [items=(list expr) expected=itype env=ienv state=istate context=span]
7475+ ^- iresult
7476+ ?~ items [%& expected state]
7477+ =/ target=itype (itype-walk expected sub.state)
7478+ =/ value=iresult (infer-call-context-arg i.items target env state context)
7479+ ?: ?=(%| -.value) value
7480+ =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7481+ ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
7482+ ?: ?=(%bad -.fit)
7483+ ?: |((itype-family-related typ.p.value target sub.state.p.value) (itype-has-any-atom typ.p.value sub.state.p.value) (itype-has-any-atom target sub.state.p.value))
7484+ [%| ["list item widening is not supported by partial inference" ~]]
7485+ [%| ["list items do not have compatible types" ~[[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)]]]]
7486+ ?: (itype-has-tag (itype-normalize expected sub.fit))
7487+ [%| ["list item needs context in partial inference" ~]]
7488+ $(items t.items, state state.p.value(sub sub.fit, next next.fit))
7489+::
6519++ infer-list-items
7490++ infer-list-items
6520 |= [items=(list expr) expected=itype env=ienv state=istate context=span]
7491 |= [items=(list expr) expected=itype env=ienv state=istate context=span]
6521 ^- iresult
7492 ^- iresult
6522 ?~ items [%& expected state]
7493 ?~ items [%& expected state]
6523 =/ target=itype (itype-walk expected sub.state)
7494 =/ target=itype (itype-walk expected sub.state)
6524− =/ value=iresult
6525− ?: &(?=(%union -.target) (context-union-branch i.items))
6526− (infer-union-context i.items target env state context)
6527− ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch i.items))
6528− (infer-union-context i.items target env state context)
6529− ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression i.items))
6530− (infer-list-context i.items target env state context)
7495+ =/ value=iresult (infer-call-context-arg i.items target env state context)
6531− (infer-fragment i.items env state)
6532 ?: ?=(%| -.value) value
7496 ?: ?=(%| -.value) value
6533 =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
7497 =/ fit=ifit (itype-fit typ.p.value target sub.state.p.value next.state.p.value)
6534 ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
7498 ?: ?=(%unknown -.fit) [%| ["list item constraint is not supported by partial inference" ~]]
6535 ?: ?=(%bad -.fit)
7499 ?: ?=(%bad -.fit)
7500+ =/ missing=(unit idiag) (missing-union-tag i.items target sub.state.p.value context)
7501+ ?^ missing [%| u.missing]
7502+ =/ nested=(unit idiag) (nested-missing-tag i.items typ.p.value target sub.state.p.value next.state.p.value context)
7503+ ?^ nested [%| u.nested]
6536 [%| ["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)]]]]
7504 [%| ["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)]]]]
6537 $(items t.items, state state.p.value(sub sub.fit, next next.fit))
7505 $(items t.items, state state.p.value(sub sub.fit, next next.fit))
6538::
7506::
@@ -6613,6 +7581,11 @@
6613 [%| ["list pattern needs the standard prelude in partial inference" ~]]
7581 [%| ["list pattern needs the standard prelude in partial inference" ~]]
6614 ?~ args.typ [%| ["list pattern is not supported by partial inference" ~]]
7582 ?~ args.typ [%| ["list pattern is not supported by partial inference" ~]]
6615 ?^ t.args.typ [%| ["list pattern is not supported by partial inference" ~]]
7583 ?^ t.args.typ [%| ["list pattern is not supported by partial inference" ~]]
7584+ =/ item-live=(unit [result=?(%yes %no %unknown) left=@ud])
7585+ (itype-inhabited-proof i.args.typ sub.state caps.state 256)
7586+ ?~ item-live [%| ["list element reachability needs unsupported inference" ~]]
7587+ ?: =(%unknown result.u.item-live) [%| ["list element reachability needs unsupported inference" ~]]
7588+ ?: =(%no result.u.item-live) [%| ["list nonempty pattern is unreachable" ~]]
6616 ?~ arms.e [%| ["list branch is not supported by partial inference" ~]]
7589 ?~ arms.e [%| ["list branch is not supported by partial inference" ~]]
6617 ?~ t.arms.e [%| ["list branch is not supported by partial inference" ~]]
7590 ?~ t.arms.e [%| ["list branch is not supported by partial inference" ~]]
6618 ?^ t.t.arms.e [%| ["list branch is not supported by partial inference" ~]]
7591 ?^ t.t.arms.e [%| ["list branch is not supported by partial inference" ~]]
@@ -6625,7 +7598,7 @@
6625 [%| ["list branch pattern is not supported by partial inference" ~]]
7598 [%| ["list branch pattern is not supported by partial inference" ~]]
6626 =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
7599 =/ binder=(unit [head=term tail=term]) ?:(first-empty second-name first-name)
6627 ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
7600 ?~ binder [%| ["list branch pattern is not supported by partial inference" ~]]
6628− ?: |(=(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)))))
7601+ ?: |(=(head.u.binder %proj) =(tail.u.binder %proj) =(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)))))
6629 [%| ["pattern binder shadows a name" ~]]
7602 [%| ["pattern binder shadows a name" ~]]
6630 =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
7603 =/ extended=ienv [[head.u.binder [i.args.typ ~]] [tail.u.binder [typ ~]] env]
6631 =/ left=iresult
7604 =/ left=iresult
@@ -6662,10 +7635,15 @@
6662 [%| ["unit branch pattern is not supported by partial inference" ~]]
7635 [%| ["unit branch pattern is not supported by partial inference" ~]]
6663 =/ binder=(unit term) ?:(first-empty second-name first-name)
7636 =/ binder=(unit term) ?:(first-empty second-name first-name)
6664 ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
7637 ?~ binder [%| ["unit branch pattern is not supported by partial inference" ~]]
6665− ?: |(?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
7638+ ?: |(=(u.binder %proj) ?=(^ (ienv-lookup u.binder env)) (lien globals.state |=(n=term =(n u.binder))))
6666 [%| ["pattern binder shadows a name" ~]]
7639 [%| ["pattern binder shadows a name" ~]]
6667 =/ payload=(unit itype) (unit-union-payload typ)
7640 =/ payload=(unit itype) (unit-union-payload typ)
6668 ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
7641 ?~ payload [%| ["unit branch subject is not supported by partial inference" ~]]
7642+ =/ payload-live=(unit [result=?(%yes %no %unknown) left=@ud])
7643+ (itype-inhabited-proof u.payload sub.state.p.subject caps.state.p.subject 256)
7644+ ?~ payload-live [%| ["unit payload reachability needs unsupported inference" ~]]
7645+ ?: =(%unknown result.u.payload-live) [%| ["unit payload reachability needs unsupported inference" ~]]
7646+ ?: =(%no result.u.payload-live) [%| ["unit present pattern is unreachable" ~]]
6669 =/ extended=ienv [[u.binder [u.payload ~]] env]
7647 =/ extended=ienv [[u.binder [u.payload ~]] env]
6670 =/ left=iresult
7648 =/ left=iresult
6671 ?~ expected (infer-fragment val.x ?:(first-empty env extended) state.p.subject)
7649 ?~ expected (infer-fragment val.x ?:(first-empty env extended) state.p.subject)
@@ -6694,12 +7672,14 @@
6694 =/ t=itype (itype-normalize typ.p.item sub.state.p.item)
7672 =/ t=itype (itype-normalize typ.p.item sub.state.p.item)
6695 ?: |(?=(%atom -.t) ?=(%any-atom -.t))
7673 ?: |(?=(%atom -.t) ?=(%any-atom -.t))
6696 $(ps t.ps, state state.p.item)
7674 $(ps t.ps, state state.p.item)
6697− ?: &(?=(%nvar -.t) ?=(%lit -.p.i.ps) =(%number form.lit.p.i.ps))
7675+ ?: &(|(?=(%nvar -.t) ?=(%rnvar -.t)) ?=(%lit -.p.i.ps) =(%number form.lit.p.i.ps))
6698 $(ps t.ps, state state.p.item)
7676 $(ps t.ps, state state.p.item)
6699 ?: &(?=(%collection -.t) =(%list name.t) =(~[[%atom 'tD']] args.t))
7677 ?: &(?=(%collection -.t) =(%list name.t) =(~[[%atom 'tD']] args.t))
6700 $(ps t.ps, state state.p.item)
7678 $(ps t.ps, state state.p.item)
6701 ?: &(?=(%avar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7679 ?: &(?=(%avar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
6702 [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7680 [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
7681+ ?: &(?=(%rvar -.t) (atom-var-from-cap id.t caps.state.p.item sub.state.p.item))
7682+ [%| ["a generic atom in interpolation needs an aura" ~[[(span-of p.i.ps) "atom with a generic aura"]]]]
6703 ?: ?=(%cell -.t)
7683 ?: ?=(%cell -.t)
6704 [%| ["a cell in interpolation needs a printer" ~[[(span-of p.i.ps) "cell without a printer"]]]]
7684 [%| ["a cell in interpolation needs a printer" ~[[(span-of p.i.ps) "cell without a printer"]]]]
6705 [%| ["interpolation type needs unsupported inference" ~]]
7685 [%| ["interpolation type needs unsupported inference" ~]]
@@ -6762,7 +7742,7 @@
6762 ^- (unit ienv)
7742 ^- (unit ienv)
6763 =. t ?:(?=(%face -.t) body.t t)
7743 =. t ?:(?=(%face -.t) body.t t)
6764 ?: ?=(%bind -.p)
7744 ?: ?=(%bind -.p)
6765− ?: |(?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
7745+ ?: |(=(name.p %proj) ?=(^ (ienv-lookup name.p env)) (lien globals |=(n=term =(n name.p)))) ~
6766 `[[name.p [t ~]] env]
7746 `[[name.p [t ~]] env]
6767 ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
7747 ?: ?=(%cell -.p) (union-pattern-bind-items items.p t env globals)
6768 `env
7748 `env
@@ -6810,14 +7790,15 @@
6810 $(xs t.xs, out (weld out rows), origin +(origin))
7790 $(xs t.xs, out (weld out rows), origin +(origin))
6811::
7791::
6812++ infer-known-union-whole
7792++ infer-known-union-whole
6813− |= [e=expr env=ienv state=istate]
7793+ |= [e=expr env=ienv subject=iresult]
6814 ^- (unit iresult)
7794 ^- (unit iresult)
6815 ?> ?=(%branch -.e)
7795 ?> ?=(%branch -.e)
6816− =/ subject=iresult (infer-fragment subject.e env state)
6817 ?: ?=(%| -.subject) `subject
7796 ?: ?=(%| -.subject) `subject
6818 =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7797 =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6819 ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
7798 ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
6820− =/ cases=(list itype) cases.typ
7799+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7800+ ?~ live ~
7801+ =/ cases=(list itype) u.live
6821 =/ remaining=(list itype) cases
7802 =/ remaining=(list itype) cases
6822 =/ arms=(list arm) arms.e
7803 =/ arms=(list arm) arms.e
6823 =/ st=istate state.p.subject
7804 =/ st=istate state.p.subject
@@ -6847,15 +7828,62 @@
6847 ?: mismatch `[%| ["union branch result matching needs unsupported inference" ~]]
7828 ?: mismatch `[%| ["union branch result matching needs unsupported inference" ~]]
6848 $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body, answer `result)
7829 $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body, answer `result)
6849::
7830::
7831+++ infer-known-union-context-whole
7832+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
7833+ ^- (unit iresult)
7834+ ?> ?=(%branch -.e)
7835+ ?: ?=(%| -.subject) `subject
7836+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7837+ ?. ?=(%union -.typ) `[%| ["branch is not supported by partial inference" ~]]
7838+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7839+ ?~ live ~
7840+ =/ cases=(list itype) u.live
7841+ =/ remaining=(list itype) cases
7842+ =/ arms=(list arm) arms.e
7843+ =/ st=istate state.p.subject
7844+ =/ answer=(unit itype) ~
7845+ |-
7846+ ?~ arms
7847+ ?^ remaining
7848+ `[%| ["missing union case {(show-itype i.remaining sub.st)}" ~]]
7849+ ?~ answer `[%| ["empty union branch is not supported by partial inference" ~]]
7850+ `[%& expected st]
7851+ =/ a=arm i.arms
7852+ ?: (lien remaining |=(c=itype =(%unknown (union-pattern pat.a c))))
7853+ ~
7854+ =/ matching=(list itype) (skim remaining |=(c=itype =(%full (union-pattern pat.a c))))
7855+ ?~ matching
7856+ ?: (lien cases |=(c=itype =(%full (union-pattern pat.a c))))
7857+ `[%| ["branch arm is covered by earlier arms" ~[[at.pat.a "covered arm"]]]]
7858+ `[%| ["union pattern is not supported by partial inference" ~]]
7859+ ?: &(?=(^ t.matching) (union-pattern-has-bind pat.a))
7860+ `[%| ["a union pattern binding several cases is not supported by partial inference" ~]]
7861+ =/ bound=(unit ienv) (union-pattern-bind pat.a i.matching env globals.st)
7862+ ?~ bound `[%| ["pattern binder shadows a name" ~]]
7863+ =/ body=iresult (infer-call-context-arg val.a expected u.bound st context)
7864+ ?: ?=(%| -.body) `body
7865+ =/ fit=ifit (itype-fit typ.p.body expected sub.state.p.body next.state.p.body)
7866+ ?: ?=(%unknown -.fit) `[%| ["union branch result constraint is not supported by partial inference" ~]]
7867+ ?: ?=(%bad -.fit)
7868+ =/ missing=(unit idiag) (missing-union-tag val.a expected sub.state.p.body context)
7869+ ?^ missing `[%| u.missing]
7870+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body expected sub.state.p.body next.state.p.body context)
7871+ ?^ nested `[%| u.nested]
7872+ `[%| ["union branch arm does not fit its expected type" ~[[context "expected type"] [(span-of val.a) "branch arm"]]]]
7873+ ?: (itype-has-tag (itype-normalize expected sub.fit))
7874+ `[%| ["union branch result needs context in partial inference" ~]]
7875+ $(arms t.arms, remaining (skim remaining |=(c=itype !=(%full (union-pattern pat.a c)))), st state.p.body(sub sub.fit, next next.fit), answer `expected)
7876+::
6850++ infer-known-union-finite
7877++ infer-known-union-finite
6851− |= [e=expr env=ienv state=istate]
7878+ |= [e=expr env=ienv subject=iresult expected=(unit [typ=itype context=span])]
6852 ^- iresult
7879 ^- iresult
6853 ?> ?=(%branch -.e)
7880 ?> ?=(%branch -.e)
6854− =/ subject=iresult (infer-fragment subject.e env state)
6855 ?: ?=(%| -.subject) subject
7881 ?: ?=(%| -.subject) subject
6856 =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7882 =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6857 ?. ?=(%union -.typ) [%| ["branch is not supported by partial inference" ~]]
7883 ?. ?=(%union -.typ) [%| ["branch is not supported by partial inference" ~]]
7884+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
7885+ ?~ live [%| ["union emptiness needs unsupported inference" ~]]
6858− =/ expanded=(unit (list ifinite)) (finite-cases cases.typ ~ 0)
7886+ =/ expanded=(unit (list ifinite)) (finite-cases u.live ~ 0)
6859 ?~ expanded [%| ["union pattern expansion needs unsupported inference" ~]]
7887 ?~ expanded [%| ["union pattern expansion needs unsupported inference" ~]]
6860 =/ cases=(list ifinite) u.expanded
7888 =/ cases=(list ifinite) u.expanded
6861 =/ remaining=(list ifinite) cases
7889 =/ remaining=(list ifinite) cases
@@ -6867,7 +7895,8 @@
6867 ?^ remaining
7895 ?^ remaining
6868 [%| ["missing union case {(show-itype part.i.remaining sub.st)}" ~]]
7896 [%| ["missing union case {(show-itype part.i.remaining sub.st)}" ~]]
6869 ?~ answer [%| ["empty union branch is not supported by partial inference" ~]]
7897 ?~ answer [%| ["empty union branch is not supported by partial inference" ~]]
6870− [%& u.answer st]
7898+ ?~ expected [%& u.answer st]
7899+ [%& typ.u.expected st]
6871 =/ a=arm i.arms
7900 =/ a=arm i.arms
6872 ?: (lien remaining |=(c=ifinite =(%unknown (union-pattern pat.a part.c))))
7901 ?: (lien remaining |=(c=ifinite =(%unknown (union-pattern pat.a part.c))))
6873 [%| ["partial union pattern is not supported by partial inference" ~]]
7902 [%| ["partial union pattern is not supported by partial inference" ~]]
@@ -6880,39 +7909,454 @@
6880 [%| ["a union pattern binding several cases is not supported by partial inference" ~]]
7909 [%| ["a union pattern binding several cases is not supported by partial inference" ~]]
6881 =/ bound=(unit ienv) (union-pattern-bind pat.a base.i.matching env globals.st)
7910 =/ bound=(unit ienv) (union-pattern-bind pat.a base.i.matching env globals.st)
6882 ?~ bound [%| ["pattern binder shadows a name" ~]]
7911 ?~ bound [%| ["pattern binder shadows a name" ~]]
7912+ =/ body=iresult
6883− =/ body=iresult (infer-fragment val.a u.bound st)
7913+ ?~ expected (infer-fragment val.a u.bound st)
7914+ (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
6884 ?: ?=(%| -.body) body
7915 ?: ?=(%| -.body) body
7916+ ?^ expected
7917+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
7918+ ?: ?=(%unknown -.fit) [%| ["union branch result constraint is not supported by partial inference" ~]]
7919+ ?: ?=(%bad -.fit)
7920+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
7921+ ?^ missing [%| u.missing]
7922+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body typ.u.expected sub.state.p.body next.state.p.body context.u.expected)
7923+ ?^ nested [%| u.nested]
7924+ [%| ["union branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
7925+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
7926+ [%| ["union branch result needs context in partial inference" ~]]
7927+ $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body(sub sub.fit, next next.fit), answer `typ.u.expected)
6885 =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
7928 =/ result=itype (itype-normalize typ.p.body sub.state.p.body)
6886 =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
7929 =/ mismatch=? ?~(answer | !=((itype-normalize u.answer sub.state.p.body) result))
6887 ?: mismatch [%| ["union branch result matching needs unsupported inference" ~]]
7930 ?: mismatch [%| ["union branch result matching needs unsupported inference" ~]]
6888 $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body, answer `result)
7931 $(arms t.arms, remaining (skim remaining |=(c=ifinite !=(%full (union-pattern pat.a part.c)))), st state.p.body, answer `result)
6889::
7932::
7933+:: Prove a one-arm record pattern covers a known, non-union subject.
7934+:: Variable or partial matches stay unsupported; binding uses the same
7935+:: scope and original payload types as the existing union matcher.
7936+++ single-structured-pattern
7937+ |= e=expr
7938+ ^- ?
6890−++ infer-known-union-branch
7939+ ?. ?=(%branch -.e) |
7940+ ?~ arms.e |
7941+ ?^ t.arms.e |
7942+ =/ p=pattern pat.i.arms.e
7943+ ?. ?=(%cell -.p) |
7944+ !(levy items.p |=(x=pattern ?=(%bind -.x)))
7945+::
7946+++ infer-single-case-branch
7947+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
7948+ ^- iresult
7949+ ?> (single-structured-pattern e)
7950+ ?> ?=(%branch -.e)
7951+ ?> ?=(^ arms.e)
7952+ =/ a=arm i.arms.e
7953+ =/ subject=iresult (infer-fragment subject.e env state)
7954+ ?: ?=(%| -.subject) subject
7955+ =/ st=istate state.p.subject
7956+ =/ typ=itype (itype-normalize typ.p.subject sub.st)
7957+ ?: ?=(%union -.typ) [%| ["single-case pattern needs unsupported inference" ~]]
7958+ ?. =(%full (union-pattern pat.a typ))
7959+ [%| ["single-case pattern needs unsupported inference" ~]]
7960+ =/ bound=(unit ienv) (union-pattern-bind pat.a typ env globals.st)
7961+ ?~ bound [%| ["pattern binder shadows a name" ~]]
7962+ ?~ expected (infer-fragment val.a u.bound st)
7963+ =/ body=iresult (infer-call-context-arg val.a typ.u.expected u.bound st context.u.expected)
7964+ ?: ?=(%| -.body) body
7965+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
7966+ ?: ?=(%unknown -.fit) [%| ["single-case branch result constraint is not supported by partial inference" ~]]
7967+ ?: ?=(%bad -.fit)
7968+ =/ missing=(unit idiag) (missing-union-tag val.a typ.u.expected sub.state.p.body context.u.expected)
7969+ ?^ missing [%| u.missing]
7970+ =/ nested=(unit idiag) (nested-missing-tag val.a typ.p.body typ.u.expected sub.state.p.body next.state.p.body context.u.expected)
7971+ ?^ nested [%| u.nested]
7972+ [%| ["single-case branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.a) "branch arm"]]]]
7973+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
7974+ [%| ["single-case branch result needs context in partial inference" ~]]
7975+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
7976+::
7977+:: This view is used only by pattern analysis, never exported or bound as
7978+:: the subject. Only null plus a two-binder/wildcard cell is supported; its
7979+:: tail keeps the original recursive type. Other patterns fail closed.
7980+++ jrec-match-view
7981+ |= [e=expr subject=iresult]
7982+ ^- iresult
7983+ ?: ?=(%| -.subject) subject
7984+ ?. ?=(%branch -.e) subject
7985+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
7986+ ?. ?=(%jrec -.typ) subject
7987+ ?~ arms.e subject
7988+ ?~ t.arms.e subject
7989+ ?^ t.t.arms.e subject
7990+ =/ x=pattern pat.i.arms.e
7991+ =/ y=pattern pat.i.t.arms.e
7992+ =/ empty=? &(?=(%lit -.x) =(%null form.lit.x))
7993+ =/ full=pattern ?:(empty y x)
7994+ ?. |(empty &(?=(%lit -.y) =(%null form.lit.y))) subject
7995+ ?. ?=(%cell -.full) subject
7996+ ?~ items.full subject
7997+ ?~ t.items.full subject
7998+ ?^ t.t.items.full subject
7999+ ?. |(?=(%bind -.i.items.full) ?=(%any -.i.items.full)) subject
8000+ ?. |(?=(%bind -.i.t.items.full) ?=(%any -.i.t.items.full)) subject
8001+ ?: =(0 jrec-fuel.state.p.subject)
8002+ [%| ["recursive mold unfolding needs unsupported inference" ~]]
8003+ =/ nil=itype [%const [%null %n 0 '~']]
8004+ =/ cell=itype [%cell [%face head.typ [%atom aura.typ]] [%face tail.typ typ]]
8005+ [%& [%union ~[nil cell] ~ ~ ~] state.p.subject(jrec-fuel (dec jrec-fuel.state.p.subject))]
8006+::
8007+:: A bounded source-proven tree match permits flat tag patterns and
8008+:: nonbinding catch-alls. Whole-case binders cannot consume the temporary
8009+:: structural view. Pattern count and field arity are checked first.
8010+++ grec-simple-pattern
8011+ |= [pat=pattern view=itype]
8012+ ^- ?
8013+ ?. ?=(%cell -.pat) |
8014+ ?~ items.pat |
8015+ =/ first=pattern i.items.pat
8016+ ?. ?=(%lit -.first) |
8017+ ?. =(%term form.lit.first) |
8018+ =/ chosen=(unit itype) (contextual-tagged-case view val.lit.first ~)
8019+ ?~ chosen |
8020+ ?> ?=(%cell -.u.chosen)
8021+ =/ rest=(list pattern) t.items.pat
8022+ =/ arity=? ?:(?=(%cell -.tal.u.chosen) ?=([* [* ~]] rest) ?=([* ~] rest))
8023+ ?. arity |
8024+ (levy rest |=(p=pattern |(?=(%bind -.p) ?=(%any -.p))))
8025+::
8026+:: A catch-all with no binder is safe even when it covers both cases.
8027+:: A bound whole case still declines to avoid exporting the analysis view.
8028+++ grec-patterns-eligible
8029+ |= [arms=(list arm) view=itype left=@ud]
8030+ ^- ?
8031+ ?~ arms &
8032+ ?: =(0 left) |
8033+ =/ pat=pattern pat.i.arms
8034+ ?. |(?=(%any -.pat) (grec-simple-pattern pat view)) |
8035+ $(arms t.arms, left (dec left))
8036+++ grec-match-view
8037+ |= [e=expr subject=iresult]
8038+ ^- iresult
8039+ ?: ?=(%| -.subject) subject
8040+ ?. ?=(%branch -.e) subject
8041+ ?. (grec-direct-context typ.p.subject sub.state.p.subject) subject
8042+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8043+ ?. ?=(%grec -.typ) subject
8044+ ?~ arms.e subject
8045+ =/ view=(unit [view=itype left=@ud]) (grec-unfold-view typ jrec-fuel.state.p.subject)
8046+ ?~ view [%| ["recursive mold unfolding needs unsupported inference" ~]]
8047+ ?. (grec-patterns-eligible arms.e view.u.view 128) subject
8048+ [%& view.u.view state.p.subject(jrec-fuel left.u.view)]
8049+::
8050+:: A single-arm diagnostic only probes a direct, source-typed in-scope wing;
8051+:: other subjects retain the prior single-pattern inference path.
8052+++ grec-single-wing-subject
6891 |= [e=expr env=ienv state=istate]
8053 |= [e=expr env=ienv state=istate]
8054+ ^- (unit iresult)
8055+ ?. ?=(%wing -.e) ~
8056+ ?. ?=([@ ~] names.e) ~
8057+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8058+ ?~ scheme ~
8059+ ?. (grec-direct-context typ.u.scheme sub.state) ~
8060+ `(infer-fragment e env state)
8061+::
8062+++ infer-known-union-branch-subject
8063+ |= [e=expr env=ienv subject=iresult]
6892 ^- iresult
8064 ^- iresult
8065+ =. subject (grec-match-view e subject)
8066+ =. subject (jrec-match-view e subject)
6893− =/ whole=(unit iresult) (infer-known-union-whole e env state)
8067+ =/ whole=(unit iresult) (infer-known-union-whole e env subject)
6894− ?~ whole (infer-known-union-finite e env state)
8068+ ?~ whole (infer-known-union-finite e env subject ~)
6895 u.whole
8069 u.whole
6896::
8070::
6897−++ known-union-subject
8071+++ infer-known-union-branch
6898 |= [e=expr env=ienv state=istate]
8072 |= [e=expr env=ienv state=istate]
6899− ^- (unit itype)
8073+ ^- iresult
6900− ?. ?=(%wing -.e) ~
8074+ ?> ?=(%branch -.e)
6901− =/ subject=iresult (infer-fragment e env state)
8075+ (infer-known-union-branch-subject e env (infer-fragment subject.e env state))
6902− ?: ?=(%| -.subject) ~
6903− =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
6904− ?. ?=(%union -.typ) ~
6905− `typ
6906::
8076::
6907−++ infer-fragment
8077+++ infer-known-union-context-subject
6908− |= [e=expr env=ienv state=istate]
8078+ |= [e=expr expected=itype env=ienv subject=iresult context=span]
6909 ^- iresult
8079 ^- iresult
8080+ =. subject (grec-match-view e subject)
8081+ =. subject (jrec-match-view e subject)
8082+ =/ whole=(unit iresult) (infer-known-union-context-whole e expected env subject context)
8083+ ?~ whole (infer-known-union-finite e env subject `[expected context])
8084+ u.whole
8085+::
8086+:: Limit speculative subject inference to wings and shallow calls;
8087+:: grouping is peeled linearly and cannot introduce a nested branch.
8088+++ simple-union-subject-arg
8089+ |= e=expr
8090+ ^- ?
6910 ?- -.e
8091 ?- -.e
6911− %lit
8092+ %wing &
6912− ?- form.lit.e
8093+ %lit &
6913− %number ?: =(%ud aura.lit.e)
8094+ %str !(lien pieces.e |=(p=piece ?=(%expr -.p)))
6914− [%& [%nvar next.state] state(next +(next.state))]
8095+ * |
6915− [%& [%atom aura.lit.e] state]
8096+ ==
8097+::
8098+++ safe-union-subject
8099+ |= e=expr
8100+ ^- ?
8101+ ?: ?=(%group -.e) $(e inner.e)
8102+ ?: ?=(%wing -.e) &
8103+ ?. ?=(%call -.e) |
8104+ ?. ?=(%wing -.head.e) |
8105+ (levy args.e simple-union-subject-arg)
8106+::
8107+++ duplicate-loobean-arms
8108+ |= e=expr
8109+ ^- ?
8110+ ?. ?=(%branch -.e) |
8111+ ?~ arms.e |
8112+ ?~ t.arms.e |
8113+ ?^ t.t.arms.e |
8114+ =/ x=pattern pat.i.arms.e
8115+ =/ y=pattern pat.i.t.arms.e
8116+ ?. &(?=(%lit -.x) ?=(%lit -.y)) |
8117+ ?. &(=(%loobean form.lit.x) =(%loobean form.lit.y)) |
8118+ =(val.lit.x val.lit.y)
8119+::
8120+++ union-subject-call
8121+ |= e=expr
8122+ ^- ?
8123+ ?: ?=(%group -.e) $(e inner.e)
8124+ ?=(%call -.e)
8125+::
8126+++ known-union-subject
8127+ |= [e=expr env=ienv state=istate]
8128+ ^- (unit iresult)
8129+ ?. (safe-union-subject e) ~
8130+ =/ subject=iresult (infer-fragment e env state)
8131+ ?: ?=(%| -.subject) ?:((union-subject-call e) `subject ~)
8132+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8133+ ?. |(?=(%union -.typ) ?=(%jrec -.typ) &(?=(%grec -.typ) (grec-direct-context typ.p.subject sub.state.p.subject))) ~
8134+ `subject
8135+::
8136+:: A direct wing with an already-known union may skip genuinely empty cases
8137+:: when checking a one-arm match. Other subjects keep their existing path.
8138+:: A directly known canonical list of an empty element contains only null.
8139+:: This helper never refines an opaque or variable-bound subject.
8140+++ empty-list-null-branch
8141+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
8142+ ^- (unit iresult)
8143+ ?. ?=(%branch -.e) ~
8144+ ?~ arms.e ~
8145+ ?^ t.arms.e ~
8146+ ?. (unit-empty-pattern pat.i.arms.e) ~
8147+ ?. ?=(%wing -.subject.e) ~
8148+ ?. ?=([@ ~] names.subject.e) ~
8149+ =/ scheme=(unit ischeme) (ienv-lookup i.names.subject.e env)
8150+ ?~ scheme ~
8151+ ?. ?=(%collection -.typ.u.scheme) ~
8152+ ?. =(%list name.typ.u.scheme) ~
8153+ ?~ prelude.state ~
8154+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb) ~
8155+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8156+ ?~ standard ~
8157+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
8158+ =/ subject=iresult (infer-fragment subject.e env state)
8159+ ?: ?=(%| -.subject) ~
8160+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8161+ ?. ?=(%collection -.typ) ~
8162+ ?. =(%list name.typ) ~
8163+ ?~ args.typ ~
8164+ ?^ t.args.typ ~
8165+ =/ proof=(unit [empty=? left=@ud]) (itype-empty-proof i.args.typ sub.state.p.subject 256)
8166+ ?~ proof ~
8167+ ?. empty.u.proof ~
8168+ ?~ expected `(infer-fragment val.i.arms.e env state.p.subject)
8169+ =/ body=iresult (infer-call-context-arg val.i.arms.e typ.u.expected env state.p.subject context.u.expected)
8170+ ?: ?=(%| -.body) `body
8171+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
8172+ ?: ?=(%unknown -.fit) `[%| ["single-case branch result constraint is not supported by partial inference" ~]]
8173+ ?: ?=(%bad -.fit) `[%| ["single-case branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.i.arms.e) "branch arm"]]]]
8174+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
8175+ `[%| ["single-case branch result needs context in partial inference" ~]]
8176+ `[%& typ.p.body state.p.body(sub sub.fit, next next.fit)]
8177+::
8178+++ known-empty-union-wing
8179+ |= [e=expr env=ienv state=istate]
8180+ ^- (unit iresult)
8181+ ?. ?=(%wing -.e) ~
8182+ ?. ?=([@ ~] names.e) ~
8183+ =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8184+ ?~ scheme ~
8185+ ?. (contextual-direct-union typ.u.scheme) ~
8186+ =/ subject=iresult (infer-fragment e env state)
8187+ ?: ?=(%| -.subject) ~
8188+ =/ typ=itype (itype-normalize typ.p.subject sub.state.p.subject)
8189+ ?. ?=(%union -.typ) ~
8190+ =/ live=(unit (list itype)) (itype-live-cases cases.typ sub.state.p.subject caps.state.p.subject 4.096)
8191+ ?~ live ~
8192+ ?: =(u.live cases.typ) ~
8193+ `subject
8194+::
8195+:: Infer changes only against a fully known record spine. Retain the
8196+:: target type; unknown spines and repeated edits remain unsupported.
8197+++ change-spine-known
8198+ |= [t=itype sub=isub]
8199+ ^- ?
8200+ =. t (itype-walk t sub)
8201+ ?: ?=(%face -.t) &
8202+ ?. ?=(%cell -.t) |
8203+ =/ first=itype (itype-walk hed.t sub)
8204+ ?. ?=(%face -.first) |
8205+ $(t tal.t)
8206+::
8207+++ infer-change-edits
8208+ |= [edits=(list edit) target=itype env=ienv state=istate seen=(list term)]
8209+ ^- iresult
8210+ ?~ edits [%& target state]
8211+ =/ entry=edit i.edits
8212+ ?: (lien seen |=(name=term =(name name.entry)))
8213+ [%| ["repeated change fields are not supported by partial inference" ~]]
8214+ ?. (change-spine-known target sub.state)
8215+ [%| ["change target needs a known record in partial inference" ~]]
8216+ =/ found=(list itype) (record-fields-named name.entry target sub.state)
8217+ ?~ found
8218+ [%| ["record has no field `{(trip name.entry)}`" ~[[at.entry "unknown field"]]]]
8219+ ?^ t.found [%| ["change field is ambiguous in partial inference" ~]]
8220+ =/ expected=itype i.found
8221+ =/ value=iresult (infer-call-context-arg val.entry expected env state at.entry)
8222+ ?: ?=(%| -.value) value
8223+ =/ fit=ifit (itype-fit typ.p.value expected sub.state.p.value next.state.p.value)
8224+ ?: ?=(%unknown -.fit) [%| ["change field constraint is not supported by partial inference" ~]]
8225+ ?: ?=(%bad -.fit)
8226+ [%| ["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)]]]]
8227+ $(edits t.edits, state state.p.value(sub sub.fit, next next.fit), seen [name.entry seen])
8228+::
8229+:: Backtick constructs the canonical prelude unit, after checking its
8230+:: prepared template has the standard null and [~ u=A] cases.
8231+++ standard-unit-template
8232+ |= [template=ischeme at=path]
8233+ ^- ?
8234+ ?. =(at /lib/jibb/prelude/jibb) |
8235+ ?~ vars.template |
8236+ ?^ t.vars.template |
8237+ =/ v=@ud i.vars.template
8238+ =/ nil=itype [%const [%null %n 0 '~']]
8239+ =/ expected=itype
8240+ [%union ~[nil [%cell nil [%face %u [%var v]]]] `[at %unit] `%unit ~[[%var v]]]
8241+ =(typ.template expected)
8242+::
8243+:: A named missing-case diagnostic needs more than a failed fit: a case
8244+:: with that tag but the wrong payload is not a missing case. Unknown
8245+:: shapes and atom types that accept terms keep the proof conservative.
8246++$ itag-presence ?(%yes %no %maybe)
8247+++ tag-presence-cases
8248+ |= [cases=(list itype) value=@ sub=isub]
8249+ ^- itag-presence
8250+ ?~ cases %no
8251+ =/ first=itag-presence (tag-presence i.cases value sub)
8252+ ?: =(%yes first) %yes
8253+ =/ rest=itag-presence $(cases t.cases)
8254+ ?: =(%yes rest) %yes
8255+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8256+ %no
8257+::
8258+++ tag-presence
8259+ |= [t=itype value=@ sub=isub]
8260+ ^- itag-presence
8261+ =. t (itype-walk t sub)
8262+ ?- -.t
8263+ %const ?:(=(value val.literal.t) %yes %no)
8264+ %flag ?:(|(=(value 0) =(value 1)) %yes %no)
8265+ %atom ?:(|(=(%tas aura.t) =(%ta aura.t)) %maybe %no)
8266+ %face $(t body.t)
8267+ %cell
8268+ =/ first=itag-presence $(t hed.t)
8269+ ?: =(%yes first) %yes
8270+ =/ rest=itag-presence $(t tal.t)
8271+ ?: =(%yes rest) %yes
8272+ ?: |(=(%maybe first) =(%maybe rest)) %maybe
8273+ %no
8274+ %union (tag-presence-cases cases.t value sub)
8275+ * %maybe
8276+ ==
8277+::
8278+++ missing-union-tag
8279+ |= [e=expr expected=itype sub=isub context=span]
8280+ ^- (unit idiag)
8281+ ?. ?=(%lit -.e) ~
8282+ ?. =(%term form.lit.e) ~
8283+ =. expected (itype-walk expected sub)
8284+ |-
8285+ ?: ?=(%face -.expected) $(expected (itype-walk body.expected sub))
8286+ ?. ?=(%union -.expected) ~
8287+ ?. =(%no (tag-presence-cases cases.expected val.lit.e sub)) ~
8288+ =/ label=tape
8289+ ?~ label.expected "union {(show-itype expected sub)}"
8290+ (show-itype expected sub)
8291+ `["{label} has no case `{(trip txt.lit.e)}`" ~[[context "expected union"] [(span-of e) "tag"]]]
8292+::
8293+:: Locate a missing tag inside a syntactic tuple only by replaying the
8294+:: directional fit in source order. Uncertain or earlier failures stop
8295+:: the walk, preserving the generic diagnostic rather than guessing.
8296+++ nested-missing-tag
8297+ |= [e=expr actual=itype expected=itype sub=isub next=@ud context=span]
8298+ ^- (unit idiag)
8299+ =/ original=[left=itype right=itype] [actual expected]
8300+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
8301+ =/ fit=ifit (itype-fit actual expected sub next)
8302+ ?. ?=(%bad -.fit) ~
8303+ =. actual (itype-walk actual sub)
8304+ =. expected (itype-walk expected sub)
8305+ ?: &(?=(%face -.actual) ?=(%face -.expected))
8306+ ?. =(name.actual name.expected) ~
8307+ $(actual body.actual, expected body.expected)
8308+ ?: ?=(%face -.actual) $(actual body.actual)
8309+ ?: ?=(%face -.expected) $(expected body.expected)
8310+ =/ direct=(unit idiag) (missing-union-tag e expected sub context)
8311+ ?^ direct direct
8312+ ?. ?=(%tuple -.e) ~
8313+ (nested-missing-items items.e actual expected sub next context)
8314+::
8315+++ nested-missing-items
8316+ |= [items=(list item) actual=itype expected=itype sub=isub next=@ud context=span]
8317+ ^- (unit idiag)
8318+ ?~ items ~
8319+ ?~ t.items (nested-missing-tag val.i.items actual expected sub next context)
8320+ =/ original=[left=itype right=itype] [actual expected]
8321+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
8322+ =. actual (itype-walk actual sub)
8323+ =. expected (itype-walk expected sub)
8324+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8325+ =/ first=ifit (itype-fit hed.actual hed.expected sub next)
8326+ ?: ?=(%bad -.first)
8327+ (nested-missing-tag val.i.items hed.actual hed.expected sub next context)
8328+ ?. ?=(%ok -.first) ~
8329+ $(items t.items, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
8330+::
8331+:: A term-headed pair is the same noun as a two-item cell. Preserve the
8332+:: whole pair span for the synthetic head and the value's own span for
8333+:: the payload; unresolved term constraints follow ordinary cell inference.
8334+++ pair-as-cell
8335+ |= e=expr
8336+ ^- expr
8337+ ?> ?=(%pair -.e)
8338+ =/ head=expr [%lit at.e [%term %tas tag.e (crip ['%' (trip tag.e)])]]
8339+ [%tuple at.e ~[[at.e ~ head] [(span-of val.e) ~ val.e]]]
8340+::
8341+:: A segment costs one shared step; dynamic segments are not handled yet.
8342+++ qath-static-fuel
8343+ |= [segs=(list qseg) fuel=@ud]
8344+ ^- (unit @ud)
8345+ ?~ segs `fuel
8346+ ?: =(0 fuel) ~
8347+ ?. ?=(%knot -.i.segs) ~
8348+ $(segs t.segs, fuel (dec fuel))
8349+::
8350+++ infer-fragment
8351+ |= [e=expr env=ienv state=istate]
8352+ ^- iresult
8353+ ?- -.e
8354+ %pair $(e (pair-as-cell e))
8355+ %lit
8356+ ?- form.lit.e
8357+ %number ?: =(%ud aura.lit.e)
8358+ [%& [%nvar next.state] state(next +(next.state))]
8359+ [%& [%atom aura.lit.e] state]
6916 %ship [%& [%atom %p] state]
8360 %ship [%& [%atom %p] state]
6917 %date [%& [%atom %da] state]
8361 %date [%& [%atom %da] state]
6918 %duration [%& [%atom %dr] state]
8362 %duration [%& [%atom %dr] state]
@@ -6921,7 +8365,45 @@
6921 %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
8365 %term [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
6922 %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
8366 %null [%& [%tag next.state lit.e |] state(next +(next.state), tags [[next.state lit.e] tags.state])]
6923 ==
8367 ==
8368+ %unit
8369+ ?~ prelude.state [%| ["unit construction needs the standard prelude in partial inference" ~]]
8370+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
8371+ ?~ standard [%| ["unit construction needs the standard prelude in partial inference" ~]]
8372+ ?. (standard-unit-template u.standard at.u.prelude.state)
8373+ [%| ["unit construction needs the standard prelude in partial inference" ~]]
8374+ =/ value=iresult $(e val.e)
8375+ ?: ?=(%| -.value) value
8376+ =/ result=(unit itype) (template-apply u.standard ~[typ.p.value])
8377+ ?~ result [%| ["unit construction is not supported by partial inference" ~]]
8378+ [%& u.result state.p.value]
8379+ %list
8380+ ?~ prelude.state [%| ["list literal needs the standard prelude in partial inference" ~]]
8381+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8382+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8383+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude.state)
8384+ ?~ standard [%| ["list literal needs the standard prelude in partial inference" ~]]
8385+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]])
8386+ [%| ["list literal needs the standard prelude in partial inference" ~]]
8387+ =/ element=itype [%var next.state]
8388+ =/ result=iresult (infer-open-list-items items.e element env state(next +(next.state)) at.e)
8389+ ?: ?=(%| -.result) result
8390+ [%& [%collection %list ~[element]] state.p.result]
6924 %str (infer-string-pieces pieces.e env state)
8391 %str (infer-string-pieces pieces.e env state)
8392+ %qath
8393+ ?~ prelude.state [%| ["application path needs the standard prelude in partial inference" ~]]
8394+ ?. =(at.u.prelude.state /lib/jibb/prelude/jibb)
8395+ [%| ["application path needs the standard prelude in partial inference" ~]]
8396+ =/ standard=(unit ischeme) (find-jibb-mold %qath u.prelude.state)
8397+ ?~ standard [%| ["application path needs the standard prelude in partial inference" ~]]
8398+ ?. ?=(~ vars.u.standard) [%| ["application path mold needs unsupported inference" ~]]
8399+ =/ typ=itype typ.u.standard
8400+ ?. ?=(%jrec -.typ) [%| ["application path mold needs unsupported inference" ~]]
8401+ ?. &(=(at.typ /lib/jibb/internal/jibb) =(%qath name.typ) =(%i head.typ) =(%ta aura.typ) =(%t tail.typ))
8402+ [%| ["application path mold needs unsupported inference" ~]]
8403+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
8404+ =/ remain=(unit @ud) (qath-static-fuel segs.e (dec jrec-fuel.state))
8405+ ?~ remain [%| ["application path segments need unsupported inference" ~]]
8406+ [%& typ state(jrec-fuel u.remain)]
6925 %wing
8407 %wing
6926 ?~ names.e [%| ["empty wing" ~]]
8408 ?~ names.e [%| ["empty wing" ~]]
6927 ?^ t.names.e
8409 ?^ t.names.e
@@ -6930,7 +8412,7 @@
6930 ?~ iface (infer-field-wing names.e env state)
8412 ?~ iface (infer-field-wing names.e env state)
6931 =/ member=(unit ischeme) (ienv-lookup i.names.e values.u.iface)
8413 =/ member=(unit ischeme) (ienv-lookup i.names.e values.u.iface)
6932 ?~ member [%| ["module member is not available to partial inference" ~]]
8414 ?~ member [%| ["module member is not available to partial inference" ~]]
6933− =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e)
8415+ =. typ.u.member (itype-in-import typ.u.member u.iface i.t.names.e prelude.state)
6934 =/ instance=[typ=itype state=istate] (instantiate-scheme u.member state)
8416 =/ instance=[typ=itype state=istate] (instantiate-scheme u.member state)
6935 [%& typ.instance state.instance]
8417 [%& typ.instance state.instance]
6936 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
8418 =/ scheme=(unit ischeme) (ienv-lookup i.names.e env)
@@ -6943,6 +8425,11 @@
6943 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
8425 =/ instance=[typ=itype state=istate] (instantiate-scheme u.scheme state)
6944 [%& typ.instance state.instance]
8426 [%& typ.instance state.instance]
6945 %group $(e inner.e)
8427 %group $(e inner.e)
8428+ %change
8429+ ?~ edits.e [%| ["a change takes at least one field" ~[[at.e "empty change"]]]]
8430+ =/ target=iresult $(e [%wing at.e target.e])
8431+ ?: ?=(%| -.target) target
8432+ (infer-change-edits edits.e typ.p.target env state.p.target ~)
6946 %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e] tags.state])]
8433 %ctor [%& [%tag next.state tag.e &] state(next +(next.state), tags [[next.state tag.e] tags.state])]
6947 %trace
8434 %trace
6948 =/ traced=iresult $(e val.e)
8435 =/ traced=iresult $(e val.e)
@@ -6959,6 +8446,9 @@
6959 [%| ["local molds shadow a name" ~]]
8446 [%| ["local molds shadow a name" ~]]
6960 =/ local-state=istate
8447 =/ local-state=istate
6961 state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
8448 state(globals (weld local-names globals.state), molds (weld local-molds molds.state))
8449+ =/ mold-hole=(unit span) (simple-local-mold-hole defs.e)
8450+ ?^ mold-hole
8451+ [%| ["type hole needs a determined type" ~[[u.mold-hole "unresolved type hole"]]]]
6962 ?. (local-molds-supported local-molds local-state)
8452 ?. (local-molds-supported local-molds local-state)
6963 [%| ["local molds need unsupported inference" ~]]
8453 [%| ["local molds need unsupported inference" ~]]
6964 =/ values=(list def) (local-value-defs defs.e)
8454 =/ values=(list def) (local-value-defs defs.e)
@@ -6968,12 +8458,22 @@
6968 ?: ?=(%| -.result) result
8458 ?: ?=(%| -.result) result
6969 [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
8459 [%& typ.p.result state.p.result(globals globals.state, molds molds.state)]
6970 %branch
8460 %branch
8461+ ?^ defer.state (dg-boolean-branch e env state)
6971 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
8462 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
6972− ?~ t.arms.e (infer-cell-branch e env state)
8463+ ?~ t.arms.e
8464+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state ~)
8465+ ?^ empty-list u.empty-list
8466+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
8467+ ?^ empty-union (infer-known-union-branch-subject e env u.empty-union)
8468+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
8469+ ?^ single (infer-known-union-branch-subject e env u.single)
8470+ ?: (single-structured-pattern e) (infer-single-case-branch e env state ~)
8471+ (infer-cell-branch e env state ~)
6973 ?^ t.t.arms.e (infer-known-union-branch e env state)
8472 ?^ t.t.arms.e (infer-known-union-branch e env state)
6974− =/ known=(unit itype) (known-union-subject subject.e env state)
8473+ =/ known=(unit iresult) (known-union-subject subject.e env state)
6975− ?: &(?=(^ known) ?=(~ (unit-union-payload u.known)))
8474+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
6976− (infer-known-union-branch e env state)
8475+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
8476+ (infer-known-union-branch-subject e env u.known)
6977 =/ x=arm i.arms.e
8477 =/ x=arm i.arms.e
6978 =/ y=arm i.t.arms.e
8478 =/ y=arm i.t.arms.e
6979 ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
8479 ?: |((unit-empty-pattern pat.x) (unit-empty-pattern pat.y))
@@ -6982,7 +8482,7 @@
6982 ?. ?=(%lit -.pat.y) (infer-known-union-branch e env state)
8482 ?. ?=(%lit -.pat.y) (infer-known-union-branch e env state)
6983 ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
8483 ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y))
6984 (infer-known-union-branch e env state)
8484 (infer-known-union-branch e env state)
6985− ?^ known (infer-known-union-branch e env state)
8485+ ?: &(?=(^ known) ?=(%& -.u.known)) (infer-known-union-branch-subject e env u.known)
6986 ?: =(val.lit.pat.x val.lit.pat.y)
8486 ?: =(val.lit.pat.x val.lit.pat.y)
6987 [%| ["branch does not cover both loobeans" ~]]
8487 [%| ["branch does not cover both loobeans" ~]]
6988 =/ subject=iresult $(e subject.e)
8488 =/ subject=iresult $(e subject.e)
@@ -7021,18 +8521,21 @@
7021 ?^ diag [%| u.diag]
8521 ?^ diag [%| u.diag]
7022 [%| ["cast mold is not supported by partial inference" ~]]
8522 [%| ["cast mold is not supported by partial inference" ~]]
7023 =/ value=iresult
8523 =/ value=iresult
7024− ?: &(?=(%union -.typ.u.target) (context-union-branch val.e))
8524+ (infer-call-context-arg val.e typ.u.target env state.u.target at.shape.e)
7025− (infer-union-context val.e typ.u.target env state.u.target at.shape.e)
7026− ?: &(?=(%collection -.typ.u.target) =(%list name.typ.u.target) (context-union-branch val.e))
7027− (infer-union-context val.e typ.u.target env state.u.target at.shape.e)
7028− ?: &(?=(%collection -.typ.u.target) =(%list name.typ.u.target) (context-list-expression val.e))
7029− (infer-list-context val.e typ.u.target env state.u.target at.shape.e)
7030− $(e val.e, state state.u.target)
7031 ?: ?=(%| -.value) value
8525 ?: ?=(%| -.value) value
8526+ =/ shape=(unit [source=iwfields target=iwfields])
8527+ (width-shape typ.p.value typ.u.target sub.state.p.value)
8528+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
7032 =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
8529 =/ fit=ifit (itype-fit typ.p.value typ.u.target sub.state.p.value next.state.p.value)
7033 ?: ?=(%unknown -.fit) [%| ["cast constraint is not supported by partial inference" ~]]
8530 ?: ?=(%unknown -.fit) [%| ["cast constraint is not supported by partial inference" ~]]
7034 ?: ?=(%bad -.fit)
8531 ?: ?=(%bad -.fit)
8532+ =/ missing=(unit idiag) (missing-union-tag val.e typ.u.target sub.state.p.value at.shape.e)
8533+ ?^ missing [%| u.missing]
8534+ =/ nested=(unit idiag) (nested-missing-tag val.e typ.p.value typ.u.target sub.state.p.value next.state.p.value at.shape.e)
8535+ ?^ nested [%| u.nested]
7035 [%| ["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)]]]]
8536 [%| ["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)]]]]
8537+ ?: &(?=(^ defer.state.p.value) !(dg-stable-fit typ.p.value typ.u.target sub.fit))
8538+ [%| ["deferred cast fit needs stable inference" ~]]
7036 =/ merged=itype (itype-merge-faces typ.p.value typ.u.target sub.fit)
8539 =/ merged=itype (itype-merge-faces typ.p.value typ.u.target sub.fit)
7037 [%& merged state.p.value(sub sub.fit, next next.fit)]
8540 [%& merged state.p.value(sub sub.fit, next next.fit)]
7038 %crash [%& [%var next.state] state(next +(next.state))]
8541 %crash [%& [%var next.state] state(next +(next.state))]
@@ -7056,43 +8559,9 @@
7056 [%& [%fn typ.p.sam typ.p.body] state.p.body]
8559 [%& [%fn typ.p.sam typ.p.body] state.p.body]
7057 %call
8560 %call
7058 ?~ args.e [%| ["call has no argument" ~]]
8561 ?~ args.e [%| ["call has no argument" ~]]
7059− =/ head=iresult $(e head.e)
8562+ ?: (explicit-proj-call e env state)
7060− ?: ?=(%| -.head) head
8563+ [%| ["proj needs an expected record type" ~]]
7061− =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
8564+ (infer-call-with-head e env state (infer-fragment head.e env state))
7062− =/ arg=iresult
7063− ?^ t.args.e
7064− ?: ?=(%fn -.head-type)
7065− (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
7066− (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
7067− ?: &(?=(%fn -.head-type) ?=(%union -.sample.head-type) (context-union-branch i.args.e))
7068− (infer-union-context i.args.e sample.head-type env state.p.head (span-of head.e))
7069− ?: &(?=(%fn -.head-type) ?=(%collection -.sample.head-type) =(%list name.sample.head-type) (context-union-branch i.args.e))
7070− (infer-union-context i.args.e sample.head-type env state.p.head (span-of head.e))
7071− ?: &(?=(%fn -.head-type) ?=(%collection -.sample.head-type) =(%list name.sample.head-type) (context-list-expression i.args.e))
7072− (infer-list-context i.args.e sample.head-type env state.p.head (span-of head.e))
7073− $(e i.args.e, state state.p.head)
7074− ?: ?=(%| -.arg) arg
7075− =/ st=istate state.p.arg
7076− =/ ht=itype (itype-walk typ.p.head sub.st)
7077− ?: ?=(%fn -.ht)
7078− =/ fit=ifit (itype-fit typ.p.arg sample.ht sub.st next.st)
7079− ?: ?=(%unknown -.fit) [%| ["call constraint is not supported by partial inference" ~]]
7080− ?: ?=(%bad -.fit)
7081− =/ bad=(unit [at=span typ=itype])
7082− ?~(t.args.e ~ (call-error-site args.e typ.p.arg sample.ht sub.st next.st))
7083− =/ whole-args=span
7084− ?~(t.args.e (span-of i.args.e) [beg:(span-of i.args.e) end:(span-of (rear args.e))])
7085− =/ arg-at=span ?~(bad whole-args at.u.bad)
7086− =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
7087− [%| ["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)]]]]
7088− ?: &((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))
7089− [%| ["call result face propagation is not supported by partial inference" ~]]
7090− [%& product.ht st(sub sub.fit, next next.fit)]
7091− =/ result=itype [%var next.st]
7092− =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
7093− ?~ uni
7094− [%| ["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)]]]]
7095− [%& result st(next +(next.st), sub u.uni)]
7096 * [%| ["expression is not supported by partial inference" ~]]
8565 * [%| ["expression is not supported by partial inference" ~]]
7097 ==
8566 ==
7098::
8567::
@@ -7100,12 +8569,322 @@
7100:: failed. If an intermediate fit is uncertain, retain the whole argument
8569:: failed. If an intermediate fit is uncertain, retain the whole argument
7101:: span rather than assigning blame to a particular argument.
8570:: span rather than assigning blame to a particular argument.
7102::
8571::
8572+:: Check a call using the head already inferred in this state. Keeping
8573+:: this shared avoids evaluating or instantiating a contextual head twice.
8574+++ width-has-projections
8575+ |= ps=(list iwprojection)
8576+ ^- ?
8577+ ?~ ps |
8578+ &
8579+::
8580++$ iwidth-elaboration [original=expr typ=itype sub=isub projections=(list iwprojection)]
8581+++ infer-width-elaboration
8582+ |= [e=expr env=ienv state=istate]
8583+ ^- (each iwidth-elaboration idiag)
8584+ =/ out=iresult (infer-fragment e env state)
8585+ ?: ?=(%| -.out) [%| p.out]
8586+ [%& [e typ.p.out sub.state.p.out (flop projections.state.p.out)]]
8587+::
8588+:: Source-bound gate-layout evidence, confined to checked root gate
8589+:: definitions and direct unshadowed prelude calls. The prepared prelude
8590+:: interface and its retained source are trusted as a matching artifact.
8591+:: Layouts identify sample binder faces; they do not change call arity or
8592+:: authorize stripping nested value faces. Unknown origins use ordinary fit.
8593+++ direct-written-gates
8594+ |= [ds=(list def) out=ivisited]
8595+ ^- ivisited
8596+ ?~ ds out
8597+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8598+ ?. |(?=(%gate -.val.i.ds) ?=(%gate-wide -.val.i.ds)) $(ds t.ds)
8599+ $(ds t.ds, out (~(put by out) name.i.ds &))
8600+++ direct-may-use-prelude
8601+ |= [ds=(list def) root=ivisited heads=ivisited]
8602+ ^- ?
8603+ ?~ ds |
8604+ ?: ?=(%mold -.i.ds) $(ds t.ds)
8605+ =/ refs=(list term) (dependency-expr val.i.ds)
8606+ =/ has-root=? (lien refs |=(n=term ?=(^ (~(get by root) n))))
8607+ =/ has-head=? (lien refs |=(n=term ?=(^ (~(get by heads) n))))
8608+ ?: &(has-root has-head) &
8609+ $(ds t.ds)
8610+++ direct-unique-names
8611+ |= [names=(list term) seen=ivisited]
8612+ ^- ?
8613+ ?~ names &
8614+ ?: ?=(^ (~(get by seen) i.names)) |
8615+ $(names t.names, seen (~(put by seen) i.names &))
8616+++ direct-prelude-evidence
8617+ |= [ds=(list def) prelude=(unit ifile)]
8618+ ^- (unit igate-prelude-evidence)
8619+ ?~ prelude ~
8620+ ?~ source.u.prelude ~
8621+ =/ root=ivisited (direct-written-gates ds ~)
8622+ =/ names=(list term) (turn values.u.prelude |=(e=[name=term scheme=ischeme] name.e))
8623+ =/ heads=ivisited (graph-nameset names ~)
8624+ ?. (direct-may-use-prelude ds root heads) ~
8625+ =/ parsed (parse at.u.prelude u.source.u.prelude)
8626+ ?: ?=(%| -.parsed) ~
8627+ ?^ (duplicate-defs defs.p.parsed) ~
8628+ ?. (direct-unique-names (global-value-names defs.p.parsed) ~) ~
8629+ =/ gates=(map term def) (direct-checked-gates defs.p.parsed values.u.prelude)
8630+ `[u.prelude gates]
8631+++ direct-checked-gates
8632+ |= [ds=(list def) env=ienv]
8633+ ^- (map term def)
8634+ =/ names=(list term) (turn env |=(e=[name=term scheme=ischeme] name.e))
8635+ =/ known=ivisited (graph-nameset names ~)
8636+ =/ out=(map term def) ~
8637+ |-
8638+ ?~ ds out
8639+ =/ d=def i.ds
8640+ ?: ?=(%mold -.d) $(ds t.ds)
8641+ ?. ?=(^ (~(get by known) name.d)) $(ds t.ds)
8642+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) $(ds t.ds)
8643+ $(ds t.ds, out (~(put by out) name.d d))
8644+++ direct-find-gate
8645+ |= [n=term ds=(list def)]
8646+ ^- (unit def)
8647+ ?~ ds ~
8648+ ?: &(?=(%value -.i.ds) =(n name.i.ds)) `i.ds
8649+ $(ds t.ds)
8650+++ direct-gate-sample
8651+ |= d=def
8652+ ^- (unit sample)
8653+ ?. ?=(%value -.d) ~
8654+ ?- -.val.d
8655+ %gate `sample.val.d
8656+ %gate-wide `sample.val.d
8657+ * ~
8658+ ==
8659+++ direct-sample-name
8660+ |= sam=sample
8661+ ^- (unit term)
8662+ ?- -.sam
8663+ %bind `name.sam
8664+ %face `name.sam
8665+ %pun `name.sam
8666+ * ~
8667+ ==
8668+++ direct-field-name
8669+ |= f=field
8670+ ^- (unit term)
8671+ ?- -.f
8672+ %face `name.f
8673+ %pun `name.f
8674+ * ~
8675+ ==
8676+++ direct-slot-body
8677+ |= [typ=itype name=(unit term)]
8678+ ^- (unit itype)
8679+ ?~ name `typ
8680+ ?. ?=(%face -.typ) ~
8681+ ?. =(name.typ u.name) ~
8682+ `body.typ
8683+++ direct-invariant
8684+ |= [a=itype b=itype sub=isub next=@ud]
8685+ ^- ifit
8686+ ?: (itype-face-asym a b sub) [%unknown ~]
8687+ =/ forward=ifit (itype-fit a b sub next)
8688+ ?. ?=(%ok -.forward) [%unknown ~]
8689+ ?: (itype-face-asym a b sub.forward) [%unknown ~]
8690+ =/ reverse=ifit (itype-fit b a sub.forward next.forward)
8691+ ?. ?=(%ok -.reverse) [%unknown ~]
8692+ reverse
8693+++ direct-function-fit
8694+ |= [a=itype b=itype sam=sample sh=shape sub=isub next=@ud]
8695+ ^- ifit
8696+ ?. &(?=(%fn -.a) ?=(%fn -.b) ?=(%cell -.sam) ?=(%fn -.sh)) [%unknown ~]
8697+ ?. ?=(%cell -.sample.sh) [%unknown ~]
8698+ =/ as=(list sample) items.sam
8699+ =/ bs=(list field) fields.sample.sh
8700+ ?~ as [%unknown ~]
8701+ ?~ t.as [%unknown ~]
8702+ ?^ t.t.as [%unknown ~]
8703+ ?~ bs [%unknown ~]
8704+ ?~ t.bs [%unknown ~]
8705+ ?^ t.t.bs [%unknown ~]
8706+ ?. &(?=(%cell -.sample.a) ?=(%cell -.sample.b)) [%unknown ~]
8707+ =/ an=(unit term) (direct-sample-name i.as)
8708+ =/ bn=(unit term) (direct-field-name i.bs)
8709+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8710+ =/ x=(unit itype) (direct-slot-body hed.sample.a an)
8711+ =/ y=(unit itype) (direct-slot-body hed.sample.b bn)
8712+ ?~ x [%unknown ~]
8713+ ?~ y [%unknown ~]
8714+ =/ first=ifit (direct-invariant u.x u.y sub next)
8715+ ?. ?=(%ok -.first) [%unknown ~]
8716+ =. an (direct-sample-name i.t.as)
8717+ =. bn (direct-field-name i.t.bs)
8718+ ?: &(?=(^ an) ?=(^ bn) !=(u.an u.bn)) [%unknown ~]
8719+ =/ x2=(unit itype) (direct-slot-body tal.sample.a an)
8720+ =/ y2=(unit itype) (direct-slot-body tal.sample.b bn)
8721+ ?~ x2 [%unknown ~]
8722+ ?~ y2 [%unknown ~]
8723+ =/ second=ifit (direct-invariant u.x2 u.y2 sub.first next.first)
8724+ ?. ?=(%ok -.second) [%unknown ~]
8725+ (direct-invariant product.a product.b sub.second next.second)
8726+:: This is a tentative proof: its caller must require closed call samples
8727+:: and repeat every positional check under the stable final substitution.
8728+++ direct-positional-fit
8729+ |= [args=(list expr) slots=(list sample) actual=itype expected=itype env=ienv state=istate sub=isub next=@ud]
8730+ ^- ifit
8731+ ?~ args [%unknown ~]
8732+ ?~ slots [%unknown ~]
8733+ =/ last=? ?=(~ t.args)
8734+ ?: !=(last ?=(~ t.slots)) [%unknown ~]
8735+ =/ split=(unit [left=itype right=itype])
8736+ ?: last `[actual expected]
8737+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8738+ `[hed.actual hed.expected]
8739+ ?~ split [%unknown ~]
8740+ =/ x=itype left.u.split
8741+ =/ y=itype right.u.split
8742+ =/ expected-name=(unit term) (direct-sample-name i.slots)
8743+ =/ expected-body=(unit itype) (direct-slot-body y expected-name)
8744+ ?~ expected-body [%unknown ~]
8745+ =. y u.expected-body
8746+ =/ fit=ifit (itype-fit x y sub next)
8747+ =/ accepted=? &(?=(%ok -.fit) !(itype-positional-slot-face-asym x y sub.fit))
8748+ =/ result=(unit ifit)
8749+ ?: accepted `fit
8750+ ?. &(?=(%face -.i.slots) ?=(%fn -.shape.i.slots)) ~
8751+ ?. ?=(%wing -.i.args) ~
8752+ ?. ?=([@ ~] names.i.args) ~
8753+ ?. (unique-value-name i.names.i.args globals.state) ~
8754+ =/ source=(unit def) (~(get by gate-defs.state) i.names.i.args)
8755+ ?~ source ~
8756+ =/ sample=(unit sample) (direct-gate-sample u.source)
8757+ ?~ sample ~
8758+ =/ trial=ifit (direct-function-fit x y u.sample shape.i.slots sub next)
8759+ ?. ?=(%ok -.trial) ~
8760+ `trial
8761+ ?~ result [%unknown ~]
8762+ =. fit u.result
8763+ ?: last fit
8764+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) [%unknown ~]
8765+ ?. ?=(%ok -.fit) [%unknown ~]
8766+ $(args t.args, slots t.slots, actual tal.actual, expected tal.expected, sub sub.fit, next next.fit)
8767+++ direct-any-gate-arg
8768+ |= [args=(list expr) defs=(map term def)]
8769+ ^- ?
8770+ ?~ args |
8771+ =/ found=?
8772+ ?. ?=(%wing -.i.args) |
8773+ ?. ?=([@ ~] names.i.args) |
8774+ ?=(^ (~(get by defs) i.names.i.args))
8775+ ?: found &
8776+ $(args t.args)
8777+++ direct-gate-call-fit
8778+ |= [e=expr actual=itype expected=itype env=ienv state=istate]
8779+ ^- (unit ifit)
8780+ ?. ?=(%call -.e) ~
8781+ ?~ args.e ~
8782+ ?~ t.args.e ~
8783+ ?. &(?=(%cell -.actual) ?=(%cell -.expected)) ~
8784+ ?. ?=(%wing -.head.e) ~
8785+ ?. ?=([@ ~] names.head.e) ~
8786+ ?. ?=(~ (ienv-lookup i.names.head.e env)) ~
8787+ ?. (unique-value-name i.names.head.e globals.state) ~
8788+ ?. (direct-any-gate-arg args.e gate-defs.state) ~
8789+ ?~ prelude.state ~
8790+ ?~ source.u.prelude.state ~
8791+ ?~ head-evidence.state ~
8792+ ?. =(u.prelude.state iface.u.head-evidence.state) ~
8793+ ?. ?=(^ (ienv-lookup i.names.head.e values.u.prelude.state)) ~
8794+ =/ head=(unit def) (~(get by gates.u.head-evidence.state) i.names.head.e)
8795+ ?~ head ~
8796+ =/ sam=(unit sample) (direct-gate-sample u.head)
8797+ ?~ sam ~
8798+ ?. ?=(%cell -.u.sam) ~
8799+ =/ fit=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.state next.state)
8800+ ?. ?=(%ok -.fit) ~
8801+ :: Enclosing inference may add constraints after this call. Only a
8802+ :: closed call-sample proof can remain stable under those later bindings.
8803+ =/ actual-final=itype (itype-normalize actual sub.fit)
8804+ =/ expected-final=itype (itype-normalize expected sub.fit)
8805+ ?^ (itype-vars actual-final) ~
8806+ ?^ (itype-vars expected-final) ~
8807+ ?: |((itype-has-tag actual-final) (itype-has-tag expected-final)) ~
8808+ :: A later argument may resolve a variable used by an earlier slot.
8809+ :: Recheck every fit and face against the completed substitution; no
8810+ :: additional binding or fresh variable is permitted in the second pass.
8811+ =/ verified=ifit (direct-positional-fit args.e items.u.sam actual expected env state sub.fit next.fit)
8812+ ?. ?=(%ok -.verified) ~
8813+ ?. &(=(sub.fit sub.verified) =(next.fit next.verified)) ~
8814+ `fit
8815+::
8816+++ infer-call-with-head
8817+ |= [e=expr env=ienv state=istate head=iresult]
8818+ ^- iresult
8819+ ?> ?=(%call -.e)
8820+ ?~ args.e [%| ["call has no argument" ~]]
8821+ ?: ?=(%| -.head) head
8822+ =/ head-type=itype (itype-walk typ.p.head sub.state.p.head)
8823+ =/ arg=iresult
8824+ ?^ t.args.e
8825+ ?: ?=(%fn -.head-type)
8826+ (infer-call-context-args args.e sample.head-type env state.p.head (span-of head.e))
8827+ (infer-simple-items (turn args.e |=(a=expr [(span-of a) ~ a])) env state.p.head)
8828+ ?: ?=(%fn -.head-type)
8829+ (infer-call-context-arg i.args.e sample.head-type env state.p.head (span-of head.e))
8830+ (infer-fragment i.args.e env state.p.head)
8831+ ?: ?=(%| -.arg) arg
8832+ =/ st=istate state.p.arg
8833+ =/ ht=itype (itype-walk typ.p.head sub.st)
8834+ ?: ?=(%fn -.ht)
8835+ =/ shape=(unit [source=iwfields target=iwfields])
8836+ ?^ t.args.e ~
8837+ (width-shape typ.p.arg sample.ht sub.st)
8838+ ?^ shape [%| ["record width constraint needs unsupported inference" ~]]
8839+ =/ fit=ifit
8840+ ?^ t.args.e (itype-fit-inner typ.p.arg sample.ht sub.st next.st & |)
8841+ (itype-fit typ.p.arg sample.ht sub.st next.st)
8842+ =/ direct=(unit ifit)
8843+ ?: ?=(%ok -.fit) ~
8844+ (direct-gate-call-fit e typ.p.arg sample.ht env st)
8845+ =. fit ?~(direct fit u.direct)
8846+ ?: ?=(%unknown -.fit)
8847+ ?~ defer.st [%| ["call constraint is not supported by partial inference" ~]]
8848+ =/ edge=(unit dgo) (dg-eligible-ctor e typ.p.head typ.p.arg sample.ht st)
8849+ ?~ edge [%| ["call constraint is not supported by partial inference" ~]]
8850+ ?: (gth (lent obligations.st) 63) [%| ["call constraint is not supported by partial inference" ~]]
8851+ [%& product.ht st(obligations [u.edge obligations.st])]
8852+
8853+ ?: ?=(%bad -.fit)
8854+ ?~ t.args.e
8855+ =/ missing=(unit idiag) (missing-union-tag i.args.e sample.ht sub.st (span-of head.e))
8856+ ?^ missing [%| u.missing]
8857+ =/ nested=(unit idiag) (nested-missing-tag i.args.e typ.p.arg sample.ht sub.st next.st (span-of head.e))
8858+ ?^ nested [%| u.nested]
8859+ [%| ["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)]]]]
8860+ =/ bad=(unit [at=span typ=itype])
8861+ (call-error-site args.e typ.p.arg sample.ht sub.st next.st)
8862+ =/ whole-args=span
8863+ [beg:(span-of i.args.e) end:(span-of (rear args.e))]
8864+ =/ arg-at=span ?~(bad whole-args at.u.bad)
8865+ =/ arg-type=itype ?~(bad typ.p.arg typ.u.bad)
8866+ [%| ["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)]]]]
8867+ ?: &(?=(^ defer.st) !(dg-stable-call-fit typ.p.arg sample.ht product.ht sub.fit ?=(^ t.args.e)))
8868+ [%| ["deferred call fit needs stable inference" ~]]
8869+ =/ face-asym=?
8870+ ?^ direct |
8871+ ?^ t.args.e (itype-positional-face-asym args.e typ.p.arg sample.ht sub.fit)
8872+ (itype-face-asym typ.p.arg sample.ht sub.fit)
8873+ ?: &((itype-has-face typ.p.arg sub.fit) face-asym (itype-output-may-be-cell product.ht sub.fit))
8874+ [%| ["call result face propagation is not supported by partial inference" ~]]
8875+ [%& product.ht st(sub sub.fit, next next.fit)]
8876+ =/ result=itype [%var next.st]
8877+ =/ uni=(unit isub) (itype-unify ht [%fn typ.p.arg result] sub.st)
8878+ ?~ uni
8879+ [%| ["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)]]]]
8880+ [%& result st(next +(next.st), sub u.uni)]
8881+::
7103++ call-error-site
8882++ call-error-site
7104 |= [args=(list expr) actual=itype expected=itype sub=isub next=@ud]
8883 |= [args=(list expr) actual=itype expected=itype sub=isub next=@ud]
7105 ^- (unit [at=span typ=itype])
8884 ^- (unit [at=span typ=itype])
7106 ?~ args ~
8885 ?~ args ~
7107 =/ original=[left=itype right=itype] [actual expected]
8886 =/ original=[left=itype right=itype] [actual expected]
7108− ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%nvar -.left.original) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%nvar -.right.original)) ~
8887+ ?: |(?=(%var -.left.original) ?=(%avar -.left.original) ?=(%rvar -.left.original) |(?=(%nvar -.left.original) ?=(%rnvar -.left.original)) ?=(%var -.right.original) ?=(%avar -.right.original) ?=(%rvar -.right.original) |(?=(%nvar -.right.original) ?=(%rnvar -.right.original))) ~
7109 =. actual (itype-walk actual sub)
8888 =. actual (itype-walk actual sub)
7110 =. expected (itype-walk expected sub)
8889 =. expected (itype-walk expected sub)
7111 ?: &(?=(%face -.expected) !?=(%face -.actual))
8890 ?: &(?=(%face -.expected) !?=(%face -.actual))
@@ -7120,34 +8899,505 @@
7120 ?: ?=(%unknown -.first) ~
8899 ?: ?=(%unknown -.first) ~
7121 $(args t.args, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
8900 $(args t.args, actual tal.actual, expected tal.expected, sub sub.first, next next.first)
7122::
8901::
7123−:: Context can help each argument while the final fit still checks the
8902+:: Context can help a call argument or cast value while the final fit
7124−:: complete right-nested sample, including any faces on its positions.
8903+:: checks the complete right-nested type, including any written faces.
8904+::
8905+:: Context can resolve the payload of a canonical prelude unit, but an
8906+:: unrelated union with a similar noun shape is not the same mold.
8907+++ infer-unit-context
8908+ |= [e=expr expected=itype env=ienv state=istate context=span]
8909+ ^- iresult
8910+ ?> ?=(%unit -.e)
8911+ ?> ?=(%union -.expected)
8912+ ?~ prelude.state (infer-fragment e env state)
8913+ =/ standard=(unit ischeme) (find-jibb-mold %unit u.prelude.state)
8914+ ?~ standard (infer-fragment e env state)
8915+ ?. (standard-unit-template u.standard at.u.prelude.state) (infer-fragment e env state)
8916+ ?. =(origin.expected `[at.u.prelude.state %unit]) (infer-fragment e env state)
8917+ ?~ args.expected (infer-fragment e env state)
8918+ ?^ t.args.expected (infer-fragment e env state)
8919+ =/ payload=itype i.args.expected
8920+ =/ canonical=(unit itype) (template-apply u.standard ~[payload])
8921+ ?~ canonical (infer-fragment e env state)
8922+ ?> ?=(%union -.u.canonical)
8923+ ?. =((itype-normalize expected(label ~) sub.state) (itype-normalize u.canonical(label ~) sub.state))
8924+ (infer-fragment e env state)
8925+ =/ value=iresult (infer-call-context-arg val.e payload env state context)
8926+ ?: ?=(%| -.value) value
8927+ =/ fit=ifit (itype-fit typ.p.value payload sub.state.p.value next.state.p.value)
8928+ ?: ?=(%unknown -.fit) [%| ["unit payload constraint is not supported by partial inference" ~]]
8929+ ?: ?=(%bad -.fit)
8930+ =/ missing=(unit idiag) (missing-union-tag val.e payload sub.state.p.value context)
8931+ ?^ missing [%| u.missing]
8932+ =/ nested=(unit idiag) (nested-missing-tag val.e typ.p.value payload sub.state.p.value next.state.p.value context)
8933+ ?^ nested [%| u.nested]
8934+ [%| ["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)]]]]
8935+ [%& expected state.p.value(sub sub.fit, next next.fit)]
8936+::
8937+:: A known gate may receive an enclosing target before its argument is
8938+:: inferred when its result is open or a direct, matching named generic
8939+:: union. Opaque, recursive, tag-constrained and variable-bound union
8940+:: results keep the existing directional path.
8941+++ infer-contextual-call
8942+ |= [e=expr expected=itype env=ienv state=istate]
8943+ ^- iresult
8944+ ?> ?=(%call -.e)
8945+ ?~ args.e [%| ["call has no argument" ~]]
8946+ =/ head=iresult (infer-fragment head.e env state)
8947+ ?: ?=(%| -.head) head
8948+ =/ ht=itype (itype-walk typ.p.head sub.state.p.head)
8949+ ?. ?=(%fn -.ht) (infer-call-with-head e env state head)
8950+ =/ result=itype (itype-walk product.ht sub.state.p.head)
8951+ =/ eligible=?
8952+ ?: ?=(%var -.result) &
8953+ :: A direct known generic union may receive the same nominal result
8954+ :: context before its arguments are checked. Variable-bound origins,
8955+ :: pending tags, recursive identities and unknown atoms stay open.
8956+ ?. &(?=(%union -.product.ht) ?=(%union -.result) ?=(%union -.expected)) |
8957+ ?~ origin.result |
8958+ ?. =(origin.result origin.expected) |
8959+ ?~ args.result |
8960+ ?. =((lent args.result) (lent args.expected)) |
8961+ ?: |((itype-has-tag (itype-normalize result sub.state.p.head)) (itype-has-tag (itype-normalize expected sub.state.p.head))) |
8962+ ?: |((itype-has-recursive (itype-normalize result sub.state.p.head)) (itype-has-recursive (itype-normalize expected sub.state.p.head))) |
8963+ ?: |((itype-has-any-atom result sub.state.p.head) (itype-has-any-atom expected sub.state.p.head)) |
8964+ &
8965+ ?. eligible (infer-call-with-head e env state head)
8966+ ?: |(?=(%var -.expected) ?=(%avar -.expected) ?=(%rvar -.expected) |(?=(%nvar -.expected) ?=(%rnvar -.expected)) (itype-has-tag (itype-normalize expected sub.state.p.head)))
8967+ (infer-call-with-head e env state head)
8968+ =/ sub=(unit isub) (itype-unify result expected sub.state.p.head)
8969+ ?~ sub (infer-call-with-head e env state head)
8970+ (infer-call-with-head e env state [%& typ.p.head state.p.head(sub u.sub)])
8971+::
8972+:: An eligible fully faced literal receives context by name, in source order.
8973+++ width-literal-fields
8974+ |= [items=(list item) axis=@ud fuel=@ud]
8975+ ^- (unit iwfields)
8976+ =/ order=(list iwfield) ~
8977+ =/ index=(map term iwfield) *(map term iwfield)
8978+ |-
8979+ ?~ items ~
8980+ ?: =(0 fuel) ~
8981+ ?~ face.i.items ~
8982+ =/ at-axis=@ud ?~(t.items axis (mul 2 axis))
8983+ =/ entry=iwfield [u.face.i.items at-axis [%noun ~]]
8984+ ?: ?=(^ (~(get by index) name.entry)) ~
8985+ =. index (~(put by index) name.entry entry)
8986+ =. order [entry order]
8987+ ?~ t.items `[(flop order) index]
8988+ $(items t.items, axis +((mul 2 axis)), fuel (dec fuel))
8989+++ width-infer-items
8990+ |= [items=(list item) expected=(map term iwfield) env=ienv state=istate context=span]
8991+ ^- iresult
8992+ ?~ items [%| ["empty record is not supported" ~]]
8993+ ?~ face.i.items [%| ["record face needs unsupported inference" ~]]
8994+ =/ field=(unit iwfield) (~(get by expected) u.face.i.items)
8995+ =/ head=iresult
8996+ ?~ field (infer-fragment val.i.items env state)
8997+ (infer-call-context-arg val.i.items typ.u.field env state context)
8998+ ?: ?=(%| -.head) head
8999+ =/ typ=itype [%face u.face.i.items typ.p.head]
9000+ ?~ t.items [%& typ state.p.head]
9001+ =/ tail=iresult $(items t.items, state state.p.head)
9002+ ?: ?=(%| -.tail) tail
9003+ [%& [%cell typ typ.p.tail] state.p.tail]
9004+++ width-infer-literal
9005+ |= [e=expr expected=itype env=ienv state=istate context=span]
9006+ ^- (unit iresult)
9007+ ?. ?=(%tuple -.e) ~
9008+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) ~
9009+ =/ source=(unit iwfields) (width-literal-fields items.e 1 4.096)
9010+ =/ target=(unit iwfields) (width-scan expected sub.state 1 4.096)
9011+ ?~ source ~
9012+ ?~ target ~
9013+ ?: (lth (lent order.u.source) (lent order.u.target)) ~
9014+ ?. (width-in-order order.u.source order.u.target)
9015+ `(infer-simple-items items.e env state)
9016+ `(width-infer-items items.e index.u.target env state context)
9017+::
9018+:: Experimental intrinsic recognition; real bindings retain normal calls.
9019+++ explicit-proj-call
9020+ |= [e=expr env=ienv state=istate]
9021+ ^- ?
9022+ ?. ?=(%call -.e) |
9023+ ?. ?=([* ~] args.e) |
9024+ ?. ?=(%wing -.head.e) |
9025+ ?. =(names.head.e ~[%proj]) |
9026+ ?: ?=(^ (ienv-lookup %proj env)) |
9027+ ?: (lien globals.state |=(n=term =(n %proj))) |
9028+ ?~ prelude.state &
9029+ ?:(?=(^ (ienv-lookup %proj values.u.prelude.state)) | &)
9030+++ infer-proj-source
9031+ |= [e=expr expected=itype env=ienv state=istate context=span]
9032+ ^- iresult
9033+ ?: ?=(%group -.e) $(e inner.e)
9034+ =/ literal=(unit iresult) (width-infer-literal e expected env state context)
9035+ ?^ literal u.literal
9036+ (infer-fragment e env state)
9037+++ infer-proj-context
9038+ |= [e=expr expected=itype env=ienv state=istate context=span]
9039+ ^- iresult
9040+ ?> ?=(%call -.e)
9041+ ?~ args.e [%| ["proj needs one record" ~]]
9042+ ?. |(?=(%cell -.expected) ?=(%face -.expected)) [%| ["proj needs an expected record type" ~]]
9043+ =/ value=iresult (infer-proj-source i.args.e expected env state context)
9044+ ?: ?=(%| -.value) value
9045+ =/ shape=(unit [source=iwfields target=iwfields])
9046+ (width-proj-shape typ.p.value expected sub.state.p.value)
9047+ ?~ shape [%| ["proj needs a known record containing its expected fields" ~]]
9048+ =/ project=(unit iwidth-result) (width-project u.shape sub.state.p.value next.state.p.value)
9049+ ?~ project [%| ["proj constraint needs unsupported inference" ~]]
9050+ =/ st=istate state.p.value(sub sub.u.project, next next.u.project)
9051+ [%& expected st(projections [[at.e e typ.p.value expected steps.u.project] projections.st])]
9052+::
9053+:: A known literal singleton in a direct union can contextualize a
9054+:: loobean literal of the same noun. Only explicit singleton and cell
9055+:: competitors are considered; opaque or variable cases stay unknown.
9056+++ explicit-singleton-in-union
9057+ |= [t=itype noun=@]
9058+ ^- ?
9059+ ?. ?=(%union -.t) |
9060+ =/ cases=(list itype) cases.t
9061+ =/ found=? |
9062+ |-
9063+ ?~ cases found
9064+ =/ c=itype i.cases
9065+ ?: ?=(%cell -.c) $(cases t.cases)
9066+ ?. ?=(%const -.c) |
9067+ ?: =(noun val.literal.c)
9068+ ?: found |
9069+ $(cases t.cases, found &)
9070+ $(cases t.cases)
9071+::
9072+:: Select a written literal-headed case only when every competing case is
9073+:: also an explicit singleton-headed cell and exactly one matches. Opaque,
9074+:: variable-bound and differently shaped cases keep inference unchanged.
9075+:: This first slice supplies context to a directly called payload. Plain
9076+:: literal data and other expressions retain their existing inference path.
9077+++ contextual-atomic-arguments
9078+ |= args=(list expr)
9079+ ^- ?
9080+ ?~ args &
9081+ ?. ?=(?(%lit %wing %ctor) -.i.args) |
9082+ $(args t.args)
9083+++ contextual-direct-payload-call
9084+ |= e=expr
9085+ ^- ?
9086+ ?: ?=(%group -.e) $(e inner.e)
9087+ ?. ?=(%call -.e) |
9088+ ?. ?=(%wing -.head.e) |
9089+ ?~ args.e |
9090+ (contextual-atomic-arguments args.e)
9091+::
9092+:: A walked variable may have concealed a union inside a substituted
9093+:: structure before this arm was called. Decline in that case rather than
9094+:: deriving provenance from the already-walked type.
9095+++ contextual-simple-sub
9096+ |= sub=isub
9097+ ^- ?
9098+ ?~ sub &
9099+ ?: ?=(?(%cell %face %fn %union %collection) -.val.i.sub) |
9100+ $(sub t.sub)
9101+::
9102+:: Check the syntactic root before scanning; scan substitutions once.
9103+++ grec-direct-context
9104+ |= [expected=itype sub=isub]
9105+ ^- ?
9106+ =/ left=@ud 4.096
9107+ |-
9108+ ?: ?=(%face -.expected)
9109+ ?: =(0 left) |
9110+ $(expected body.expected, left (dec left))
9111+ ?. ?=(%grec -.expected) |
9112+ ?~ sub &
9113+ ?: =(0 left) |
9114+ ?: ?=(?(%cell %face %fn %union %collection %grec) -.val.i.sub) |
9115+ $(sub t.sub, left (dec left))
9116+++ contextual-direct-union
9117+ |= target=itype
9118+ ^- ?
9119+ ?: ?=(%face -.target) $(target body.target)
9120+ ?=(%union -.target)
9121+++ contextual-tagged-case
9122+ |= [target=itype tag=@ sub=isub]
9123+ ^- (unit itype)
9124+ ?. ?=(%union -.target) ~
9125+ =/ remaining=(list itype) cases.target
9126+ =/ found=(unit itype) ~
9127+ =/ seen=(set @) *(set @)
9128+ |-
9129+ ?~ remaining found
9130+ =/ c=itype i.remaining
9131+ ?. ?=(%cell -.c) ~
9132+ =/ head=itype hed.c
9133+ ?. ?=(%const -.head) ~
9134+ ?: (~(has in:..zuse seen) val.literal.head) ~
9135+ =. seen (~(put in:..zuse seen) val.literal.head)
9136+ ?: =(tag val.literal.head)
9137+ $(remaining t.remaining, found `c)
9138+ $(remaining t.remaining)
9139+::
9140+:: A bounded syntactic screen: no nested branch, cast, gate or local body
9141+:: can re-enter cell-branch retry during either inference attempt.
9142+++ closed-cell-retry-safe
9143+ |= [todo=(list expr) fuel=@ud]
9144+ ^- ?
9145+ ?~ todo &
9146+ ?: =(0 fuel) |
9147+ =/ e=expr i.todo
9148+ =. fuel (dec fuel)
9149+ ?+ -.e |
9150+ %lit $(todo t.todo)
9151+ %wing $(todo t.todo)
9152+ %ctor $(todo t.todo)
9153+ %path $(todo t.todo)
9154+ %crash $(todo t.todo)
9155+ %str
9156+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) |
9157+ $(todo t.todo)
9158+ %group $(todo [inner.e t.todo])
9159+ %pair $(todo [val.e t.todo])
9160+ %unit $(todo [val.e t.todo])
9161+ %list $(todo (weld items.e t.todo))
9162+ %tuple $(todo (weld (turn items.e |=(i=item val.i)) t.todo))
9163+ %change $(todo (weld (turn edits.e |=(ed=edit val.ed)) t.todo))
9164+ %call $(todo [head.e (weld args.e t.todo)])
9165+ %trace $(todo [val.e then.e t.todo])
9166+ ==
9167+::
9168+++ closed-cell-sub-safe
9169+ |= [sub=isub fuel=@ud]
9170+ ^- ?
9171+ ?~ sub &
9172+ ?: =(0 fuel) |
9173+ ?: ?=(?(%cell %face %fn %union %collection %grec %jrec %recursive) -.val.i.sub) |
9174+ $(sub t.sub, fuel (dec fuel))
9175+::
9176+++ closed-cell-branch-eligible
9177+ |= [e=expr expected=itype sub=isub]
9178+ ^- ?
9179+ ?. &(?=(%branch -.e) ?=(%cell -.expected) (closed-cell-sub-safe sub 512)) |
9180+ ?~ arms.e |
9181+ ?~ t.arms.e |
9182+ ?^ t.t.arms.e |
9183+ =/ x=arm i.arms.e
9184+ =/ y=arm i.t.arms.e
9185+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
9186+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
9187+ ?: =(val.lit.pat.x val.lit.pat.y) |
9188+ (closed-cell-retry-safe ~[subject.e val.x val.y] 512)
9189+::
9190+:: Attempt ordinary inference first; retry from the same state only for
9191+:: the bounded non-reentrant syntax above. Preserve original value faces.
9192+++ infer-closed-cell-branch
9193+ |= [e=expr expected=itype env=ienv state=istate context=span]
9194+ ^- iresult
9195+ ?> (closed-cell-branch-eligible e expected sub.state)
9196+ ?> ?=(%branch -.e)
9197+ ?> ?=(^ arms.e)
9198+ ?> ?=(^ t.arms.e)
9199+ =/ ordinary=iresult (infer-fragment e env state)
9200+ =/ ordinary-good=?
9201+ ?: ?=(%| -.ordinary) |
9202+ =/ fit=ifit (itype-fit typ.p.ordinary expected sub.state.p.ordinary next.state.p.ordinary)
9203+ ?=(%ok -.fit)
9204+ ?: ordinary-good ordinary
9205+ =/ attempt=(unit iresult)
9206+ =/ x=arm i.arms.e
9207+ =/ y=arm i.t.arms.e
9208+ =/ subject=iresult (infer-fragment subject.e env state)
9209+ ?: ?=(%| -.subject) ~
9210+ =/ subject-type=itype (itype-normalize typ.p.subject sub.state.p.subject)
9211+ ?: ?=(%union -.subject-type) ~
9212+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
9213+ ?~ su ~
9214+ =/ left=iresult (infer-call-context-arg val.x expected env state.p.subject(sub u.su) context)
9215+ ?: ?=(%| -.left) ~
9216+ =/ lf=ifit (itype-fit typ.p.left expected sub.state.p.left next.state.p.left)
9217+ ?. ?=(%ok -.lf) ~
9218+ =/ right=iresult (infer-call-context-arg val.y expected env state.p.left(sub sub.lf, next next.lf) context)
9219+ ?: ?=(%| -.right) ~
9220+ =/ rf=ifit (itype-fit typ.p.right expected sub.state.p.right next.state.p.right)
9221+ ?. ?=(%ok -.rf) ~
9222+ =/ sub=isub sub.rf
9223+ =/ next=@ud next.rf
9224+ =/ lt=itype (itype-normalize typ.p.left sub)
9225+ =/ rt=itype (itype-normalize typ.p.right sub)
9226+ =/ et=itype (itype-normalize expected sub)
9227+ ?. =(lt rt) ~
9228+ ?: |(?=(^ (itype-vars lt)) ?=(^ (itype-vars rt)) ?=(^ (itype-vars et))) ~
9229+ ?: |((itype-has-tag lt) (itype-has-tag rt) (itype-has-tag et)) ~
9230+ =/ lcheck=ifit (itype-fit typ.p.left expected sub next)
9231+ ?. ?=(%ok -.lcheck) ~
9232+ ?. &(=(sub.lcheck sub) =(next.lcheck next)) ~
9233+ =/ rcheck=ifit (itype-fit typ.p.right expected sub next)
9234+ ?. ?=(%ok -.rcheck) ~
9235+ ?. &(=(sub.rcheck sub) =(next.rcheck next)) ~
9236+ `[%& typ.p.left state.p.right(sub sub, next next)]
9237+ ?~ attempt ordinary
9238+ u.attempt
7125::
9239::
7126++ infer-call-context-arg
9240++ infer-call-context-arg
7127 |= [e=expr expected=itype env=ienv state=istate context=span]
9241 |= [e=expr expected=itype env=ienv state=istate context=span]
7128 ^- iresult
9242 ^- iresult
9243+ ?: &(?=(^ defer.state) ?=(%branch -.e)) (infer-fragment e env state)
9244+ ?: ?=(%pair -.e) $(e (pair-as-cell e))
9245+ ?: ?=(%group -.e) $(e inner.e)
9246+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
9247+ ?: ?=(%trace -.e)
9248+ =/ traced=iresult (infer-fragment val.e env state)
9249+ ?: ?=(%| -.traced) traced
9250+ $(e then.e, state state.p.traced)
7129 =/ target=itype (itype-walk expected sub.state)
9251 =/ target=itype (itype-walk expected sub.state)
7130 |-
9252 |-
7131 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9253 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9254+ ?: (explicit-proj-call e env state)
9255+ (infer-proj-context e expected env state context)
9256+ :: Experimental construction only for a source-proven direct target.
9257+ :: Decline any walked structural binding to retain raw-variable provenance.
9258+ ?: &(?=(%grec -.target) ?=(%tuple -.e) (grec-direct-context expected sub.state))
9259+ =/ unfolded=(unit [view=itype left=@ud]) (grec-unfold-view target jrec-fuel.state)
9260+ ?~ unfolded [%| ["recursive mold unfolding needs unsupported inference" ~]]
9261+ ?~ items.e [%| ["recursive mold constructor needs unsupported inference" ~]]
9262+ =/ first=item i.items.e
9263+ ?. &(?=(~ face.first) ?=(%lit -.val.first) =(%term form.lit.val.first))
9264+ [%| ["recursive mold constructor needs unsupported inference" ~]]
9265+ =/ chosen=(unit itype) (contextual-tagged-case view.u.unfolded val.lit.val.first sub.state)
9266+ ?~ chosen [%| ["recursive mold constructor has no matching case" ~]]
9267+ =/ value=iresult (infer-call-context-items items.e u.chosen env state(jrec-fuel left.u.unfolded) context)
9268+ ?: ?=(%| -.value) value
9269+ =/ fit=ifit (itype-fit typ.p.value u.chosen sub.state.p.value next.state.p.value)
9270+ ?: ?=(%unknown -.fit) [%| ["recursive mold case needs unsupported inference" ~]]
9271+ ?: ?=(%bad -.fit) [%| ["recursive mold case does not fit its source shape" ~]]
9272+ [%& target state.p.value(sub sub.fit, next next.fit)]
9273+ :: Only the source-proven one-layer cell is exposed. Each recursive
9274+ :: descent consumes one written tuple; named values use ordinary fit.
9275+ ?: &(?=(%jrec -.target) ?=(%lit -.e) =(%null form.lit.e))
9276+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9277+ [%& target state(jrec-fuel (dec jrec-fuel.state))]
9278+ ?: &(?=(%jrec -.target) ?=(%tuple -.e))
9279+ ?: =(0 jrec-fuel.state) [%| ["recursive mold unfolding needs unsupported inference" ~]]
9280+ =. state state(jrec-fuel (dec jrec-fuel.state))
9281+ =/ shape=itype
9282+ [%cell [%face head.target [%atom aura.target]] [%face tail.target target]]
9283+ =/ value=iresult (infer-call-context-items items.e shape env state context)
9284+ ?: ?=(%| -.value) value
9285+ =/ fit=ifit (itype-fit typ.p.value shape sub.state.p.value next.state.p.value)
9286+ ?: ?=(%unknown -.fit) [%| ["recursive mold cell constraint needs unsupported inference" ~]]
9287+ ?: ?=(%bad -.fit) [%| ["recursive mold cell does not fit its source shape" ~]]
9288+ [%& target state.p.value(sub sub.fit, next next.fit)]
9289+ ?: ?=(%call -.e) (infer-contextual-call e target env state)
9290+ =/ empty-list=(unit iresult) (empty-list-null-branch e env state `[target context])
9291+ ?^ empty-list u.empty-list
9292+ ?: (single-structured-pattern e)
9293+ ?> ?=(%branch -.e)
9294+ =/ empty-union=(unit iresult) (known-empty-union-wing subject.e env state)
9295+ ?^ empty-union (infer-known-union-context-subject e target env u.empty-union context)
9296+ =/ single=(unit iresult) (grec-single-wing-subject subject.e env state)
9297+ ?^ single (infer-known-union-context-subject e target env u.single context)
9298+ (infer-single-case-branch e env state `[target context])
9299+ ?: (cell-binder-pattern e)
9300+ (infer-cell-branch e env state `[target context])
9301+ :: In an explicit singleton context retain the written loobean noun;
9302+ :: the ordinary singleton fit compares its noun, not its spelling.
9303+ =/ singleton=(unit itype)
9304+ ?. ?=(%lit -.e) ~
9305+ ?. =(%loobean form.lit.e) ~
9306+ ?. |(?=(%const -.target) &(?=(%union -.expected) (explicit-singleton-in-union expected val.lit.e))) ~
9307+ `[%const lit.e]
9308+ ?^ singleton [%& u.singleton state]
9309+ =/ known=(unit iresult)
9310+ ?: ?=(%branch -.e) (known-union-subject subject.e env state)
9311+ ~
9312+ ?: &(?=(^ known) ?=(%| -.u.known) !(duplicate-loobean-arms e)) u.known
9313+ ?: &(?=(^ known) ?=(%& -.u.known) ?=(~ (unit-union-payload (itype-normalize typ.p.u.known sub.state.p.u.known))))
9314+ (infer-known-union-context-subject e target env u.known context)
9315+ ?: &(?=(%union -.target) ?=(%unit -.e))
9316+ (infer-unit-context e target env state context)
9317+ ?: (closed-cell-branch-eligible e expected sub.state)
9318+ (infer-closed-cell-branch e expected env state context)
9319+ ?: &(?=(%flag -.target) (context-union-branch e))
9320+ (infer-union-context e target env state context)
7132 ?: &(?=(%union -.target) (context-union-branch e))
9321 ?: &(?=(%union -.target) (context-union-branch e))
7133 (infer-union-context e target env state context)
9322 (infer-union-context e target env state context)
7134 ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch e))
9323 ?: &(?=(%collection -.target) =(%list name.target) (context-union-branch e))
7135 (infer-union-context e target env state context)
9324 (infer-union-context e target env state context)
7136 ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression e))
9325 ?: &(?=(%collection -.target) =(%list name.target) (context-list-expression e))
7137 (infer-list-context e target env state context)
9326 (infer-list-context e target env state context)
9327+ :: A literal-headed tuple can receive the unique case's payload
9328+ :: context. The ordinary final fit still checks the complete union.
9329+ =/ selected=(unit itype)
9330+ ?. &((contextual-simple-sub sub.state) (contextual-direct-union expected) ?=(%union -.target) ?=(%tuple -.e) ?=(^ items.e)) ~
9331+ ?~ t.items.e ~
9332+ ?^ t.t.items.e ~
9333+ ?. (contextual-direct-payload-call val.i.t.items.e) ~
9334+ =/ first=item i.items.e
9335+ ?. &(?=(~ face.first) ?=(%lit -.val.first) |(=(%term form.lit.val.first) =(%null form.lit.val.first) =(%loobean form.lit.val.first))) ~
9336+ (contextual-tagged-case target val.lit.val.first sub.state)
9337+ ?^ selected
9338+ ?> ?=(%tuple -.e)
9339+ :: On this bounded shallow-call shape, preserve any inference that
9340+ :: already fits before trying the new contextual path. Neither pass
9341+ :: can recursively select a nested tuple from the atomic arguments.
9342+ =/ ordinary=(unit iresult)
9343+ =/ initial=iresult (infer-fragment e env state)
9344+ ?: ?=(%| -.initial) ~
9345+ =/ fit=ifit (itype-fit typ.p.initial target sub.state.p.initial next.state.p.initial)
9346+ ?. ?=(%ok -.fit) ~
9347+ `initial
9348+ ?^ ordinary u.ordinary
9349+ =/ value=iresult (infer-call-context-items items.e u.selected env state context)
9350+ ?: ?=(%| -.value) value
9351+ =/ fit=ifit (itype-fit typ.p.value u.selected sub.state.p.value next.state.p.value)
9352+ ?: ?=(%unknown -.fit) [%| ["tagged case needs unsupported inference" ~]]
9353+ ?: ?=(%bad -.fit) [%| ["tagged case does not fit its expected type" ~[[context "expected union case"] [(span-of e) "value"]]]]
9354+ [%& typ.p.value state.p.value(sub sub.fit, next next.fit)]
9355+ ?: &(?=(%cell -.target) ?=(%tuple -.e))
9356+ (infer-call-context-items items.e target env state context)
7138 (infer-fragment e env state)
9357 (infer-fragment e env state)
7139::
9358::
9359+:: Preserve each written face; the final complete sample fit checks faces.
9360+:: A tuple or positional field face belongs to the enclosing sample,
9361+:: not to the expression at that position. A second face, if present,
9362+:: is part of the value's own expected type.
9363+++ projection-field-target
9364+ |= expected=itype
9365+ ^- itype
9366+ ?:(?=(%face -.expected) body.expected expected)
9367+::
9368+++ infer-call-context-items
9369+ |= [items=(list item) expected=itype env=ienv state=istate context=span]
9370+ ^- iresult
9371+ ?~ items [%| ["empty cell is not supported by partial inference" ~]]
9372+ ?~ t.items
9373+ =/ last=iresult (infer-call-context-arg val.i.items (projection-field-target expected) env state context)
9374+ ?: ?=(%| -.last) last
9375+ =/ typ=itype typ.p.last
9376+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9377+ [%& typ state.p.last]
9378+ =/ target=itype (itype-walk expected sub.state)
9379+ |-
9380+ ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9381+ ?. ?=(%cell -.target) (infer-simple-items items env state)
9382+ =/ head=iresult (infer-call-context-arg val.i.items (projection-field-target hed.target) env state context)
9383+ ?: ?=(%| -.head) head
9384+ =/ typ=itype typ.p.head
9385+ =. typ ?~(face.i.items typ [%face u.face.i.items typ])
9386+ =/ tail=iresult (infer-call-context-items t.items tal.target env state.p.head context)
9387+ ?: ?=(%| -.tail) tail
9388+ [%& [%cell typ typ.p.tail] state.p.tail]
9389+::
7140++ infer-call-context-args
9390++ infer-call-context-args
7141 |= [args=(list expr) expected=itype env=ienv state=istate context=span]
9391 |= [args=(list expr) expected=itype env=ienv state=istate context=span]
7142 ^- iresult
9392 ^- iresult
7143 ?~ args [%| ["call has no argument" ~]]
9393 ?~ args [%| ["call has no argument" ~]]
7144− ?~ t.args (infer-call-context-arg i.args expected env state context)
9394+ ?~ t.args (infer-call-context-arg i.args (projection-field-target expected) env state context)
7145 =/ target=itype (itype-walk expected sub.state)
9395 =/ target=itype (itype-walk expected sub.state)
7146 |-
9396 |-
7147 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
9397 ?: ?=(%face -.target) $(target (itype-walk body.target sub.state))
7148 ?. ?=(%cell -.target)
9398 ?. ?=(%cell -.target)
7149 (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
9399 (infer-simple-items (turn args |=(a=expr [(span-of a) ~ a])) env state)
7150− =/ head=iresult (infer-call-context-arg i.args hed.target env state context)
9400+ =/ head=iresult (infer-call-context-arg i.args (projection-field-target hed.target) env state context)
7151 ?: ?=(%| -.head) head
9401 ?: ?=(%| -.head) head
7152 =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
9402 =/ tail=iresult (infer-call-context-args t.args tal.target env state.p.head context)
7153 ?: ?=(%| -.tail) tail
9403 ?: ?=(%| -.tail) tail
@@ -7168,11 +9418,55 @@
7168 ?: ?=(%| -.tail) tail
9418 ?: ?=(%| -.tail) tail
7169 [%& [%cell ht typ.p.tail] state.p.tail]
9419 [%& [%cell ht typ.p.tail] state.p.tail]
7170::
9420::
7171−:: A single two-binder cell pattern covers every value of a cell type.
9421+:: A single all-binder cell pattern covers a known cell spine; the final
7172−:: No other pattern matrix is implemented here.
9422+:: binder captures the remaining noun. Other pattern matrices stay partial.
9423+::
9424+:: Validate binders before reading the subject, preserving shadow-error
9425+:: precedence. The last binder receives the entire remaining tail.
9426+++ cell-pattern-names
9427+ |= [pats=(list pattern) env=ienv globals=(list term) seen=(list term)]
9428+ ^- (each (list term) @t)
9429+ ?~ pats [%& ~]
9430+ ?. ?=(%bind -.i.pats) [%| 'branch pattern is not supported by partial inference']
9431+ =/ name=term name.i.pats
9432+ ?: |(=(name %proj) ?=(^ (ienv-lookup name env)) (lien globals |=(n=term =(n name))) (lien seen |=(n=term =(n name))))
9433+ [%| 'pattern shadows a name']
9434+ =/ rest=(each (list term) @t) $(pats t.pats, seen [name seen])
9435+ ?: ?=(%| -.rest) rest
9436+ [%& [name p.rest]]
9437+::
9438+++ cell-pattern-types
9439+ |= [names=(list term) env=ienv next=@ud]
9440+ ^- [typ=itype env=ienv next=@ud]
9441+ ?~ names !!
9442+ =/ head=itype [%var next]
9443+ =/ scope=ienv [[i.names [head ~]] env]
9444+ ?~ t.names [head scope +(next)]
9445+ =/ tail=[typ=itype env=ienv next=@ud] $(names t.names, env scope, next +(next))
9446+ [[%cell head typ.tail] env.tail next.tail]
9447+::
9448+:: At every position that must be a cell, opaque or sum types may still
9449+:: contain cells. Do not report a definite mismatch without unfolding them.
9450+++ cell-pattern-spine-unknown
9451+ |= [typ=itype names=(list term) sub=isub]
9452+ ^- ?
9453+ ?~ names |
9454+ ?~ t.names |
9455+ =. typ (itype-walk typ sub)
9456+ ?: ?=(%cell -.typ) $(typ tal.typ, names t.names)
9457+ |(?=(%union -.typ) ?=(%collection -.typ) ?=(%recursive -.typ) ?=(%jrec -.typ) ?=(%grec -.typ) ?=(%noun -.typ) ?=(%fn -.typ) ?=(%tag -.typ))
9458+::
9459+++ cell-binder-pattern
9460+ |= e=expr
9461+ ^- ?
9462+ ?. ?=(%branch -.e) |
9463+ ?~ arms.e |
9464+ ?^ t.arms.e |
9465+ ?. ?=(%cell -.pat.i.arms.e) |
9466+ !(single-structured-pattern e)
7173::
9467::
7174++ infer-cell-branch
9468++ infer-cell-branch
7175− |= [e=expr env=ienv state=istate]
9469+ |= [e=expr env=ienv state=istate expected=(unit [typ=itype context=span])]
7176 ^- iresult
9470 ^- iresult
7177 ?> ?=(%branch -.e)
9471 ?> ?=(%branch -.e)
7178 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
9472 ?~ arms.e [%| ["branch is not supported by partial inference" ~]]
@@ -7181,25 +9475,31 @@
7181 =/ pats=(list pattern) items.pat.arm
9475 =/ pats=(list pattern) items.pat.arm
7182 ?~ pats [%| ["branch pattern is not supported by partial inference" ~]]
9476 ?~ pats [%| ["branch pattern is not supported by partial inference" ~]]
7183 ?~ t.pats [%| ["branch pattern is not supported by partial inference" ~]]
9477 ?~ t.pats [%| ["branch pattern is not supported by partial inference" ~]]
7184− ?^ t.t.pats [%| ["branch pattern is not supported by partial inference" ~]]
9478+ =/ names=(each (list term) @t) (cell-pattern-names pats env globals.state ~)
7185− ?. ?=(%bind -.i.pats) [%| ["branch pattern is not supported by partial inference" ~]]
9479+ ?: ?=(%| -.names) [%| [(trip p.names) ~]]
7186− ?. ?=(%bind -.i.t.pats) [%| ["branch pattern is not supported by partial inference" ~]]
7187− =/ one=term name.i.pats
7188− =/ two=term name.i.t.pats
7189− ?: |(=(one two) ?=(^ (ienv-lookup one env)) ?=(^ (ienv-lookup two env)) (lien globals.state |=(x=term |(=(x one) =(x two)))))
7190− [%| ["pattern shadows a name" ~]]
7191 =/ subject=iresult (infer-fragment subject.e env state)
9480 =/ subject=iresult (infer-fragment subject.e env state)
7192 ?: ?=(%| -.subject) subject
9481 ?: ?=(%| -.subject) subject
7193 =/ st=istate state.p.subject
9482 =/ st=istate state.p.subject
7194− ?: (itype-has-recursive (itype-normalize typ.p.subject sub.st))
9483+ =/ subject-type=itype (itype-normalize typ.p.subject sub.st)
9484+ ?: (itype-has-recursive subject-type)
7195 [%| ["recursive pattern is not supported by partial inference" ~]]
9485 [%| ["recursive pattern is not supported by partial inference" ~]]
7196 ?: (itype-has-face typ.p.subject sub.st)
9486 ?: (itype-has-face typ.p.subject sub.st)
7197 [%| ["record patterns are not supported by partial inference" ~]]
9487 [%| ["record patterns are not supported by partial inference" ~]]
7198− =/ head=itype [%var next.st]
9488+ ?: (cell-pattern-spine-unknown subject-type p.names sub.st)
7199− =/ tail=itype [%var +(next.st)]
9489+ [%| ["cell pattern subject is not supported by partial inference" ~]]
7200− =/ sub=(unit isub) (itype-unify typ.p.subject [%cell head tail] sub.st)
9490+ =/ binders=[typ=itype env=ienv next=@ud] (cell-pattern-types p.names env next.st)
9491+ =/ sub=(unit isub) (itype-unify typ.p.subject typ.binders sub.st)
7201 ?~ sub [%| ["cell pattern does not match the subject type" ~]]
9492 ?~ sub [%| ["cell pattern does not match the subject type" ~]]
7202− (infer-fragment val.arm [[one [head ~]] [two [tail ~]] env] st(next (add 2 next.st), sub u.sub))
9493+ =. st st(next next.binders, sub u.sub)
9494+ ?~ expected (infer-fragment val.arm env.binders st)
9495+ =/ body=iresult (infer-call-context-arg val.arm typ.u.expected env.binders st context.u.expected)
9496+ ?: ?=(%| -.body) body
9497+ =/ fit=ifit (itype-fit typ.p.body typ.u.expected sub.state.p.body next.state.p.body)
9498+ ?: ?=(%unknown -.fit) [%| ["cell branch result constraint is not supported by partial inference" ~]]
9499+ ?: ?=(%bad -.fit) [%| ["cell branch arm does not fit its expected type" ~[[context.u.expected "expected type"] [(span-of val.arm) "branch arm"]]]]
9500+ ?: (itype-has-tag (itype-normalize typ.u.expected sub.fit))
9501+ [%| ["cell branch result needs context in partial inference" ~]]
9502+ [%& typ.u.expected state.p.body(sub sub.fit, next next.fit)]
7203::
9503::
7204++ show-itype
9504++ show-itype
7205 |= [t=itype sub=isub]
9505 |= [t=itype sub=isub]
@@ -7212,12 +9512,20 @@
7212 %avar
9512 %avar
7213 ?: (lth id.t 26) [(add 65 id.t) ~]
9513 ?: (lth id.t 26) [(add 65 id.t) ~]
7214 "T{<id.t>}"
9514 "T{<id.t>}"
9515+ %rvar
9516+ ?: (lth id.t 26) [(add 65 id.t) ~]
9517+ "T{<id.t>}"
7215 %nvar
9518 %nvar
7216 ?: (lth id.t 26) [(add 65 id.t) ~]
9519 ?: (lth id.t 26) [(add 65 id.t) ~]
7217 "T{<id.t>}"
9520 "T{<id.t>}"
9521+ %rnvar
9522+ ?: (lth id.t 26) [(add 65 id.t) ~]
9523+ "T{<id.t>}"
7218 %atom "@{(trip aura.t)}"
9524 %atom "@{(trip aura.t)}"
7219 %any-atom "@"
9525 %any-atom "@"
7220 %flag "?"
9526 %flag "?"
9527+ %noun "*"
9528+ %empty "!!"
7221 %tag (trip txt.literal.t)
9529 %tag (trip txt.literal.t)
7222 %const (trip txt.literal.t)
9530 %const (trip txt.literal.t)
7223 %union
9531 %union
@@ -7225,6 +9533,8 @@
7225 ?~ args.t (trip u.label.t)
9533 ?~ args.t (trip u.label.t)
7226 "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
9534 "({(trip u.label.t)} {(show-itype-cases args.t sub)})"
7227 %recursive ?~(label.t "recursive mold" (trip u.label.t))
9535 %recursive ?~(label.t "recursive mold" (trip u.label.t))
9536+ %jrec ?~(label.t "recursive mold" (trip u.label.t))
9537+ %grec ?~(label.t "recursive mold" "({(trip u.label.t)} {(show-itype-cases args.t sub)})")
7228 %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
9538 %collection "({(trip name.t)} {(show-itype-cases args.t sub)})"
7229 %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
9539 %face "[{(trip name.t)}={(show-itype-context body.t sub)}]"
7230 %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
9540 %fn "$-({(show-itype-context sample.t sub)} {(show-itype-context product.t sub)})"
@@ -7260,15 +9570,21 @@
7260 ^- ?
9570 ^- ?
7261 ?- -.typ
9571 ?- -.typ
7262 %nvar &
9572 %nvar &
9573+ %rnvar &
7263 %var |
9574 %var |
7264 %avar |
9575 %avar |
9576+ %rvar |
7265 %atom |
9577 %atom |
7266 %any-atom |
9578 %any-atom |
7267 %flag |
9579 %flag |
9580+ %noun |
9581+ %empty |
7268 %tag |
9582 %tag |
7269 %const |
9583 %const |
7270 %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
9584 %union |((lien cases.typ |=(c=itype (itype-has-nvar c))) (lien args.typ |=(c=itype (itype-has-nvar c))))
7271 %recursive |
9585 %recursive |
9586+ %jrec |
9587+ %grec (lien args.typ |=(c=itype (itype-has-nvar c)))
7272 %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
9588 %collection (lien args.typ |=(c=itype (itype-has-nvar c)))
7273 %face $(typ body.typ)
9589 %face $(typ body.typ)
7274 %fn |($(typ sample.typ) $(typ product.typ))
9590 %fn |($(typ sample.typ) $(typ product.typ))
@@ -7279,7 +9595,7 @@
7279 |= [label=tape typ=itype sub=isub]
9595 |= [label=tape typ=itype sub=isub]
7280 ^- tape
9596 ^- tape
7281 =/ normalized=itype (itype-normalize typ sub)
9597 =/ normalized=itype (itype-normalize typ sub)
7282− ?: |(?=(%var -.normalized) ?=(%avar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
9598+ ?: |(?=(%var -.normalized) ?=(%avar -.normalized) ?=(%rvar -.normalized) (itype-has-nvar normalized) (itype-has-tag normalized) (itype-has-union normalized)) label
7283 ?: (itype-has-hidden-recursive normalized) label
9599 ?: (itype-has-hidden-recursive normalized) label
7284 =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
9600 =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
7285 ?: (gth (lent vars) 26) label
9601 ?: (gth (lent vars) 26) label
@@ -7301,6 +9617,7 @@
7301 ?+ -.resolved ~
9617 ?+ -.resolved ~
7302 %var `id.resolved
9618 %var `id.resolved
7303 %avar `id.resolved
9619 %avar `id.resolved
9620+ %rvar `id.resolved
7304 ==
9621 ==
7305 ?~ ident $(caps t.caps)
9622 ?~ ident $(caps t.caps)
7306 ?: =(n u.ident) &
9623 ?: =(n u.ident) &
@@ -7315,6 +9632,7 @@
7315 ?+ -.resolved ~
9632 ?+ -.resolved ~
7316 %var `id.resolved
9633 %var `id.resolved
7317 %avar `id.resolved
9634 %avar `id.resolved
9635+ %rvar `id.resolved
7318 ==
9636 ==
7319 ?~ ident $(caps t.caps)
9637 ?~ ident $(caps t.caps)
7320 ?: =(n u.ident) `i.caps
9638 ?: =(n u.ident) `i.caps
@@ -7329,6 +9647,7 @@
7329 ?+ -.resolved ~
9647 ?+ -.resolved ~
7330 %var `id.resolved
9648 %var `id.resolved
7331 %avar `id.resolved
9649 %avar `id.resolved
9650+ %rvar `id.resolved
7332 ==
9651 ==
7333 ?~ ident $(caps t.caps)
9652 ?~ ident $(caps t.caps)
7334 =/ found=(unit icap) (cap-with-id u.ident t.caps sub)
9653 =/ found=(unit icap) (cap-with-id u.ident t.caps sub)
@@ -7344,6 +9663,7 @@
7344 ?+ -.resolved ~
9663 ?+ -.resolved ~
7345 %var `id.resolved
9664 %var `id.resolved
7346 %avar `id.resolved
9665 %avar `id.resolved
9666+ %rvar `id.resolved
7347 ==
9667 ==
7348 ?~ ident &
9668 ?~ ident &
7349 ?: (cap-id-in u.ident t.caps sub) &
9669 ?: (cap-id-in u.ident t.caps sub) &
@@ -7358,8 +9678,8 @@
7358 ^- ?
9678 ^- ?
7359 ?~ caps |
9679 ?~ caps |
7360 =/ resolved=itype (itype-walk [%var id.i.caps] sub)
9680 =/ resolved=itype (itype-walk [%var id.i.caps] sub)
7361− ?: ?=(%avar -.resolved)
9681+ ?: |(?=(%avar -.resolved) ?=(%rvar -.resolved))
7362− ?: =(n id.resolved) &
9682+ ?: =(n +.resolved) &
7363 $(caps t.caps)
9683 $(caps t.caps)
7364 $(caps t.caps)
9684 $(caps t.caps)
7365::
9685::
@@ -7369,14 +9689,20 @@
7369 ?- -.t
9689 ?- -.t
7370 %var |
9690 %var |
7371 %avar =(n id.t)
9691 %avar =(n id.t)
9692+ %rvar =(n id.t)
7372 %nvar |
9693 %nvar |
9694+ %rnvar |
7373 %atom |
9695 %atom |
7374 %any-atom |
9696 %any-atom |
7375 %flag |
9697 %flag |
9698+ %noun |
9699+ %empty |
7376 %tag |
9700 %tag |
7377 %const |
9701 %const |
7378 %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
9702 %union |((lien cases.t |=(c=itype (has-atom-var n c))) (lien args.t |=(c=itype (has-atom-var n c))))
7379 %recursive |
9703 %recursive |
9704+ %jrec |
9705+ %grec (lien args.t |=(c=itype (has-atom-var n c)))
7380 %collection (lien args.t |=(c=itype (has-atom-var n c)))
9706 %collection (lien args.t |=(c=itype (has-atom-var n c)))
7381 %face $(t body.t)
9707 %face $(t body.t)
7382 %fn |($(t sample.t) $(t product.t))
9708 %fn |($(t sample.t) $(t product.t))
@@ -7416,6 +9742,10 @@
7416 =/ out=tape ""
9742 =/ out=tape ""
7417 |-
9743 |-
7418 ?~ vars out
9744 ?~ vars out
9745+ ?: (itype-var-is-restricted i.vars t)
9746+ =/ sep=tape ?:(printed ", " " where ")
9747+ =/ clause=tape "{sep}{(show-itype [%rvar i.vars] ~)} is an atom other than ?"
9748+ $(vars t.vars, printed &, out (weld out clause))
7419 ?: (itype-var-is-atom i.vars t)
9749 ?: (itype-var-is-atom i.vars t)
7420 =/ sep=tape ?:(printed ", " " where ")
9750 =/ sep=tape ?:(printed ", " " where ")
7421 =/ clause=tape "{sep}{(show-itype [%avar i.vars] ~)} is an atom"
9751 =/ clause=tape "{sep}{(show-itype [%avar i.vars] ~)} is an atom"
@@ -7424,9 +9754,9 @@
7424::
9754::
7425:: Build the supported part of the value environment in dependency order.
9755:: Build the supported part of the value environment in dependency order.
7426:: Each pass adds successful definitions. Forward references become
9756:: Each pass adds successful definitions. Forward references become
7427−:: available on a later pass; mutually recursive groups and unsupported
9757+:: available on a later pass; unsupported syntax does not enter the
7428−:: syntax do not enter the environment. Generalized definitions are closed, so a
9758+:: environment. Generalized definitions are closed, so a use instantiates
7429−:: use instantiates its variables afresh.
9759+:: its variables afresh.
7430::
9760::
7431++ global-value-names
9761++ global-value-names
7432 |= ds=(list def)
9762 |= ds=(list def)
@@ -7516,6 +9846,8 @@
7516++ infer-recursive-gate
9846++ infer-recursive-gate
7517 |= [d=def env=ienv state=istate]
9847 |= [d=def env=ienv state=istate]
7518 ^- iresult
9848 ^- iresult
9849+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
9850+ =. gate-defs.state ~
7519 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
9851 ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
7520 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
9852 ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
7521 [%| ["recursive definition is not a gate" ~]]
9853 [%| ["recursive definition is not a gate" ~]]
@@ -7656,9 +9988,9 @@
7656 * ~
9988 * ~
7657 ==
9989 ==
7658::
9990::
7659−:: Infer a cyclic top-level component with one monomorphic seed per gate.
9991+:: Infer a cyclic component with one monomorphic seed per gate. All members
7660−:: All members must succeed before any scheme is available; local cyclic
9992+:: must succeed before any scheme is available; pending constraints and
7661−:: groups, pending constraints and unresolved branch joins remain partial.
9993+:: unresolved branch joins remain partial.
7662+$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
9994+$ igate-entry [name=term typ=itype body=expr env=ienv caps=icaps]
7663+$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
9995+$ igate-seeds (each [entries=(list igate-entry) state=istate] idiag)
7664++ seed-gate-group
9996++ seed-gate-group
@@ -7725,6 +10057,7 @@
7725 ?: (constrained-capitals caps.entry sub.state)
10057 ?: (constrained-capitals caps.entry sub.state)
7726 [%| ["explicit capital constraints are not supported by partial inference" ~]]
10058 [%| ["explicit capital constraints are not supported by partial inference" ~]]
7727 =/ typ=itype (itype-normalize typ.entry sub.state)
10059 =/ typ=itype (itype-normalize typ.entry sub.state)
10060+ ?: (itype-has-nvar typ) [%| ["recursive group needs unsupported inference" ~]]
7728 ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
10061 ?: |((itype-has-tag typ) (itype-has-hidden-generic typ) (itype-has-hidden-recursive typ) (unsupported-atom-vars typ caps.entry binders.state sub.state))
7729 [%| ["recursive group needs unsupported inference" ~]]
10062 [%| ["recursive group needs unsupported inference" ~]]
7730 =/ free=(list @ud) (weld (free-env-vars env sub.state) (free-cap-vars caps.outer sub.state))
10063 =/ free=(list @ud) (weld (free-env-vars env sub.state) (free-cap-vars caps.outer sub.state))
@@ -7738,46 +10071,52 @@
7738++ infer-gate-group
10071++ infer-gate-group
7739 |= [ds=(list def) env=ienv state=istate]
10072 |= [ds=(list def) env=ienv state=istate]
7740 ^- ilocal-result
10073 ^- ilocal-result
10074+ ?^ defer.state [%| ["deferred recursive inference is unsupported" ~]]
7741 =/ names=(list term) (global-value-names ds)
10075 =/ names=(list term) (global-value-names ds)
7742 ?. (levy names |=(n=term (unique-value-name n names)))
10076 ?. (levy names |=(n=term (unique-value-name n names)))
7743 [%| ["recursive group contains duplicate names" ~]]
10077 [%| ["recursive group contains duplicate names" ~]]
7744 ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
10078 ?: (lien names |=(n=term ?=(^ (ienv-lookup n env))))
7745 [%| ["recursive group shadows a name" ~]]
10079 [%| ["recursive group shadows a name" ~]]
7746− =/ scoped=istate state(globals (weld names globals.state))
10080+ =/ scoped=istate state(globals (weld names globals.state), gate-defs ~)
7747 =/ seeded=igate-seeds (seed-gate-group ds env scoped)
10081 =/ seeded=igate-seeds (seed-gate-group ds env scoped)
7748 ?: ?=(%| -.seeded) seeded
10082 ?: ?=(%| -.seeded) seeded
7749 =/ seeds=ienv (group-seed-env entries.p.seeded ~)
10083 =/ seeds=ienv (group-seed-env entries.p.seeded ~)
7750 =/ body=igate-seeds (infer-gate-group-bodies entries.p.seeded seeds state.p.seeded)
10084 =/ body=igate-seeds (infer-gate-group-bodies entries.p.seeded seeds state.p.seeded)
7751 ?: ?=(%| -.body) body
10085 ?: ?=(%| -.body) body
10086+ :: Per-member ownership through mutual recursion is not implemented.
10087+ ?: !=(projections.state.p.body projections.state)
10088+ [%| ["record projection in recursive groups needs unsupported inference" ~]]
10089+ ?: !=(holes.state.p.body holes.state)
10090+ [%| ["holes in recursive groups need unsupported inference" ~]]
7752 ?: (pending-tags tags.state.p.body sub.state.p.body)
10091 ?: (pending-tags tags.state.p.body sub.state.p.body)
7753 [%| ["recursive group has unresolved literal constraints" ~]]
10092 [%| ["recursive group has unresolved literal constraints" ~]]
7754 =/ schemes=(each ienv idiag) (group-schemes entries.p.body env state state.p.body)
10093 =/ schemes=(each ienv idiag) (group-schemes entries.p.body env state state.p.body)
7755 ?: ?=(%| -.schemes) schemes
10094 ?: ?=(%| -.schemes) schemes
7756 [%& [(weld p.schemes env) state.p.body(globals globals.state)]]
10095 [%& [(weld p.schemes env) state.p.body(globals globals.state)]]
7757::
10096::
10097+++ width-finalize
10098+ |= [ps=(list iwprojection) sub=isub visible=(list @ud)]
10099+ ^- (unit (list iwprojection))
10100+ ?~ ps `~
10101+ ?: (lien t.ps |=(p=iwprojection =(at.p at.i.ps))) ~
10102+ =/ src=itype (default-decimals (itype-normalize source.i.ps sub))
10103+ =/ dst=itype (default-decimals (itype-normalize target.i.ps sub))
10104+ ?: |((itype-has-nvar src) (itype-has-nvar dst) (itype-has-tag src) (itype-has-tag dst)) ~
10105+ =/ vars=(list @ud) (weld (itype-vars src) (itype-vars dst))
10106+ ?. (levy vars |=(n=@ud (lien visible |=(v=@ud =(n v))))) ~
10107+ =/ rest=(unit (list iwprojection)) $(ps t.ps)
10108+ ?~ rest ~
10109+ =/ entry=iwprojection i.ps
10110+ =. entry entry(source src, target dst)
10111+ `[entry u.rest]
10112+::
7758++ add-supported-defs
10113++ add-supported-defs
7759− |= [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)]
10114+ |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) 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) artifacts=(list iwidth-definition)]
7760− ^- ienv
10115+ ^- [env=ienv artifacts=(list iwidth-definition)]
7761− ?~ ds env
10116+ (add-supported-defs-core ds all-defs checked heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts ~)
7762− =/ d=def i.ds
7763− ?: ?=(%mold -.d) $(ds t.ds)
7764− ?. (unique-value-name name.d globals) $(ds t.ds)
7765− ?^ (ienv-lookup name.d env) $(ds t.ds)
7766− =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7767− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
7768− =. initial (reserve-def-caps val.d initial)
7769− =/ result=iresult (infer-fragment val.d env initial)
7770− =? result ?=(%| -.result) (infer-recursive-gate d env initial)
7771− ?: ?=(%| -.result) $(ds t.ds)
7772− ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
7773− =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
7774− ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
7775− ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
7776− =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
7777− ?: (gth (lent vars) 26) $(ds t.ds)
7778− $(ds t.ds, env [[name.d [typ vars]] env])
7779::
10117::
7780−+$ iresolved [env=ienv grouped=(list term)]
10118+
10119++$ iresolved [env=ienv grouped=(list term) artifacts=(list iwidth-definition)]
7781+$ iadj (map term (list term))
10120+$ iadj (map term (list term))
7782+$ ivisited (map term ?)
10121+$ ivisited (map term ?)
7783+$ iwork (list [name=term done=?])
10122+$ iwork (list [name=term done=?])
@@ -7871,9 +10210,9 @@
7871 (lien (graph-edges i.component graph) |=(x=term =(x i.component)))
10210 (lien (graph-edges i.component graph) |=(x=term =(x i.component)))
7872::
10211::
7873++ add-groups
10212++ add-groups
7874− |= [ds=(list def) components=icomponents graph=iadj env=ienv grouped=(list term) state=istate]
10213+ |= [ds=(list def) components=icomponents graph=iadj env=ienv grouped=(list term) artifacts=(list iwidth-definition) state=istate]
7875 ^- iresolved
10214 ^- iresolved
7876− ?~ components [env grouped]
10215+ ?~ components [env grouped artifacts]
7877 =/ component=(list term) i.components
10216 =/ component=(list term) i.components
7878 ?. (graph-cycle component graph) $(components t.components)
10217 ?. (graph-cycle component graph) $(components t.components)
7879 ?: (lien component |=(n=term ?=(^ (ienv-lookup n env)))) $(components t.components)
10218 ?: (lien component |=(n=term ?=(^ (ienv-lookup n env)))) $(components t.components)
@@ -7890,24 +10229,185 @@
7890++ resolve-groups
10229++ resolve-groups
7891 |= [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)]
10230 |= [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)]
7892 ^- iresolved
10231 ^- iresolved
7893− =/ env=ienv ~
10232+ (resolve-groups-core ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude ~)
7894− =/ grouped=(list term) ~
10233+::
7895− =/ names=(list term) (global-value-names ds)
10234+
7896− =/ nameset=ivisited (graph-nameset names ~)
10235+++ add-supported-defs-core
7897− =/ graph=iadj (graph-make-forward ds nameset ~)
10236+ |= [ds=(list def) all-defs=(list def) checked=(map term def) heads=(unit igate-prelude-evidence) 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) artifacts=(list iwidth-definition) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
7898− =/ components=icomponents (graph-components ds names)
10237+ ^- [env=ienv artifacts=(list iwidth-definition)]
7899− =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10238+ ?~ ds [env artifacts]
7900− |-
10239+ =/ d=def i.ds
7901− =/ next=ienv (add-supported-defs ds env molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
10240+ ?: ?=(%mold -.d) $(ds t.ds)
7902− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
10241+ ?. (unique-value-name name.d globals) $(ds t.ds)
7903− =/ out=iresolved (add-groups ds components graph next grouped initial)
10242+ ?^ (ienv-lookup name.d env) $(ds t.ds)
7904− ?: =(env env.out) out
10243+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7905− $(env env.out, grouped grouped.out)
10244+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
7906−::
10245+ =. grec-index.initial index
7907−++ resolve-supported-defs
10246+ =. gate-defs.initial checked
7908− |= [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)]
10247+ =. head-evidence.initial heads
7909− ^- ienv
10248+ =. initial (reserve-def-caps val.d initial)
7910− env:(resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
10249+ =/ result=iresult (infer-fragment val.d env initial)
10250+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
10251+ ?: ?=(%| -.result) $(ds t.ds)
10252+ =. state.p.result (promote-restricted-numbers state.p.result env)
10253+ =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
10254+ ?^ (unresolved-hole holes.state.p.result holes.initial state.p.result) $(ds t.ds)
10255+ ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
10256+ =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
10257+ ?: |((pending-tags tags.state.p.result sub.state.p.result) (itype-has-tag typ)) $(ds t.ds)
10258+ ?: (unsupported-atom-vars typ caps.state.p.result binders.state.p.result sub.state.p.result) $(ds t.ds)
10259+ =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
10260+ ?: (gth (lent vars) 26) $(ds t.ds)
10261+ =/ finalized=(unit (list iwprojection))
10262+ (width-finalize projections.state.p.result sub.state.p.result vars)
10263+ ?~ finalized $(ds t.ds)
10264+ =? artifacts ?=(^ u.finalized)
10265+ [[name.d val.d typ sub.state.p.result (flop u.finalized)] artifacts]
10266+ =? checked |(?=(%gate -.val.d) ?=(%gate-wide -.val.d)) (~(put by checked) name.d d)
10267+ $(ds t.ds, env [[name.d [typ vars]] env], checked checked)
10268+::
10269+++ resolve-groups-core
10270+ |= [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) index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])]
10271+ ^- iresolved
10272+ =/ env=ienv ~
10273+ =/ grouped=(list term) ~
10274+ =/ artifacts=(list iwidth-definition) ~
10275+ =/ names=(list term) (global-value-names ds)
10276+ =/ nameset=ivisited (graph-nameset names ~)
10277+ =/ graph=iadj (graph-make-forward ds nameset ~)
10278+ =/ components=icomponents (graph-components ds names)
10279+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
10280+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
10281+ |-
10282+ =/ next=[env=ienv artifacts=(list iwidth-definition)]
10283+ (add-supported-defs-core ds ds (direct-checked-gates ds env) heads env molds globals externals surs mark-externals marks jimports reserved-molds at prelude artifacts index)
10284+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
10285+ =. grec-index.initial index
10286+ =/ out=iresolved (add-groups ds components graph env.next grouped artifacts.next initial)
10287+ ?: =(env env.out) out
10288+ $(env env.out, grouped grouped.out, artifacts artifacts.out)
10289+::
10290+++ resolve-supported-defs
10291+ |= [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)]
10292+ ^- ienv
10293+ env:(resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds at prelude)
10294+::
10295+:: A diagnostic-only proof for a narrow syntactic value cycle. Every
10296+:: edge is an unqualified wing in a supported expression, and samples
10297+:: may not shadow global bindings. Unknown forms yield no conclusion.
10298++$ icyclesite [name=term at=span]
10299++$ icycle [name=term first=span next=span]
10300+++ cycle-sites-list
10301+ |= [xs=(list expr) globals=(list term) locals=(list term)]
10302+ ^- (unit (list icyclesite))
10303+ ?~ xs `~
10304+ =/ first=(unit (list icyclesite)) (cycle-sites i.xs globals locals)
10305+ ?~ first ~
10306+ =/ tail=(unit (list icyclesite)) $(xs t.xs)
10307+ ?~ tail ~
10308+ `(weld u.first u.tail)
10309+::
10310+++ cycle-sample-name
10311+ |= [sam=sample globals=(list term) locals=(list term)]
10312+ ^- (unit (unit term))
10313+ ?- -.sam
10314+ %bind
10315+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10316+ ``name.sam
10317+ %face
10318+ ?: (lien (weld globals locals) |=(n=term =(n name.sam))) ~
10319+ ``name.sam
10320+ %bare `~
10321+ * ~
10322+ ==
10323+::
10324+++ cycle-sites
10325+ |= [e=expr globals=(list term) locals=(list term)]
10326+ ^- (unit (list icyclesite))
10327+ ?- -.e
10328+ %wing
10329+ ?. ?=([@ ~] names.e) ~
10330+ `~[[i.names.e at.e]]
10331+ %lit `~
10332+ %str
10333+ ?: (lien pieces.e |=(p=piece ?=(%expr -.p))) ~
10334+ `~
10335+ %group $(e inner.e)
10336+ %body ?~(defs.e $(e final.e) ~)
10337+ %cast $(e val.e)
10338+ %gate
10339+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10340+ ?~ binder ~
10341+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10342+ $(e body.e, locals nested)
10343+ %gate-wide
10344+ =/ binder=(unit (unit term)) (cycle-sample-name sample.e globals locals)
10345+ ?~ binder ~
10346+ =/ nested=(list term) ?~(u.binder locals [u.u.binder locals])
10347+ $(e body.e, locals nested)
10348+ %call
10349+ =/ first=(unit (list icyclesite)) $(e head.e)
10350+ ?~ first ~
10351+ =/ tail=(unit (list icyclesite)) (cycle-sites-list args.e globals locals)
10352+ ?~ tail ~
10353+ `(weld u.first u.tail)
10354+ * ~
10355+ ==
10356+::
10357+++ cycle-definitely-atom
10358+ |= e=expr
10359+ ^- ?
10360+ ?: ?=(%group -.e) $(e inner.e)
10361+ ?: &(?=(%body -.e) ?=(~ defs.e)) $(e final.e)
10362+ ?. ?=(%cast -.e) |
10363+ |(?=(%aura -.shape.e) ?=(%flag -.shape.e))
10364+::
10365+++ cycle-proof-group
10366+ |= [members=(list def) globals=(list term)]
10367+ ^- ?
10368+ ?~ members &
10369+ ?. ?=(%value -.i.members) |
10370+ ?. (unique-value-name name.i.members globals) |
10371+ ?. ?=(^ (cycle-sites val.i.members globals ~)) |
10372+ $(members t.members)
10373+::
10374+++ cycle-find-site
10375+ |= [sites=(list icyclesite) component=(list term)]
10376+ ^- (unit span)
10377+ ?~ sites ~
10378+ ?: (lien component |=(n=term =(n name.i.sites))) `at.i.sites
10379+ $(sites t.sites)
10380+::
10381+++ cycle-group-errors
10382+ |= [members=(list def) component=(list term) globals=(list term)]
10383+ ^- (list icycle)
10384+ ?~ members ~
10385+ =/ d=def i.members
10386+ ?> ?=(%value -.d)
10387+ =/ tail=(list icycle) $(members t.members)
10388+ ?. (cycle-definitely-atom val.d) tail
10389+ =/ sites=(unit (list icyclesite)) (cycle-sites val.d globals ~)
10390+ ?~ sites tail
10391+ =/ found=(unit span) (cycle-find-site u.sites component)
10392+ ?~ found tail
10393+ [[name.d at.d u.found] tail]
10394+::
10395+++ definite-value-cycles
10396+ |= [ds=(list def) globals=(list term)]
10397+ ^- (list icycle)
10398+ =/ names=(list term) (global-value-names ds)
10399+ =/ graph=iadj (graph-make-forward ds (graph-nameset names ~) ~)
10400+ =/ components=icomponents (graph-components ds names)
10401+ =/ out=(list icycle) ~
10402+ |-
10403+ ?~ components out
10404+ =/ component=(list term) i.components
10405+ ?. (graph-cycle component graph) $(components t.components)
10406+ =/ members=(list def)
10407+ (skim ds |=(d=def &(?=(%value -.d) (lien component |=(n=term =(n name.d))))))
10408+ ?. =((lent members) (lent component)) $(components t.components)
10409+ ?. (cycle-proof-group members globals) $(components t.components)
10410+ $(components t.components, out (weld (cycle-group-errors members component globals) out))
7911::
10411::
7912+| %union-analysis
10412+| %union-analysis
7913::
10413::
@@ -8031,6 +10531,257 @@
8031 %overlap
10531 %overlap
8032 %unknown
10532 %unknown
8033::
10533::
10534+:: A source-only fallback for literal-tagged cells and one-hop local
10535+:: generic applications. It screens all work before ordinary inference.
10536+++ union-simple-shape-budget
10537+ |= [s=shape fuel=@ud vars=(unit (list @t))]
10538+ ^- (unit @ud)
10539+ ?: =(0 fuel) ~
10540+ =. fuel (dec fuel)
10541+ ?- -.s
10542+ ?(%aura %noun %void %flag) `fuel
10543+ %tvar
10544+ ?~ vars `fuel
10545+ ?:((lien u.vars |=(n=@t =(n name.s))) `fuel ~)
10546+ %const
10547+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10548+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10549+ `fuel
10550+ %cell (union-simple-fields-budget fields.s fuel vars)
10551+ %fn
10552+ =/ left=(unit @ud) $(s sample.s, fuel fuel)
10553+ ?~ left ~
10554+ $(s product.s, fuel u.left)
10555+ * ~
10556+ ==
10557+++ union-simple-fields-budget
10558+ |= [fields=(list field) fuel=@ud vars=(unit (list @t))]
10559+ ^- (unit @ud)
10560+ ?~ fields `fuel
10561+ ?: =(0 fuel) ~
10562+ =/ field-shape=shape
10563+ ?- -.i.fields
10564+ %bare shape.i.fields
10565+ %face shape.i.fields
10566+ %pun [%ref at.i.fields ~[name.i.fields]]
10567+ ==
10568+ =/ head=(unit @ud) (union-simple-shape-budget field-shape (dec fuel) vars)
10569+ ?~ head ~
10570+ $(fields t.fields, fuel u.head)
10571+++ union-source-find
10572+ |= [n=term molds=imolds fuel=@ud]
10573+ ^- (unit [body=shape left=@ud])
10574+ =/ found=(unit shape) ~
10575+ |-
10576+ ?~ molds
10577+ ?~ found ~
10578+ `[u.found fuel]
10579+ ?: =(0 fuel) ~
10580+ ?: =(n name.i.molds)
10581+ ?^ found ~
10582+ $(molds t.molds, fuel (dec fuel), found `body.i.molds)
10583+ $(molds t.molds, fuel (dec fuel))
10584+++ union-source-args-budget
10585+ |= [vars=(list @t) args=(list shape) fuel=@ud]
10586+ ^- (unit @ud)
10587+ =/ seen=(set @t) *(set @t)
10588+ |-
10589+ ?~ vars ?~(args `fuel ~)
10590+ ?~ args ~
10591+ ?: =(0 fuel) ~
10592+ ?: (~(has in:..zuse seen) i.vars) ~
10593+ =/ arg=(unit @ud) (union-simple-shape-budget i.args (dec fuel) ~)
10594+ ?~ arg ~
10595+ $(vars t.vars, args t.args, fuel u.arg, seen (~(put in:..zuse seen) i.vars))
10596+++ union-source-cell-tag
10597+ |= s=shape
10598+ ^- (unit @)
10599+ ?. ?=(%cell -.s) ~
10600+ ?~ fields.s ~
10601+ ?~ t.fields.s ~
10602+ ?. ?=(%bare -.i.fields.s) ~
10603+ =/ head=shape shape.i.fields.s
10604+ ?. ?=(%const -.head) ~
10605+ ?. |(=(%term form.lit.head) =(%null form.lit.head) =(%loobean form.lit.head)) ~
10606+ ?: &(=(%loobean form.lit.head) !|(=(0 val.lit.head) =(1 val.lit.head))) ~
10607+ `val.lit.head
10608+++ union-source-case-tag
10609+ |= [s=shape molds=imolds fuel=@ud]
10610+ ^- (unit [tag=@ left=@ud])
10611+ ?: ?=(%cell -.s)
10612+ =/ tag=(unit @) (union-source-cell-tag s)
10613+ ?~ tag ~
10614+ =/ left=(unit @ud) (union-simple-shape-budget s fuel ~)
10615+ ?~ left ~
10616+ `[u.tag u.left]
10617+ ?. ?=(%apply -.s) ~
10618+ ?. ?=([@ ~] ref.s) ~
10619+ ?: =(0 fuel) ~
10620+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10621+ ?~ found ~
10622+ ?. ?=(%generic -.body.u.found) ~
10623+ ?~ vars.body.u.found ~
10624+ =/ tag=(unit @) (union-source-cell-tag body.body.u.found)
10625+ ?~ tag ~
10626+ =/ args=(unit @ud) (union-source-args-budget vars.body.u.found args.s left.u.found)
10627+ ?~ args ~
10628+ =/ left=(unit @ud) (union-simple-shape-budget body.body.u.found u.args `vars.body.u.found)
10629+ ?~ left ~
10630+ `[u.tag u.left]
10631+++ union-source-distinct-tags
10632+ |= [cases=(list shape) molds=imolds fuel=@ud]
10633+ ^- ?
10634+ =/ seen=(set @) *(set @)
10635+ =/ has-application=? |
10636+ |-
10637+ ?~ cases has-application
10638+ ?: =(0 fuel) |
10639+ =/ item=(unit [tag=@ left=@ud]) (union-source-case-tag i.cases molds (dec fuel))
10640+ ?~ item |
10641+ ?: (~(has in:..zuse seen) tag.u.item) |
10642+ $(cases t.cases, fuel left.u.item, seen (~(put in:..zuse seen) tag.u.item), has-application |(has-application ?=(%apply -.i.cases)))
10643+::
10644+:: This inference-only screen bounds inherited work that the small source
10645+:: slice may consult. It does not authenticate a caller-created state.
10646+++ union-state-leaf
10647+ |= t=itype
10648+ ^- ?
10649+ ?=(?(%var %avar %rvar %nvar %rnvar %atom %any-atom %flag %noun %empty %const) -.t)
10650+++ union-state-params-budget
10651+ |= [params=iparams fuel=@ud]
10652+ ^- (unit @ud)
10653+ ?~ params `fuel
10654+ ?: =(0 fuel) ~
10655+ ?. (union-state-leaf typ.i.params) ~
10656+ $(params t.params, fuel (dec fuel))
10657+++ union-state-sub-budget
10658+ |= [sub=isub fuel=@ud]
10659+ ^- (unit @ud)
10660+ ?~ sub `fuel
10661+ ?: =(0 fuel) ~
10662+ ?. (union-state-leaf val.i.sub) ~
10663+ $(sub t.sub, fuel (dec fuel))
10664+++ union-state-caps-budget
10665+ |= [caps=icaps fuel=@ud]
10666+ ^- (unit @ud)
10667+ ?~ caps `fuel
10668+ ?: =(0 fuel) ~
10669+ $(caps t.caps, fuel (dec fuel))
10670+++ union-state-active-budget
10671+ |= [active=(list term) fuel=@ud]
10672+ ^- (unit @ud)
10673+ ?~ active `fuel
10674+ ?: =(0 fuel) ~
10675+ $(active t.active, fuel (dec fuel))
10676+++ union-state-tags-budget
10677+ |= [tags=(list ipending) fuel=@ud]
10678+ ^- (unit @ud)
10679+ ?~ tags `fuel
10680+ ?: =(0 fuel) ~
10681+ $(tags t.tags, fuel (dec fuel))
10682+++ union-source-state-safe
10683+ |= [state=istate fuel=@ud]
10684+ ^- ?
10685+ ?^ grec-index.state |
10686+ ?^ holes.state |
10687+ ?^ defer.state |
10688+ ?^ obligations.state |
10689+ =/ params=(unit @ud) (union-state-params-budget params.state fuel)
10690+ ?~ params |
10691+ =/ sub=(unit @ud) (union-state-sub-budget sub.state u.params)
10692+ ?~ sub |
10693+ =/ caps=(unit @ud) (union-state-caps-budget caps.state u.sub)
10694+ ?~ caps |
10695+ =/ active=(unit @ud) (union-state-active-budget active.state u.caps)
10696+ ?~ active |
10697+ ?=(^ (union-state-tags-budget tags.state u.active))
10698+::
10699+:: Positive overlap witnesses from parsed, one-hop local source only.
10700+:: Unknown or exhausted work returns no witness, never disjointness.
10701++$ uow-case [at=span head=@ payload=upat]
10702+++ union-overlap-primitive
10703+ |= s=shape
10704+ ^- (unit upat)
10705+ ?- -.s
10706+ %aura `[%atom ~]
10707+ %noun `[%all ~]
10708+ %void `[%empty ~]
10709+ %flag `[%flag ~]
10710+ %const
10711+ ?. |(=(%term form.lit.s) =(%null form.lit.s) =(%loobean form.lit.s)) ~
10712+ ?: &(=(%loobean form.lit.s) !|(=(0 val.lit.s) =(1 val.lit.s))) ~
10713+ `[%atom `val.lit.s]
10714+ * ~
10715+ ==
10716+++ union-overlap-case
10717+ |= [s=shape molds=imolds fuel=@ud]
10718+ ^- (unit [item=uow-case left=@ud])
10719+ ?: =(0 fuel) ~
10720+ =. fuel (dec fuel)
10721+ :: Each body has exactly two fields; an application has exactly one
10722+ :: parameter and one concrete primitive argument. The full mold table
10723+ :: is scanned to establish unique ownership.
10724+ =/ expanded=(unit [body=shape param=(unit [name=@t pat=upat]) left=@ud])
10725+ ?: ?=(%cell -.s) `[s ~ fuel]
10726+ ?. ?=(%apply -.s) ~
10727+ ?. ?=([@ ~] ref.s) ~
10728+ ?. ?=([* ~] args.s) ~
10729+ ?: =(0 fuel) ~
10730+ =/ found=(unit [body=shape left=@ud]) (union-source-find i.ref.s molds (dec fuel))
10731+ ?~ found ~
10732+ ?. ?=(%generic -.body.u.found) ~
10733+ ?. ?=([@ ~] vars.body.u.found) ~
10734+ ?: =(0 left.u.found) ~
10735+ =/ argument=(unit upat) (union-overlap-primitive i.args.s)
10736+ ?~ argument ~
10737+ `[body.body.u.found `[i.vars.body.u.found u.argument] (dec left.u.found)]
10738+ ?~ expanded ~
10739+ =/ body=shape body.u.expanded
10740+ ?. ?=(%cell -.body) ~
10741+ ?. ?=([* * ~] fields.body) ~
10742+ :: Charge the cell, two fields, and the head and payload nodes.
10743+ ?: (lth left.u.expanded 5) ~
10744+ =/ head=(unit @) (union-source-cell-tag body)
10745+ ?~ head ~
10746+ =/ field=field i.t.fields.body
10747+ =/ payload=shape
10748+ ?- -.field
10749+ %bare shape.field
10750+ %face shape.field
10751+ %pun [%ref at.field ~[name.field]]
10752+ ==
10753+ =/ pattern=(unit upat)
10754+ ?: ?=(%tvar -.payload)
10755+ ?~ param.u.expanded ~
10756+ ?. =(name.payload name.u.param.u.expanded) ~
10757+ `pat.u.param.u.expanded
10758+ (union-overlap-primitive payload)
10759+ ?~ pattern ~
10760+ `[[at.s u.head u.pattern] (sub left.u.expanded 5)]
10761+++ union-overlap-against
10762+ |= [first=uow-case rest=(list shape) molds=imolds fuel=@ud]
10763+ ^- (unit [witness=(unit upair) left=@ud])
10764+ ?~ rest `[~ fuel]
10765+ ?: =(0 fuel) ~
10766+ =/ other=(unit [item=uow-case left=@ud]) (union-overlap-case i.rest molds (dec fuel))
10767+ ?~ other ~
10768+ ?: &(=(head.first head.item.u.other) =(%overlap (union-relate payload.first payload.item.u.other)))
10769+ `[`[at.first at.item.u.other %overlap] left.u.other]
10770+ $(rest t.rest, fuel left.u.other)
10771+++ union-source-overlap
10772+ |= [cases=(list shape) molds=imolds fuel=@ud]
10773+ ^- (unit upair)
10774+ ?~ cases ~
10775+ ?~ t.cases ~
10776+ ?: =(0 fuel) ~
10777+ =/ first=(unit [item=uow-case left=@ud]) (union-overlap-case i.cases molds (dec fuel))
10778+ ?~ first ~
10779+ =/ found=(unit [witness=(unit upair) left=@ud])
10780+ (union-overlap-against item.u.first t.cases molds left.u.first)
10781+ ?~ found ~
10782+ ?^ witness.u.found witness.u.found
10783+ $(cases t.cases, fuel left.u.found)
10784+::
8034++ union-pairs
10785++ union-pairs
8035 |= [cases=(list shape) molds=imolds]
10786 |= [cases=(list shape) molds=imolds]
8036 ^- (list upair)
10787 ^- (list upair)
@@ -8044,15 +10795,151 @@
8044 [at.first at.second (union-relate a (project-union-mold second molds ~))]
10795 [at.first at.second (union-relate a (project-union-mold second molds ~))]
8045 (weld pairs $(cases t.cases))
10796 (weld pairs $(cases t.cases))
8046::
10797::
10798+:: A closed structural mold supplies no equation to determine a hole.
10799+:: Applications, references, unbound capitals and unions are unproved.
10800+++ simple-mold-hole
10801+ |= sh=shape
10802+ ^- (unit (unit span))
10803+ ?: ?=(%generic -.sh)
10804+ ?~ vars.sh ~
10805+ ?. (distinct-params vars.sh) ~
10806+ (simple-mold-hole-in body.sh vars.sh)
10807+ (simple-mold-hole-in sh ~)
10808+++ simple-mold-hole-in
10809+ |= [sh=shape vars=(list @t)]
10810+ ^- (unit (unit span))
10811+ ?- -.sh
10812+ %hole ``at.sh
10813+ ?(%aura %noun %void %flag %const) `~
10814+ %tvar ?:((lien vars |=(v=@t =(v name.sh))) `~ ~)
10815+ %cell (simple-mold-field-holes fields.sh vars)
10816+ %fn
10817+ =/ a=(unit (unit span)) $(sh sample.sh)
10818+ ?~ a ~
10819+ =/ b=(unit (unit span)) $(sh product.sh)
10820+ ?~ b ~
10821+ `?~(u.a u.b u.a)
10822+ %generic ~
10823+ * ~
10824+ ==
10825+++ simple-mold-field-holes
10826+ |= [fields=(list field) vars=(list @t)]
10827+ ^- (unit (unit span))
10828+ ?~ fields `~
10829+ =/ f=field i.fields
10830+ =/ first=(unit (unit span))
10831+ ?- -.f
10832+ %face (simple-mold-hole-in shape.f vars)
10833+ %bare (simple-mold-hole-in shape.f vars)
10834+ %pun ~
10835+ ==
10836+ ?~ first ~
10837+ =/ rest=(unit (unit span)) $(fields t.fields)
10838+ ?~ rest ~
10839+ `?~(u.first u.rest u.first)
10840+++ simple-local-mold-hole
10841+ |= defs=(list def)
10842+ ^- (unit span)
10843+ ?~ defs ~
10844+ ?. ?=(%mold -.i.defs) $(defs t.defs)
10845+ =/ found=(unit (unit span)) (simple-mold-hole shape.i.defs)
10846+ ?~ found $(defs t.defs)
10847+ ?^ u.found u.found
10848+ $(defs t.defs)
10849+::
10850+:: A partial prelude may omit unsupported declarations, but may not
10851+:: publish an interface while a named mold's hole remains unchecked.
10852+++ shape-has-hole
10853+ |= sh=shape
10854+ ^- ?
10855+ ?- -.sh
10856+ %hole &
10857+ %path (lien segs.sh |=(s=pseg ?=(%inferred -.s)))
10858+ %apply (lien args.sh shape-has-hole)
10859+ %union (lien cases.sh shape-has-hole)
10860+ %cell (lien fields.sh field-has-hole)
10861+ %fn |($(sh sample.sh) $(sh product.sh))
10862+ %generic $(sh body.sh)
10863+ * |
10864+ ==
10865+++ field-has-hole
10866+ |= f=field
10867+ ^- ?
10868+ ?- -.f
10869+ %face (shape-has-hole shape.f)
10870+ %bare (shape-has-hole shape.f)
10871+ %pun |
10872+ ==
10873+++ named-mold-has-hole
10874+ |= ds=(list def)
10875+ ^- ?
10876+ ?~ ds |
10877+ ?: &(?=(%mold -.i.ds) (shape-has-hole shape.i.ds)) &
10878+ $(ds t.ds)
10879+::
10880+++ sample-has-hole
10881+ |= sam=sample
10882+ ^- ?
10883+ ?- -.sam
10884+ %face (shape-has-hole shape.sam)
10885+ %bare (shape-has-hole shape.sam)
10886+ %cell (lien items.sam sample-has-hole)
10887+ * |
10888+ ==
10889+++ def-has-hole
10890+ |= d=def
10891+ ^- ?
10892+ ?- -.d
10893+ %mold (shape-has-hole shape.d)
10894+ %value (expr-has-hole val.d)
10895+ ==
10896+++ expr-has-hole
10897+ |= e=expr
10898+ ^- ?
10899+ ?- -.e
10900+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
10901+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (expr-has-hole p.p) |)))
10902+ %change (lien edits.e |=(p=edit (expr-has-hole val.p)))
10903+ %pair $(e val.e)
10904+ %unit $(e val.e)
10905+ %group $(e inner.e)
10906+ %list (lien items.e expr-has-hole)
10907+ %tuple (lien items.e |=(i=item (expr-has-hole val.i)))
10908+ ?(%gate %gate-wide) |((sample-has-hole sample.e) $(e body.e))
10909+ %cast |((shape-has-hole shape.e) $(e val.e))
10910+ %call |($(e head.e) (lien args.e expr-has-hole))
10911+ %trace |($(e val.e) $(e then.e))
10912+ %branch |($(e subject.e) (lien arms.e |=(a=arm (expr-has-hole val.a))))
10913+ %body |((lien defs.e def-has-hole) $(e final.e))
10914+ * |
10915+ ==
10916+++ hole-values-present
10917+ |= [ds=(list def) env=ienv]
10918+ ^- ?
10919+ ?~ ds &
10920+ ?. ?=(%value -.i.ds) $(ds t.ds)
10921+ ?: (expr-has-hole val.i.ds)
10922+ ?. ?=(^ (ienv-lookup name.i.ds env)) |
10923+ $(ds t.ds)
10924+ $(ds t.ds)
8047++ show-partial-mold
10925++ show-partial-mold
8048 |= [file=path src=@t d=def molds=imolds]
10926 |= [file=path src=@t d=def molds=imolds]
8049 ^- @t
10927 ^- @t
8050 ?> ?=(%mold -.d)
10928 ?> ?=(%mold -.d)
8051 =/ sh=shape shape.d
10929 =/ sh=shape shape.d
10930+ =/ hole=(unit (unit span)) (simple-mold-hole sh)
10931+ ?: &(?=(^ hole) ?=(^ u.hole))
10932+ =/ text=@t (show-error src [file line.beg.u.u.hole col.beg.u.u.hole "unresolved type hole"])
10933+ (of-wain:format ~[(crip "+$ {(trip name.d)}: type hole needs a determined type") text])
8052 =? sh ?=(%generic -.sh) body.sh
10934 =? sh ?=(%generic -.sh) body.sh
8053 ?. ?=(%union -.sh) (crip "+$ {(trip name.d)}: not checked")
10935 ?. ?=(%union -.sh) (crip "+$ {(trip name.d)}: not checked")
8054 =/ pairs=(list upair) (union-pairs cases.sh molds)
10936 =/ pairs=(list upair) (union-pairs cases.sh molds)
8055 =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
10937 =/ overlapping=(list upair) (skim pairs |=(p=upair =(%overlap relation.p)))
10938+ =. overlapping
10939+ ?^ overlapping overlapping
10940+ ?. (lien pairs |=(p=upair =(%unknown relation.p))) ~
10941+ =/ witness=(unit upair) (union-source-overlap cases.sh molds 256)
10942+ ?~(witness ~ ~[u.witness])
8056 ?^ overlapping
10943 ?^ overlapping
8057 =/ p=upair i.overlapping
10944 =/ p=upair i.overlapping
8058 =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
10945 =/ summary=@t (crip "+$ {(trip name.d)}: overlapping cases; mold not checked")
@@ -8060,7 +10947,9 @@
8060 =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
10947 =/ second=@t (show-error src [file line.beg.second.p col.beg.second.p "overlapping case"])
8061 (of-wain:format ~[summary first second])
10948 (of-wain:format ~[summary first second])
8062 ?: (lien pairs |=(p=upair =(%unknown relation.p)))
10949 ?: (lien pairs |=(p=upair =(%unknown relation.p)))
8063− (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
10950+ ?. (union-source-distinct-tags cases.sh molds 256)
10951+ (crip "+$ {(trip name.d)}: case disjointness unresolved; mold not checked")
10952+ (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
8064 (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
10953 (crip "+$ {(trip name.d)}: cases proven disjoint; mold not checked")
8065::
10954::
8066:: +show-inference-diagnostic: a partial report with both source sites
10955:: +show-inference-diagnostic: a partial report with both source sites
@@ -8075,6 +10964,21 @@
8075 (show-error src [file line.beg.at.site col.beg.at.site note.site])
10964 (show-error src [file line.beg.at.site col.beg.at.site note.site])
8076 (of-wain:format [summary excerpts])
10965 (of-wain:format [summary excerpts])
8077::
10966::
10967+:: Both written field sites are shown in the source that declares them.
10968+++ show-duplicate-fields
10969+ |= [file=path src=@t diagnostic=idiag]
10970+ ^- @t
10971+ =/ excerpts=(list @t)
10972+ %+ turn sites.diagnostic
10973+ |= site=[at=span note=tape]
10974+ (show-error src [file line.beg.at.site col.beg.at.site note.site])
10975+ (of-wain:format [(crip msg.diagnostic) excerpts])
10976+::
10977+++ duplicate-fields-report
10978+ |= [file=path src=@t diagnostic=idiag]
10979+ ^- @t
10980+ (of-wain:format ~['partial inference; module not checked' (show-duplicate-fields file src diagnostic)])
10981+::
8078:: +golden-types: a partial report; it does not claim the module checks
10982:: +golden-types: a partial report; it does not claim the module checks
8079::
10983::
8080++ golden-types
10984++ golden-types
@@ -8102,8 +11006,189 @@
8102+$ jbundle (list jsource)
11006+$ jbundle (list jsource)
8103+$ jcache (list [at=path iface=ifile])
11007+$ jcache (list [at=path iface=ifile])
8104+$ jfile-result (each [iface=ifile cache=jcache] @t)
11008+$ jfile-result (each [iface=ifile cache=jcache] @t)
11009+:: Overlap evidence retains the exact source that supplied its spans.
11010+:: Ordinary Jibb imports preserve this evidence through the resolver.
11011++$ jfile-overlap [file=path source=@t name=term cases=upair]
11012++$ jfile-failure [message=@t overlap=(unit jfile-overlap)]
11013++$ jfile-detailed-result (each [iface=ifile cache=jcache] jfile-failure)
8105+$ jimports-result (each [resolved=ijimports cache=jcache] @t)
11014+$ jimports-result (each [resolved=ijimports cache=jcache] @t)
11015+:: Preserve an imported overlap's original file and source across the graph.
11016++$ jimports-detailed-result (each [resolved=ijimports cache=jcache] jfile-failure)
8106::
11017::
11018+:: Written record fields each have their own lexical record scope.
11019++$ written-fields (map term span)
11020+++ duplicate-written-field
11021+ |= [name=term at=span seen=written-fields]
11022+ ^- (unit idiag)
11023+ =/ prior=(unit span) (~(get by seen) name)
11024+ ?~ prior ~
11025+ `["record field `{(trip name)}` is repeated" ~[[u.prior "first field"] [at "repeated field"]]]
11026+++ duplicate-shapes
11027+ |= xs=(list shape)
11028+ ^- (unit idiag)
11029+ ?~ xs ~
11030+ =/ first (duplicate-shape i.xs)
11031+ ?^ first first
11032+ $(xs t.xs)
11033+++ duplicate-fields
11034+ |= [fields=(list field) seen=written-fields]
11035+ ^- (unit idiag)
11036+ ?~ fields ~
11037+ =/ f=field i.fields
11038+ =/ n=(unit term)
11039+ ?- -.f
11040+ %face `name.f
11041+ %pun `name.f
11042+ %bare ~
11043+ ==
11044+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.f seen))
11045+ ?^ dup dup
11046+ =/ inner=(unit idiag)
11047+ ?- -.f
11048+ %face (duplicate-shape shape.f)
11049+ %pun ~
11050+ %bare (duplicate-shape shape.f)
11051+ ==
11052+ ?^ inner inner
11053+ $(fields t.fields, seen ?~(n seen (~(put by seen) u.n at.f)))
11054+++ duplicate-shape
11055+ |= s=shape
11056+ ^- (unit idiag)
11057+ ?- -.s
11058+ %cell (duplicate-fields fields.s ~)
11059+ %apply (duplicate-shapes args.s)
11060+ %union (duplicate-shapes cases.s)
11061+ %fn
11062+ =/ left (duplicate-shape sample.s)
11063+ ?^ left left
11064+ (duplicate-shape product.s)
11065+ %generic (duplicate-shape body.s)
11066+ * ~
11067+ ==
11068+++ duplicate-samples
11069+ |= [items=(list sample) seen=written-fields]
11070+ ^- (unit idiag)
11071+ ?~ items ~
11072+ =/ a=sample i.items
11073+ =/ n=(unit term)
11074+ ?- -.a
11075+ %bind `name.a
11076+ %face `name.a
11077+ %pun `name.a
11078+ * ~
11079+ ==
11080+ =/ dup=(unit idiag) ?~(n ~ (duplicate-written-field u.n at.a seen))
11081+ ?^ dup dup
11082+ =/ inner (duplicate-sample a)
11083+ ?^ inner inner
11084+ $(items t.items, seen ?~(n seen (~(put by seen) u.n at.a)))
11085+++ duplicate-sample
11086+ |= s=sample
11087+ ^- (unit idiag)
11088+ ?- -.s
11089+ %cell (duplicate-samples items.s ~)
11090+ %face (duplicate-shape shape.s)
11091+ %bare (duplicate-shape shape.s)
11092+ * ~
11093+ ==
11094+++ duplicate-exprs
11095+ |= xs=(list expr)
11096+ ^- (unit idiag)
11097+ ?~ xs ~
11098+ =/ first (duplicate-expr i.xs)
11099+ ?^ first first
11100+ $(xs t.xs)
11101+++ duplicate-items
11102+ |= [items=(list item) seen=written-fields]
11103+ ^- (unit idiag)
11104+ ?~ items ~
11105+ =/ a=item i.items
11106+ =/ dup=(unit idiag) ?~(face.a ~ (duplicate-written-field u.face.a at.a seen))
11107+ ?^ dup dup
11108+ =/ inner (duplicate-expr val.a)
11109+ ?^ inner inner
11110+ $(items t.items, seen ?~(face.a seen (~(put by seen) u.face.a at.a)))
11111+++ duplicate-pieces
11112+ |= pieces=(list piece)
11113+ ^- (unit idiag)
11114+ ?~ pieces ~
11115+ =/ first=(unit idiag) ?:(?=(%expr -.i.pieces) (duplicate-expr p.i.pieces) ~)
11116+ ?^ first first
11117+ $(pieces t.pieces)
11118+++ duplicate-qsegs
11119+ |= segs=(list qseg)
11120+ ^- (unit idiag)
11121+ ?~ segs ~
11122+ =/ first=(unit idiag) ?:(?=(%expr -.i.segs) (duplicate-expr p.i.segs) ~)
11123+ ?^ first first
11124+ $(segs t.segs)
11125+++ duplicate-edits
11126+ |= edits=(list edit)
11127+ ^- (unit idiag)
11128+ ?~ edits ~
11129+ =/ first (duplicate-expr val.i.edits)
11130+ ?^ first first
11131+ $(edits t.edits)
11132+++ duplicate-arms
11133+ |= arms=(list arm)
11134+ ^- (unit idiag)
11135+ ?~ arms ~
11136+ =/ first (duplicate-expr val.i.arms)
11137+ ?^ first first
11138+ $(arms t.arms)
11139+++ duplicate-defs
11140+ |= defs=(list def)
11141+ ^- (unit idiag)
11142+ ?~ defs ~
11143+ =/ first=(unit idiag)
11144+ ?- -.i.defs
11145+ %mold (duplicate-shape shape.i.defs)
11146+ %value (duplicate-expr val.i.defs)
11147+ ==
11148+ ?^ first first
11149+ $(defs t.defs)
11150+++ duplicate-expr
11151+ |= e=expr
11152+ ^- (unit idiag)
11153+ ?- -.e
11154+ %str (duplicate-pieces pieces.e)
11155+ %qath (duplicate-qsegs segs.e)
11156+ %change (duplicate-edits edits.e)
11157+ %pair (duplicate-expr val.e)
11158+ %unit (duplicate-expr val.e)
11159+ %group (duplicate-expr inner.e)
11160+ %list (duplicate-exprs items.e)
11161+ %tuple (duplicate-items items.e ~)
11162+ %gate-wide
11163+ =/ first (duplicate-sample sample.e)
11164+ ?^ first first
11165+ (duplicate-expr body.e)
11166+ %gate
11167+ =/ first (duplicate-sample sample.e)
11168+ ?^ first first
11169+ (duplicate-expr body.e)
11170+ %cast
11171+ =/ first (duplicate-shape shape.e)
11172+ ?^ first first
11173+ (duplicate-expr val.e)
11174+ %call
11175+ =/ first (duplicate-expr head.e)
11176+ ?^ first first
11177+ (duplicate-exprs args.e)
11178+ %trace
11179+ =/ first (duplicate-expr val.e)
11180+ ?^ first first
11181+ (duplicate-expr then.e)
11182+ %branch
11183+ =/ first (duplicate-expr subject.e)
11184+ ?^ first first
11185+ (duplicate-arms arms.e)
11186+ %body
11187+ =/ first (duplicate-defs defs.e)
11188+ ?^ first first
11189+ (duplicate-expr final.e)
11190+ * ~
11191+ ==
8107++ import-binding-names
11192++ import-binding-names
8108 |= imports=(list import)
11193 |= imports=(list import)
8109 ^- (list term)
11194 ^- (list term)
@@ -8116,6 +11201,60 @@
8116 ==
11201 ==
8117 [n $(imports t.imports)]
11202 [n $(imports t.imports)]
8118::
11203::
11204+++ reserved-proj-sample
11205+ |= sam=sample
11206+ ^- ?
11207+ ?- -.sam
11208+ %bind =(name.sam %proj)
11209+ %face =(name.sam %proj)
11210+ %pun =(name.sam %proj)
11211+ %cell (lien items.sam reserved-proj-sample)
11212+ * |
11213+ ==
11214+++ reserved-proj-pattern
11215+ |= p=pattern
11216+ ^- ?
11217+ ?- -.p
11218+ %bind =(name.p %proj)
11219+ %cell (lien items.p reserved-proj-pattern)
11220+ * |
11221+ ==
11222+++ reserved-proj-def
11223+ |= d=def
11224+ ^- ?
11225+ ?: =(name.d %proj) &
11226+ ?: ?=(%value -.d) (reserved-proj-expr val.d)
11227+ |
11228+++ reserved-proj-expr
11229+ |= e=expr
11230+ ^- ?
11231+ ?- -.e
11232+ %str (lien pieces.e |=(p=piece ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11233+ %qath (lien segs.e |=(p=qseg ?:(?=(%expr -.p) (reserved-proj-expr p.p) |)))
11234+ %change (lien edits.e |=(p=edit (reserved-proj-expr val.p)))
11235+ %pair $(e val.e)
11236+ %unit $(e val.e)
11237+ %group $(e inner.e)
11238+ %list (lien items.e reserved-proj-expr)
11239+ %tuple (lien items.e |=(i=item (reserved-proj-expr val.i)))
11240+ ?(%gate %gate-wide) |((reserved-proj-sample sample.e) $(e body.e))
11241+ %cast $(e val.e)
11242+ %call |($(e head.e) (lien args.e reserved-proj-expr))
11243+ %trace |($(e val.e) $(e then.e))
11244+ %branch |($(e subject.e) (lien arms.e |=(a=arm |((reserved-proj-pattern pat.a) (reserved-proj-expr val.a)))))
11245+ %body |((lien defs.e reserved-proj-def) $(e final.e))
11246+ * |
11247+ ==
11248+::
11249+++ module-has-reserved-proj
11250+ |= mod=module
11251+ ^- ?
11252+ =/ imported=(list term) (import-binding-names imports.mod)
11253+ =/ vals=(list term) (global-value-names defs.mod)
11254+ =/ molds=imolds (collect-simple-molds defs.mod)
11255+ =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11256+ |((lien (weld imported (weld vals mold-names)) |=(n=term =(n %proj))) (lien defs.mod reserved-proj-def))
11257+::
8119++ module-scope-valid
11258++ module-scope-valid
8120 |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
11259 |= [mod=module prelude-values=(list term) prelude-molds=(list term)]
8121 ^- ?
11260 ^- ?
@@ -8123,6 +11262,7 @@
8123 =/ vals=(list term) (global-value-names defs.mod)
11262 =/ vals=(list term) (global-value-names defs.mod)
8124 =/ molds=imolds (collect-simple-molds defs.mod)
11263 =/ molds=imolds (collect-simple-molds defs.mod)
8125 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11264 =/ mold-names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11265+ ?: (module-has-reserved-proj mod) |
8126 ?. %+ levy imported
11266 ?. %+ levy imported
8127 |= n=term
11267 |= n=term
8128 &((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))))
11268 &((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))))
@@ -8130,6 +11270,59 @@
8130 ?. (levy vals |=(n=term &((unique-value-name n vals) !(lien prelude-values |=(v=term =(n v)))))) |
11270 ?. (levy vals |=(n=term &((unique-value-name n vals) !(lien prelude-values |=(v=term =(n v)))))) |
8131 (levy mold-names |=(n=term &((unique-value-name n mold-names) !(lien prelude-molds |=(m=term =(n m))))))
11271 (levy mold-names |=(n=term &((unique-value-name n mold-names) !(lien prelude-molds |=(m=term =(n m))))))
8132::
11272::
11273+:: In an API file or before main's kind is known, a lone `+$ poke`
11274+:: may be a declaration rather than a mold that shadows the prelude. Do not call
11275+:: that one collision definite, and do not hide unrelated scope errors.
11276+++ pending-declared-poke
11277+ |= [at=path mod=module prelude-values=(list term) prelude-molds=(list term)]
11278+ ^- ?
11279+ ?. (lien prelude-molds |=(n=term =(%poke n))) |
11280+ ?. |(?=([%ui %api @ %jibb ~] at) (lien defs.mod |=(d=def &(?=(%value -.d) =(%main name.d))))) |
11281+ =/ pokes=(list def)
11282+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(%poke name.d))))
11283+ ?~ pokes |
11284+ ?^ t.pokes |
11285+ =/ remaining=(list def)
11286+ (skim defs.mod |=(d=def !&(?=(%mold -.d) =(%poke name.d))))
11287+ (module-scope-valid mod(defs remaining) prelude-values prelude-molds)
11288+::
11289+:: A detailed failure is attached only to the first mold that actually
11290+:: failed in this check, using that module's checked source mold table.
11291++$ imold-failure [message=@t overlap=(unit [name=term cases=upair])]
11292+:: Validate a generic wrapper without an unbounded duplicate-name pass.
11293+++ module-mold-params-valid
11294+ |= [vars=(list @t) seen=(set @t) fuel=@ud]
11295+ ^- ?
11296+ ?~ vars &
11297+ ?: =(0 fuel) |
11298+ ?: (~(has in:..zuse seen) i.vars) |
11299+ $(vars t.vars, seen (~(put in:..zuse seen) i.vars), fuel (dec fuel))
11300+++ module-mold-overlap
11301+ |= [m=[name=term body=shape] molds=imolds]
11302+ ^- (unit upair)
11303+ =/ sh=shape body.m
11304+ =/ valid=?
11305+ ?. ?=(%generic -.sh) &
11306+ ?~ vars.sh |
11307+ (module-mold-params-valid vars.sh *(set @t) 256)
11308+ ?. valid ~
11309+ =? sh ?=(%generic -.sh) body.sh
11310+ ?. ?=(%union -.sh) ~
11311+ (union-source-overlap cases.sh molds 256)
11312+++ module-mold-types-detail
11313+ |= [molds=imolds state=istate]
11314+ ^- (each imold-types imold-failure)
11315+ ?~ molds [%& ~]
11316+ =/ m=[name=term body=shape] i.molds
11317+ =/ t=(unit [template=ischeme state=istate])
11318+ (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11319+ ?~ t
11320+ =/ overlap=(unit upair) (module-mold-overlap m molds.state)
11321+ [%| ['module mold needs unsupported inference' ?~(overlap ~ `[name.m u.overlap])]]
11322+ =. typ.template.u.t (label-direct-union typ.template.u.t body.m name.m state)
11323+ =/ rest=(each imold-types imold-failure) $(molds t.molds)
11324+ ?: ?=(%| -.rest) rest
11325+ [%& [[name.m template.u.t] p.rest]]
8133++ module-mold-types
11326++ module-mold-types
8134 |= [molds=imolds state=istate]
11327 |= [molds=imolds state=istate]
8135 ^- (each imold-types @t)
11328 ^- (each imold-types @t)
@@ -8145,9 +11338,9 @@
8145::
11338::
8146:: Prepare a provisional interface from the trusted vendored source.
11339:: Prepare a provisional interface from the trusted vendored source.
8147:: Every declared name remains reserved, but only molds and values this
11340:: Every declared name remains reserved, but only molds and values this
8148−:: fragment can infer are usable. Unsupported bodies are not validated,
11341+:: fragment can infer are usable. Unsupported bodies are not validated.
8149−:: and imports into the prelude are not supported yet. The fixed origin
11342+:: An optional internal source supplies the prelude's one supported import;
8150−:: gives its named unions the same identity in every importing module.
11343+:: clients cannot import that path directly. Named unions retain their origin.
8151::
11344::
8152:: Recognize only the complete standard prelude list shape. Its recursive
11345:: Recognize only the complete standard prelude list shape. Its recursive
8153:: tail uses the same parameter and the unqualified list name. The reader
11346:: tail uses the same parameter and the unqualified list name. The reader
@@ -8187,6 +11380,20 @@
8187 ?. ?=(%tvar -.i.args.tail) |
11380 ?. ?=(%tvar -.i.args.tail) |
8188 =(var name.i.args.tail)
11381 =(var name.i.args.tail)
8189::
11382::
11383+++ prelude-label
11384+ |= [typ=itype name=term vars=(list @ud)]
11385+ ^- itype
11386+ ?: ?=(%jrec -.typ) typ(label `name)
11387+ ?: ?=(%grec -.typ)
11388+ ?. (identity-union-parameters vars args.typ) typ(label ~)
11389+ typ(label `name)
11390+ ?. ?=(%union -.typ) typ
11391+ ?. (identity-union-parameters vars args.typ)
11392+ ?~ origin.typ typ
11393+ ?: =(at.u.origin.typ /lib/jibb/internal/jibb) typ(label ~)
11394+ typ
11395+ typ(label `name)
11396+::
8190++ partial-prelude-molds
11397++ partial-prelude-molds
8191 |= [molds=imolds state=istate]
11398 |= [molds=imolds state=istate]
8192 ^- imold-types
11399 ^- imold-types
@@ -8199,22 +11406,124 @@
8199 (infer-mold-template body.m state(active [name.m active.state], in-mold &))
11406 (infer-mold-template body.m state(active [name.m active.state], in-mold &))
8200 ?~ out $(molds t.molds)
11407 ?~ out $(molds t.molds)
8201 =. typ.template.u.out (label-direct-union typ.template.u.out body.m name.m state)
11408 =. typ.template.u.out (label-direct-union typ.template.u.out body.m name.m state)
11409+ =. typ.template.u.out (prelude-label typ.template.u.out name.m vars.template.u.out)
8202 [[name.m template.u.out] $(molds t.molds)]
11410 [[name.m template.u.out] $(molds t.molds)]
8203::
11411::
8204−++ partial-prelude-interface
11412+:: A compiler-owned interface available only to the dedicated
8205− |= src=@t
11413+:: internal-prelude preparation path, never the ordinary module resolver.
11414+++ private-primitive-interface
11415+ ^- ifile
11416+ =/ a=itype [%avar 0]
11417+ =/ pair=itype [%cell a a]
11418+ =/ b=itype [%rvar 0]
11419+ =/ plus=ischeme [[%fn [%cell b b] b] ~[0]]
11420+ =/ minus=ischeme [[%fn b b] ~[0]]
11421+ =/ greater=ischeme [[%fn pair [%flag ~]] ~[0]]
11422+ [~[[%raw-add plus] [%raw-dec minus] [%raw-gth greater]] ~ /lib/jibb/primitives/jibb ~ ~ ~ ~ ~]
11423+::
11424+++ infer-private-internal
11425+ |= [src=@t public-source=@t]
11426+ ^- (unit ifile)
11427+ =/ at=path /lib/jibb/internal/jibb
11428+ =/ parsed (parse at src)
11429+ ?: ?=(%| -.parsed) ~
11430+ =/ mod=module p.parsed
11431+ ?^ (duplicate-defs defs.mod) ~
11432+ ?~ imports.mod
11433+ =/ built=jfile-result (infer-jibb-file at src ~ ~ ~ ~[at] ~ ~ ~ ~)
11434+ ?: ?=(%| -.built) ~
11435+ `iface.p.built
11436+ ?. ?=([[%jibb *] ~] imports.mod) ~
11437+ ?. =(path.i.imports.mod /lib/jibb/primitives) ~
11438+ ?. (module-scope-valid mod ~ ~) ~
11439+ =/ vals=(list term) (global-value-names defs.mod)
11440+ ?: (lien vals |=(n=term =(n %main))) ~
11441+ =/ molds=imolds (collect-simple-molds defs.mod)
11442+ =/ globals=(list term) (weld (import-binding-names imports.mod) vals)
11443+ :: The private source can use the public list and unit molds before the
11444+ :: prelude is otherwise prepared. Re-read the trusted public source here
11445+ :: and admit only its validated canonical templates; do not accept schemes
11446+ :: supplied independently by the caller.
11447+ =/ public=(each module error) (parse /lib/jibb/prelude/jibb public-source)
11448+ ?: ?=(%| -.public) ~
11449+ ?^ (duplicate-defs defs.p.public) ~
11450+ ?. (module-scope-valid p.public ~ ~) ~
11451+ =/ source-molds=imolds (collect-simple-molds defs.p.public)
11452+ =/ written-list=(unit shape) (find-simple-mold %list source-molds)
11453+ =/ source-list=(unit ischeme)
11454+ ?~ written-list ~
11455+ ?. (standard-prelude-list u.written-list) ~
11456+ `[[%collection %list ~[[%var 0]]] ~[0]]
11457+ :: Derive the public unit template from its actual source, then compare
11458+ :: the complete nominal template before making it available privately.
11459+ =/ unit-decl=(unit shape) (find-simple-mold %unit source-molds)
11460+ =/ source-unit=(unit ischeme)
11461+ ?~ unit-decl ~
11462+ =/ unit-molds=imolds ~[[%unit u.unit-decl]]
11463+ =/ unit-state=istate [0 ~ ~ ~ unit-molds ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | /lib/jibb/prelude/jibb ~[%unit] ~ ~ 256 ~ ~ ~ ~ ~ ~]
11464+ =/ unit-types=imold-types (partial-prelude-molds unit-molds unit-state)
11465+ =/ unit-iface=ifile [~ unit-types /lib/jibb/prelude/jibb ~ ~ ~ ~ ~]
11466+ =/ found=(unit ischeme) (find-jibb-mold %unit unit-iface)
11467+ ?~ found ~
11468+ ?. (standard-unit-template u.found /lib/jibb/prelude/jibb) ~
11469+ found
11470+ =/ primitive=ifile private-primitive-interface
11471+ =? primitive ?=(^ source-list)
11472+ primitive(molds [[%list u.source-list] molds.primitive])
11473+ =? primitive ?=(^ source-unit)
11474+ primitive(molds [[%unit u.source-unit] molds.primitive])
11475+ =/ js=ijimports ~[[face.i.imports.mod primitive]]
11476+ =/ reserved=(list term) ~[face.i.imports.mod]
11477+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11478+ =/ state=istate [0 ~ ~ ~ molds globals ~ ~ ~ ~ js reserved ~ ~ ~ | at top ~ ~ 256 ~ ~ ~ ~ ~ ~]
11479+ =/ mts=(each imold-types @t) (module-mold-types molds state)
11480+ =/ usable=(unit imold-types)
11481+ ?: ?=(%& -.mts) `p.mts
11482+ :: Missing public templates may make an unrelated internal mold
11483+ :: unavailable. Validate all molds once with isolated canonical
11484+ :: templates before admitting only those inferred using the actual
11485+ :: source-backed templates. The proof interface is never exported.
11486+ ?. |(?=(~ source-list) ?=(~ source-unit)) ~
11487+ =/ nil=itype [%const [%null %n 0 '~']]
11488+ =/ canonical-unit=ischeme
11489+ [[%union ~[nil [%cell nil [%face %u [%var 0]]]] `[/lib/jibb/prelude/jibb %unit] `%unit ~[[%var 0]]] ~[0]]
11490+ =/ canonical-list=ischeme [[%collection %list ~[[%var 0]]] ~[0]]
11491+ =/ proof-primitive=ifile private-primitive-interface
11492+ =. molds.proof-primitive ~[[%list canonical-list] [%unit canonical-unit]]
11493+ =/ proof-imports=ijimports ~[[face.i.imports.mod proof-primitive]]
11494+ =/ proof=(each imold-types @t) (module-mold-types molds state(jimports proof-imports))
11495+ ?: ?=(%| -.proof) ~
11496+ `(partial-prelude-molds molds state)
11497+ ?~ usable ~
11498+ =/ resolution=iresolved (resolve-groups defs.mod molds globals ~ ~ ~ ~ js reserved at ~)
11499+ =/ env=ienv env.resolution
11500+ ?. (module-values-complete defs.mod env) ~
11501+ `[env u.usable at ~ artifacts.resolution ~ `src ~]
11502+::
11503+++ partial-prelude-interface-with-internal
11504+ |= [src=@t internal-source=(unit @t)]
8206 ^- (unit ifile)
11505 ^- (unit ifile)
8207 ?: =(0 src) ~
11506 ?: =(0 src) ~
8208 =/ at=path /lib/jibb/prelude/jibb
11507 =/ at=path /lib/jibb/prelude/jibb
8209 =/ parsed (parse at src)
11508 =/ parsed (parse at src)
8210 ?: ?=(%| -.parsed) ~
11509 ?: ?=(%| -.parsed) ~
8211− ?^ imports.p.parsed ~
11510+ ?: (named-mold-has-hole defs.p.parsed) ~
11511+ ?^ (duplicate-defs defs.p.parsed) ~
11512+ =/ private=(unit ijimports)
11513+ ?~ imports.p.parsed `~
11514+ ?. ?=([[%jibb *] ~] imports.p.parsed) ~
11515+ ?. =(path.i.imports.p.parsed /lib/jibb/internal) ~
11516+ ?~ internal-source ~
11517+ =/ built=(unit ifile) (infer-private-internal u.internal-source src)
11518+ ?~ built ~
11519+ `~[[face.i.imports.p.parsed u.built]]
11520+ ?~ private ~
8212 ?~ defs.p.parsed ~
11521 ?~ defs.p.parsed ~
8213 ?. (module-scope-valid p.parsed ~ ~) ~
11522 ?. (module-scope-valid p.parsed ~ ~) ~
8214 =/ ds=(list def) defs.p.parsed
11523 =/ ds=(list def) defs.p.parsed
8215 =/ molds=imolds (collect-simple-molds ds)
11524 =/ molds=imolds (collect-simple-molds ds)
8216 =/ names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
11525 =/ names=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8217− =/ globals=(list term) (global-value-names ds)
11526+ =/ globals=(list term) (weld (import-binding-names imports.p.parsed) (global-value-names ds))
8218 :: Remove raw list before inferring any template, so an altered list
11527 :: Remove raw list before inferring any template, so an altered list
8219 :: cannot leak through an alias. Its name remains reserved either way.
11528 :: cannot leak through an alias. Its name remains reserved either way.
8220 =/ declared=? (lien names |=(name=term =(%list name)))
11529 =/ declared=? (lien names |=(name=term =(%list name)))
@@ -8222,11 +11531,38 @@
8222 =? env-molds declared
11531 =? env-molds declared
8223 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
11532 (skim molds |=(m=[name=term body=shape] !=(%list name.m)))
8224 =/ reserved=(list term) ?:(declared ~[%list] ~)
11533 =/ reserved=(list term) ?:(declared ~[%list] ~)
8225− =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ ~ reserved ~ ~ ~ | at names ~]
11534+ =/ state=istate [0 ~ ~ ~ env-molds globals ~ ~ ~ ~ u.private reserved ~ ~ ~ | at names ~ ~ 256 ~ ~ ~ ~ ~ ~]
8226− =/ mt=imold-types (partial-prelude-molds molds state)
11535+ :: Other prelude molds may use list only after its source has passed
8227− =/ partial=ifile [~ mt at]
11536+ :: the standard-list check. The raw declaration remains removed.
8228− =/ env=ienv (resolve-supported-defs ds env-molds globals ~ ~ ~ ~ ~ reserved at `partial)
11537+ =/ declared-list=(unit shape) (find-simple-mold %list molds)
8229− `[env mt at]
11538+ =/ mold-prelude=(unit ifile)
11539+ ?~ declared-list ~
11540+ ?. (standard-prelude-list u.declared-list) ~
11541+ `[~ ~[[%list [[%collection %list ~[[%var 0]]] ~[0]]]] at ~ ~ ~ ~ ~]
11542+ =/ mt=imold-types (partial-prelude-molds molds state(prelude mold-prelude))
11543+ =/ partial=ifile [~ mt at ~ ~ ~ ~ ~]
11544+ :: An explicitly qualified re-export must resolve. Other unsupported
11545+ :: prelude declarations remain reserved but absent from the interface.
11546+ =/ required=imolds
11547+ %+ skim molds
11548+ |= m=[name=term body=shape]
11549+ =/ sh=shape body.m
11550+ ?. ?=(%ref -.sh) |
11551+ ?~ names.sh |
11552+ ?=(^ t.names.sh)
11553+ ?. (levy required |=(m=[name=term body=shape] ?=(^ (find-jibb-mold name.m partial)))) ~
11554+ =/ resolution=iresolved (resolve-groups ds env-molds globals ~ ~ ~ ~ u.private reserved at `partial)
11555+ =/ env=ienv env.resolution
11556+ ?. (hole-values-present ds env) ~
11557+ =/ deps=(list iwidth-dependency)
11558+ ?~ u.private ~
11559+ ~[[at.interface.i.u.private source.interface.i.u.private elaborations.interface.i.u.private]]
11560+ `[env mt at ~ artifacts.resolution deps `src ~]
11561+::
11562+++ partial-prelude-interface
11563+ |= src=@t
11564+ ^- (unit ifile)
11565+ (partial-prelude-interface-with-internal src ~)
8230::
11566::
8231+$ iprelude [iface=ifile values=(list term) molds=(list term)]
11567+$ iprelude [iface=ifile values=(list term) molds=(list term)]
8232::
11568::
@@ -8241,6 +11577,17 @@
8241 =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
11577 =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
8242 `[u.iface vals ms]
11578 `[u.iface vals ms]
8243::
11579::
11580+++ prepare-prelude-with-internal
11581+ |= [src=@t internal-source=@t]
11582+ ^- (unit iprelude)
11583+ =/ iface=(unit ifile) (partial-prelude-interface-with-internal src `internal-source)
11584+ ?~ iface ~
11585+ =/ parsed (parse /lib/jibb/prelude/jibb src)
11586+ ?: ?=(%| -.parsed) ~
11587+ =/ vals=(list term) (global-value-names defs.p.parsed)
11588+ =/ ms=(list term) (turn (collect-simple-molds defs.p.parsed) |=(m=[name=term body=shape] name.m))
11589+ `[u.iface vals ms]
11590+::
8244++ module-values-complete
11591++ module-values-complete
8245 |= [ds=(list def) env=ienv]
11592 |= [ds=(list def) env=ienv]
8246 ^- ?
11593 ^- ?
@@ -8261,52 +11608,990 @@
8261 ?: =(at at.i.cache) `iface.i.cache
11608 ?: =(at at.i.cache) `iface.i.cache
8262 $(cache t.cache)
11609 $(cache t.cache)
8263::
11610::
11611+:: These certificates retain the complete checked source closure. The
11612+:: trusted host must supply the identical prepared prelude and reader nouns.
11613+:: Exact bundle equality binds all source paths and versions; the set
11614+:: retains transitive paths for active-cycle checks. Request-bearing graphs
11615+:: alone have a size limit; incompatible diamond evidence fails closed.
11616+++ request-graph-requests-add
11617+ |= [pending=(list irequest-evidence) acc=(list irequest-evidence) fuel=@ud]
11618+ ^- (unit (list irequest-evidence))
11619+ ?~ pending `acc
11620+ ?: =(0 fuel) ~
11621+ =/ hit=(list irequest-evidence)
11622+ (skim acc |=(x=irequest-evidence &(=(api-at.x api-at.i.pending) =(name.x name.i.pending))))
11623+ ?^ hit
11624+ ?. ?=([* ~] hit) ~
11625+ ?. =(i.hit i.pending) ~
11626+ $(pending t.pending, fuel (dec fuel))
11627+ $(pending t.pending, acc [i.pending acc], fuel (dec fuel))
11628+++ request-graph-inputs-match
11629+ |= [g=irequest-graph externals=iexternals marks=imark-externals modules=jbundle values=(list term) molds=(list term) prelude=(unit ifile)]
11630+ ^- ?
11631+ ?& =(bundle-input.g modules)
11632+ =(prelude-input.g prelude)
11633+ =(prelude-values.g values)
11634+ =(prelude-molds.g molds)
11635+ =(externals.g externals)
11636+ =(marks.g marks)
11637+ ==
11638+++ request-graph-merge
11639+ |= [imports=ijimports g=irequest-graph fuel=@ud]
11640+ ^- (unit irequest-graph)
11641+ ?~ imports `g
11642+ ?: =(0 fuel) ~
11643+ =/ child=ifile interface.i.imports
11644+ ?~ graph.child ~
11645+ =/ cg=irequest-graph u.graph.child
11646+ ?. ?& =(bundle-input.g bundle-input.cg)
11647+ =(prelude-input.g prelude-input.cg)
11648+ =(prelude-values.g prelude-values.cg)
11649+ =(prelude-molds.g prelude-molds.cg)
11650+ =(externals.g externals.cg)
11651+ =(marks.g marks.cg)
11652+ ==
11653+ ~
11654+ =/ merged=(set path) (~(uni in:..zuse paths.g) paths.cg)
11655+ =/ rs=(unit (list irequest-evidence))
11656+ (request-graph-requests-add requests.cg requests.g (add 1 (lent requests.cg)))
11657+ ?~ rs ~
11658+ ?: &(?=(^ u.rs) |((gth (lent ~(tap in:..zuse merged)) 256) (gth (lent u.rs) 256))) ~
11659+ $(imports t.imports, g g(paths merged, requests u.rs), fuel (dec fuel))
11660+++ request-graph-reusable
11661+ |= [f=ifile src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) values=(list term) molds=(list term) prelude=(unit ifile)]
11662+ ^- ?
11663+ ?~ source.f |
11664+ ?. =(u.source.f src) |
11665+ ?~ graph.f |
11666+ =/ g=irequest-graph u.graph.f
11667+ ?. (request-graph-inputs-match g externals marks modules values molds prelude) |
11668+ ?. (~(has in:..zuse paths.g) at.f) |
11669+ !(lien active |=(p=path (~(has in:..zuse paths.g) p)))
11670+::
8264++ resolve-jibb-imports
11671++ resolve-jibb-imports
8265 |= [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)]
11672 |= [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)]
8266 ^- jimports-result
11673 ^- jimports-result
11674+ =/ result=jimports-detailed-result
11675+ (resolve-jibb-imports-detailed imports externals mark-externals modules active prelude-values prelude-molds cache prelude)
11676+ ?: ?=(%| -.result) [%| message.p.result]
11677+ [%& p.result]
11678+++ resolve-jibb-imports-detailed
11679+ |= [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)]
11680+ ^- jimports-detailed-result
8267 ?~ imports [%& [~ cache]]
11681 ?~ imports [%& [~ cache]]
8268 ?. ?=(%jibb -.i.imports) $(imports t.imports)
11682 ?. ?=(%jibb -.i.imports) $(imports t.imports)
8269 =/ at=path (weld path.i.imports `path`~[%jibb])
11683 =/ at=path (weld path.i.imports `path`~[%jibb])
11684+ ?: =(at /lib/jibb/internal/jibb)
11685+ [%| ['the prelude internal module is private' ~]]
11686+ ?: =(at /lib/jibb/primitives/jibb)
11687+ [%| ['the prelude primitive interface is private' ~]]
8270 ?: (lien active |=(p=path =(p at)))
11688 ?: (lien active |=(p=path =(p at)))
8271− [%| (crip "import cycle at {(spud at)}")]
11689+ [%| [(crip "import cycle at {(spud at)}") ~]]
8272 =/ found=jbundle (skim modules |=(m=jsource =(at at.m)))
11690 =/ found=jbundle (skim modules |=(m=jsource =(at at.m)))
8273− ?~ found [%| (crip "module source missing: {(spud at)}")]
11691+ ?~ found [%| [(crip "module source missing: {(spud at)}") ~]]
8274− ?^ t.found [%| (crip "duplicate module sources: {(spud at)}")]
11692+ ?^ t.found [%| [(crip "duplicate module sources: {(spud at)}") ~]]
8275 =/ cached=(unit ifile) (find-jibb-cache at cache)
11693 =/ cached=(unit ifile) (find-jibb-cache at cache)
8276− =/ iface=jfile-result
11694+ =/ iface=jfile-detailed-result
8277− ?^ cached [%& [u.cached cache]]
11695+ ?^ cached
8278− (infer-jibb-file at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
11696+ ?. =(at.u.cached at) [%| ['cached module identity needs unsupported inference' ~]]
11697+ ?~ graph.u.cached
11698+ :: A detached legacy interface has unknown evidence. Rebuild it
11699+ :: against the current graph, without retaining any stale entry.
11700+ =/ clean=jcache (skim cache |=(x=[at=path iface=ifile] !=(at.x at)))
11701+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds clean prelude)
11702+ ?. (request-graph-reusable u.cached source.i.found externals mark-externals modules active prelude-values prelude-molds prelude)
11703+ [%| ['cached module evidence needs unsupported inference' ~]]
11704+ [%& [u.cached cache]]
11705+ (infer-jibb-file-detailed at source.i.found externals mark-externals modules [at active] prelude-values prelude-molds cache prelude)
8279 ?: ?=(%| -.iface) [%| p.iface]
11706 ?: ?=(%| -.iface) [%| p.iface]
8280− =/ rest=jimports-result $(imports t.imports, cache cache.p.iface)
11707+ =/ rest=jimports-detailed-result $(imports t.imports, cache cache.p.iface)
8281 ?: ?=(%| -.rest) rest
11708 ?: ?=(%| -.rest) rest
8282 [%& [[[face.i.imports iface.p.iface] resolved.p.rest] cache.p.rest]]
11709 [%& [[[face.i.imports iface.p.iface] resolved.p.rest] cache.p.rest]]
8283::
11710::
11711+:: Provisional declaration extraction only; this does not derive asks,
11712+:: validate imported types, or claim that an API module has checked.
11713++$ iapi-path [at=span name=term segments=(list pseg) full=term diffs=(list term) scry=(unit (list pseg))]
11714+++ api-path-mark
11715+ |= [sh=shape marks=(list term)]
11716+ ^- (unit term)
11717+ ?. ?=(%ref -.sh) ~
11718+ ?. ?=([@ ~] names.sh) ~
11719+ ?. (unique-value-name i.names.sh marks) ~
11720+ `i.names.sh
11721+::
11722+++ api-path-diffs
11723+ |= [shapes=(list shape) marks=(list term) used=(list term)]
11724+ ^- (unit (list term))
11725+ ?~ shapes `~
11726+ =/ n=(unit term) (api-path-mark i.shapes marks)
11727+ ?~ n ~
11728+ ?: (lien used |=(x=term =(x u.n))) ~
11729+ =/ rest=(unit (list term)) $(shapes t.shapes, used [u.n used])
11730+ ?~ rest ~
11731+ `[u.n u.rest]
11732+::
11733+++ api-path-payload
11734+ |= [sh=shape marks=(list term)]
11735+ ^- (unit [full=term diffs=(list term)])
11736+ =/ direct=(unit term) (api-path-mark sh marks)
11737+ ?^ direct `[u.direct ~]
11738+ ?. ?=(%apply -.sh) ~
11739+ ?. =(~[%facts] ref.sh) ~
11740+ ?~ args.sh ~
11741+ ?~ t.args.sh ~
11742+ =/ full=(unit term) (api-path-mark i.args.sh marks)
11743+ ?~ full ~
11744+ =/ diffs=(unit (list term)) (api-path-diffs t.args.sh marks ~[u.full])
11745+ ?~ diffs ~
11746+ `[u.full u.diffs]
11747+::
11748++$ iapi-parameter [name=term aura=@ta at=span]
11749+++ api-path-parameters
11750+ |= [segments=(list pseg) seen=(list term)]
11751+ ^- (unit (list iapi-parameter))
11752+ ?~ segments `~
11753+ ?: ?=(%knot -.i.segments) $(segments t.segments)
11754+ =/ seg=pseg i.segments
11755+ ?. ?=(%typed -.seg) ~
11756+ ?: =(0 aura.seg) ~
11757+ ?: (lien seen |=(n=term =(n name.seg))) ~
11758+ =/ rest=(unit (list iapi-parameter)) $(segments t.segments, seen [name.seg seen])
11759+ ?~ rest ~
11760+ `[[name.seg aura.seg at.seg] u.rest]
11761+::
11762+++ api-scry-parameters-compatible
11763+ |= [scry=(list iapi-parameter) watch=(list iapi-parameter)]
11764+ ^- ?
11765+ ?~ scry &
11766+ ?. (lien watch |=(p=iapi-parameter &(=(name.p name.i.scry) =(aura.p aura.i.scry)))) |
11767+ $(scry t.scry)
11768+::
11769+++ api-path-one
11770+ |= [sh=shape marks=(list term)]
11771+ ^- (unit iapi-path)
11772+ ?. ?=(%cell -.sh) ~
11773+ =/ fs=(list field) fields.sh
11774+ ?~ fs ~
11775+ ?~ t.fs ~
11776+ ?~ t.t.fs ~
11777+ ?: (gth (lent fs) 4) ~
11778+ ?. ?=(%bare -.i.fs) ~
11779+ =/ tag=shape shape.i.fs
11780+ ?. ?=(%const -.tag) ~
11781+ ?. =(%term form.lit.tag) ~
11782+ =/ name=term val.lit.tag
11783+ ?. (jibb-face-name name) ~
11784+ ?. ?=(%bare -.i.t.fs) ~
11785+ =/ path-shape=shape shape.i.t.fs
11786+ ?. ?=(%path -.path-shape) ~
11787+ ?. ?=(%bare -.i.t.t.fs) ~
11788+ =/ payload=(unit [full=term diffs=(list term)]) (api-path-payload shape.i.t.t.fs marks)
11789+ ?~ payload ~
11790+ =/ scry=(unit (unit (list pseg)))
11791+ ?~ t.t.t.fs `~
11792+ =/ entry=field i.t.t.t.fs
11793+ ?. ?=(%face -.entry) ~
11794+ ?. =(%scry name.entry) ~
11795+ ?. ?=(%path -.shape.entry) ~
11796+ ``segs.shape.entry
11797+ ?~ scry ~
11798+ =/ params=(unit (list iapi-parameter)) (api-path-parameters segs.path-shape ~)
11799+ ?~ params ~
11800+ ?^ u.scry
11801+ =/ scry-params=(unit (list iapi-parameter)) (api-path-parameters u.u.scry ~)
11802+ ?~ scry-params ~
11803+ ?. (api-scry-parameters-compatible u.scry-params u.params) ~
11804+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
11805+ `[at.sh name segs.path-shape full.u.payload diffs.u.payload u.scry]
11806+::
11807+++ api-path-many
11808+ |= [shapes=(list shape) marks=(list term) seen=(list term)]
11809+ ^- (unit (list iapi-path))
11810+ ?~ shapes `~
11811+ =/ one=(unit iapi-path) (api-path-one i.shapes marks)
11812+ ?~ one ~
11813+ ?: (lien seen |=(n=term =(n name.u.one))) ~
11814+ =/ rest=(unit (list iapi-path)) $(shapes t.shapes, seen [name.u.one seen])
11815+ ?~ rest ~
11816+ `[u.one u.rest]
11817+::
11818+++ api-path-declaration
11819+ |= [sh=shape marks=(list term)]
11820+ ^- (unit (list iapi-path))
11821+ ?: ?=(%union -.sh) (api-path-many cases.sh marks ~)
11822+ (api-path-many ~[sh] marks ~)
11823+::
11824+:: Derived gates share the value namespace. /% marks name molds; /- and
11825+:: /= also introduce faces that cannot be shadowed by a derived value.
11826+++ api-import-faces
11827+ |= imports=(list import)
11828+ ^- (list term)
11829+ ?~ imports ~
11830+ ?- -.i.imports
11831+ %mark $(imports t.imports)
11832+ %sur [name.i.imports $(imports t.imports)]
11833+ %jibb [face.i.imports $(imports t.imports)]
11834+ ==
11835+::
11836+++ api-derived-names-valid
11837+ |= [paths=(list iapi-path) poke-names=(list term) mod=module prelude-values=(list term)]
11838+ ^- ?
11839+ =/ path-names=(list term) (turn paths |=(p=iapi-path name.p))
11840+ =/ derived=(list term) (weld path-names poke-names)
11841+ ?: (lien derived |=(n=term =(n %proj))) |
11842+ =/ outer=(list term) (weld prelude-values (weld (global-value-names defs.mod) (api-import-faces imports.mod)))
11843+ (levy derived |=(n=term &((unique-value-name n derived) !(lien outer |=(x=term =(n x))))))
11844+::
11845+:: Analysis only. Successful external entries must be unchanged results
11846+:: produced for the declared marks; no request interface is produced.
11847++$ iapi-mark-type [name=term typ=itype]
11848++$ iapi-path-typed [path=iapi-path full=itype diffs=(list iapi-mark-type)]
11849+++ api-diff-types
11850+ |= [names=(list term) externals=imark-externals declared=(list term)]
11851+ ^- (unit (list iapi-mark-type))
11852+ ?~ names `~
11853+ =/ typ=(unit itype) (find-imported-mark i.names externals declared)
11854+ ?~ typ ~
11855+ =/ tail=(unit (list iapi-mark-type)) $(names t.names)
11856+ ?~ tail ~
11857+ `[[i.names u.typ] u.tail]
11858+::
11859+++ api-path-types
11860+ |= [paths=(list iapi-path) externals=imark-externals declared=(list term)]
11861+ ^- (unit (list iapi-path-typed))
11862+ ?~ paths `~
11863+ =/ full=(unit itype) (find-imported-mark full.i.paths externals declared)
11864+ ?~ full ~
11865+ =/ diffs=(unit (list iapi-mark-type)) (api-diff-types diffs.i.paths externals declared)
11866+ ?~ diffs ~
11867+ =/ tail=(unit (list iapi-path-typed)) $(paths t.paths)
11868+ ?~ tail ~
11869+ `[[i.paths u.full u.diffs] u.tail]
11870+::
11871+++ api-poke-mark-names
11872+ |= [pokes=(list def) declared=(list term)]
11873+ ^- (unit (list term))
11874+ ?~ pokes `~
11875+ ?^ t.pokes ~
11876+ =/ d=def i.pokes
11877+ ?. ?=(%mold -.d) ~
11878+ =/ sh=shape shape.d
11879+ ?: ?=(%union -.sh) (api-path-diffs cases.sh declared ~)
11880+ =/ name=(unit term) (api-path-mark sh declared)
11881+ ?~ name ~
11882+ `~[u.name]
11883+::
11884+++ api-path-analysis
11885+ |= [mod=module externals=imark-externals prelude-values=(list term) prelude-molds=(list term)]
11886+ ^- (unit (list iapi-path-typed))
11887+ ?: (lien defs.mod def-has-hole) ~
11888+ ?^ (duplicate-defs defs.mod) ~
11889+ =/ ds=(list def) defs.mod
11890+ =/ declarations=(list def)
11891+ (skim ds |=(d=def &(?=(%mold -.d) =(%paths name.d))))
11892+ ?. ?=([* ~] declarations) ~
11893+ =/ pokes=(list def)
11894+ (skim ds |=(d=def &(?=(%mold -.d) =(%poke name.d))))
11895+ ?: (gth (lent pokes) 1) ~
11896+ =/ ordinary=(list def)
11897+ (skim ds |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
11898+ ?. (module-scope-valid mod(defs ordinary) prelude-values prelude-molds) ~
11899+ =/ declared=(list term) (collect-mark-imports imports.mod)
11900+ =/ poke-names=(unit (list term)) (api-poke-mark-names pokes declared)
11901+ ?~ poke-names ~
11902+ =/ decl=def i.declarations
11903+ ?> ?=(%mold -.decl)
11904+ =/ paths=(unit (list iapi-path)) (api-path-declaration shape.decl declared)
11905+ ?~ paths ~
11906+ ?. (api-derived-names-valid u.paths u.poke-names mod prelude-values) ~
11907+ (api-path-types u.paths externals declared)
11908+::
11909+:: Source/graph entry for path analysis only. The returned paths retain
11910+:: reader-derived mark types and import resolution has checked reachable
11911+:: Jibb dependencies. This is not an API interface or a module check.
11912+++ api-path-analysis-source
11913+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
11914+ ^- (each (list iapi-path-typed) @t)
11915+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path analysis requires /ui/api/<agent>.jibb']
11916+ =/ parsed (parse file src)
11917+ ?: ?=(%| -.parsed) [%| 'API path source does not parse']
11918+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11919+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11920+ ?~ prepared [%| 'API path analysis needs the prepared prelude']
11921+ =/ prelude=(unit ifile) `iface.u.prepared
11922+ =/ deps=jimports-result
11923+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ prelude)
11924+ ?: ?=(%| -.deps) [%| p.deps]
11925+ =/ paths=(unit (list iapi-path-typed))
11926+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11927+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11928+ [%& u.paths]
11929+::
11930+:: Analysis evidence retains the API source, the prepared interface, the
11931+:: caller's reader results and the resolved Jibb dependency cache alongside
11932+:: the typed path declarations. Reader results and prepared interfaces are
11933+:: trusted inputs: this does not verify their underlying Hoon source/version,
11934+:: create requests or check the provenance of arbitrary values.
11935++$ iapi-path-evidence
11936+ [at=path source=@t prepared=iprelude externals=iexternals marks=imark-externals dependencies=jcache paths=(list iapi-path-typed)]
11937+++ api-path-evidence-source
11938+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
11939+ ^- (each iapi-path-evidence @t)
11940+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
11941+ =/ parsed (parse file src)
11942+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
11943+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11944+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11945+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
11946+ =/ public=ifile iface.u.prepared
11947+ =/ deps=jimports-result
11948+ (resolve-jibb-imports imports.p.parsed externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
11949+ ?: ?=(%| -.deps) [%| p.deps]
11950+ =/ paths=(unit (list iapi-path-typed))
11951+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11952+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11953+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
11954+:: Graph-aware variant preserves the caller active stack and cache.
11955+++ api-path-evidence-graph
11956+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
11957+ ^- (each iapi-path-evidence @t)
11958+ ?~ active [%| 'API analysis needs an active graph']
11959+ ?. =(i.active file) [%| 'API analysis active graph does not start at the source']
11960+ ?: (lien t.active |=(p=path =(p file))) [%| 'API analysis active graph contains a cycle']
11961+ ?. ?=([%ui %api @ %jibb ~] file) [%| 'API path evidence requires /ui/api/<agent>.jibb']
11962+ =/ parsed (parse file src)
11963+ ?: ?=(%| -.parsed) [%| 'API path evidence source does not parse']
11964+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
11965+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
11966+ ?~ prepared [%| 'API path evidence needs the prepared prelude']
11967+ =/ public=ifile iface.u.prepared
11968+ =/ deps=jimports-result
11969+ (resolve-jibb-imports imports.p.parsed externals marks modules active values.u.prepared molds.u.prepared cache `public)
11970+ ?: ?=(%| -.deps) [%| p.deps]
11971+ =/ paths=(unit (list iapi-path-typed))
11972+ (api-path-analysis p.parsed marks values.u.prepared molds.u.prepared)
11973+ ?~ paths [%| 'API path declaration needs unsupported analysis']
11974+ [%& [file src u.prepared externals marks cache.p.deps u.paths]]
11975+::
11976+:: This query classifies a unique path declaration only. Missing evidence
11977+:: or a nonunique name is unknown; it proves nothing about an ask value.
11978+:: Like prepared interfaces, the supplied evidence is a trusted host input.
11979+++ api-path-watchability
11980+ |= [evidence=(unit iapi-path-evidence) case-name=term]
11981+ ^- ?(%watchable %not-watchable %unknown)
11982+ ?~ evidence %unknown
11983+ =/ found=(list iapi-path-typed)
11984+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
11985+ ?. ?=([* ~] found) %unknown
11986+ ?~ scry.path.i.found %watchable
11987+ %not-watchable
11988+::
11989+:: These are declaration-derived request components, not a callable gate,
11990+:: an ask value, or proof of a value's provenance. Keep the exact trusted
11991+:: source/reader evidence until a later checked interface and lowerer can
11992+:: attach it to a generated request. No argument ordering is claimed here.
11993++$ iapi-request-parameter [name=term typ=itype at=span]
11994++$ iapi-request-parts
11995+ [evidence=iapi-path-evidence path=iapi-path-typed parameters=(list iapi-request-parameter) reply-sample=itype fold=(unit itype) watchability=?(%watchable %not-watchable)]
11996+++ api-request-parameter-types
11997+ |= params=(list iapi-parameter)
11998+ ^- (unit (list iapi-request-parameter))
11999+ ?~ params `~
12000+ =/ aura=@ta aura.i.params
12001+ ?. |(?=(?(%u %ud %ux %uv %t %ta %tas %p %da %dr) aura) =('tD' aura)) ~
12002+ =/ rest=(unit (list iapi-request-parameter)) $(params t.params)
12003+ ?~ rest ~
12004+ `[[name.i.params [%atom aura] at.i.params] u.rest]
12005+::
12006+:: A single diff's fold consumes the tagged diff and the previous full value.
12007+:: Multiple-diff unions need a checked union representation and remain open.
12008+++ api-request-fold-type
12009+ |= p=iapi-path-typed
12010+ ^- (unit (unit itype))
12011+ ?~ diffs.p `~
12012+ ?^ t.diffs.p ~
12013+ =/ d=iapi-mark-type i.diffs.p
12014+ =/ literal=lit [%term %tas name.d (crip ['%' (trip name.d)])]
12015+ =/ sample=itype [%cell [%cell [%const literal] typ.d] full.p]
12016+ ``[%fn sample full.p]
12017+::
12018+++ api-request-parts
12019+ |= [evidence=(unit iapi-path-evidence) case-name=term]
12020+ ^- (unit iapi-request-parts)
12021+ ?~ evidence ~
12022+ =/ found=(list iapi-path-typed)
12023+ (skim paths.u.evidence |=(p=iapi-path-typed =(name.path.p case-name)))
12024+ ?. ?=([* ~] found) ~
12025+ =/ p=iapi-path-typed i.found
12026+ =/ raw=(unit (list iapi-parameter)) (api-path-parameters segments.path.p ~)
12027+ ?~ raw ~
12028+ =/ params=(unit (list iapi-request-parameter)) (api-request-parameter-types u.raw)
12029+ ?~ params ~
12030+ =/ fold=(unit (unit itype)) (api-request-fold-type p)
12031+ ?~ fold ~
12032+ =/ watch=?(%watchable %not-watchable) ?~(scry.path.p %watchable %not-watchable)
12033+ `[u.evidence p u.params full.p u.fold watch]
12034+::
12035+:: Check ordinary API molds and values plus every declared mark type using
12036+:: the same trusted source, prepared prelude and reader inputs as path
12037+:: evidence. Keep elaborations with those inputs for a later interface.
12038+:: This is partial analysis: an unused /- core is not independently checked,
12039+:: definitions needing derived values remain unsupported, and no complete
12040+:: API, request or constructor is exported or given runtime behavior.
12041++$ iapi-support-evidence
12042+ [paths=iapi-path-evidence values=ienv molds=imold-types marks=(list iapi-mark-type) elaborations=(list iwidth-definition)]
12043+++ api-support-analysis-source
12044+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12045+ ^- (each iapi-support-evidence @t)
12046+ =/ path-result (api-path-evidence-source file src externals marks modules prepared)
12047+ ?: ?=(%| -.path-result) [%| p.path-result]
12048+ =/ evidence=iapi-path-evidence p.path-result
12049+ =/ parsed (parse file src)
12050+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12051+ =/ mod=module p.parsed
12052+ =/ ordinary=(list def)
12053+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12054+ =/ prep=iprelude prepared.evidence
12055+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12056+ =/ vals=(list term) (global-value-names ordinary)
12057+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12058+ =/ declared=(list term) (collect-mark-imports imports.mod)
12059+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12060+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12061+ =/ prelude=(unit ifile) `iface.prep
12062+ =/ deps=jimports-result
12063+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.prep molds.prep dependencies.evidence prelude)
12064+ ?: ?=(%| -.deps) [%| p.deps]
12065+ =/ molds=imolds (collect-simple-molds ordinary)
12066+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12067+ =/ surs=(list term) (collect-sur-imports imports.mod)
12068+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12069+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12070+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12071+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12072+ ?: ?=(%| -.mts) [%| p.mts]
12073+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12074+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12075+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12076+:: Preserve the same graph context through supporting definitions.
12077+++ api-support-analysis-graph
12078+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12079+ ^- (each iapi-support-evidence @t)
12080+ =/ path-result (api-path-evidence-graph file src externals marks modules active cache prepared)
12081+ ?: ?=(%| -.path-result) [%| p.path-result]
12082+ =/ evidence=iapi-path-evidence p.path-result
12083+ =/ parsed (parse file src)
12084+ ?: ?=(%| -.parsed) [%| 'API source does not parse']
12085+ =/ mod=module p.parsed
12086+ =/ ordinary=(list def)
12087+ (skim defs.mod |=(d=def !&(?=(%mold -.d) |(=(%paths name.d) =(%poke name.d)))))
12088+ =/ prep=iprelude prepared.evidence
12089+ ?. (module-scope-valid mod(defs ordinary) values.prep molds.prep) [%| 'API ordinary scope needs unsupported inference']
12090+ =/ vals=(list term) (global-value-names ordinary)
12091+ ?: (lien vals |=(n=term =(n %main))) [%| 'API module kind needs unsupported inference']
12092+ =/ declared=(list term) (collect-mark-imports imports.mod)
12093+ =/ mark-types=(unit (list iapi-mark-type)) (api-diff-types declared marks declared)
12094+ ?~ mark-types [%| 'API declared marks need unsupported inference']
12095+ =/ prelude=(unit ifile) `iface.prep
12096+ =/ deps=jimports-result
12097+ (resolve-jibb-imports imports.mod externals marks modules active values.prep molds.prep dependencies.evidence prelude)
12098+ ?: ?=(%| -.deps) [%| p.deps]
12099+ =/ molds=imolds (collect-simple-molds ordinary)
12100+ =/ globals=(list term) (weld values.prep (weld (import-binding-names imports.mod) vals))
12101+ =/ surs=(list term) (collect-sur-imports imports.mod)
12102+ =/ reserved=(list term) (weld molds.prep (turn resolved.p.deps |=(j=[face=term interface=ifile] face.j)))
12103+ =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12104+ =/ state=istate [0 ~ ~ ~ molds globals externals surs marks declared resolved.p.deps reserved ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12105+ =/ mts=(each imold-types @t) (module-mold-types molds state)
12106+ ?: ?=(%| -.mts) [%| p.mts]
12107+ =/ resolution=iresolved (resolve-groups ordinary molds globals externals surs marks declared resolved.p.deps reserved file prelude)
12108+ ?. (module-values-complete ordinary env.resolution) [%| 'API ordinary definitions need unsupported inference']
12109+ [%& [evidence env.resolution p.mts u.mark-types artifacts.resolution]]
12110+::
12111+:: Type-analysis artifact for one plain request. The resolver may publish
12112+:: its interface only together with trusted source and reader evidence.
12113+:: No lowering or runtime validator exists.
12114+:: Value watchability remains unproved even for a watchable declaration.
12115++$ ione-request-interface
12116+ [support=iapi-support-evidence parts=iapi-request-parts iface=ifile]
12117+++ request-compatible-ask
12118+ |= prelude=iprelude
12119+ ^- (unit ischeme)
12120+ =/ public=ifile iface.prelude
12121+ ?. =(at.public /lib/jibb/prelude/jibb) ~
12122+ =/ ask=(unit ischeme) (find-jibb-mold %ask public)
12123+ ?~ ask ~
12124+ ?. ?=([@ ~] vars.u.ask) ~
12125+ ?. ?=(%union -.typ.u.ask) ~
12126+ ?. =(origin.typ.u.ask `[/lib/jibb/internal/jibb %ask]) ~
12127+ ?. (identity-union-parameters vars.u.ask args.typ.u.ask) ~
12128+ =/ m=@ud i.vars.u.ask
12129+ ?: (itype-var-is-atom m typ.u.ask) ~
12130+ ?. (levy (itype-vars typ.u.ask) |=(n=@ud =(n m))) ~
12131+ ?: (itype-has-tag typ.u.ask) ~
12132+ =/ private=(list iwidth-dependency)
12133+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12134+ ?. ?=([* ~] private) ~
12135+ ?~ source.i.private ~
12136+ =/ path=(unit ischeme) (find-jibb-mold %path public)
12137+ ?~ path ~
12138+ ?^ vars.u.path ~
12139+ =/ path-type=itype [%collection %list ~[[%atom %ta]]]
12140+ ?. =(typ.u.path path-type) ~
12141+ =/ unit-template=(unit ischeme) (find-jibb-mold %unit public)
12142+ ?~ unit-template ~
12143+ ?. (standard-unit-template u.unit-template /lib/jibb/prelude/jibb) ~
12144+ =/ state-unit=(unit itype) (template-apply u.unit-template ~[[%noun ~]])
12145+ ?~ state-unit ~
12146+ =/ path-unit=(unit itype) (template-apply u.unit-template ~[path-type])
12147+ ?~ path-unit ~
12148+ =/ output=itype [%cell [%face %state [%noun ~]] [%face %message [%var m]]]
12149+ =/ agent-input=itype [%cell [%face %mark [%atom %tas]] [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]]
12150+ =/ store-input=itype [%cell [%face %state u.state-unit] [%face %fact [%noun ~]]]
12151+ =/ pure-case=itype [%cell [%const [%term %tas %pure '%pure']] [%face %value [%var m]]]
12152+ =/ agent-case=itype
12153+ [%cell [%const [%term %tas %agent '%agent']] [%cell [%face %api [%atom %t]] [%cell [%face %case [%atom %tas]] [%cell [%face %agent [%atom %tas]] [%cell [%face %path path-type] [%cell [%face %scry u.path-unit] [%face %receive [%fn agent-input output]]]]]]]]
12154+ =/ store-case=itype
12155+ [%cell [%const [%term %tas %store '%store']] [%cell [%face %module [%atom %t]] [%cell [%face %name [%atom %tas]] [%face %receive [%fn store-input output]]]]]
12156+ ?. =(cases.typ.u.ask ~[pure-case agent-case store-case]) ~
12157+ ask
12158+::
12159+:: The first supported standalone API has exactly one mark import and one
12160+:: plain path declaration, with no other definitions or imports. No partial
12161+:: success is published when source, schema, or a required mold is unknown.
12162+++ one-request-interface-source
12163+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude)]
12164+ ^- (each ione-request-interface @t)
12165+ =/ out (api-support-analysis-source file src externals marks modules prepared)
12166+ ?: ?=(%| -.out) [%| p.out]
12167+ =/ support=iapi-support-evidence p.out
12168+ =/ ev=iapi-path-evidence paths.support
12169+ =/ parsed (parse file src)
12170+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12171+ =/ mod=module p.parsed
12172+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12173+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12174+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12175+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12176+ =/ p=iapi-path-typed i.paths.ev
12177+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12178+ ?~ parts [%| 'request components need unsupported inference']
12179+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12180+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12181+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12182+ =/ valid-marks=?
12183+ ?~ fold.u.parts ?=([* ~] marks.support)
12184+ ?=([* [* ~]] marks.support)
12185+ ?. valid-marks [%| 'request marks need unsupported inference']
12186+ =/ fold-open=?
12187+ ?~ fold.u.parts |
12188+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12189+ ?: fold-open [%| 'request fold needs unsupported inference']
12190+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12191+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12192+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12193+ ?~ ask [%| 'request ask needs unsupported inference']
12194+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12195+ ?~ result [%| 'request ask needs unsupported inference']
12196+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12197+ =/ sample=itype
12198+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12199+ ?~ parameters.u.parts callback
12200+ [%cell typ.i.parameters.u.parts callback]
12201+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12202+ =/ exports=imold-types
12203+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12204+ =/ prelude=iprelude prepared.ev
12205+ =/ public=ifile iface.prelude
12206+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12207+ =/ private=(list iwidth-dependency)
12208+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12209+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12210+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12211+ =/ req=irequest-evidence
12212+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12213+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] modules `public values.prelude molds.prelude externals marks]]
12214+ [%& [support u.parts interface]]
12215+:: Graph-aware request artifact; resolver use remains type-only.
12216+++ one-request-interface-graph
12217+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12218+ ^- (each ione-request-interface @t)
12219+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12220+ ?: ?=(%| -.out) [%| p.out]
12221+ =/ support=iapi-support-evidence p.out
12222+ =/ ev=iapi-path-evidence paths.support
12223+ =/ parsed (parse file src)
12224+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12225+ =/ mod=module p.parsed
12226+ ?. ?=(?([[%mark *] ~] [[%mark *] [%mark *] ~]) imports.mod) [%| 'request imports need unsupported inference']
12227+ ?. ?=([[%mold *] ~] defs.mod) [%| 'request definitions need unsupported inference']
12228+ ?. =(%paths name.i.defs.mod) [%| 'request declaration needs unsupported inference']
12229+ ?. ?=([* ~] paths.ev) [%| 'request count needs unsupported inference']
12230+ =/ p=iapi-path-typed i.paths.ev
12231+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12232+ ?~ parts [%| 'request components need unsupported inference']
12233+ ?. ?=(?(~ [* ~]) parameters.u.parts) [%| 'request parameters need unsupported inference']
12234+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) [%| 'request parameter and fold need unsupported inference']
12235+ ?^ scry.path.p [%| 'request scry needs unsupported inference']
12236+ =/ valid-marks=?
12237+ ?~ fold.u.parts ?=([* ~] marks.support)
12238+ ?=([* [* ~]] marks.support)
12239+ ?. valid-marks [%| 'request marks need unsupported inference']
12240+ =/ fold-open=?
12241+ ?~ fold.u.parts |
12242+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12243+ ?: fold-open [%| 'request fold needs unsupported inference']
12244+ ?^ (itype-vars reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12245+ ?: (itype-has-tag reply-sample.u.parts) [%| 'request payload needs unsupported inference']
12246+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12247+ ?~ ask [%| 'request ask needs unsupported inference']
12248+ =/ result=(unit itype) (template-apply u.ask ~[[%var 0]])
12249+ ?~ result [%| 'request ask needs unsupported inference']
12250+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12251+ =/ sample=itype
12252+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12253+ ?~ parameters.u.parts callback
12254+ [%cell typ.i.parameters.u.parts callback]
12255+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12256+ =/ exports=imold-types
12257+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12258+ =/ prelude=iprelude prepared.ev
12259+ =/ public=ifile iface.prelude
12260+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12261+ =/ private=(list iwidth-dependency)
12262+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12263+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12264+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12265+ =/ req=irequest-evidence
12266+ [file name.path.p p src u.source.public u.source.i.private values.prelude molds.prelude externals marks]
12267+ =/ interface=ifile [~[[name.path.p scheme]] exports file ~ ~ ~ `src `[(silt `(list path)`~[file]) ~[req] modules `public values.prelude molds.prelude externals marks]]
12268+ [%& [support u.parts interface]]
12269+::
12270+++ api-mark-exports
12271+ |= [marks=(list term) all=(list term) externals=imark-externals]
12272+ ^- imold-types
12273+ ?~ marks ~
12274+ =/ t=(unit itype) (find-imported-mark i.marks externals all)
12275+ ?~ t $(marks t.marks)
12276+ [[i.marks [u.t ~]] $(marks t.marks)]
12277+::
12278+:: Experimental direct poke-only API. Unsupported API declarations fail
12279+:: as a whole; supplied mark reader results retain their existing boundary.
12280+++ api-poke-interface
12281+ |= [at=path mod=module mark-externals=imark-externals prelude-values=(list term) prelude-molds=(list term) prelude=(unit ifile)]
12282+ ^- (unit ifile)
12283+ ?: (lien defs.mod def-has-hole) ~
12284+ ?. ?=([%ui %api @ %jibb ~] at) ~
12285+ ?^ (duplicate-defs defs.mod) ~
12286+ ?~ prelude ~
12287+ ?. =(at.u.prelude /lib/jibb/prelude/jibb) ~
12288+ =/ poke=(unit ischeme) (find-jibb-mold %poke u.prelude)
12289+ ?~ poke ~
12290+ ?. ?=(%union -.typ.u.poke) ~
12291+ ?^ vars.u.poke ~
12292+ =/ compatible=?
12293+ %+ lien cases.typ.u.poke
12294+ |= c=itype
12295+ ?=([%cell [%const [%term %tas %agent *]] [%cell [%face %agent [%atom %tas]] [%cell [%face %mark [%atom %tas]] [%face %payload [%noun ~]]]]] c)
12296+ ?. compatible ~
12297+ ?. (module-scope-valid mod(defs ~) prelude-values prelude-molds) ~
12298+ ?. (levy imports.mod |=(i=import ?=(%mark -.i))) ~
12299+ =/ marks=(list term) (collect-mark-imports imports.mod)
12300+ ?. ?=([@ ~] marks) ~
12301+ =/ ds=(list def) defs.mod
12302+ ?. ?=([[%mold *] ~] ds) ~
12303+ ?. =(%poke name.i.ds) ~
12304+ =/ sh=shape shape.i.ds
12305+ ?. ?=([%ref *] sh) ~
12306+ ?. ?=([@ ~] names.sh) ~
12307+ =/ n=term i.names.sh
12308+ ?. (unique-value-name n marks) ~
12309+ ?: |((lien prelude-values |=(x=term =(n x))) (lien prelude-molds |=(x=term =(n x)))) ~
12310+ =/ mark=(unit itype) (find-imported-mark n mark-externals marks)
12311+ ?~ mark ~
12312+ =/ sc=ischeme [[%fn u.mark typ.u.poke] ~]
12313+ `[~[[n sc]] (api-mark-exports marks marks mark-externals) at ~[[n i.t.t.at n]] ~ ~ ~ ~]
12314+::
12315+:: Source-proven ordinary helpers validate each selected /sur dependency.
12316+:: Unused or less direct cores remain unsupported by this first interface.
12317+++ api-sur-covered
12318+ |= [surs=(list term) defs=(list def) externals=iexternals all=(list term)]
12319+ ^- ?
12320+ ?~ surs &
12321+ =/ found=(list def)
12322+ %+ skim defs
12323+ |= d=def
12324+ ?. ?=(%mold -.d) |
12325+ ?. ?=(%ref -.shape.d) |
12326+ ?. ?=([@ [@ ~]] names.shape.d) |
12327+ =(i.t.names.shape.d i.surs)
12328+ ?~ found |
12329+ =/ selected=def i.found
12330+ ?. ?=(%mold -.selected) |
12331+ =/ sh=shape shape.selected
12332+ ?. ?=(%ref -.sh) |
12333+ ?. ?=([@ [@ ~]] names.sh) |
12334+ =/ checked=(unit itype) (find-imported-mold i.surs i.names.sh externals all)
12335+ ?~ checked |
12336+ $(surs t.surs)
12337+::
12338++$ imulti-request-gates [values=ienv requests=(list irequest-evidence)]
12339+++ api-request-gates
12340+ |= [paths=(list iapi-path-typed) ev=iapi-path-evidence ask=ischeme file=path src=@t public=@t internal=@t externals=iexternals marks=imark-externals fuel=@ud]
12341+ ^- (unit imulti-request-gates)
12342+ ?~ paths `[~ ~]
12343+ ?: =(0 fuel) ~
12344+ =/ p=iapi-path-typed i.paths
12345+ =/ parts=(unit iapi-request-parts) (api-request-parts `ev name.path.p)
12346+ ?~ parts ~
12347+ ?. ?=(?(~ [* ~]) parameters.u.parts) ~
12348+ ?: &(?=(^ fold.u.parts) ?=(^ parameters.u.parts)) ~
12349+ ?^ scry.path.p ~
12350+ ?^ (itype-vars reply-sample.u.parts) ~
12351+ ?: (itype-has-tag reply-sample.u.parts) ~
12352+ =/ open-fold=?
12353+ ?~ fold.u.parts |
12354+ |(?=(^ (itype-vars u.fold.u.parts)) (itype-has-tag u.fold.u.parts))
12355+ ?: open-fold ~
12356+ =/ result=(unit itype) (template-apply ask ~[[%var 0]])
12357+ ?~ result ~
12358+ =/ callback=itype [%fn reply-sample.u.parts [%var 0]]
12359+ =/ sample=itype
12360+ ?^ fold.u.parts [%cell callback u.fold.u.parts]
12361+ ?~ parameters.u.parts callback
12362+ [%cell typ.i.parameters.u.parts callback]
12363+ =/ scheme=ischeme [[%fn sample u.result] ~[0]]
12364+ =/ prep=iprelude prepared.ev
12365+ =/ req=irequest-evidence
12366+ [file name.path.p p src public internal values.prep molds.prep externals marks]
12367+ =/ rest=(unit imulti-request-gates)
12368+ $(paths t.paths, fuel (dec fuel))
12369+ ?~ rest ~
12370+ `[[[name.path.p scheme] values.u.rest] [req requests.u.rest]]
12371+::
12372+++ api-poke-from-checked
12373+ |= [file=path mod=module marks=imark-externals values=(list term) molds=(list term) prelude=(unit ifile)]
12374+ ^- (unit [values=ienv derived=(list iderived)])
12375+ =/ pokes=(list def)
12376+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(%poke name.d))))
12377+ ?~ pokes `[~ ~]
12378+ ?. ?=([* ~] pokes) ~
12379+ =/ declared=(list term) (collect-mark-imports imports.mod)
12380+ =/ ns=(unit (list term)) (api-poke-mark-names pokes declared)
12381+ ?~ ns ~
12382+ ?. ?=([@ ~] u.ns) ~
12383+ =/ matching=(list import)
12384+ %+ skim imports.mod
12385+ |= i=import
12386+ ?. ?=(%mark -.i) |
12387+ =(mark.i i.u.ns)
12388+ ?. ?=([* ~] matching) ~
12389+ =/ checked=(unit ifile)
12390+ (api-poke-interface file mod(defs pokes, imports matching) marks values molds prelude)
12391+ ?~ checked ~
12392+ `[values.u.checked derived.u.checked]
12393+::
12394+:: The partial interface is published atomically: all paths, ordinary
12395+:: source definitions, declared marks and the poke must check. Unselected
12396+:: /sur bindings, runtime validation and value watchability remain unproved.
12397+++ multi-request-interface-graph
12398+ |= [file=path src=@t externals=iexternals marks=imark-externals modules=jbundle active=(list path) cache=jcache prepared=(unit iprelude)]
12399+ ^- (each [iface=ifile cache=jcache] @t)
12400+ =/ out (api-support-analysis-graph file src externals marks modules active cache prepared)
12401+ ?: ?=(%| -.out) [%| p.out]
12402+ =/ support=iapi-support-evidence p.out
12403+ =/ ev=iapi-path-evidence paths.support
12404+ =/ parsed (parse file src)
12405+ ?: ?=(%| -.parsed) [%| 'request source does not parse']
12406+ =/ mod=module p.parsed
12407+ ?. (levy imports.mod |=(i=import ?=(?(%mark %sur) -.i)))
12408+ [%| 'request imports need unsupported inference']
12409+ =/ surs=(list term) (collect-sur-imports imports.mod)
12410+ ?. (api-sur-covered surs defs.mod externals surs)
12411+ [%| 'API source dependency needs unsupported inference']
12412+ ?~ paths.ev [%| 'request count needs unsupported inference']
12413+ =/ ask=(unit ischeme) (request-compatible-ask prepared.ev)
12414+ ?~ ask [%| 'request ask needs unsupported inference']
12415+ =/ prep=iprelude prepared.ev
12416+ =/ public=ifile iface.prep
12417+ ?~ source.public [%| 'request prelude source needs unsupported inference']
12418+ =/ private=(list iwidth-dependency)
12419+ (skim dependencies.public |=(d=iwidth-dependency =(at.d /lib/jibb/internal/jibb)))
12420+ ?. ?=([* ~] private) [%| 'request internal source needs unsupported inference']
12421+ ?~ source.i.private [%| 'request internal source needs unsupported inference']
12422+ =/ gates=(unit imulti-request-gates)
12423+ (api-request-gates paths.ev ev u.ask file src u.source.public u.source.i.private externals marks 256)
12424+ ?~ gates [%| 'request paths need unsupported inference']
12425+ =/ poke=(unit [values=ienv derived=(list iderived)])
12426+ (api-poke-from-checked file mod marks values.prep molds.prep `public)
12427+ ?~ poke [%| 'API poke needs unsupported inference']
12428+ =/ mark-molds=imold-types
12429+ (turn marks.support |=(m=iapi-mark-type [name.m [typ.m ~]]))
12430+ =/ exports=imold-types (weld mark-molds molds.support)
12431+ =/ names=(list term) (turn exports |=(m=[name=term template=ischeme] name.m))
12432+ ?. (levy names |=(n=term (unique-value-name n names)))
12433+ [%| 'API exported molds need unsupported inference']
12434+ =/ env=ienv (weld values.u.gates (weld values.u.poke values.support))
12435+ =/ graph=irequest-graph
12436+ [(silt `(list path)`~[file]) requests.u.gates modules `public values.prep molds.prep externals marks]
12437+ =/ iface=ifile
12438+ [env exports file derived.u.poke elaborations.support ~ `src `graph]
12439+ [%& [iface dependencies.ev]]
12440+::
8284++ infer-jibb-file
12441++ infer-jibb-file
8285 |= [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)]
12442 |= [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)]
8286 ^- jfile-result
12443 ^- jfile-result
8287− ?: ?=([%ui %api *] at) [%| (crip "API module needs unsupported inference: {(spud at)}")]
12444+ =/ out=jfile-detailed-result
12445+ (infer-jibb-file-detailed at src externals mark-externals modules active prelude-values prelude-molds cache prelude)
12446+ ?: ?=(%| -.out) [%| message.p.out]
12447+ [%& p.out]
12448+:: Returns structured root-source overlap evidence after the same full check.
12449+++ infer-jibb-file-detailed
12450+ |= [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)]
12451+ ^- jfile-detailed-result
8288 =/ parsed (parse at src)
12452 =/ parsed (parse at src)
8289− ?: ?=(%| -.parsed) [%| (crip "module source does not parse: {(spud at)}")]
12453+ ?: ?=(%| -.parsed) [%| [(crip "module source does not parse: {(spud at)}") ~]]
8290 =/ mod=module p.parsed
12454 =/ mod=module p.parsed
8291− ?. (module-scope-valid mod prelude-values prelude-molds) [%| (crip "module has conflicting names: {(spud at)}")]
12455+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
12456+ ?^ duplicate [%| [(show-duplicate-fields at src u.duplicate) ~]]
12457+ ?: ?=([%ui %api *] at)
12458+ =/ iface=(unit ifile) (api-poke-interface at mod mark-externals prelude-values prelude-molds prelude)
12459+ ?^ iface
12460+ =/ checked=ifile u.iface(source `src, graph `[(silt `(list path)`~[at]) ~ modules prelude prelude-values prelude-molds externals mark-externals])
12461+ [%& [checked [[at checked] cache]]]
12462+ ?~ prelude [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12463+ =/ prepared=iprelude [u.prelude prelude-values prelude-molds]
12464+ =/ narrow=?
12465+ ?. ?=([[%mark *] ~] imports.mod) |
12466+ ?. ?=([[%mold *] ~] defs.mod) |
12467+ ?. =(%paths name.i.defs.mod) |
12468+ !?=(%union -.shape.i.defs.mod)
12469+ ?: narrow
12470+ =/ request=(each ione-request-interface @t)
12471+ (one-request-interface-graph at src externals mark-externals modules active cache `prepared)
12472+ ?: ?=(%| -.request) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12473+ =/ checked=ifile iface.p.request
12474+ [%& [checked [[at checked] dependencies.paths.support.p.request]]]
12475+ =/ multi=(each [iface=ifile cache=jcache] @t)
12476+ (multi-request-interface-graph at src externals mark-externals modules active cache `prepared)
12477+ ?: ?=(%| -.multi) [%| [(crip "API module needs unsupported inference: {(spud at)}") ~]]
12478+ [%& [iface.p.multi [[at iface.p.multi] cache.p.multi]]]
12479+ ?. (module-scope-valid mod prelude-values prelude-molds)
12480+ ?: (pending-declared-poke at mod prelude-values prelude-molds)
12481+ [%| [(crip "module kind or scope needs unsupported inference: {(spud at)}") ~]]
12482+ [%| [(crip "module has conflicting names: {(spud at)}") ~]]
8292 =/ vals=(list term) (global-value-names defs.mod)
12483 =/ vals=(list term) (global-value-names defs.mod)
8293 ?: (lien vals |=(n=term =(n %main)))
12484 ?: (lien vals |=(n=term =(n %main)))
8294− [%| (crip "module kind needs unsupported inference: {(spud at)}")]
12485+ [%| [(crip "module kind needs unsupported inference: {(spud at)}") ~]]
8295− =/ js=jimports-result (resolve-jibb-imports imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
12486+ =/ js=jimports-detailed-result (resolve-jibb-imports-detailed imports.mod externals mark-externals modules active prelude-values prelude-molds cache prelude)
8296 ?: ?=(%| -.js) [%| p.js]
12487 ?: ?=(%| -.js) [%| p.js]
8297− =/ molds=imolds (collect-simple-molds defs.mod)
12488+ =/ collected=grec-collected
12489+ ?^ imports.mod [(collect-simple-molds defs.mod) *(map term shape)]
12490+ (grec-collect-molds defs.mod)
12491+ =/ molds=imolds molds.collected
8298 =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
12492 =/ globals=(list term) (weld prelude-values (weld (import-binding-names imports.mod) vals))
8299 =/ surs=(list term) (collect-sur-imports imports.mod)
12493 =/ surs=(list term) (collect-sur-imports imports.mod)
8300 =/ marks=(list term) (collect-mark-imports imports.mod)
12494 =/ marks=(list term) (collect-mark-imports imports.mod)
8301 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
12495 =/ reserved=(list term) (weld prelude-molds (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
8302 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12496 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8303− =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude]
12497+ =/ state=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks resolved.p.js reserved ~ ~ ~ | at top prelude ~ 256 ~ ~ ~ ~ ~ ~]
8304− =/ mts=(each imold-types @t) (module-mold-types molds state)
12498+ :: Source and scope were checked above; preserve that exact root and prelude.
8305− ?: ?=(%| -.mts) [%| (crip "{(trip p.mts)}: {(spud at)}")]
12499+ :: This first integration only indexes import-free library sources.
8306− =/ env=ienv (resolve-supported-defs defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
12500+ =/ index=(unit [at=path source=@t prelude=ifile shapes=(map term shape)])
12501+ ?^ imports.mod ~
12502+ ?~ prelude ~
12503+ =/ standard=(unit ischeme) (find-jibb-mold %list u.prelude)
12504+ ?~ standard ~
12505+ ?. =(u.standard [[%collection %list ~[[%var 0]]] ~[0]]) ~
12506+ =/ index=(map term shape) proofs.collected
12507+ ?. !=(index *(map term shape)) ~
12508+ ?: (lien molds |=(m=[name=term body=shape] =(%list name.m))) ~
12509+ `[at src u.prelude index]
12510+ =. grec-index.state index
12511+ =/ mts=(each imold-types imold-failure) (module-mold-types-detail molds state)
12512+ ?: ?=(%| -.mts)
12513+ ?~ overlap.p.mts [%| [(crip "{(trip message.p.mts)}: {(spud at)}") ~]]
12514+ =/ witness=[name=term cases=upair] u.overlap.p.mts
12515+ =/ first=@t (show-error src [at line.beg.first.cases.witness col.beg.first.cases.witness "first union case"])
12516+ =/ second=@t (show-error src [at line.beg.second.cases.witness col.beg.second.cases.witness "overlapping case"])
12517+ =/ msg=@t (of-wain:format ~[(crip "module mold {(trip name.witness)} has overlapping cases") first second])
12518+ [%| [msg `[at src name.witness cases.witness]]]
12519+ =/ resolution=iresolved
12520+ ?~ index
12521+ (resolve-groups defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude)
12522+ (resolve-groups-core defs.mod molds globals externals surs mark-externals marks resolved.p.js reserved at prelude index)
12523+ =/ env=ienv env.resolution
12524+ =. env
12525+ ?: (module-values-complete defs.mod env) env
12526+ ?: |(?=([%ui %stores *] at) ?=(^ imports.mod) ?=(^ prelude) ?=(^ prelude-values) ?=(^ prelude-molds)) env
12527+ ?: (gth (met 3 src) 65.536) env
12528+ ?: (gth (lent defs.mod) 64) env
12529+ ?. (dg-source-candidate defs.mod 64) env
12530+ =/ transaction=(unit dgcommit) (dg-root-source at src)
12531+ ?~ transaction env
12532+ ?: (dg-interface-safe env.u.transaction) env.u.transaction
12533+ env
8307 ?. (module-values-complete defs.mod env)
12534 ?. (module-values-complete defs.mod env)
8308− [%| (crip "module definitions need unsupported inference: {(spud at)}")]
12535+ [%| [(crip "module definitions need unsupported inference: {(spud at)}") ~]]
8309− [%& [[env p.mts at] [[at [env p.mts at]] cache.p.js]]]
12536+ =/ initial=irequest-graph [(silt `(list path)`~[at]) ~ modules prelude prelude-values prelude-molds externals mark-externals]
12537+ =/ graph=(unit irequest-graph) (request-graph-merge resolved.p.js initial (add 1 (lent resolved.p.js)))
12538+ ?~ graph [%| ['module request evidence needs unsupported inference' ~]]
12539+ =/ iface=ifile [env p.mts at ~ artifacts.resolution ~ `src graph]
12540+ [%& [iface [[at iface] cache.p.js]]]
12541+::
12542+:: A source-bound analysis of one named mold, not a module, island,
12543+:: request, watchability or runtime check. The host owns the trusted
12544+:: prepared prelude, canonical paths and reader/source version identities.
12545+:: The 256-node cap covers only classification, not source/graph work.
12546++$ igate-free-mold
12547+ [at=path source=@t name=term prepared=iprelude externals=iexternals marks=imark-externals modules=jbundle dependencies=jcache mold=ischeme requested=@ud budget=@ud result=igate-free]
12548+++ gate-free-mold-source
12549+ |= [file=path src=@t name=term externals=iexternals marks=imark-externals modules=jbundle prepared=(unit iprelude) fuel=@ud]
12550+ ^- (each igate-free-mold @t)
12551+ ?~ file [%| 'mold analysis needs a path ending in jibb']
12552+ ?. =(%jibb (rear file)) [%| 'mold analysis needs a path ending in jibb']
12553+ ?: |(=(file /lib/jibb/internal/jibb) =(file /lib/jibb/primitives/jibb))
12554+ [%| 'the prelude internal modules are private']
12555+ ?: ?=([%ui %api *] file) [%| 'API declarations need unsupported mold analysis']
12556+ ?: ?=([%ui %stores *] file) [%| 'store declarations need unsupported mold analysis']
12557+ =/ entries=jbundle (skim modules |=(m=jsource =(file at.m)))
12558+ ?: (gth (lent entries) 1) [%| 'duplicate root module sources']
12559+ =/ wrong-root=? ?~(entries | !=(source.i.entries src))
12560+ ?: wrong-root [%| 'root module source does not match bundle']
12561+ =/ parsed (parse file src)
12562+ ?: ?=(%| -.parsed) [%| 'mold source does not parse']
12563+ =/ mod=module p.parsed
12564+ =/ duplicate=(unit idiag) (duplicate-defs defs.mod)
12565+ ?^ duplicate [%| (show-duplicate-fields file src u.duplicate)]
12566+ ?~ prepared [%| 'mold analysis needs the prepared prelude']
12567+ ?. (module-scope-valid mod values.u.prepared molds.u.prepared)
12568+ [%| 'mold source has conflicting or unsupported scope']
12569+ =/ selected=(list def)
12570+ (skim defs.mod |=(d=def &(?=(%mold -.d) =(name.d name))))
12571+ ?~ selected [%| 'selected mold is not declared']
12572+ ?^ t.selected [%| 'selected mold is not unique']
12573+ ?> ?=(%mold -.i.selected)
12574+ =/ public=ifile iface.u.prepared
12575+ =/ js=jimports-result
12576+ (resolve-jibb-imports imports.mod externals marks modules ~[file] values.u.prepared molds.u.prepared ~ `public)
12577+ ?: ?=(%| -.js) [%| p.js]
12578+ =/ ms=imolds (collect-simple-molds defs.mod)
12579+ =/ vals=(list term) (global-value-names defs.mod)
12580+ =/ globals=(list term) (weld values.u.prepared (weld (import-binding-names imports.mod) vals))
12581+ =/ surs=(list term) (collect-sur-imports imports.mod)
12582+ =/ declared=(list term) (collect-mark-imports imports.mod)
12583+ =/ reserved=(list term) (weld molds.u.prepared (turn resolved.p.js |=(j=[face=term interface=ifile] face.j)))
12584+ =/ top=(list term) (turn ms |=(m=[name=term body=shape] name.m))
12585+ =/ state=istate [0 ~ ~ ~ ms globals externals surs marks declared resolved.p.js reserved ~ ~ ~ | file top `public ~ 256 ~ ~ ~ ~ ~ ~]
12586+ =/ inferred=(unit [template=ischeme state=istate])
12587+ (infer-mold-template shape.i.selected state(active ~[name], in-mold &))
12588+ ?~ inferred [%| 'selected mold needs unsupported inference']
12589+ =/ template=ischeme template.u.inferred
12590+ =. typ.template (label-direct-union typ.template shape.i.selected name state)
12591+ =. typ.template (itype-normalize typ.template sub.state.u.inferred)
12592+ =/ cap=@ud (min fuel 256)
12593+ =/ analysis=igate-free (gate-free-type typ.template cap ~)
12594+ [%& [file src name u.prepared externals marks modules cache.p.js template fuel cap analysis]]
8310::
12595::
8311:: +golden-types-with-modules fails closed for imports without prelude
12596:: +golden-types-with-modules fails closed for imports without prelude
8312:: scope. +golden-types-with-prelude resolves supported library graphs;
12597:: scope. +golden-types-with-prelude resolves supported library graphs;
@@ -8317,6 +12602,8 @@
8317 ^- @t
12602 ^- @t
8318 =/ parsed (parse file src)
12603 =/ parsed (parse file src)
8319 ?: ?=(%| -.parsed) (show-error src p.parsed)
12604 ?: ?=(%| -.parsed) (show-error src p.parsed)
12605+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12606+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
8320 ?: (lien imports.p.parsed |=(i=import ?=(%jibb -.i)))
12607 ?: (lien imports.p.parsed |=(i=import ?=(%jibb -.i)))
8321 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
12608 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
8322 (golden-types-with-marks file src externals mark-externals)
12609 (golden-types-with-marks file src externals mark-externals)
@@ -8331,6 +12618,8 @@
8331 ^- @t
12618 ^- @t
8332 =/ parsed (parse file src)
12619 =/ parsed (parse file src)
8333 ?: ?=(%| -.parsed) (show-error src p.parsed)
12620 ?: ?=(%| -.parsed) (show-error src p.parsed)
12621+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12622+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
8334 ?: =(0 prelude-source) 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
12623 ?: =(0 prelude-source) 'partial inference; module not checked\0aprelude source missing; module import inference unsupported'
8335 =/ prelude (parse /lib/jibb/prelude/jibb prelude-source)
12624 =/ prelude (parse /lib/jibb/prelude/jibb prelude-source)
8336 ?: ?=(%| -.prelude) 'partial inference; module not checked\0aprelude source does not parse; module import inference unsupported'
12625 ?: ?=(%| -.prelude) 'partial inference; module not checked\0aprelude source does not parse; module import inference unsupported'
@@ -8338,16 +12627,26 @@
8338 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
12627 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
8339 (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
12628 (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
8340::
12629::
12630+++ golden-types-with-prelude-and-internal
12631+ |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prelude-source=@t internal-source=@t]
12632+ ^- @t
12633+ =/ prepared=(unit iprelude) (prepare-prelude-with-internal prelude-source internal-source)
12634+ (golden-types-with-prepared-prelude file src externals mark-externals modules prepared)
12635+::
8341++ golden-types-with-prepared-prelude
12636++ golden-types-with-prepared-prelude
8342 |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prepared=(unit iprelude)]
12637 |= [file=path src=@t externals=iexternals mark-externals=imark-externals modules=jbundle prepared=(unit iprelude)]
8343 ^- @t
12638 ^- @t
8344 =/ parsed (parse file src)
12639 =/ parsed (parse file src)
8345 ?: ?=(%| -.parsed) (show-error src p.parsed)
12640 ?: ?=(%| -.parsed) (show-error src p.parsed)
12641+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12642+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
8346 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
12643 ?~ prepared 'partial inference; module not checked\0aprelude interface is not supported'
8347 =/ prelude-values=(list term) values.u.prepared
12644 =/ prelude-values=(list term) values.u.prepared
8348 =/ prelude-molds=(list term) molds.u.prepared
12645 =/ prelude-molds=(list term) molds.u.prepared
8349 =/ iface=(unit ifile) `iface.u.prepared
12646 =/ iface=(unit ifile) `iface.u.prepared
8350 ?. (module-scope-valid p.parsed prelude-values prelude-molds)
12647 ?. (module-scope-valid p.parsed prelude-values prelude-molds)
12648+ ?: (pending-declared-poke file p.parsed prelude-values prelude-molds)
12649+ 'partial inference; module not checked\0amodule kind or scope needs unsupported inference'
8351 'partial inference; module not checked\0amodule has conflicting names'
12650 'partial inference; module not checked\0amodule has conflicting names'
8352 =/ js=jimports-result
12651 =/ js=jimports-result
8353 (resolve-jibb-imports imports.p.parsed externals mark-externals modules ~[file] prelude-values prelude-molds ~ iface)
12652 (resolve-jibb-imports imports.p.parsed externals mark-externals modules ~[file] prelude-values prelude-molds ~ iface)
@@ -8388,13 +12687,45 @@
8388 =. reserved-molds (weld reserved-molds (turn jimports |=(j=[face=term interface=ifile] face.j)))
12687 =. reserved-molds (weld reserved-molds (turn jimports |=(j=[face=term interface=ifile] face.j)))
8389 =/ parsed (parse file src)
12688 =/ parsed (parse file src)
8390 ?: ?=(%| -.parsed) (show-error src p.parsed)
12689 ?: ?=(%| -.parsed) (show-error src p.parsed)
12690+ =/ duplicate=(unit idiag) (duplicate-defs defs.p.parsed)
12691+ ?^ duplicate (duplicate-fields-report file src u.duplicate)
12692+ ?: (module-has-reserved-proj p.parsed)
12693+ 'module has reserved proj name'
8391 =/ ds=(list def) defs.p.parsed
12694 =/ ds=(list def) defs.p.parsed
8392 =/ molds=imolds (collect-simple-molds ds)
12695 =/ molds=imolds (collect-simple-molds ds)
8393 =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
12696 =/ globals=(list term) (weld prelude-values (weld (turn jimports |=(j=[face=term interface=ifile] face.j)) (global-value-names ds)))
8394 =/ surs=(list term) (collect-sur-imports imports.p.parsed)
12697 =/ surs=(list term) (collect-sur-imports imports.p.parsed)
8395 =/ marks=(list term) (collect-mark-imports imports.p.parsed)
12698 =/ marks=(list term) (collect-mark-imports imports.p.parsed)
8396 =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
12699 =/ resolution=iresolved (resolve-groups ds molds globals externals surs mark-externals marks jimports reserved-molds file prelude)
12700+ =/ cycles=(list icycle) (definite-value-cycles ds globals)
8397 =/ env=ienv env.resolution
12701 =/ env=ienv env.resolution
12702+ =/ recovered=(list term) ~
12703+ =/ eligible=?
12704+ ?& ?=(~ imports.p.parsed)
12705+ ?=(~ jimports)
12706+ ?=(~ prelude)
12707+ ?=(~ prelude-values)
12708+ ?=(~ reserved-molds)
12709+ !?=([%ui %api *] file)
12710+ !?=([%ui %stores *] file)
12711+ !(lien (global-value-names ds) |=(n=term =(n %main)))
12712+ (module-scope-valid p.parsed ~ ~)
12713+ !(module-values-complete ds env)
12714+ (lte (met 3 src) 65.536)
12715+ (lte (lent ds) 64)
12716+ (dg-source-candidate ds 64)
12717+ ==
12718+ =/ transaction=(unit dgcommit) ?:(eligible (dg-root-source file src) ~)
12719+ =. recovered
12720+ ?~ transaction ~
12721+ ?. &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) ~
12722+ (turn (skim env.u.transaction |=(entry=[name=term scheme=ischeme] ?=(~ (ienv-lookup name.entry env)))) |=(entry=[name=term scheme=ischeme] name.entry))
12723+ =. env
12724+ ?~ transaction env
12725+ ?: &((module-values-complete ds env.u.transaction) (dg-interface-safe env.u.transaction)) env.u.transaction
12726+ env
12727+ =/ source-defs=(map term def) (direct-checked-gates ds env)
12728+ =/ heads=(unit igate-prelude-evidence) (direct-prelude-evidence ds prelude)
8398 =/ lines=(list @t) ~
12729 =/ lines=(list @t) ~
8399 |-
12730 |-
8400 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
12731 ?~ ds (of-wain:format ['partial inference; module not checked' (flop lines)])
@@ -8403,6 +12734,20 @@
8403 $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
12734 $(ds t.ds, lines [(show-partial-mold file src d molds) lines])
8404 ?. (unique-value-name name.d globals)
12735 ?. (unique-value-name name.d globals)
8405 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
12736 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
12737+ =/ cycle=(list icycle) (skim cycles |=(c=icycle =(name.c name.d)))
12738+ ?^ cycle
12739+ =/ diag=idiag ["non-gate value depends on itself through a cycle" ~[[first.i.cycle "value in cycle"] [next.i.cycle "dependency in cycle"]]]
12740+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d diag) lines])
12741+ ?: (lien recovered |=(n=term =(n name.d)))
12742+ =/ found=(unit ischeme) (ienv-lookup name.d env)
12743+ ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: committed definition unavailable") lines])
12744+ ?: (itype-has-hidden-recursive typ.u.found)
12745+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive mold name is not available in this scope") lines])
12746+ ?: (itype-has-hidden-generic typ.u.found)
12747+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: generic union name is not available in this scope") lines])
12748+ =/ typ=itype (canonical-itype typ.u.found vars.u.found)
12749+ =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
12750+ $(ds t.ds, lines [line lines])
8406 ?: (lien grouped.resolution |=(n=term =(n name.d)))
12751 ?: (lien grouped.resolution |=(n=term =(n name.d)))
8407 =/ found=(unit ischeme) (ienv-lookup name.d env)
12752 =/ found=(unit ischeme) (ienv-lookup name.d env)
8408 ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive group unavailable") lines])
12753 ?~ found $(ds t.ds, lines [(crip "++ {(trip name.d)}: recursive group unavailable") lines])
@@ -8410,7 +12755,9 @@
8410 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
12755 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype typ ~)}{(show-atom-constraint typ)}")
8411 $(ds t.ds, lines [line lines])
12756 $(ds t.ds, lines [line lines])
8412 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
12757 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
8413− =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude]
12758+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude ~ 256 ~ ~ ~ ~ ~ ~]
12759+ =. gate-defs.initial source-defs
12760+ =. head-evidence.initial heads
8414 =. initial (reserve-def-caps val.d initial)
12761 =. initial (reserve-def-caps val.d initial)
8415 =/ result=iresult
12762 =/ result=iresult
8416 ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
12763 ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
@@ -8418,6 +12765,11 @@
8418 (infer-fragment val.d env initial)
12765 (infer-fragment val.d env initial)
8419 ?: ?=(%| -.result)
12766 ?: ?=(%| -.result)
8420 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
12767 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
12768+ =. state.p.result (promote-restricted-numbers state.p.result env)
12769+ =. state.p.result (default-hole-numbers holes.state.p.result holes.initial state.p.result env !(itype-has-gate (itype-normalize typ.p.result sub.state.p.result)))
12770+ =/ hole=(unit idiag) (unresolved-hole holes.state.p.result holes.initial state.p.result)
12771+ ?^ hole
12772+ $(ds t.ds, lines [(show-inference-diagnostic file src name.d u.hole) lines])
8421 =/ merged=(unit [first=icap second=icap])
12773 =/ merged=(unit [first=icap second=icap])
8422 (merged-capitals caps.state.p.result sub.state.p.result)
12774 (merged-capitals caps.state.p.result sub.state.p.result)
8423 ?^ merged
12775 ?^ merged
@@ -8440,7 +12792,576 @@
8440 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
12792 =/ vars=(list @ud) (unique-type-vars (itype-vars typ))
8441 ?: (gth (lent vars) 26)
12793 ?: (gth (lent vars) 26)
8442 $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
12794 $(ds t.ds, lines [(crip "++ {(trip name.d)}: too many variables for partial printer") lines])
12795+ ?~ (width-finalize projections.state.p.result sub.state.p.result vars)
12796+ $(ds t.ds, lines [(crip "++ {(trip name.d)}: record projection elaboration needs unsupported inference") lines])
8443 =/ printable=itype (canonical-itype typ vars)
12797 =/ printable=itype (canonical-itype typ vars)
8444 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
12798 =/ line=@t (crip "++ {(trip name.d)}: {(show-itype printable ~)}{(show-atom-constraint printable)}")
8445 $(ds t.ds, lines [line lines])
12799 $(ds t.ds, lines [line lines])
12800+:: Experimental module-owned pending-constraint generalization only.
12801+:: Inputs, IDs and substitution come from one checker-owned transaction.
12802++$ dgscan [ids=(list @ud) fuel=@ud]
12803+++ dg-scan
12804+ |= [todo=(list itype) sub=isub fuel=@ud ids=(list @ud)]
12805+ ^- (unit dgscan)
12806+ ?~ todo `[ids fuel]
12807+ ?: =(0 fuel) ~
12808+ =. fuel (dec fuel)
12809+ =/ t=itype i.todo
12810+ ?: ?=(?(%var %avar %rvar %nvar %rnvar %tag) -.t)
12811+ =/ node-id=@ud ?:(?=(%tag -.t) id.t +.t)
12812+ =/ found=(unit itype) (itype-lookup node-id sub)
12813+ ?~ found $(todo t.todo, ids [node-id ids])
12814+ ?: &(?=(?(%rvar %rnvar) -.u.found) =(node-id +.u.found))
12815+ $(todo t.todo, ids [node-id ids])
12816+ $(todo [u.found t.todo])
12817+ ?: ?=(%jrec -.t) $(todo t.todo)
12818+ ?+ -.t ~
12819+ %collection $(todo (weld args.t t.todo))
12820+ %union $(todo (weld args.t (weld cases.t t.todo)))
12821+ %face $(todo [body.t t.todo])
12822+ %fn $(todo [sample.t product.t t.todo])
12823+ %cell $(todo [hed.t tal.t t.todo])
12824+ %atom $(todo t.todo)
12825+ %any-atom $(todo t.todo)
12826+ %flag $(todo t.todo)
12827+ %noun $(todo t.todo)
12828+ %empty $(todo t.todo)
12829+ %const $(todo t.todo)
12830+ ==
12831+::
12832+++ dg-scan-ids
12833+ |= [ids=(list @ud) sub=isub fuel=@ud blocked=(list @ud)]
12834+ ^- (unit dgscan)
12835+ ?~ ids `[blocked fuel]
12836+ =/ one=(unit dgscan) (dg-scan ~[[%var i.ids]] sub fuel blocked)
12837+ ?~ one ~
12838+ $(ids t.ids, fuel fuel.u.one, blocked ids.u.one)
12839+::
12840+++ dg-env
12841+ |= [env=ienv sub=isub fuel=@ud blocked=(list @ud)]
12842+ ^- (unit dgscan)
12843+ ?~ env `[blocked fuel]
12844+ =/ sc=ischeme scheme.i.env
12845+ :: Quantifiers are local to the scheme: first find raw free IDs, then
12846+ :: follow those IDs in the module substitution without capturing them.
12847+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ fuel ~)
12848+ ?~ raw ~
12849+ =/ free=(list @ud) (skim ids.u.raw |=(n=@ud !(lien vars.sc |=(q=@ud =(q n)))))
12850+ =/ resolved=(unit dgscan) (dg-scan-ids free sub fuel.u.raw blocked)
12851+ ?~ resolved ~
12852+ $(env t.env, fuel fuel.u.resolved, blocked ids.u.resolved)
12853+::
12854+++ dg-obligations
12855+ |= [pending=(list dgo) sub=isub fuel=@ud blocked=(list @ud)]
12856+ ^- (unit dgscan)
12857+ ?~ pending `[blocked fuel]
12858+ =/ found=(unit dgscan) (dg-scan ~[left.i.pending right.i.pending] sub fuel blocked)
12859+ ?~ found ~
12860+ $(pending t.pending, fuel fuel.u.found, blocked ids.u.found)
12861+::
12862+++ dg-tags
12863+ |= [tags=(list ipending) sub=isub fuel=@ud blocked=(list @ud)]
12864+ ^- (unit dgscan)
12865+ ?~ tags `[blocked fuel]
12866+ ?: =(0 fuel) ~
12867+ =/ found=(unit itype) (itype-lookup id.i.tags sub)
12868+ ?~ found $(tags t.tags, fuel (dec fuel), blocked [id.i.tags blocked])
12869+ :: Until this entry is explicitly discharged, retain variables reachable
12870+ :: through its binding; mere existence of a substitution is not proof.
12871+ =/ reached=(unit dgscan) (dg-scan ~[u.found] sub (dec fuel) blocked)
12872+ ?~ reached ~
12873+ $(tags t.tags, fuel fuel.u.reached, blocked ids.u.reached)
12874+::
12875+++ dg-generalize
12876+ |= [typ=itype env=ienv pending=(list dgo) tags=(list ipending) captured=(list @ud) state=istate fuel=@ud]
12877+ ^- (unit ischeme)
12878+ :: Bound the obligation list and all graph/substitution walks. The
12879+ :: substitution is assumed checker-owned and occurs-checked.
12880+ ?: (gth (lent pending) 64) ~
12881+ =/ capt=(unit dgscan) (dg-scan-ids captured sub.state fuel ~)
12882+ ?~ capt ~
12883+ =/ env-free=(unit dgscan) (dg-env env sub.state fuel.u.capt ids.u.capt)
12884+ ?~ env-free ~
12885+ =/ obligations=(unit dgscan) (dg-obligations pending sub.state fuel.u.env-free ids.u.env-free)
12886+ ?~ obligations ~
12887+ =/ tagged=(unit dgscan) (dg-tags tags sub.state fuel.u.obligations ids.u.obligations)
12888+ ?~ tagged ~
12889+ =/ bounded=(unit dgscan) (dg-scan ~[typ] sub.state fuel.u.tagged ~)
12890+ ?~ bounded ~
12891+ =/ normalized=itype (itype-normalize typ sub.state)
12892+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
12893+ =/ quantified=(list @ud) (skim vars |=(n=@ud !(lien ids.u.tagged |=(b=@ud =(b n)))))
12894+ `[[normalized quantified]]
12895+::
12896++$ dgcommit [env=ienv state=istate]
12897+:: A branch literal must not acquire a value face through replay.
12898+++ dg-literal-target-safe
12899+ |= target=itype
12900+ ^- ?
12901+ ?: ?=(%union -.target)
12902+ (levy cases.target |=(c=itype ?=(?(%const %cell) -.c)))
12903+ ?=(?(%const %atom %any-atom %flag %noun) -.target)
12904+::
12905+++ dg-replay-edges
12906+ |= [edges=(list dgo) state=istate fuel=@ud]
12907+ ^- (unit istate)
12908+ ?~ edges `state
12909+ ?: =(0 fuel) ~
12910+ =/ trial=ifit (itype-fit left.i.edges right.i.edges sub.state next.state)
12911+ ?. ?=(%ok -.trial) ~
12912+ =/ valid=?
12913+ ?: ?=(%tag -.left.i.edges)
12914+ ?. constructor.left.i.edges
12915+ =/ closed=(unit dgscan) (dg-scan ~[right.i.edges] sub.trial 512 ~)
12916+ ?~ closed |
12917+ ?^ ids.u.closed |
12918+ (dg-literal-target-safe (itype-normalize right.i.edges sub.trial))
12919+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
12920+ =((itype-walk left.i.edges sub.trial) (itype-walk right.i.edges sub.trial))
12921+ ?. valid ~
12922+ $(edges t.edges, state state(sub sub.trial, next next.trial), fuel (dec fuel))
12923+::
12924+++ dg-close-env
12925+ |= [env=ienv sub=isub fuel=@ud]
12926+ ^- (unit ienv)
12927+ ?~ env `~
12928+ ?: =(0 fuel) ~
12929+ =/ s=ischeme scheme.i.env
12930+ :: Quantified IDs are scheme-local and cannot be rewritten on publication.
12931+ ?. (levy vars.s |=(n=@ud ?=(~ (itype-lookup n sub)))) ~
12932+ =/ bounded=(unit dgscan) (dg-scan ~[typ.s] sub (dec fuel) ~)
12933+ ?~ bounded ~
12934+ =/ normalized=itype (itype-normalize typ.s sub)
12935+ ?: (itype-has-tag normalized) ~
12936+ =/ vars=(list @ud) (unique-type-vars (itype-vars normalized))
12937+ ?. (levy vars |=(n=@ud (lien vars.s |=(v=@ud =(v n))))) ~
12938+ =/ rest=(unit ienv) (dg-close-env t.env sub fuel.u.bounded)
12939+ ?~ rest ~
12940+ `[[name.i.env [normalized vars.s]] u.rest]
12941+::
12942+:: A deferred boolean branch has exactly the two literal flag patterns.
12943+:: Arms are inferred in order. Equal types are retained; two direct pending
12944+:: literals may instead retain source-owned obligations for later context.
12945+++ dg-boolean-patterns
12946+ |= e=expr
12947+ ^- ?
12948+ ?. ?=(%branch -.e) |
12949+ ?~ arms.e |
12950+ ?~ t.arms.e |
12951+ ?^ t.t.arms.e |
12952+ =/ x=arm i.arms.e
12953+ =/ y=arm i.t.arms.e
12954+ ?. &(?=(%lit -.pat.x) ?=(%lit -.pat.y)) |
12955+ ?. &(=(%loobean form.lit.pat.x) =(%loobean form.lit.pat.y)) |
12956+ !=(val.lit.pat.x val.lit.pat.y)
12957+:: Only a direct source literal which created its own unbound pending tag
12958+:: may create a branch edge. The caller must retain the exact source and state.
12959+++ dg-owned-arm-literal
12960+ |= [e=expr t=itype tags=(list ipending) sub=isub initial=@ud]
12961+ ^- ?
12962+ ?. ?=(%lit -.e) |
12963+ ?. ?=(%tag -.t) |
12964+ ?: constructor.t |
12965+ ?. =(lit.e literal.t) |
12966+ ?: (lth id.t initial) |
12967+ ?^ (itype-lookup id.t sub) |
12968+ (lien tags |=(x=ipending &(=(id.x id.t) =(literal.x literal.t))))
12969+++ dg-boolean-branch
12970+ |= [e=expr env=ienv state=istate]
12971+ ^- iresult
12972+ ?. (dg-boolean-patterns e) [%| ["deferred branch patterns need unsupported inference" ~]]
12973+ ?> ?=(%branch -.e)
12974+ ?> ?=(^ arms.e)
12975+ ?> ?=(^ t.arms.e)
12976+ =/ x=arm i.arms.e
12977+ =/ y=arm i.t.arms.e
12978+ =/ subject=iresult (infer-fragment subject.e env state)
12979+ ?: ?=(%| -.subject) subject
12980+ =/ su=(unit isub) (itype-unify typ.p.subject [%flag ~] sub.state.p.subject)
12981+ ?~ su [%| ["deferred branch subject does not unify with ?" ~]]
12982+ =/ left=iresult (infer-fragment val.x env state.p.subject(sub u.su))
12983+ ?: ?=(%| -.left) left
12984+ =/ right=iresult (infer-fragment val.y env state.p.left)
12985+ ?: ?=(%| -.right) right
12986+ ?. (dg-stable-fit typ.p.left typ.p.right sub.state.p.right)
12987+ =/ st=istate state.p.right
12988+ ?. (dg-owned-arm-literal val.x typ.p.left tags.st sub.st next.state)
12989+ [%| ["deferred branch arm context needs unsupported inference" ~]]
12990+ ?. (dg-owned-arm-literal val.y typ.p.right tags.st sub.st next.state)
12991+ [%| ["deferred branch arm context needs unsupported inference" ~]]
12992+ ?> ?=(%tag -.typ.p.left)
12993+ ?> ?=(%tag -.typ.p.right)
12994+ ?: =(id.typ.p.left id.typ.p.right)
12995+ [%| ["deferred branch arm context needs unsupported inference" ~]]
12996+ ?: (gth (lent obligations.st) 62)
12997+ [%| ["deferred branch arm context needs unsupported inference" ~]]
12998+ =/ result=itype [%var next.st]
12999+ =/ ex=dgo [typ.p.left result (span-of val.x) (span-of e)]
13000+ =/ ey=dgo [typ.p.right result (span-of val.y) (span-of e)]
13001+ [%& result st(next +(next.st), obligations [ex ey obligations.st])]
13002+ [%& typ.p.left state.p.right]
13003+::
13004+:: Deferred inference uses only source forms whose successful fit sites are
13005+:: guarded below; a shared source-node budget bounds this screen.
13006+++ dg-safe-expressions
13007+ |= [todo=(list expr) fuel=@ud]
13008+ ^- (unit @ud)
13009+ ?~ todo `fuel
13010+ =/ first=(unit @ud) (dg-safe-expression i.todo fuel)
13011+ ?~ first ~
13012+ $(todo t.todo, fuel u.first)
13013+++ dg-safe-expression
13014+ |= [e=expr fuel=@ud]
13015+ ^- (unit @ud)
13016+ ?: =(0 fuel) ~
13017+ =. fuel (dec fuel)
13018+ ?+ -.e ~
13019+ ?(%lit %ctor) `fuel
13020+ %wing ?:(?=([@ ~] names.e) `fuel ~)
13021+ %str
13022+ ?. (levy pieces.e |=(p=piece ?=(%text -.p))) ~
13023+ `fuel
13024+ %group $(e inner.e, fuel fuel)
13025+ %body
13026+ ?^ defs.e ~
13027+ $(e final.e, fuel fuel)
13028+ %gate $(e body.e, fuel fuel)
13029+ %gate-wide $(e body.e, fuel fuel)
13030+ %branch
13031+ ?. (dg-boolean-patterns e) ~
13032+ ?> ?=(^ arms.e)
13033+ ?> ?=(^ t.arms.e)
13034+ =/ subject=(unit @ud) $(e subject.e, fuel fuel)
13035+ ?~ subject ~
13036+ (dg-safe-expressions ~[val.i.arms.e val.i.t.arms.e] u.subject)
13037+ %cast $(e val.e, fuel fuel)
13038+ %call
13039+ =/ head=(unit @ud) $(e head.e, fuel fuel)
13040+ ?~ head ~
13041+ (dg-safe-expressions args.e u.head)
13042+ ==
13043+:: Exact normalized equality is preserved by all later substitutions.
13044+:: The bounded scan declines opaque types and oversized inputs.
13045+++ dg-stable-fit
13046+ |= [actual=itype expected=itype sub=isub]
13047+ ^- ?
13048+ ?~ (dg-scan ~[actual expected] sub 512 ~) |
13049+ =((itype-normalize actual sub) (itype-normalize expected sub))
13050+::
13051+:: A positional call peels sample-slot faces during its separate face check.
13052+:: Require its argument, sample and result closed so that check stays valid.
13053+++ dg-stable-call-fit
13054+ |= [actual=itype expected=itype product=itype sub=isub positional=?]
13055+ ^- ?
13056+ =/ checked=(unit dgscan) (dg-scan ~[actual expected product] sub 512 ~)
13057+ ?~ checked |
13058+ ?: &(positional ?=(^ ids.u.checked)) |
13059+ =((itype-normalize actual sub) (itype-normalize expected sub))
13060+::
13061+:: One definition attempt retains state only when inference succeeds.
13062++$ dg-step [env=ienv state=istate pending=(list dgo)]
13063+++ dg-stage-one
13064+ |= [d=def env=ienv state=istate]
13065+ ^- (unit dg-step)
13066+ ?> ?=(%value -.d)
13067+ ?~ (dg-safe-expression val.d 512) ~
13068+ =/ local=istate (reserve-def-caps val.d state)
13069+ :: This first slice declines all written capitals and holes/projections.
13070+ ?^ caps.local ~
13071+ =/ ordinary=iresult (infer-fragment val.d env local)
13072+ ?: ?=(%| -.ordinary) ~
13073+ =/ typ=itype typ.p.ordinary
13074+ =/ after=istate state.p.ordinary
13075+ =/ edges=(list dgo) obligations.after
13076+ ?. =(binders.after binders.state) ~
13077+ ?. =(molds.after molds.state) ~
13078+ ?. =(globals.after globals.state) ~
13079+ ?. =(externals.after externals.state) ~
13080+ ?. =(surs.after surs.state) ~
13081+ ?. =(mark-externals.after mark-externals.state) ~
13082+ ?. =(marks.after marks.state) ~
13083+ ?. =(jimports.after jimports.state) ~
13084+ ?. =(reserved-molds.after reserved-molds.state) ~
13085+ ?. =(params.after params.state) ~
13086+ ?. =(active.after active.state) ~
13087+ ?. =(in-mold.after in-mold.state) ~
13088+ ?. =(at.after at.state) ~
13089+ ?. =(top-molds.after top-molds.state) ~
13090+ ?. =(prelude.after prelude.state) ~
13091+ ?. =(gate-defs.after gate-defs.state) ~
13092+ ?. =(head-evidence.after head-evidence.state) ~
13093+ ?. =(grec-index.after grec-index.state) ~
13094+ ?. =(defer.after defer.state) ~
13095+ ?. =(holes.after holes.state) ~
13096+ ?. =(caps.after caps.state) ~
13097+ ?. =(projections.after projections.state) ~
13098+ ?: (unsupported-atom-vars (itype-normalize typ sub.after) caps.after binders.after sub.after) ~
13099+ ?: (itype-has-nvar (itype-normalize typ sub.after)) ~
13100+ =/ scheme=(unit ischeme) (dg-generalize typ env edges tags.after ~ after 32.768)
13101+ ?~ scheme ~
13102+ `[[[name.d u.scheme] env] after edges]
13103+:: Retry only definitions that did not infer. Successful definitions are
13104+:: committed into the local transaction, never published until all close.
13105+++ dg-stage
13106+ |= [ds=(list def) base=ienv env=ienv state=istate pending=(list dgo) fuel=@ud]
13107+ ^- (unit dgcommit)
13108+ ?: (gth fuel 64) ~
13109+ ?: (gth (lent ds) fuel) ~
13110+ =/ remaining=(list def) ds
13111+ =/ waiting=(list def) ~
13112+ =/ progress=? |
13113+ =/ attempts=@ud (mul fuel fuel)
13114+ |-
13115+ ?~ remaining
13116+ ?^ waiting
13117+ ?. progress ~
13118+ $(remaining (flop waiting), waiting ~, progress |)
13119+ =/ replayed=(unit istate) (dg-replay-edges pending state 64)
13120+ ?~ replayed ~
13121+ ?: (pending-tags tags.u.replayed sub.u.replayed) ~
13122+ =/ closed-edges=(unit dgscan) (dg-obligations pending sub.u.replayed 32.768 ~)
13123+ ?~ closed-edges ~
13124+ ?^ ids.u.closed-edges ~
13125+ =/ rechecked=(unit istate) (dg-replay-edges pending u.replayed 64)
13126+ ?~ rechecked ~
13127+ ?. =(sub.u.rechecked sub.u.replayed) ~
13128+ ?. =(next.u.rechecked next.u.replayed) ~
13129+ =/ closed=(unit ienv) (dg-close-env env sub.u.replayed 32.768)
13130+ ?~ closed ~
13131+ `[[u.closed u.replayed(defer ~, obligations ~)]]
13132+ ?: =(0 attempts) ~
13133+ =. attempts (dec attempts)
13134+ =/ d=def i.remaining
13135+ ?: ?=(%mold -.d) $(remaining t.remaining)
13136+ ?^ (ienv-lookup name.d base) $(remaining t.remaining)
13137+ ?^ (ienv-lookup name.d env) ~
13138+ =/ done=(unit dg-step) (dg-stage-one d env state)
13139+ ?~ done $(remaining t.remaining, waiting [d waiting])
13140+ $(remaining t.remaining, env env.u.done, state state.u.done, pending pending.u.done, progress &)
13141+::
13142+:: Cheap bounded eligibility check on the already parsed source. This
13143+:: deliberately covers only direct constructor calls beneath transparent
13144+:: groups, gates, casts and definition-free bodies. Other shapes decline
13145+:: this fallback without a second parse or resolution pass.
13146+++ dg-direct-source
13147+ |= [e=expr fuel=@ud]
13148+ ^- ?
13149+ ?: =(0 fuel) |
13150+ ?+ -.e |
13151+ %group $(e inner.e, fuel (dec fuel))
13152+ %gate $(e body.e, fuel (dec fuel))
13153+ %gate-wide $(e body.e, fuel (dec fuel))
13154+ %cast $(e val.e, fuel (dec fuel))
13155+ %body ?~(defs.e $(e final.e, fuel (dec fuel)) |)
13156+ %call
13157+ ?. ?=([* ~] args.e) |
13158+ ?=(%ctor -.i.args.e)
13159+ ==
13160+++ dg-source-candidate
13161+ |= [ds=(list def) fuel=@ud]
13162+ ^- ?
13163+ ?~ ds |
13164+ ?: =(0 fuel) |
13165+ ?. ?=(%value -.i.ds) $(ds t.ds, fuel (dec fuel))
13166+ ?: (dg-direct-source val.i.ds 64) &
13167+ $(ds t.ds, fuel (dec fuel))
13168+::
13169+++ dg-interface-safe
13170+ |= [env=ienv]
13171+ ^- ?
13172+ ?~ env &
13173+ =/ sc=ischeme scheme.i.env
13174+ ?: |((itype-has-hidden-recursive typ.sc) (itype-has-hidden-generic typ.sc)) |
13175+ ?: (gth (lent vars.sc) 26) |
13176+ $(env t.env)
13177+:: Parse status and the transaction result come from the same source parse.
13178++$ dgparse [parsed=? result=(unit dgcommit)]
13179+++ dg-root-source
13180+ |= [at=path src=@t]
13181+ ^- (unit dgcommit)
13182+ result:(dg-root-detail at src)
13183+++ dg-root-detail
13184+ |= [at=path src=@t]
13185+ ^- dgparse
13186+ =/ parsed (parse at src)
13187+ ?: ?=(%| -.parsed) [| ~]
13188+ =/ transact
13189+ |.
13190+ ?^ imports.p.parsed ~
13191+ ?. (module-scope-valid p.parsed ~ ~) ~
13192+ ?^ (duplicate-defs defs.p.parsed) ~
13193+ =/ defs=(list def) defs.p.parsed
13194+ ?: (gth (lent defs) 64) ~
13195+ =/ molds=imolds (collect-simple-molds defs)
13196+ =/ globals=(list term) (global-value-names defs)
13197+ =/ resolution=iresolved (resolve-groups defs molds globals ~ ~ ~ ~ ~ ~ at ~)
13198+ ?^ grouped.resolution ~
13199+ ?^ artifacts.resolution ~
13200+ =/ base=ienv env.resolution
13201+ =/ free=(unit dgscan) (dg-env base ~ 32.768 ~)
13202+ ?~ free ~
13203+ ?^ ids.u.free ~
13204+ =/ all=(unit dgscan) (dg-all-env-ids base 32.768 ~)
13205+ ?~ all ~
13206+ =/ fresh=@ud (dg-next-id ids.u.all 0)
13207+ =/ st=istate *istate
13208+ =. st st(next fresh, defer `~, molds molds, globals globals, at at, top-molds (turn molds |=(m=[name=term body=shape] name.m)), in-mold |, jrec-fuel 256)
13209+ =/ checked-molds=(each imold-types @t) (module-mold-types molds st)
13210+ ?: ?=(%| -.checked-molds) ~
13211+ (dg-stage defs base base st ~ 64)
13212+ ::
13213+ [& (transact)]
13214+++ dg-all-env-ids
13215+ |= [env=ienv fuel=@ud ids=(list @ud)]
13216+ ^- (unit dgscan)
13217+ ?~ env `[ids fuel]
13218+ ?: =(0 fuel) ~
13219+ =/ sc=ischeme scheme.i.env
13220+ ?: (itype-has-tag typ.sc) ~
13221+ =/ raw=(unit dgscan) (dg-scan ~[typ.sc] ~ (dec fuel) ids)
13222+ ?~ raw ~
13223+ =/ quant=(unit dgscan) (dg-scan-ids vars.sc ~ fuel.u.raw ids.u.raw)
13224+ ?~ quant ~
13225+ $(env t.env, fuel fuel.u.quant, ids ids.u.quant)
13226+::
13227+++ dg-next-id
13228+ |= [ids=(list @ud) largest=@ud]
13229+ ^- @ud
13230+ ?~ ids +(largest)
13231+ $(ids t.ids, largest (max largest i.ids))
13232+::
13233+++ dg-eligible-ctor
13234+ |= [e=expr head=itype actual=itype expected=itype state=istate]
13235+ ^- (unit dgo)
13236+ ?. ?=(%call -.e) ~
13237+ ?. ?=([* ~] args.e) ~
13238+ ?. ?=(%ctor -.i.args.e) ~
13239+ ?. ?=(%fn -.head) ~
13240+ ?. ?=(%fn -.expected) ~
13241+ ?. ?=(%tag -.actual) ~
13242+ ?. constructor.actual ~
13243+ ?. ?=(%var -.product.expected) ~
13244+ ?^ (itype-lookup id.product.expected sub.state) ~
13245+ =/ bounded=(unit dgscan) (dg-scan ~[sample.expected] sub.state 256 ~)
13246+ ?~ bounded ~
13247+ ?^ ids.u.bounded ~
13248+ `[[actual expected (span-of i.args.e) (span-of head.e)]]
13249+::
13250+:: Experimental per-module, source-derived recursive tree index.
13251+:: The two tags and the exact children/list/self layout are fixed-shape
13252+:: checks, so ordinary definitions incur no type-tree or source scans.
13253+++ grec-tagged-fields
13254+ |= sh=shape
13255+ ^- (unit [tag=@ fields=(list field)])
13256+ ?. ?=(%cell -.sh) ~
13257+ ?~ fields.sh ~
13258+ =/ head=field i.fields.sh
13259+ ?. ?=(%bare -.head) ~
13260+ ?. ?=(%const -.shape.head) ~
13261+ ?. &(?=(%term form.lit.shape.head) =(%tas aura.lit.shape.head)) ~
13262+ `[val.lit.shape.head t.fields.sh]
13263+++ grec-tree-children
13264+ |= [fs=(list field) param=@t]
13265+ ^- (unit field)
13266+ ?~ fs ~
13267+ ?~ t.fs `i.fs
13268+ ?^ t.t.fs ~
13269+ =/ event=field i.fs
13270+ =/ kids=field i.t.fs
13271+ ?. &(?=(%face -.event) ?=(%face -.kids)) ~
13272+ ?. !=(name.event name.kids) ~
13273+ ?. ?=(%fn -.shape.event) ~
13274+ ?. ?=(%aura -.sample.shape.event) ~
13275+ ?. =(%t aura.sample.shape.event) ~
13276+ ?. ?=(%tvar -.product.shape.event) ~
13277+ ?. =(param name.product.shape.event) ~
13278+ `kids
13279+::
13280+++ grec-tree-proof
13281+ |= [name=term sh=shape]
13282+ ^- ?
13283+ ?. ?=(%generic -.sh) |
13284+ ?. ?=([@ ~] vars.sh) |
13285+ =/ param=@t i.vars.sh
13286+ ?. ?=(%union -.body.sh) |
13287+ ?. ?=([* [* ~]] cases.body.sh) |
13288+ =/ a=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.cases.body.sh)
13289+ =/ b=(unit [tag=@ fields=(list field)]) (grec-tagged-fields i.t.cases.body.sh)
13290+ ?~ a |
13291+ ?~ b |
13292+ ?. !=(tag.u.a tag.u.b) |
13293+ ?. ?=([* ~] fields.u.a) |
13294+ =/ value=field i.fields.u.a
13295+ ?. ?=(%face -.value) |
13296+ ?. ?=(%aura -.shape.value) |
13297+ ?. =(%t aura.shape.value) |
13298+ =/ selected=(unit field) (grec-tree-children fields.u.b param)
13299+ ?~ selected |
13300+ =/ kids=field u.selected
13301+ ?. ?=(%face -.kids) |
13302+ ?. ?=(%apply -.shape.kids) |
13303+ ?. =(ref.shape.kids ~[%list]) |
13304+ ?. ?=([* ~] args.shape.kids) |
13305+ =/ self=shape i.args.shape.kids
13306+ ?. ?=(%apply -.self) |
13307+ ?. =(ref.self ~[name]) |
13308+ ?. ?=([* ~] args.self) |
13309+ ?. ?=(%tvar -.i.args.self) |
13310+ =(name.i.args.self param)
13311++$ grec-collected [molds=imolds proofs=(map term shape)]
13312+:: Experimental one-layer analysis view, never an exported mold identity.
13313+++ grec-unfold-view
13314+ |= [typ=itype fuel=@ud]
13315+ ^- (unit [view=itype left=@ud])
13316+ ?. ?=(%grec -.typ) ~
13317+ ?: =(fuel 0) ~
13318+ ?. ?=([* ~] args.typ) ~
13319+ =/ sh=shape proof.typ
13320+ ?. (grec-tree-proof name.typ sh) ~
13321+ ?> ?=(%generic -.sh)
13322+ ?> ?=([@ ~] vars.sh)
13323+ ?> ?=(%union -.body.sh)
13324+ ?> ?=([* [* ~]] cases.body.sh)
13325+ =/ ca=shape i.cases.body.sh
13326+ =/ cb=shape i.t.cases.body.sh
13327+ ?> ?=(%cell -.ca)
13328+ ?> ?=(%cell -.cb)
13329+ ?> ?=([* [* ~]] fields.ca)
13330+ ?> ?=([* *] fields.cb)
13331+ =/ tag-a=field i.fields.ca
13332+ =/ tag-b=field i.fields.cb
13333+ ?> ?=(%bare -.tag-a)
13334+ ?> ?=(%bare -.tag-b)
13335+ ?> ?=(%const -.shape.tag-a)
13336+ ?> ?=(%const -.shape.tag-b)
13337+ =/ text-field=field i.t.fields.ca
13338+ ?> ?=(%face -.text-field)
13339+ =/ branch=(list field) t.fields.cb
13340+ =/ kids=(unit field) (grec-tree-children branch i.vars.sh)
13341+ ?~ kids ~
13342+ ?> ?=(%face -.u.kids)
13343+ =/ children=itype [%face name.u.kids [%collection %list ~[typ]]]
13344+ ?> ?=(^ branch)
13345+ =/ payload=itype
13346+ ?~ t.branch children
13347+ =/ event=field i.branch
13348+ ?> ?=(%face -.event)
13349+ [%cell [%face name.event [%fn [%atom %t] i.args.typ]] children]
13350+ =/ leaf=itype [%cell [%const lit.shape.tag-a] [%face name.text-field [%atom %t]]]
13351+ =/ node=itype [%cell [%const lit.shape.tag-b] payload]
13352+ `[[%union ~[leaf node] ~ ~ ~] (dec fuel)]
13353+::
13354+++ grec-collect-molds
13355+ |= ds=(list def)
13356+ ^- grec-collected
13357+ ?~ ds [~ *(map term shape)]
13358+ =/ rest=grec-collected $(ds t.ds)
13359+ ?. ?=(%mold -.i.ds) rest
13360+ =/ name=term name.i.ds
13361+ =/ body=shape shape.i.ds
13362+ =/ proofs=(map term shape) proofs.rest
13363+ =? proofs (grec-tree-proof name body) (~(put by proofs) name body)
13364+ [[[name body] molds.rest] proofs]
13365+::
13366+
8446--
13367--
jibb-dev/lib/jibb/internal.jibbnew file+31
@@ -0,0 +1,31 @@
1+/= core /lib/jibb/primitives
2+
3+:: Representation for agent and in-process store pokes.
4+:: The prelude re-exports this mold; effect lowering and the runtime must
5+:: agree on these cells when effect execution is implemented.
6++$ poke
7+ [%agent agent=@tas mark=@tas payload=*]
8+ [%store module=@t action=@tas payload=*]
9+
10+:: The compiler supplies this private interface; execution is not yet implemented.
11+++ gth-atom |= args=[A A] (raw-gth.core args)
12+
13+:: Application paths are knot sequences.
14++$ qath
15+ ~
16+ [i=@ta t=qath]
17+
18+:: Private compiler primitive wrappers; execution is a later milestone.
19+++ add-atom |= args=[A A] (raw-add.core args)
20+++ dec-atom |= atom=A (raw-dec.core atom)
21+
22+:: Transparent request data. Identity and path fields are writable and do not
23+:: prove a schema or watchability. A future executor must bind them to checked
24+:: source evidence and validate facts and state; generated receivers must
25+:: decode before calling typed replies or folds. Runtime validation, watch
26+:: provenance and effect execution are not implemented.
27++$ agent-path (list.core @ta)
28++$ ask |$ [M]
29+ [%pure value=M]
30+ [%agent api=@t case=@tas agent=@tas path=agent-path scry=(unit.core agent-path) receive=$-([mark=@tas state=(unit.core *) fact=*] [state=* message=M])]
31+ [%store module=@t name=@tas receive=$-([state=(unit.core *) fact=*] [state=* message=M])]
jibb-dev/lib/jibb/prelude.jibb+151−61
@@ -1,4 +1,9 @@
1+/= internal /lib/jibb/internal
2++$ poke poke.internal
3++$ qath qath.internal
4+
1:: Initial prelude functions. The rest of the inventory is still to come.
5:: Initial prelude functions. The rest of the inventory is still to come.
6+
2++ same |= x=A x
7++ same |= x=A x
3
8
4++ head |= p=[A B]
9++ head |= p=[A B]
@@ -96,6 +101,14 @@
96
101
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
102+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98
103
104+++ like |= [f=$-(A B) result=(like A)]
105+ ++ mapped
106+ ^- (unit [p=B q=nail])
107+ ?- q.result
108+ ~ ~
109+ [~ value] `[p=(f p.value) q=q.value]
110+ ^- (like B) [p=p.result q=mapped]
111+
99++ wonk |= veq=(like A)
112++ wonk |= veq=(like A)
100 ?- q.veq
113 ?- q.veq
101 ~ !!
114 ~ !!
@@ -140,27 +153,34 @@
140 (reverse-into xs ~)
153 (reverse-into xs ~)
141
154
142++ drop |= maybe=(unit A)
155++ drop |= maybe=(unit A)
143− ?- maybe
156+ ^- (list A)
144− ~ ~
157+ ?- maybe
145− [~ value] [value ~]
158+ ~ ~
159+ [~ value] [value ~]
160+
161+++ bond |= fallback=$-(~ A)
162+ |= maybe=(unit A)
163+ ?- maybe
164+ ~ (fallback ~)
165+ [~ value] value
146
166
147++ bind |= args=[(unit A) $-(A B)]
167++ bind |= args=[(unit A) $-(A B)]
148 ?- args
168 ?- args
149− [maybe f]
169+ [maybe f] ^- (unit B)
150 ?- maybe
170 ?- maybe
151 ~ ~
171 ~ ~
152 [~ value] `(f value)
172 [~ value] `(f value)
153
173
154++ biff |= args=[(unit A) $-(A (unit B))]
174++ biff |= args=[(unit A) $-(A (unit B))]
155 ?- args
175 ?- args
156− [maybe f]
176+ [maybe f] ^- (unit B)
157 ?- maybe
177 ?- maybe
158 ~ ~
178 ~ ~
159 [~ value] (f value)
179 [~ value] (f value)
160
180
161++ both |= args=[(unit A) (unit B)]
181++ both |= args=[(unit A) (unit B)]
162 ?- args
182 ?- args
163− [first second]
183+ [first second] ^- (unit [A B])
164 ?- first
184 ?- first
165 ~ ~
185 ~ ~
166 [~ a]
186 [~ a]
@@ -170,7 +190,7 @@
170
190
171++ clap |= args=[(unit A) (unit A) $-([A A] A)]
191++ clap |= args=[(unit A) (unit A) $-([A A] A)]
172 ?- args
192 ?- args
173− [first second combine]
193+ [first second combine] ^- (unit A)
174 ?- first
194 ?- first
175 ~ second
195 ~ second
176 [~ a]
196 [~ a]
@@ -180,7 +200,7 @@
180
200
181++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
201++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
182 ?- args
202 ?- args
183− [first second combine]
203+ [first second combine] ^- (unit C)
184 ?- first
204 ?- first
185 ~ ~
205 ~ ~
186 [~ a]
206 [~ a]
@@ -190,43 +210,45 @@
190
210
191++ skim |= args=[(list A) $-(A ?)]
211++ skim |= args=[(list A) $-(A ?)]
192 ?- args
212 ?- args
193− [xs predicate]
213+ [xs predicate] ^- (list A)
194− ?- xs
214+ ?- xs
195− ~ ~
215+ ~ ~
196− [item rest]
216+ [item rest]
197− ?- (predicate item)
217+ ?- (predicate item)
198− %.y [item (skim rest predicate)]
218+ %.y [item (skim rest predicate)]
199− %.n (skim rest predicate)
219+ %.n (skim rest predicate)
200
220
201++ skip |= args=[(list A) $-(A ?)]
221++ skip |= args=[(list A) $-(A ?)]
202 ?- args
222 ?- args
203− [xs predicate]
223+ [xs predicate] ^- (list A)
204− ?- xs
224+ ?- xs
205− ~ ~
225+ ~ ~
206− [item rest]
226+ [item rest]
207− ?- (predicate item)
227+ ?- (predicate item)
208− %.y (skip rest predicate)
228+ %.y (skip rest predicate)
209− %.n [item (skip rest predicate)]
229+ %.n [item (skip rest predicate)]
210
230
211++ levy |= args=[(list A) $-(A ?)]
231++ levy |= args=[(list A) $-(A ?)]
212− ?- args
232+ ^- ?
213− [xs predicate]
233+ ?- args
214− ?- xs
234+ [xs predicate]
215− ~ %.y
235+ ?- xs
216− [item rest]
236+ ~ %.y
217− ?- (predicate item)
237+ [item rest]
218− %.y (levy rest predicate)
238+ ?- (predicate item)
219− %.n %.n
239+ %.y (levy rest predicate)
240+ %.n %.n
220
241
221++ lien |= args=[(list A) $-(A ?)]
242++ lien |= args=[(list A) $-(A ?)]
222− ?- args
243+ ^- ?
223− [xs predicate]
244+ ?- args
224− ?- xs
245+ [xs predicate]
225− ~ %.n
246+ ?- xs
226− [item rest]
247+ ~ %.n
227− ?- (predicate item)
248+ [item rest]
228− %.y %.y
249+ ?- (predicate item)
229− %.n (lien rest predicate)
250+ %.y %.y
251+ %.n (lien rest predicate)
230
252
231++ roll |= args=[(list A) B $-([A B] B)]
253++ roll |= args=[(list A) B $-([A B] B)]
232 ?- args
254 ?- args
@@ -244,37 +266,39 @@
244
266
245++ flit |= predicate=$-(A ?)
267++ flit |= predicate=$-(A ?)
246 |= value=A
268 |= value=A
247− ?- (predicate value)
269+ ^- (unit A)
248− %.y `value
270+ ?- (predicate value)
249− %.n ~
271+ %.y `value
272+ %.n ~
250
273
251++ murn |= args=[(list A) $-(A (unit B))]
274++ murn |= args=[(list A) $-(A (unit B))]
252 ?- args
275 ?- args
253− [xs f]
276+ [xs f] ^- (list B)
254− ?- xs
277+ ?- xs
255− ~ ~
278+ ~ ~
256− [item rest]
279+ [item rest]
257− ?- (f item)
280+ ?- (f item)
258− ~ (murn rest f)
281+ ~ (murn rest f)
259− [~ value] [value (murn rest f)]
282+ [~ value] [value (murn rest f)]
260
283
261++ join |= args=[A (list A)]
284++ join |= args=[A (list A)]
262 ?- args
285 ?- args
263− [separator xs]
286+ [separator xs] ^- (list A)
264− ?- xs
287+ ?- xs
265− ~ ~
288+ ~ ~
266− [item rest]
289+ [item rest]
267− ?- rest
290+ ?- rest
268− ~ [item ~]
291+ ~ [item ~]
269− [next more] [item [separator (join separator rest)]]
292+ [next more] [item [separator (join separator rest)]]
270
293
271++ snip |= xs=(list A)
294++ snip |= xs=(list A)
272− ?- xs
295+ ^- (list A)
273− ~ ~
296+ ?- xs
274− [item rest]
297+ ~ ~
275− ?- rest
298+ [item rest]
276− ~ ~
299+ ?- rest
277− [next more] [item (snip rest)]
300+ ~ ~
301+ [next more] [item (snip rest)]
278
302
279++ rear |= xs=(list A)
303++ rear |= xs=(list A)
280 ?- xs
304 ?- xs
@@ -283,3 +307,69 @@
283 ?- rest
307 ?- rest
284 ~ item
308 ~ item
285 [next more] (rear rest)
309 [next more] (rear rest)
310+
311+++ cork |= gates=[$-(A B) $-(B C)]
312+ ?- gates
313+ [f g] |= x=A (g (f x))
314+
315+++ corl |= gates=[$-(B C) $-(A B)]
316+ ?- gates
317+ [f g] |= x=A (f (g x))
318+
319+++ cury |= args=[$-([A B] C) A]
320+ ?- args
321+ [f a] |= b=B (f a b)
322+
323+++ curr |= args=[$-([A B] C) B]
324+ ?- args
325+ [f b] |= a=A (f a b)
326+
327++$ cmd |$ [M]
328+ [%poke p=poke reply=$-((unit @t) M)]
329+ [%go url=@t]
330+ [%wait gap=@dr msg=M]
331+ [%now reply=$-(@da M)]
332+ [%who reply=$-(@p M)]
333+
334+++ gth |= args=[A A] (gth-atom.internal args)
335+++ add |= args=[A A] (add-atom.internal args)
336+++ dec |= atom=A (dec-atom.internal atom)
337+
338++$ ask |$ [M] (ask.internal M)
339+++ pure |= x=M ^- (ask M) [%pure x]
340+
341+:: This mold describes the value; island watchability needs separate proof.
342++$ sub |$ [M]
343+ [%watch a=(ask M)]
344+ [%every gap=@dr reply=$-(@da M)]
345+ [%url reply=$-(path M)]
346+
347+:: Count a finite list with the source-backed addition gate.
348+++ lent |= xs=(list A)
349+ ^- @ud
350+ ?- xs
351+ ~ 0
352+ [item rest] (add 1 (lent rest))
353+
354+++ lth |= args=[A A]
355+ ?- args
356+ [x y] (gth y x)
357+
358+++ gte |= args=[A A]
359+ ?- args
360+ [x y] (not (gth y x))
361+
362+++ lte |= args=[A A]
363+ ?- args
364+ [x y] (not (gth x y))
365+
366+++ zing |= xss=(list (list A))
367+ ^- (list A)
368+ ?- xss
369+ ~ ~
370+ [xs rest] (weld xs (zing rest))
371+
372+++ lead |= first=A |= second=B [first second]
373+++ late |= second=B |= first=A [first second]
374+
375+++ succ |= x=A (add x 1)
tests/clay-fixtures/mark-update-import-expected.txtnew file+1
@@ -0,0 +1 @@
1+"(union [added item=[id=@ud [done=(union @f:0 @f:1) text=@t]]] [toggled id=@ud])"
tests/clay-fixtures/mark-update-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-update/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-update -.mark])
8+=/ show-gate=vase (slap reader (ream 'show-result'))
9+(pure:m (slym show-gate +.got))
tests/clay-fixtures/tlon-mop-expected.txtnew file+1
@@ -0,0 +1 @@
1+[%.y %.y %.y]
tests/clay-fixtures/tlon-mop.txtnew file+20
@@ -0,0 +1,20 @@
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/mop-tlon-probe/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+=/ result=vase (slym read-gate [%notes %log -.src])
8+=/ recursive=vase (slym read-gate [%notes %import-node -.src])
9+=/ nested=vase (slym read-gate [%notes %a-notebook -.src])
10+=/ contains-ref
11+ |= node=*
12+ ?: =(node [%ref %notes %import-node]) &
13+ ?@ node |
14+ |($(node -.node) $(node +.node))
15+=/ contains-named
16+ |= node=*
17+ ?: ?=([%named %notes %import-node [%fork *]] node) (contains-ref node)
18+ ?@ node |
19+ |($(node -.node) $(node +.node))
20+(pure:m !>([?=([%& [%apply %mop [[%atom %da ~] [%fork *] ~]]] +.result) &(?=([%& [%fork *]] +.recursive) (contains-ref +.recursive)) &(?=([%& [%fork *]] +.nested) (contains-named +.nested))]))
tests/golden/doc-grammar-04-step/source.jibb+1−1
@@ -10,5 +10,5 @@
10 [%move %left n] "left {n}"
10 [%move %left n] "left {n}"
11 [%move %right n] "right {n}"
11 [%move %right n] "right {n}"
12 [t %draft] t
12 [t %draft] t
13− [t %sent at] t
13+ [t %sent sent-at] t
14 %stop "stop"
14 %stop "stop"
tests/golden/doc-grammar-04-step/tokens.txt+2−2
@@ -74,8 +74,8 @@
7413:5 glyph [
7413:5 glyph [
7513:6 tight name t
7513:6 tight name t
7613:8 lit %sent
7613:8 lit %sent
77−13:14 name at
77+13:14 name sent-at
78−13:16 tight glyph ]
78+13:21 tight glyph ]
7913:23 name t
7913:23 name t
8014:5 NEWLINE
8014:5 NEWLINE
8114:5 lit %stop
8114:5 lit %stop
tests/golden/doc-grammar-04-step/tree.txt+1−1
@@ -33,6 +33,6 @@
33 (cell 12:5 (bind 12:6 t) (lit 12:8 %draft))
33 (cell 12:5 (bind 12:6 t) (lit 12:8 %draft))
34 (wing 12:23 t))
34 (wing 12:23 t))
35 (arm 13:5
35 (arm 13:5
36− (cell 13:5 (bind 13:6 t) (lit 13:8 %sent) (bind 13:14 at))
36+ (cell 13:5 (bind 13:6 t) (lit 13:8 %sent) (bind 13:14 sent-at))
37 (wing 13:23 t))
37 (wing 13:23 t))
38 (arm 14:5 (lit 14:5 %stop) (str 14:23 "stop")))))))
38 (arm 14:5 (lit 14:5 %stop) (str 14:23 "stop")))))))
tests/golden/doc-grammar-06-cart-store/about.txt+1
@@ -1,3 +1,4 @@
1source: Grammar tab, section "Example: a store and an island", code block 6 of the tab (block 5 is the EBNF)
1source: Grammar tab, section "Example: a store and an island", code block 6 of the tab (block 5 is the EBNF)
2tests: 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))`
2tests: 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))`
3expect: parses
3expect: parses
4+expect-types: a partial inference report; store kind and declaration scope remain unresolved
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+2
@@ -0,0 +1,2 @@
1+partial inference; module not checked
2+module kind or scope needs unsupported inference
tests/golden/inline-mold-opaque/about.txt+2−2
@@ -1,3 +1,3 @@
1−source: Grammar tab, Molds: "Opaque: `poke`, `ask` and `qath`, built only by derived gates, `pure` and application-path literals."
1+source: Grammar tab, Molds: "`poke`, `ask` and `qath` are transparent types, defined in the internal prelude and re-exported normally; callers can construct and inspect their values."
2−tests: the opaque molds by name
2+tests: the effect and application-path types by name
3expect: parses
3expect: parses
tests/golden/parser-hole-parameter-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: An anonymous hole is not a named generic parameter.
3+expect: error at 1:12
tests/golden/parser-hole-parameter-rejected/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ bad |$ [_] @t
tests/golden/parser-hole-parameter-rejected/tokens.txtnew file+8
@@ -0,0 +1,8 @@
1+1:1 glyph +$
2+1:4 name bad
3+1:8 glyph |$
4+1:11 glyph [
5+1:12 tight glyph _
6+1:13 tight glyph ]
7+1:15 aura @t
8+1:17 NEWLINE
tests/golden/parser-hole-parameter-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-parameter-rejected/source.jibb:1:12: expected a type variable, found `_`
2++$ bad |$ [_] @t
3+ ^
tests/golden/parser-hole-path-space/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A path-segment type hole must remain tight after the field's `=`.
3+expect: error at 1:14
tests/golden/parser-hole-path-space/source.jibbnew file+1
@@ -0,0 +1 @@
1++$ path /[id= _]
tests/golden/parser-hole-path-space/tokens.txtnew file+9
@@ -0,0 +1,9 @@
1+1:1 glyph +$
2+1:4 name path
3+1:9 glyph /
4+1:10 tight glyph [
5+1:11 tight name id
6+1:13 tight glyph =
7+1:15 glyph _
8+1:16 tight glyph ]
9+1:17 NEWLINE
tests/golden/parser-hole-path-space/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-path-space/source.jibb:1:14: expected an aura or type hole right after `=`, found a space
2++$ path /[id= _]
3+ ^
tests/golden/parser-hole-path/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: Underscores in `/_` and `%/_` remain literal path knots, while `[id=_]` is a typed-segment hole.
3+expect: parses
tests/golden/parser-hole-path/source.jibbnew file+4
@@ -0,0 +1,4 @@
1++$ root /_
2++$ child /item/_x
3+++ show %/_
4++$ inferred /items/[id=_]
tests/golden/parser-hole-path/tokens.txtnew file+28
@@ -0,0 +1,28 @@
1+1:1 glyph +$
2+1:4 name root
3+1:9 glyph /
4+1:10 tight knot _
5+2:1 NEWLINE
6+2:1 glyph +$
7+2:4 name child
8+2:10 glyph /
9+2:11 tight knot item
10+2:15 tight glyph /
11+2:16 tight knot _x
12+3:1 NEWLINE
13+3:1 glyph ++
14+3:4 name show
15+3:9 glyph %/
16+3:11 tight knot _
17+4:1 NEWLINE
18+4:1 glyph +$
19+4:4 name inferred
20+4:13 glyph /
21+4:14 tight knot items
22+4:19 tight glyph /
23+4:20 tight glyph [
24+4:21 tight name id
25+4:23 tight glyph =
26+4:24 tight glyph _
27+4:25 tight glyph ]
28+4:26 NEWLINE
tests/golden/parser-hole-path/tree.txtnew file+5
@@ -0,0 +1,5 @@
1+(module
2+ (mold 1:1 root (path 1:9 /_))
3+ (mold 2:1 child (path 2:10 /item/_x))
4+ (value 3:1 show (qath 3:9 _))
5+ (mold 4:1 inferred (path 4:13 /items/[id=_])))
tests/golden/parser-hole-pattern-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A type hole is not a branch-pattern wildcard.
3+expect: error at 3:5
tests/golden/parser-hole-pattern-rejected/source.jibbnew file+3
@@ -0,0 +1,3 @@
1+++ bad |= x=@t
2+ ?- x
3+ _ "no"
tests/golden/parser-hole-pattern-rejected/tokens.txtnew file+15
@@ -0,0 +1,15 @@
1+1:1 glyph ++
2+1:4 name bad
3+1:8 glyph |=
4+1:11 name x
5+1:12 tight glyph =
6+1:13 tight aura @t
7+2:3 INDENT
8+2:3 glyph ?-
9+2:6 name x
10+3:5 INDENT
11+3:5 glyph _
12+3:7 str "no"
13+3:11 DEDENT
14+3:11 DEDENT
15+3:11 NEWLINE
tests/golden/parser-hole-pattern-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-pattern-rejected/source.jibb:3:5: expected a pattern, found `_`
2+ _ "no"
3+ ^
tests/golden/parser-hole-shapes/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: Holes in samples, casts, nested records, gate molds and generic mold arguments have their own source spans.
3+expect: parses
tests/golden/parser-hole-shapes/source.jibbnew file+11
@@ -0,0 +1,11 @@
1++$ unused _
2++$ nested [a=_ b=$-(_ (list _))]
3++$ alias |$ [A] (pair A _)
4+++ identity |= x=_ x
5+++ inferred ^- _ "hello"
6+++ cast-nested |= x=[$-(_ _) (list _)] ^- [first=_ second=_] [x x]
7+++ bare-sample |= _ "hello"
8+++ cell-sample |= [a=_ b=_] [a b]
9+++ local |= x=@t
10+ ++ inside |= y=_ ^- _ y
11+ (inside x)
tests/golden/parser-hole-shapes/tokens.txtnew file+121
@@ -0,0 +1,121 @@
1+1:1 glyph +$
2+1:4 name unused
3+1:11 glyph _
4+2:1 NEWLINE
5+2:1 glyph +$
6+2:4 name nested
7+2:11 glyph [
8+2:12 tight name a
9+2:13 tight glyph =
10+2:14 tight glyph _
11+2:16 name b
12+2:17 tight glyph =
13+2:18 tight glyph $-(
14+2:21 tight glyph _
15+2:23 glyph (
16+2:24 tight name list
17+2:29 glyph _
18+2:30 tight glyph )
19+2:31 tight glyph )
20+2:32 tight glyph ]
21+3:1 NEWLINE
22+3:1 glyph +$
23+3:4 name alias
24+3:10 glyph |$
25+3:13 glyph [
26+3:14 tight tvar A
27+3:15 tight glyph ]
28+3:17 glyph (
29+3:18 tight name pair
30+3:23 tvar A
31+3:25 glyph _
32+3:26 tight glyph )
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name identity
36+4:13 glyph |=
37+4:16 name x
38+4:17 tight glyph =
39+4:18 tight glyph _
40+4:20 name x
41+5:1 NEWLINE
42+5:1 glyph ++
43+5:4 name inferred
44+5:13 glyph ^-
45+5:16 glyph _
46+5:18 str "hello"
47+6:1 NEWLINE
48+6:1 glyph ++
49+6:4 name cast-nested
50+6:16 glyph |=
51+6:19 name x
52+6:20 tight glyph =
53+6:21 tight glyph [
54+6:22 tight glyph $-(
55+6:25 tight glyph _
56+6:27 glyph _
57+6:28 tight glyph )
58+6:30 glyph (
59+6:31 tight name list
60+6:36 glyph _
61+6:37 tight glyph )
62+6:38 tight glyph ]
63+6:40 glyph ^-
64+6:43 glyph [
65+6:44 tight name first
66+6:49 tight glyph =
67+6:50 tight glyph _
68+6:52 name second
69+6:58 tight glyph =
70+6:59 tight glyph _
71+6:60 tight glyph ]
72+6:62 glyph [
73+6:63 tight name x
74+6:65 name x
75+6:66 tight glyph ]
76+7:1 NEWLINE
77+7:1 glyph ++
78+7:4 name bare-sample
79+7:16 glyph |=
80+7:19 glyph _
81+7:21 str "hello"
82+8:1 NEWLINE
83+8:1 glyph ++
84+8:4 name cell-sample
85+8:16 glyph |=
86+8:19 glyph [
87+8:20 tight name a
88+8:21 tight glyph =
89+8:22 tight glyph _
90+8:24 name b
91+8:25 tight glyph =
92+8:26 tight glyph _
93+8:27 tight glyph ]
94+8:29 glyph [
95+8:30 tight name a
96+8:32 name b
97+8:33 tight glyph ]
98+9:1 NEWLINE
99+9:1 glyph ++
100+9:4 name local
101+9:10 glyph |=
102+9:13 name x
103+9:14 tight glyph =
104+9:15 tight aura @t
105+10:3 INDENT
106+10:3 glyph ++
107+10:6 name inside
108+10:13 glyph |=
109+10:16 name y
110+10:17 tight glyph =
111+10:18 tight glyph _
112+10:20 glyph ^-
113+10:23 glyph _
114+10:25 name y
115+11:3 NEWLINE
116+11:3 glyph (
117+11:4 tight name inside
118+11:11 name x
119+11:12 tight glyph )
120+11:13 DEDENT
121+11:13 NEWLINE
tests/golden/parser-hole-shapes/tree.txtnew file+47
@@ -0,0 +1,47 @@
1+(module
2+ (mold 1:1 unused (hole 1:11))
3+ (mold 2:1 nested
4+ (cell 2:11
5+ (face 2:12 a (hole 2:14))
6+ (face 2:16 b
7+ (fn 2:18
8+ (hole 2:21)
9+ (apply 2:23 list (hole 2:29))))))
10+ (mold 3:1 alias
11+ (generic 3:10 A
12+ (apply 3:17 pair (tvar 3:23 A) (hole 3:25))))
13+ (value 4:1 identity
14+ (gate 4:13
15+ (face 4:16 x (hole 4:18))
16+ (wing 4:20 x)))
17+ (value 5:1 inferred
18+ (cast 5:13 (hole 5:16) (str 5:18 "hello")))
19+ (value 6:1 cast-nested
20+ (gate 6:16
21+ (face 6:19 x
22+ (cell 6:21
23+ (fn 6:22 (hole 6:25) (hole 6:27))
24+ (apply 6:30 list (hole 6:36))))
25+ (cast 6:40
26+ (cell 6:43
27+ (face 6:44 first (hole 6:50))
28+ (face 6:52 second (hole 6:59)))
29+ (tuple 6:62 (wing 6:63 x) (wing 6:65 x)))))
30+ (value 7:1 bare-sample
31+ (gate 7:16 (hole 7:19) (str 7:21 "hello")))
32+ (value 8:1 cell-sample
33+ (gate 8:16
34+ (cell 8:19
35+ (face 8:20 a (hole 8:22))
36+ (face 8:24 b (hole 8:26)))
37+ (tuple 8:29 (wing 8:30 a) (wing 8:32 b))))
38+ (value 9:1 local
39+ (gate 9:10
40+ (face 9:13 x (aura 9:15 @t))
41+ (body 10:3
42+ (value 10:3 inside
43+ (gate 10:13
44+ (face 10:16 y (hole 10:18))
45+ (cast 10:20 (hole 10:23) (wing 10:25 y))))
46+ (group 11:3
47+ (call 11:4 (wing 11:4 inside) (wing 11:11 x)))))))
tests/golden/parser-hole-value-rejected/about.txtnew file+3
@@ -0,0 +1,3 @@
1+source: Grammar, Types and molds: `_` is an inferred type hole.
2+tests: A type hole is not a value expression.
3+expect: error at 1:8
tests/golden/parser-hole-value-rejected/source.jibbnew file+1
@@ -0,0 +1 @@
1+++ bad _
tests/golden/parser-hole-value-rejected/tokens.txtnew file+4
@@ -0,0 +1,4 @@
1+1:1 glyph ++
2+1:4 name bad
3+1:8 glyph _
4+1:9 NEWLINE
tests/golden/parser-hole-value-rejected/tree.txtnew file+3
@@ -0,0 +1,3 @@
1+/tests/golden/parser-hole-value-rejected/source.jibb:1:8: expected an expression, found `_`
2+++ bad _
3+ ^
tests/golden/prelude-1c-structural/source.jibb+8
@@ -96,6 +96,14 @@
96
96
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98
98
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
99++ wonk |= veq=(like A)
107++ wonk |= veq=(like A)
100 ?- q.veq
108 ?- q.veq
101 ~ !!
109 ~ !!
tests/golden/prelude-1c-structural/tokens.txt+199−124
@@ -588,144 +588,219 @@
58897:45 tight glyph ]
58897:45 tight glyph ]
58999:1 NEWLINE
58999:1 NEWLINE
59099:1 glyph ++
59099:1 glyph ++
591−99:4 name wonk
591+99:4 name like
59299:9 glyph |=
59299:9 glyph |=
593−99:12 name veq
593+99:12 glyph [
594−99:15 tight glyph =
594+99:13 tight name f
595−99:16 tight glyph (
595+99:14 tight glyph =
596−99:17 tight name like
596+99:15 tight glyph $-(
597−99:22 tvar A
597+99:18 tight tvar A
598−99:23 tight glyph )
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
599100:3 INDENT
607100:3 INDENT
600−100:3 glyph ?-
608+100:3 glyph ++
601−100:6 wing q.veq
609+100:6 name mapped
602101:5 INDENT
610101:5 INDENT
603−101:5 lit ~
611+101:5 glyph ^-
604−101:7 glyph !!
612+101:8 glyph (
605−102:5 NEWLINE
613+101:9 tight name unit
606−102:5 glyph [
614+101:14 glyph [
607−102:6 tight lit ~
615+101:15 tight name p
608−102:8 name product
616+101:16 tight glyph =
609−102:15 tight glyph ]
617+101:17 tight tvar B
610−102:17 wing p.product
618+101:19 name q
611−104:1 DEDENT
619+101:20 tight glyph =
612−104:1 DEDENT
620+101:21 tight name nail
613−104:1 NEWLINE
621+101:25 tight glyph ]
614−104:1 glyph +$
622+101:26 tight glyph )
615−104:4 name lone
623+102:7 INDENT
616−104:9 glyph |$
624+102:7 glyph ?-
617−104:12 glyph [
625+102:10 wing q.result
618−104:13 tight tvar A
626+103:9 INDENT
619−104:14 tight glyph ]
627+103:9 lit ~
620−104:16 glyph [
628+103:11 lit ~
621−104:17 tight name p
629+104:9 NEWLINE
622−104:18 tight glyph =
630+104:9 glyph [
623−104:19 tight tvar A
631+104:10 tight lit ~
624−104:20 tight glyph ]
632+104:12 name value
625−106:1 NEWLINE
633+104:17 tight glyph ]
626−106:1 glyph +$
634+104:19 glyph `
627−106:4 name lest
635+104:20 tight glyph [
628−106:9 glyph |$
636+104:21 tight name p
629−106:12 glyph [
637+104:22 tight glyph =
630−106:13 tight tvar A
638+104:23 tight glyph (
631−106:14 tight glyph ]
639+104:24 tight name f
632−106:16 glyph [
640+104:26 wing p.value
633−106:17 tight name i
641+104:33 tight glyph )
634−106:18 tight glyph =
642+104:35 name q
635−106:19 tight tvar A
643+104:36 tight glyph =
636−106:21 name t
644+104:37 tight wing q.value
637−106:22 tight glyph =
645+104:44 tight glyph ]
638−106:23 tight glyph (
646+105:3 DEDENT
639−106:24 tight name list
647+105:3 DEDENT
640−106:29 tvar A
648+105:3 DEDENT
641−106:30 tight glyph )
649+105:3 NEWLINE
642−106:31 tight glyph ]
650+105:3 glyph ^-
643−108:1 NEWLINE
651+105:6 glyph (
644−108:1 glyph +$
652+105:7 tight name like
645−108:4 name pole
653+105:12 tvar B
646−108:9 glyph |$
654+105:13 tight glyph )
647−108:12 glyph [
655+105:15 glyph [
648−108:13 tight tvar A
656+105:16 tight name p
649−108:14 tight glyph ]
657+105:17 tight glyph =
650−109:3 INDENT
658+105:18 tight wing p.result
651−109:3 lit ~
659+105:27 name q
652−110:3 NEWLINE
660+105:28 tight glyph =
653−110:3 glyph [
661+105:29 tight name mapped
654−110:4 tight tvar A
662+105:35 tight glyph ]
655−110:6 glyph (
663+107:1 DEDENT
656−110:7 tight name pole
664+107:1 NEWLINE
657−110:12 tvar A
665+107:1 glyph ++
658−110:13 tight glyph )
666+107:4 name wonk
659−110:14 tight glyph ]
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
674+108:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+112:1 DEDENT
660112:1 DEDENT
687112:1 DEDENT
661112:1 NEWLINE
688112:1 NEWLINE
662112:1 glyph +$
689112:1 glyph +$
663−112:4 name quip
690+112:4 name lone
664112:9 glyph |$
691112:9 glyph |$
665112:12 glyph [
692112:12 glyph [
666112:13 tight tvar A
693112:13 tight tvar A
667−112:15 tvar B
694+112:14 tight glyph ]
668−112:16 tight glyph ]
695+112:16 glyph [
669−112:18 glyph [
696+112:17 tight name p
670−112:19 tight glyph (
697+112:18 tight glyph =
671−112:20 tight name list
698+112:19 tight tvar A
672−112:25 tvar A
699+112:20 tight glyph ]
673−112:26 tight glyph )
674−112:28 tvar B
675−112:29 tight glyph ]
676114:1 NEWLINE
700114:1 NEWLINE
677114:1 glyph +$
701114:1 glyph +$
678−114:4 name tree
702+114:4 name lest
679114:9 glyph |$
703114:9 glyph |$
680114:12 glyph [
704114:12 glyph [
681114:13 tight tvar A
705114:13 tight tvar A
682114:14 tight glyph ]
706114:14 tight glyph ]
683−115:3 INDENT
707+114:16 glyph [
684−115:3 lit ~
708+114:17 tight name i
685−116:3 NEWLINE
709+114:18 tight glyph =
686−116:3 glyph [
710+114:19 tight tvar A
687−116:4 tight name n
711+114:21 name t
688−116:5 tight glyph =
712+114:22 tight glyph =
689−116:6 tight tvar A
713+114:23 tight glyph (
690−116:8 name l
714+114:24 tight name list
691−116:9 tight glyph =
715+114:29 tvar A
692−116:10 tight glyph (
716+114:30 tight glyph )
693−116:11 tight name tree
717+114:31 tight glyph ]
694−116:16 tvar A
718+116:1 NEWLINE
695−116:17 tight glyph )
719+116:1 glyph +$
696−116:19 name r
720+116:4 name pole
697−116:20 tight glyph =
721+116:9 glyph |$
698−116:21 tight glyph (
722+116:12 glyph [
699−116:22 tight name tree
723+116:13 tight tvar A
700−116:27 tvar A
724+116:14 tight glyph ]
701−116:28 tight glyph )
725+117:3 INDENT
702−116:29 tight glyph ]
726+117:3 lit ~
703−118:1 DEDENT
727+118:3 NEWLINE
704−118:1 NEWLINE
728+118:3 glyph [
705−118:1 glyph +$
729+118:4 tight tvar A
706−118:4 name each
730+118:6 glyph (
707−118:9 glyph |$
731+118:7 tight name pole
708−118:12 glyph [
732+118:12 tvar A
709−118:13 tight tvar A
733+118:13 tight glyph )
710−118:15 tvar B
734+118:14 tight glyph ]
711−118:16 tight glyph ]
735+120:1 DEDENT
712−119:3 INDENT
736+120:1 NEWLINE
713−119:3 glyph [
737+120:1 glyph +$
714−119:4 tight lit %|
738+120:4 name quip
715−119:7 name p
739+120:9 glyph |$
716−119:8 tight glyph =
740+120:12 glyph [
717−119:9 tight tvar B
741+120:13 tight tvar A
718−119:10 tight glyph ]
742+120:15 tvar B
719−120:3 NEWLINE
743+120:16 tight glyph ]
720−120:3 glyph [
744+120:18 glyph [
721−120:4 tight lit %&
745+120:19 tight glyph (
722−120:7 name p
746+120:20 tight name list
723−120:8 tight glyph =
747+120:25 tvar A
724−120:9 tight tvar A
748+120:26 tight glyph )
725−120:10 tight glyph ]
749+120:28 tvar B
726−122:1 DEDENT
750+120:29 tight glyph ]
727122:1 NEWLINE
751122:1 NEWLINE
728122:1 glyph +$
752122:1 glyph +$
729−122:4 name bloq
753+122:4 name tree
730−122:9 aura @
754+122:9 glyph |$
731−122:10 NEWLINE
755+122:12 glyph [
756+122:13 tight tvar A
757+122:14 tight glyph ]
758+123:3 INDENT
759+123:3 lit ~
760+124:3 NEWLINE
761+124:3 glyph [
762+124:4 tight name n
763+124:5 tight glyph =
764+124:6 tight tvar A
765+124:8 name l
766+124:9 tight glyph =
767+124:10 tight glyph (
768+124:11 tight name tree
769+124:16 tvar A
770+124:17 tight glyph )
771+124:19 name r
772+124:20 tight glyph =
773+124:21 tight glyph (
774+124:22 tight name tree
775+124:27 tvar A
776+124:28 tight glyph )
777+124:29 tight glyph ]
778+126:1 DEDENT
779+126:1 NEWLINE
780+126:1 glyph +$
781+126:4 name each
782+126:9 glyph |$
783+126:12 glyph [
784+126:13 tight tvar A
785+126:15 tvar B
786+126:16 tight glyph ]
787+127:3 INDENT
788+127:3 glyph [
789+127:4 tight lit %|
790+127:7 name p
791+127:8 tight glyph =
792+127:9 tight tvar B
793+127:10 tight glyph ]
794+128:3 NEWLINE
795+128:3 glyph [
796+128:4 tight lit %&
797+128:7 name p
798+128:8 tight glyph =
799+128:9 tight tvar A
800+128:10 tight glyph ]
801+130:1 DEDENT
802+130:1 NEWLINE
803+130:1 glyph +$
804+130:4 name bloq
805+130:9 aura @
806+130:10 NEWLINE
tests/golden/prelude-1c-structural/tree.txt+82−50
@@ -235,56 +235,88 @@
235 (cell 97:32
235 (cell 97:32
236 (face 97:33 p (tvar 97:35 A))
236 (face 97:33 p (tvar 97:35 A))
237 (face 97:37 q (ref 97:39 nail))))))))
237 (face 97:37 q (ref 97:39 nail))))))))
238− (value 99:1 wonk
238+ (value 99:1 like
239 (gate 99:9
239 (gate 99:9
240− (face 99:12 veq
240+ (cell 99:12
241− (apply 99:16 like (tvar 99:22 A)))
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
242 (body 100:3
245 (body 100:3
243− (branch 100:3
246+ (value 100:3 mapped
244− (wing 100:6 q.veq)
247+ (body 101:5
245− (arm 101:5 (lit 101:5 ~) (crash 101:7))
248+ (cast 101:5
246− (arm 102:5
249+ (apply 101:8 unit
247− (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
250+ (cell 101:14
248− (wing 102:17 p.product))))))
251+ (face 101:15 p (tvar 101:17 B))
249− (mold 104:1 lone
252+ (face 101:19 q (ref 101:21 nail))))
250− (generic 104:9 A
253+ (body 102:7
251− (cell 104:16
254+ (branch 102:7
252− (face 104:17 p (tvar 104:19 A)))))
255+ (wing 102:10 q.result)
253− (mold 106:1 lest
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
254− (generic 106:9 A
257+ (arm 104:9
255− (cell 106:16
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
256− (face 106:17 i (tvar 106:19 A))
259+ (unit 104:19
257− (face 106:21 t
260+ (tuple 104:20
258− (apply 106:23 list (tvar 106:29 A))))))
261+ (face 104:21 p
259− (mold 108:1 pole
262+ (group 104:23
260− (generic 108:9 A
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
261− (union 109:3
264+ (face 104:35 q (wing 104:37 q.value))))))))))
262− (const 109:3 ~)
265+ (cast 105:3
263− (cell 110:3
266+ (apply 105:6 like (tvar 105:12 B))
264− (tvar 110:4 A)
267+ (tuple 105:15
265− (apply 110:6 pole (tvar 110:12 A))))))
268+ (face 105:16 p (wing 105:18 p.result))
266− (mold 112:1 quip
269+ (face 105:27 q (wing 105:29 mapped)))))))
267− (generic 112:9 A B
270+ (value 107:1 wonk
268− (cell 112:18
271+ (gate 107:9
269− (apply 112:19 list (tvar 112:25 A))
272+ (face 107:12 veq
270− (tvar 112:28 B))))
273+ (apply 107:16 like (tvar 107:22 A)))
271− (mold 114:1 tree
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product))))))
281+ (mold 112:1 lone
282+ (generic 112:9 A
283+ (cell 112:16
284+ (face 112:17 p (tvar 112:19 A)))))
285+ (mold 114:1 lest
272 (generic 114:9 A
286 (generic 114:9 A
273− (union 115:3
287+ (cell 114:16
274− (const 115:3 ~)
288+ (face 114:17 i (tvar 114:19 A))
275− (cell 116:3
289+ (face 114:21 t
276− (face 116:4 n (tvar 116:6 A))
290+ (apply 114:23 list (tvar 114:29 A))))))
277− (face 116:8 l
291+ (mold 116:1 pole
278− (apply 116:10 tree (tvar 116:16 A)))
292+ (generic 116:9 A
279− (face 116:19 r
293+ (union 117:3
280− (apply 116:21 tree (tvar 116:27 A)))))))
294+ (const 117:3 ~)
281− (mold 118:1 each
295+ (cell 118:3
282− (generic 118:9 A B
296+ (tvar 118:4 A)
283− (union 119:3
297+ (apply 118:6 pole (tvar 118:12 A))))))
284− (cell 119:3
298+ (mold 120:1 quip
285− (const 119:4 %|)
299+ (generic 120:9 A B
286− (face 119:7 p (tvar 119:9 B)))
300+ (cell 120:18
287− (cell 120:3
301+ (apply 120:19 list (tvar 120:25 A))
288− (const 120:4 %&)
302+ (tvar 120:28 B))))
289− (face 120:7 p (tvar 120:9 A))))))
303+ (mold 122:1 tree
290− (mold 122:1 bloq (aura 122:9 @)))
304+ (generic 122:9 A
305+ (union 123:3
306+ (const 123:3 ~)
307+ (cell 124:3
308+ (face 124:4 n (tvar 124:6 A))
309+ (face 124:8 l
310+ (apply 124:10 tree (tvar 124:16 A)))
311+ (face 124:19 r
312+ (apply 124:21 tree (tvar 124:27 A)))))))
313+ (mold 126:1 each
314+ (generic 126:9 A B
315+ (union 127:3
316+ (cell 127:3
317+ (const 127:4 %|)
318+ (face 127:7 p (tvar 127:9 B)))
319+ (cell 128:3
320+ (const 128:4 %&)
321+ (face 128:7 p (tvar 128:9 A))))))
322+ (mold 130:1 bloq (aura 130:9 @)))
tests/golden/prelude-1c-structural/types.txt+1
@@ -27,6 +27,7 @@ partial inference; module not checked
27+$ spot: not checked
27+$ spot: not checked
28+$ toon: cases proven disjoint; mold not checked
28+$ toon: cases proven disjoint; mold not checked
29+$ like: not checked
29+$ like: not checked
30+++ like: sample mold is not supported by partial inference
30++ wonk: sample mold is not supported by partial inference
31++ wonk: sample mold is not supported by partial inference
31+$ lone: not checked
32+$ lone: not checked
32+$ lest: not checked
33+$ lest: not checked
tests/golden/prelude-3g-like/about.txt+3−3
@@ -1,4 +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`.
1+source: Overview, Prelude: Hoon 3g includes `like` and `wonk`; the value `like` maps an existing result.
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`.
2+tests: The source includes the generic `like` mold, its mapping gate and `wonk`.
3expect: parses
3expect: parses
4−expect-types: a partial inference report, not a checked module; generic molds and the `wonk` body are not fully checked yet
4+expect-types: a partial inference report, not a checked module
tests/golden/prelude-3g-like/source.jibb+8
@@ -96,6 +96,14 @@
96
96
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98
98
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
99++ wonk |= veq=(like A)
107++ wonk |= veq=(like A)
100 ?- q.veq
108 ?- q.veq
101 ~ !!
109 ~ !!
tests/golden/prelude-3g-like/tokens.txt+95−20
@@ -588,26 +588,101 @@
58897:45 tight glyph ]
58897:45 tight glyph ]
58999:1 NEWLINE
58999:1 NEWLINE
59099:1 glyph ++
59099:1 glyph ++
591−99:4 name wonk
591+99:4 name like
59299:9 glyph |=
59299:9 glyph |=
593−99:12 name veq
593+99:12 glyph [
594−99:15 tight glyph =
594+99:13 tight name f
595−99:16 tight glyph (
595+99:14 tight glyph =
596−99:17 tight name like
596+99:15 tight glyph $-(
597−99:22 tvar A
597+99:18 tight tvar A
598−99:23 tight glyph )
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
599100:3 INDENT
607100:3 INDENT
600−100:3 glyph ?-
608+100:3 glyph ++
601−100:6 wing q.veq
609+100:6 name mapped
602101:5 INDENT
610101:5 INDENT
603−101:5 lit ~
611+101:5 glyph ^-
604−101:7 glyph !!
612+101:8 glyph (
605−102:5 NEWLINE
613+101:9 tight name unit
606−102:5 glyph [
614+101:14 glyph [
607−102:6 tight lit ~
615+101:15 tight name p
608−102:8 name product
616+101:16 tight glyph =
609−102:15 tight glyph ]
617+101:17 tight tvar B
610−102:17 wing p.product
618+101:19 name q
611−102:26 DEDENT
619+101:20 tight glyph =
612−102:26 DEDENT
620+101:21 tight name nail
613−102:26 NEWLINE
621+101:25 tight glyph ]
622+101:26 tight glyph )
623+102:7 INDENT
624+102:7 glyph ?-
625+102:10 wing q.result
626+103:9 INDENT
627+103:9 lit ~
628+103:11 lit ~
629+104:9 NEWLINE
630+104:9 glyph [
631+104:10 tight lit ~
632+104:12 name value
633+104:17 tight glyph ]
634+104:19 glyph `
635+104:20 tight glyph [
636+104:21 tight name p
637+104:22 tight glyph =
638+104:23 tight glyph (
639+104:24 tight name f
640+104:26 wing p.value
641+104:33 tight glyph )
642+104:35 name q
643+104:36 tight glyph =
644+104:37 tight wing q.value
645+104:44 tight glyph ]
646+105:3 DEDENT
647+105:3 DEDENT
648+105:3 DEDENT
649+105:3 NEWLINE
650+105:3 glyph ^-
651+105:6 glyph (
652+105:7 tight name like
653+105:12 tvar B
654+105:13 tight glyph )
655+105:15 glyph [
656+105:16 tight name p
657+105:17 tight glyph =
658+105:18 tight wing p.result
659+105:27 name q
660+105:28 tight glyph =
661+105:29 tight name mapped
662+105:35 tight glyph ]
663+107:1 DEDENT
664+107:1 NEWLINE
665+107:1 glyph ++
666+107:4 name wonk
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
674+108:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+110:26 DEDENT
687+110:26 DEDENT
688+110:26 NEWLINE
tests/golden/prelude-3g-like/tree.txt+41−9
@@ -235,14 +235,46 @@
235 (cell 97:32
235 (cell 97:32
236 (face 97:33 p (tvar 97:35 A))
236 (face 97:33 p (tvar 97:35 A))
237 (face 97:37 q (ref 97:39 nail))))))))
237 (face 97:37 q (ref 97:39 nail))))))))
238− (value 99:1 wonk
238+ (value 99:1 like
239 (gate 99:9
239 (gate 99:9
240− (face 99:12 veq
240+ (cell 99:12
241− (apply 99:16 like (tvar 99:22 A)))
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
242 (body 100:3
245 (body 100:3
243− (branch 100:3
246+ (value 100:3 mapped
244− (wing 100:6 q.veq)
247+ (body 101:5
245− (arm 101:5 (lit 101:5 ~) (crash 101:7))
248+ (cast 101:5
246− (arm 102:5
249+ (apply 101:8 unit
247− (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
250+ (cell 101:14
248− (wing 102:17 p.product)))))))
251+ (face 101:15 p (tvar 101:17 B))
252+ (face 101:19 q (ref 101:21 nail))))
253+ (body 102:7
254+ (branch 102:7
255+ (wing 102:10 q.result)
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
257+ (arm 104:9
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
259+ (unit 104:19
260+ (tuple 104:20
261+ (face 104:21 p
262+ (group 104:23
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
264+ (face 104:35 q (wing 104:37 q.value))))))))))
265+ (cast 105:3
266+ (apply 105:6 like (tvar 105:12 B))
267+ (tuple 105:15
268+ (face 105:16 p (wing 105:18 p.result))
269+ (face 105:27 q (wing 105:29 mapped)))))))
270+ (value 107:1 wonk
271+ (gate 107:9
272+ (face 107:12 veq
273+ (apply 107:16 like (tvar 107:22 A)))
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product)))))))
tests/golden/prelude-3g-like/types.txt+1
@@ -27,4 +27,5 @@ partial inference; module not checked
27+$ spot: not checked
27+$ spot: not checked
28+$ toon: cases proven disjoint; mold not checked
28+$ toon: cases proven disjoint; mold not checked
29+$ like: not checked
29+$ like: not checked
30+++ like: sample mold is not supported by partial inference
30++ wonk: sample mold is not supported by partial inference
31++ wonk: sample mold is not supported by partial inference
tests/golden/prelude-list-helpers/source.jibb+8
@@ -96,6 +96,14 @@
96
96
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98
98
99+++ like |= [f=$-(A B) result=(like A)]
100+ ++ mapped
101+ ^- (unit [p=B q=nail])
102+ ?- q.result
103+ ~ ~
104+ [~ value] `[p=(f p.value) q=q.value]
105+ ^- (like B) [p=p.result q=mapped]
106+
99++ wonk |= veq=(like A)
107++ wonk |= veq=(like A)
100 ?- q.veq
108 ?- q.veq
101 ~ !!
109 ~ !!
tests/golden/prelude-list-helpers/tokens.txt+319−244
@@ -588,266 +588,341 @@
58897:45 tight glyph ]
58897:45 tight glyph ]
58999:1 NEWLINE
58999:1 NEWLINE
59099:1 glyph ++
59099:1 glyph ++
591−99:4 name wonk
591+99:4 name like
59299:9 glyph |=
59299:9 glyph |=
593−99:12 name veq
593+99:12 glyph [
594−99:15 tight glyph =
594+99:13 tight name f
595−99:16 tight glyph (
595+99:14 tight glyph =
596−99:17 tight name like
596+99:15 tight glyph $-(
597−99:22 tvar A
597+99:18 tight tvar A
598−99:23 tight glyph )
598+99:20 tvar B
599+99:21 tight glyph )
600+99:23 name result
601+99:29 tight glyph =
602+99:30 tight glyph (
603+99:31 tight name like
604+99:36 tvar A
605+99:37 tight glyph )
606+99:38 tight glyph ]
599100:3 INDENT
607100:3 INDENT
600−100:3 glyph ?-
608+100:3 glyph ++
601−100:6 wing q.veq
609+100:6 name mapped
602101:5 INDENT
610101:5 INDENT
603−101:5 lit ~
611+101:5 glyph ^-
604−101:7 glyph !!
612+101:8 glyph (
605−102:5 NEWLINE
613+101:9 tight name unit
606−102:5 glyph [
614+101:14 glyph [
607−102:6 tight lit ~
615+101:15 tight name p
608−102:8 name product
616+101:16 tight glyph =
609−102:15 tight glyph ]
617+101:17 tight tvar B
610−102:17 wing p.product
618+101:19 name q
611−104:1 DEDENT
619+101:20 tight glyph =
612−104:1 DEDENT
620+101:21 tight name nail
613−104:1 NEWLINE
621+101:25 tight glyph ]
614−104:1 glyph +$
622+101:26 tight glyph )
615−104:4 name lone
623+102:7 INDENT
616−104:9 glyph |$
624+102:7 glyph ?-
617−104:12 glyph [
625+102:10 wing q.result
618−104:13 tight tvar A
626+103:9 INDENT
619−104:14 tight glyph ]
627+103:9 lit ~
620−104:16 glyph [
628+103:11 lit ~
621−104:17 tight name p
629+104:9 NEWLINE
622−104:18 tight glyph =
630+104:9 glyph [
623−104:19 tight tvar A
631+104:10 tight lit ~
624−104:20 tight glyph ]
632+104:12 name value
625−106:1 NEWLINE
633+104:17 tight glyph ]
626−106:1 glyph +$
634+104:19 glyph `
627−106:4 name lest
635+104:20 tight glyph [
628−106:9 glyph |$
636+104:21 tight name p
629−106:12 glyph [
637+104:22 tight glyph =
630−106:13 tight tvar A
638+104:23 tight glyph (
631−106:14 tight glyph ]
639+104:24 tight name f
632−106:16 glyph [
640+104:26 wing p.value
633−106:17 tight name i
641+104:33 tight glyph )
634−106:18 tight glyph =
642+104:35 name q
635−106:19 tight tvar A
643+104:36 tight glyph =
636−106:21 name t
644+104:37 tight wing q.value
637−106:22 tight glyph =
645+104:44 tight glyph ]
638−106:23 tight glyph (
646+105:3 DEDENT
639−106:24 tight name list
647+105:3 DEDENT
640−106:29 tvar A
648+105:3 DEDENT
641−106:30 tight glyph )
649+105:3 NEWLINE
642−106:31 tight glyph ]
650+105:3 glyph ^-
643−108:1 NEWLINE
651+105:6 glyph (
644−108:1 glyph +$
652+105:7 tight name like
645−108:4 name pole
653+105:12 tvar B
646−108:9 glyph |$
654+105:13 tight glyph )
647−108:12 glyph [
655+105:15 glyph [
648−108:13 tight tvar A
656+105:16 tight name p
649−108:14 tight glyph ]
657+105:17 tight glyph =
650−109:3 INDENT
658+105:18 tight wing p.result
651−109:3 lit ~
659+105:27 name q
652−110:3 NEWLINE
660+105:28 tight glyph =
653−110:3 glyph [
661+105:29 tight name mapped
654−110:4 tight tvar A
662+105:35 tight glyph ]
655−110:6 glyph (
663+107:1 DEDENT
656−110:7 tight name pole
664+107:1 NEWLINE
657−110:12 tvar A
665+107:1 glyph ++
658−110:13 tight glyph )
666+107:4 name wonk
659−110:14 tight glyph ]
667+107:9 glyph |=
668+107:12 name veq
669+107:15 tight glyph =
670+107:16 tight glyph (
671+107:17 tight name like
672+107:22 tvar A
673+107:23 tight glyph )
674+108:3 INDENT
675+108:3 glyph ?-
676+108:6 wing q.veq
677+109:5 INDENT
678+109:5 lit ~
679+109:7 glyph !!
680+110:5 NEWLINE
681+110:5 glyph [
682+110:6 tight lit ~
683+110:8 name product
684+110:15 tight glyph ]
685+110:17 wing p.product
686+112:1 DEDENT
660112:1 DEDENT
687112:1 DEDENT
661112:1 NEWLINE
688112:1 NEWLINE
662112:1 glyph +$
689112:1 glyph +$
663−112:4 name quip
690+112:4 name lone
664112:9 glyph |$
691112:9 glyph |$
665112:12 glyph [
692112:12 glyph [
666112:13 tight tvar A
693112:13 tight tvar A
667−112:15 tvar B
694+112:14 tight glyph ]
668−112:16 tight glyph ]
695+112:16 glyph [
669−112:18 glyph [
696+112:17 tight name p
670−112:19 tight glyph (
697+112:18 tight glyph =
671−112:20 tight name list
698+112:19 tight tvar A
672−112:25 tvar A
699+112:20 tight glyph ]
673−112:26 tight glyph )
674−112:28 tvar B
675−112:29 tight glyph ]
676114:1 NEWLINE
700114:1 NEWLINE
677114:1 glyph +$
701114:1 glyph +$
678−114:4 name tree
702+114:4 name lest
679114:9 glyph |$
703114:9 glyph |$
680114:12 glyph [
704114:12 glyph [
681114:13 tight tvar A
705114:13 tight tvar A
682114:14 tight glyph ]
706114:14 tight glyph ]
683−115:3 INDENT
707+114:16 glyph [
684−115:3 lit ~
708+114:17 tight name i
685−116:3 NEWLINE
709+114:18 tight glyph =
686−116:3 glyph [
710+114:19 tight tvar A
687−116:4 tight name n
711+114:21 name t
688−116:5 tight glyph =
712+114:22 tight glyph =
689−116:6 tight tvar A
713+114:23 tight glyph (
690−116:8 name l
714+114:24 tight name list
691−116:9 tight glyph =
715+114:29 tvar A
692−116:10 tight glyph (
716+114:30 tight glyph )
693−116:11 tight name tree
717+114:31 tight glyph ]
694−116:16 tvar A
718+116:1 NEWLINE
695−116:17 tight glyph )
719+116:1 glyph +$
696−116:19 name r
720+116:4 name pole
697−116:20 tight glyph =
721+116:9 glyph |$
698−116:21 tight glyph (
722+116:12 glyph [
699−116:22 tight name tree
723+116:13 tight tvar A
700−116:27 tvar A
724+116:14 tight glyph ]
701−116:28 tight glyph )
725+117:3 INDENT
702−116:29 tight glyph ]
726+117:3 lit ~
703−118:1 DEDENT
727+118:3 NEWLINE
704−118:1 NEWLINE
728+118:3 glyph [
705−118:1 glyph +$
729+118:4 tight tvar A
706−118:4 name each
730+118:6 glyph (
707−118:9 glyph |$
731+118:7 tight name pole
708−118:12 glyph [
732+118:12 tvar A
709−118:13 tight tvar A
733+118:13 tight glyph )
710−118:15 tvar B
734+118:14 tight glyph ]
711−118:16 tight glyph ]
735+120:1 DEDENT
712−119:3 INDENT
736+120:1 NEWLINE
713−119:3 glyph [
737+120:1 glyph +$
714−119:4 tight lit %|
738+120:4 name quip
715−119:7 name p
739+120:9 glyph |$
716−119:8 tight glyph =
740+120:12 glyph [
717−119:9 tight tvar B
741+120:13 tight tvar A
718−119:10 tight glyph ]
742+120:15 tvar B
719−120:3 NEWLINE
743+120:16 tight glyph ]
720−120:3 glyph [
744+120:18 glyph [
721−120:4 tight lit %&
745+120:19 tight glyph (
722−120:7 name p
746+120:20 tight name list
723−120:8 tight glyph =
747+120:25 tvar A
724−120:9 tight tvar A
748+120:26 tight glyph )
725−120:10 tight glyph ]
749+120:28 tvar B
726−122:1 DEDENT
750+120:29 tight glyph ]
727122:1 NEWLINE
751122:1 NEWLINE
728122:1 glyph +$
752122:1 glyph +$
729−122:4 name bloq
753+122:4 name tree
730−122:9 aura @
754+122:9 glyph |$
731−124:1 NEWLINE
755+122:12 glyph [
732−124:1 glyph ++
756+122:13 tight tvar A
733−124:4 name some
757+122:14 tight glyph ]
734−124:9 glyph |=
758+123:3 INDENT
735−124:12 name item
759+123:3 lit ~
736−124:16 tight glyph =
760+124:3 NEWLINE
737−124:17 tight tvar A
761+124:3 glyph [
738−124:19 glyph `
762+124:4 tight name n
739−124:20 tight name item
763+124:5 tight glyph =
764+124:6 tight tvar A
765+124:8 name l
766+124:9 tight glyph =
767+124:10 tight glyph (
768+124:11 tight name tree
769+124:16 tvar A
770+124:17 tight glyph )
771+124:19 name r
772+124:20 tight glyph =
773+124:21 tight glyph (
774+124:22 tight name tree
775+124:27 tvar A
776+124:28 tight glyph )
777+124:29 tight glyph ]
778+126:1 DEDENT
740126:1 NEWLINE
779126:1 NEWLINE
741−126:1 glyph ++
780+126:1 glyph +$
742−126:4 name lure
781+126:4 name each
743−126:9 glyph |=
782+126:9 glyph |$
744−126:12 name item
783+126:12 glyph [
745−126:16 tight glyph =
784+126:13 tight tvar A
746−126:17 tight tvar A
785+126:15 tvar B
786+126:16 tight glyph ]
747127:3 INDENT
787127:3 INDENT
748−127:3 glyph ^-
788+127:3 glyph [
749−127:6 glyph (
789+127:4 tight lit %|
750−127:7 tight name list
790+127:7 name p
751−127:12 tvar A
791+127:8 tight glyph =
752−127:13 tight glyph )
792+127:9 tight tvar B
753−127:15 glyph [
793+127:10 tight glyph ]
754−127:16 tight name item
794+128:3 NEWLINE
755−127:21 lit ~
795+128:3 glyph [
756−127:22 tight glyph ]
796+128:4 tight lit %&
757−129:1 DEDENT
797+128:7 name p
758−129:1 NEWLINE
798+128:8 tight glyph =
759−129:1 glyph ++
799+128:9 tight tvar A
760−129:4 name snoc
800+128:10 tight glyph ]
761−129:9 glyph |=
801+130:1 DEDENT
762−129:12 name args
802+130:1 NEWLINE
763−129:16 tight glyph =
803+130:1 glyph +$
764−129:17 tight glyph [
804+130:4 name bloq
765−129:18 tight glyph (
805+130:9 aura @
766−129:19 tight name list
806+132:1 NEWLINE
767−129:24 tvar A
807+132:1 glyph ++
768−129:25 tight glyph )
808+132:4 name some
769−129:27 tvar A
809+132:9 glyph |=
770−129:28 tight glyph ]
810+132:12 name item
771−130:3 INDENT
811+132:16 tight glyph =
772−130:3 glyph ?-
812+132:17 tight tvar A
773−130:6 name args
813+132:19 glyph `
774−131:5 INDENT
814+132:20 tight name item
775−131:5 glyph [
815+134:1 NEWLINE
776−131:6 tight name xs
816+134:1 glyph ++
777−131:9 name item
817+134:4 name lure
778−131:13 tight glyph ]
818+134:9 glyph |=
779−131:15 glyph (
819+134:12 name item
780−131:16 tight name weld
820+134:16 tight glyph =
781−131:21 name xs
821+134:17 tight tvar A
782−131:24 glyph [
822+135:3 INDENT
783−131:25 tight name item
823+135:3 glyph ^-
784−131:30 lit ~
824+135:6 glyph (
785−131:31 tight glyph ]
825+135:7 tight name list
786−131:32 tight glyph )
826+135:12 tvar A
787−133:1 DEDENT
827+135:13 tight glyph )
788−133:1 DEDENT
828+135:15 glyph [
789−133:1 NEWLINE
829+135:16 tight name item
790−133:1 glyph ++
830+135:21 lit ~
791−133:4 name flop
831+135:22 tight glyph ]
792−133:9 glyph |=
832+137:1 DEDENT
793−133:12 name xs
833+137:1 NEWLINE
794−133:14 tight glyph =
834+137:1 glyph ++
795−133:15 tight glyph (
835+137:4 name snoc
796−133:16 tight name list
836+137:9 glyph |=
797−133:21 tvar A
837+137:12 name args
798−133:22 tight glyph )
838+137:16 tight glyph =
799−134:3 INDENT
839+137:17 tight glyph [
800−134:3 glyph ++
840+137:18 tight glyph (
801−134:6 name reverse-into
841+137:19 tight name list
802−134:19 glyph |=
842+137:24 tvar A
803−134:22 name args
843+137:25 tight glyph )
804−134:26 tight glyph =
844+137:27 tvar A
805−134:27 tight glyph [
845+137:28 tight glyph ]
806−134:28 tight glyph (
846+138:3 INDENT
807−134:29 tight name list
847+138:3 glyph ?-
808−134:34 tvar A
848+138:6 name args
809−134:35 tight glyph )
849+139:5 INDENT
810−134:37 glyph (
850+139:5 glyph [
811−134:38 tight name list
851+139:6 tight name xs
812−134:43 tvar A
852+139:9 name item
813−134:44 tight glyph )
853+139:13 tight glyph ]
814−134:45 tight glyph ]
854+139:15 glyph (
815−135:5 INDENT
855+139:16 tight name weld
816−135:5 glyph ?-
856+139:21 name xs
817−135:8 name args
857+139:24 glyph [
818−136:7 INDENT
858+139:25 tight name item
819−136:7 glyph [
859+139:30 lit ~
820−136:8 tight name rest
860+139:31 tight glyph ]
821−136:13 name acc
861+139:32 tight glyph )
822−136:16 tight glyph ]
862+141:1 DEDENT
823−137:9 INDENT
863+141:1 DEDENT
824−137:9 glyph ?-
864+141:1 NEWLINE
825−137:12 name rest
865+141:1 glyph ++
826−138:11 INDENT
866+141:4 name flop
827−138:11 lit ~
867+141:9 glyph |=
828−138:13 name acc
868+141:12 name xs
829−139:11 NEWLINE
869+141:14 tight glyph =
830−139:11 glyph [
870+141:15 tight glyph (
831−139:12 tight name item
871+141:16 tight name list
832−139:17 name more
872+141:21 tvar A
833−139:21 tight glyph ]
873+141:22 tight glyph )
834−139:23 glyph (
874+142:3 INDENT
835−139:24 tight name reverse-into
875+142:3 glyph ++
836−139:37 name more
876+142:6 name reverse-into
837−139:42 glyph [
877+142:19 glyph |=
838−139:43 tight name item
878+142:22 name args
839−139:48 name acc
879+142:26 tight glyph =
840−139:51 tight glyph ]
880+142:27 tight glyph [
841−139:52 tight glyph )
881+142:28 tight glyph (
842−140:3 DEDENT
882+142:29 tight name list
843−140:3 DEDENT
883+142:34 tvar A
844−140:3 DEDENT
884+142:35 tight glyph )
845−140:3 DEDENT
885+142:37 glyph (
846−140:3 NEWLINE
886+142:38 tight name list
847−140:3 glyph (
887+142:43 tvar A
848−140:4 tight name reverse-into
888+142:44 tight glyph )
849−140:17 name xs
889+142:45 tight glyph ]
850−140:20 lit ~
890+143:5 INDENT
851−140:21 tight glyph )
891+143:5 glyph ?-
852−140:22 DEDENT
892+143:8 name args
853−140:22 NEWLINE
893+144:7 INDENT
894+144:7 glyph [
895+144:8 tight name rest
896+144:13 name acc
897+144:16 tight glyph ]
898+145:9 INDENT
899+145:9 glyph ?-
900+145:12 name rest
901+146:11 INDENT
902+146:11 lit ~
903+146:13 name acc
904+147:11 NEWLINE
905+147:11 glyph [
906+147:12 tight name item
907+147:17 name more
908+147:21 tight glyph ]
909+147:23 glyph (
910+147:24 tight name reverse-into
911+147:37 name more
912+147:42 glyph [
913+147:43 tight name item
914+147:48 name acc
915+147:51 tight glyph ]
916+147:52 tight glyph )
917+148:3 DEDENT
918+148:3 DEDENT
919+148:3 DEDENT
920+148:3 DEDENT
921+148:3 NEWLINE
922+148:3 glyph (
923+148:4 tight name reverse-into
924+148:17 name xs
925+148:20 lit ~
926+148:21 tight glyph )
927+148:22 DEDENT
928+148:22 NEWLINE
tests/golden/prelude-list-helpers/tree.txt+138−106
@@ -235,112 +235,144 @@
235 (cell 97:32
235 (cell 97:32
236 (face 97:33 p (tvar 97:35 A))
236 (face 97:33 p (tvar 97:35 A))
237 (face 97:37 q (ref 97:39 nail))))))))
237 (face 97:37 q (ref 97:39 nail))))))))
238− (value 99:1 wonk
238+ (value 99:1 like
239 (gate 99:9
239 (gate 99:9
240− (face 99:12 veq
240+ (cell 99:12
241− (apply 99:16 like (tvar 99:22 A)))
241+ (face 99:13 f
242+ (fn 99:15 (tvar 99:18 A) (tvar 99:20 B)))
243+ (face 99:23 result
244+ (apply 99:30 like (tvar 99:36 A))))
242 (body 100:3
245 (body 100:3
243− (branch 100:3
246+ (value 100:3 mapped
244− (wing 100:6 q.veq)
247+ (body 101:5
245− (arm 101:5 (lit 101:5 ~) (crash 101:7))
248+ (cast 101:5
246− (arm 102:5
249+ (apply 101:8 unit
247− (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
250+ (cell 101:14
248− (wing 102:17 p.product))))))
251+ (face 101:15 p (tvar 101:17 B))
249− (mold 104:1 lone
252+ (face 101:19 q (ref 101:21 nail))))
250− (generic 104:9 A
253+ (body 102:7
251− (cell 104:16
254+ (branch 102:7
252− (face 104:17 p (tvar 104:19 A)))))
255+ (wing 102:10 q.result)
253− (mold 106:1 lest
256+ (arm 103:9 (lit 103:9 ~) (lit 103:11 ~))
254− (generic 106:9 A
257+ (arm 104:9
255− (cell 106:16
258+ (cell 104:9 (lit 104:10 ~) (bind 104:12 value))
256− (face 106:17 i (tvar 106:19 A))
259+ (unit 104:19
257− (face 106:21 t
260+ (tuple 104:20
258− (apply 106:23 list (tvar 106:29 A))))))
261+ (face 104:21 p
259− (mold 108:1 pole
262+ (group 104:23
260− (generic 108:9 A
263+ (call 104:24 (wing 104:24 f) (wing 104:26 p.value))))
261− (union 109:3
264+ (face 104:35 q (wing 104:37 q.value))))))))))
262− (const 109:3 ~)
265+ (cast 105:3
263− (cell 110:3
266+ (apply 105:6 like (tvar 105:12 B))
264− (tvar 110:4 A)
267+ (tuple 105:15
265− (apply 110:6 pole (tvar 110:12 A))))))
268+ (face 105:16 p (wing 105:18 p.result))
266− (mold 112:1 quip
269+ (face 105:27 q (wing 105:29 mapped)))))))
267− (generic 112:9 A B
270+ (value 107:1 wonk
268− (cell 112:18
271+ (gate 107:9
269− (apply 112:19 list (tvar 112:25 A))
272+ (face 107:12 veq
270− (tvar 112:28 B))))
273+ (apply 107:16 like (tvar 107:22 A)))
271− (mold 114:1 tree
274+ (body 108:3
275+ (branch 108:3
276+ (wing 108:6 q.veq)
277+ (arm 109:5 (lit 109:5 ~) (crash 109:7))
278+ (arm 110:5
279+ (cell 110:5 (lit 110:6 ~) (bind 110:8 product))
280+ (wing 110:17 p.product))))))
281+ (mold 112:1 lone
282+ (generic 112:9 A
283+ (cell 112:16
284+ (face 112:17 p (tvar 112:19 A)))))
285+ (mold 114:1 lest
272 (generic 114:9 A
286 (generic 114:9 A
273− (union 115:3
287+ (cell 114:16
274− (const 115:3 ~)
288+ (face 114:17 i (tvar 114:19 A))
275− (cell 116:3
289+ (face 114:21 t
276− (face 116:4 n (tvar 116:6 A))
290+ (apply 114:23 list (tvar 114:29 A))))))
277− (face 116:8 l
291+ (mold 116:1 pole
278− (apply 116:10 tree (tvar 116:16 A)))
292+ (generic 116:9 A
279− (face 116:19 r
293+ (union 117:3
280− (apply 116:21 tree (tvar 116:27 A)))))))
294+ (const 117:3 ~)
281− (mold 118:1 each
295+ (cell 118:3
282− (generic 118:9 A B
296+ (tvar 118:4 A)
283− (union 119:3
297+ (apply 118:6 pole (tvar 118:12 A))))))
284− (cell 119:3
298+ (mold 120:1 quip
285− (const 119:4 %|)
299+ (generic 120:9 A B
286− (face 119:7 p (tvar 119:9 B)))
300+ (cell 120:18
287− (cell 120:3
301+ (apply 120:19 list (tvar 120:25 A))
288− (const 120:4 %&)
302+ (tvar 120:28 B))))
289− (face 120:7 p (tvar 120:9 A))))))
303+ (mold 122:1 tree
290− (mold 122:1 bloq (aura 122:9 @))
304+ (generic 122:9 A
291− (value 124:1 some
305+ (union 123:3
292− (gate 124:9
306+ (const 123:3 ~)
293− (face 124:12 item (tvar 124:17 A))
307+ (cell 124:3
294− (unit 124:19 (wing 124:20 item))))
308+ (face 124:4 n (tvar 124:6 A))
295− (value 126:1 lure
309+ (face 124:8 l
296− (gate 126:9
310+ (apply 124:10 tree (tvar 124:16 A)))
297− (face 126:12 item (tvar 126:17 A))
311+ (face 124:19 r
298− (body 127:3
312+ (apply 124:21 tree (tvar 124:27 A)))))))
299− (cast 127:3
313+ (mold 126:1 each
300− (apply 127:6 list (tvar 127:12 A))
314+ (generic 126:9 A B
301− (tuple 127:15 (wing 127:16 item) (lit 127:21 ~))))))
315+ (union 127:3
302− (value 129:1 snoc
316+ (cell 127:3
303− (gate 129:9
317+ (const 127:4 %|)
304− (face 129:12 args
318+ (face 127:7 p (tvar 127:9 B)))
305− (cell 129:17
319+ (cell 128:3
306− (apply 129:18 list (tvar 129:24 A))
320+ (const 128:4 %&)
307− (tvar 129:27 A)))
321+ (face 128:7 p (tvar 128:9 A))))))
308− (body 130:3
322+ (mold 130:1 bloq (aura 130:9 @))
309− (branch 130:3
323+ (value 132:1 some
310− (wing 130:6 args)
324+ (gate 132:9
311− (arm 131:5
325+ (face 132:12 item (tvar 132:17 A))
312− (cell 131:5 (bind 131:6 xs) (bind 131:9 item))
326+ (unit 132:19 (wing 132:20 item))))
313− (group 131:15
327+ (value 134:1 lure
314− (call 131:16
328+ (gate 134:9
315− (wing 131:16 weld)
329+ (face 134:12 item (tvar 134:17 A))
316− (wing 131:21 xs)
330+ (body 135:3
317− (tuple 131:24 (wing 131:25 item) (lit 131:30 ~)))))))))
331+ (cast 135:3
318− (value 133:1 flop
332+ (apply 135:6 list (tvar 135:12 A))
319− (gate 133:9
333+ (tuple 135:15 (wing 135:16 item) (lit 135:21 ~))))))
320− (face 133:12 xs
334+ (value 137:1 snoc
321− (apply 133:15 list (tvar 133:21 A)))
335+ (gate 137:9
322− (body 134:3
336+ (face 137:12 args
323− (value 134:3 reverse-into
337+ (cell 137:17
324− (gate 134:19
338+ (apply 137:18 list (tvar 137:24 A))
325− (face 134:22 args
339+ (tvar 137:27 A)))
326− (cell 134:27
340+ (body 138:3
327− (apply 134:28 list (tvar 134:34 A))
341+ (branch 138:3
328− (apply 134:37 list (tvar 134:43 A))))
342+ (wing 138:6 args)
329− (body 135:5
343+ (arm 139:5
330− (branch 135:5
344+ (cell 139:5 (bind 139:6 xs) (bind 139:9 item))
331− (wing 135:8 args)
345+ (group 139:15
332− (arm 136:7
346+ (call 139:16
333− (cell 136:7 (bind 136:8 rest) (bind 136:13 acc))
347+ (wing 139:16 weld)
334− (body 137:9
348+ (wing 139:21 xs)
335− (branch 137:9
349+ (tuple 139:24 (wing 139:25 item) (lit 139:30 ~)))))))))
336− (wing 137:12 rest)
350+ (value 141:1 flop
337− (arm 138:11 (lit 138:11 ~) (wing 138:13 acc))
351+ (gate 141:9
338− (arm 139:11
352+ (face 141:12 xs
339− (cell 139:11 (bind 139:12 item) (bind 139:17 more))
353+ (apply 141:15 list (tvar 141:21 A)))
340− (group 139:23
354+ (body 142:3
341− (call 139:24
355+ (value 142:3 reverse-into
342− (wing 139:24 reverse-into)
356+ (gate 142:19
343− (wing 139:37 more)
357+ (face 142:22 args
344− (tuple 139:42 (wing 139:43 item) (wing 139:48 acc))))))))))))
358+ (cell 142:27
345− (group 140:3
359+ (apply 142:28 list (tvar 142:34 A))
346− (call 140:4 (wing 140:4 reverse-into) (wing 140:17 xs) (lit 140:20 ~)))))))
360+ (apply 142:37 list (tvar 142:43 A))))
361+ (body 143:5
362+ (branch 143:5
363+ (wing 143:8 args)
364+ (arm 144:7
365+ (cell 144:7 (bind 144:8 rest) (bind 144:13 acc))
366+ (body 145:9
367+ (branch 145:9
368+ (wing 145:12 rest)
369+ (arm 146:11 (lit 146:11 ~) (wing 146:13 acc))
370+ (arm 147:11
371+ (cell 147:11 (bind 147:12 item) (bind 147:17 more))
372+ (group 147:23
373+ (call 147:24
374+ (wing 147:24 reverse-into)
375+ (wing 147:37 more)
376+ (tuple 147:42 (wing 147:43 item) (wing 147:48 acc))))))))))))
377+ (group 148:3
378+ (call 148:4 (wing 148:4 reverse-into) (wing 148:17 xs) (lit 148:20 ~)))))))
tests/golden/prelude-list-helpers/types.txt+2−1
@@ -27,6 +27,7 @@ partial inference; module not checked
27+$ spot: not checked
27+$ spot: not checked
28+$ toon: cases proven disjoint; mold not checked
28+$ toon: cases proven disjoint; mold not checked
29+$ like: not checked
29+$ like: not checked
30+++ like: sample mold is not supported by partial inference
30++ wonk: sample mold is not supported by partial inference
31++ wonk: sample mold is not supported by partial inference
31+$ lone: not checked
32+$ lone: not checked
32+$ lest: not checked
33+$ lest: not checked
@@ -35,7 +36,7 @@ partial inference; module not checked
35+$ tree: cases proven disjoint; mold not checked
36+$ tree: cases proven disjoint; mold not checked
36+$ each: cases proven disjoint; mold not checked
37+$ each: cases proven disjoint; mold not checked
37+$ bloq: not checked
38+$ bloq: not checked
38−++ some: expression is not supported by partial inference
39+++ some: unit construction needs the standard prelude in partial inference
39++ lure: cast mold is not supported by partial inference
40++ lure: cast mold is not supported by partial inference
40++ snoc: sample mold is not supported by partial inference
41++ snoc: sample mold is not supported by partial inference
41++ flop: sample mold is not supported by partial inference
42++ flop: sample mold is not supported by partial inference
tests/golden/prelude-unit-list-transforms/about.txt+1−1
@@ -1,4 +1,4 @@
1source: 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.
1source: 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.
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. It also includes the source-backed `ask` re-export and `pure` gate.
3expect: parses
3expect: parses
4expect-types: a partial inference report, not a checked module; unit and list gate typing is not complete
4expect-types: a partial inference report, not a checked module; unit and list gate typing is not complete
tests/golden/prelude-unit-list-transforms/source.jibb+115−61
@@ -1,4 +1,9 @@
1+/= internal /lib/jibb/internal
2++$ poke poke.internal
3++$ qath qath.internal
4+
1:: Initial prelude functions. The rest of the inventory is still to come.
5:: Initial prelude functions. The rest of the inventory is still to come.
6+
2++ same |= x=A x
7++ same |= x=A x
3
8
4++ head |= p=[A B]
9++ head |= p=[A B]
@@ -96,6 +101,14 @@
96
101
97+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
102+$ like |$ [A] [p=hair q=(unit [p=A q=nail])]
98
103
104+++ like |= [f=$-(A B) result=(like A)]
105+ ++ mapped
106+ ^- (unit [p=B q=nail])
107+ ?- q.result
108+ ~ ~
109+ [~ value] `[p=(f p.value) q=q.value]
110+ ^- (like B) [p=p.result q=mapped]
111+
99++ wonk |= veq=(like A)
112++ wonk |= veq=(like A)
100 ?- q.veq
113 ?- q.veq
101 ~ !!
114 ~ !!
@@ -140,27 +153,34 @@
140 (reverse-into xs ~)
153 (reverse-into xs ~)
141
154
142++ drop |= maybe=(unit A)
155++ drop |= maybe=(unit A)
143− ?- maybe
156+ ^- (list A)
144− ~ ~
157+ ?- maybe
145− [~ value] [value ~]
158+ ~ ~
159+ [~ value] [value ~]
160+
161+++ bond |= fallback=$-(~ A)
162+ |= maybe=(unit A)
163+ ?- maybe
164+ ~ (fallback ~)
165+ [~ value] value
146
166
147++ bind |= args=[(unit A) $-(A B)]
167++ bind |= args=[(unit A) $-(A B)]
148 ?- args
168 ?- args
149− [maybe f]
169+ [maybe f] ^- (unit B)
150 ?- maybe
170 ?- maybe
151 ~ ~
171 ~ ~
152 [~ value] `(f value)
172 [~ value] `(f value)
153
173
154++ biff |= args=[(unit A) $-(A (unit B))]
174++ biff |= args=[(unit A) $-(A (unit B))]
155 ?- args
175 ?- args
156− [maybe f]
176+ [maybe f] ^- (unit B)
157 ?- maybe
177 ?- maybe
158 ~ ~
178 ~ ~
159 [~ value] (f value)
179 [~ value] (f value)
160
180
161++ both |= args=[(unit A) (unit B)]
181++ both |= args=[(unit A) (unit B)]
162 ?- args
182 ?- args
163− [first second]
183+ [first second] ^- (unit [A B])
164 ?- first
184 ?- first
165 ~ ~
185 ~ ~
166 [~ a]
186 [~ a]
@@ -170,7 +190,7 @@
170
190
171++ clap |= args=[(unit A) (unit A) $-([A A] A)]
191++ clap |= args=[(unit A) (unit A) $-([A A] A)]
172 ?- args
192 ?- args
173− [first second combine]
193+ [first second combine] ^- (unit A)
174 ?- first
194 ?- first
175 ~ second
195 ~ second
176 [~ a]
196 [~ a]
@@ -180,7 +200,7 @@
180
200
181++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
201++ clef |= args=[(unit A) (unit B) $-([A B] (unit C))]
182 ?- args
202 ?- args
183− [first second combine]
203+ [first second combine] ^- (unit C)
184 ?- first
204 ?- first
185 ~ ~
205 ~ ~
186 [~ a]
206 [~ a]
@@ -190,43 +210,45 @@
190
210
191++ skim |= args=[(list A) $-(A ?)]
211++ skim |= args=[(list A) $-(A ?)]
192 ?- args
212 ?- args
193− [xs predicate]
213+ [xs predicate] ^- (list A)
194− ?- xs
214+ ?- xs
195− ~ ~
215+ ~ ~
196− [item rest]
216+ [item rest]
197− ?- (predicate item)
217+ ?- (predicate item)
198− %.y [item (skim rest predicate)]
218+ %.y [item (skim rest predicate)]
199− %.n (skim rest predicate)
219+ %.n (skim rest predicate)
200
220
201++ skip |= args=[(list A) $-(A ?)]
221++ skip |= args=[(list A) $-(A ?)]
202 ?- args
222 ?- args
203− [xs predicate]
223+ [xs predicate] ^- (list A)
204− ?- xs
224+ ?- xs
205− ~ ~
225+ ~ ~
206− [item rest]
226+ [item rest]
207− ?- (predicate item)
227+ ?- (predicate item)
208− %.y (skip rest predicate)
228+ %.y (skip rest predicate)
209− %.n [item (skip rest predicate)]
229+ %.n [item (skip rest predicate)]
210
230
211++ levy |= args=[(list A) $-(A ?)]
231++ levy |= args=[(list A) $-(A ?)]
212− ?- args
232+ ^- ?
213− [xs predicate]
233+ ?- args
214− ?- xs
234+ [xs predicate]
215− ~ %.y
235+ ?- xs
216− [item rest]
236+ ~ %.y
217− ?- (predicate item)
237+ [item rest]
218− %.y (levy rest predicate)
238+ ?- (predicate item)
219− %.n %.n
239+ %.y (levy rest predicate)
240+ %.n %.n
220
241
221++ lien |= args=[(list A) $-(A ?)]
242++ lien |= args=[(list A) $-(A ?)]
222− ?- args
243+ ^- ?
223− [xs predicate]
244+ ?- args
224− ?- xs
245+ [xs predicate]
225− ~ %.n
246+ ?- xs
226− [item rest]
247+ ~ %.n
227− ?- (predicate item)
248+ [item rest]
228− %.y %.y
249+ ?- (predicate item)
229− %.n (lien rest predicate)
250+ %.y %.y
251+ %.n (lien rest predicate)
230
252
231++ roll |= args=[(list A) B $-([A B] B)]
253++ roll |= args=[(list A) B $-([A B] B)]
232 ?- args
254 ?- args
@@ -244,37 +266,39 @@
244
266
245++ flit |= predicate=$-(A ?)
267++ flit |= predicate=$-(A ?)
246 |= value=A
268 |= value=A
247− ?- (predicate value)
269+ ^- (unit A)
248− %.y `value
270+ ?- (predicate value)
249− %.n ~
271+ %.y `value
272+ %.n ~
250
273
251++ murn |= args=[(list A) $-(A (unit B))]
274++ murn |= args=[(list A) $-(A (unit B))]
252 ?- args
275 ?- args
253− [xs f]
276+ [xs f] ^- (list B)
254− ?- xs
277+ ?- xs
255− ~ ~
278+ ~ ~
256− [item rest]
279+ [item rest]
257− ?- (f item)
280+ ?- (f item)
258− ~ (murn rest f)
281+ ~ (murn rest f)
259− [~ value] [value (murn rest f)]
282+ [~ value] [value (murn rest f)]
260
283
261++ join |= args=[A (list A)]
284++ join |= args=[A (list A)]
262 ?- args
285 ?- args
263− [separator xs]
286+ [separator xs] ^- (list A)
264− ?- xs
287+ ?- xs
265− ~ ~
288+ ~ ~
266− [item rest]
289+ [item rest]
267− ?- rest
290+ ?- rest
268− ~ [item ~]
291+ ~ [item ~]
269− [next more] [item [separator (join separator rest)]]
292+ [next more] [item [separator (join separator rest)]]
270
293
271++ snip |= xs=(list A)
294++ snip |= xs=(list A)
272− ?- xs
295+ ^- (list A)
273− ~ ~
296+ ?- xs
274− [item rest]
297+ ~ ~
275− ?- rest
298+ [item rest]
276− ~ ~
299+ ?- rest
277− [next more] [item (snip rest)]
300+ ~ ~
301+ [next more] [item (snip rest)]
278
302
279++ rear |= xs=(list A)
303++ rear |= xs=(list A)
280 ?- xs
304 ?- xs
@@ -283,3 +307,33 @@
283 ?- rest
307 ?- rest
284 ~ item
308 ~ item
285 [next more] (rear rest)
309 [next more] (rear rest)
310+
311+++ cork |= gates=[$-(A B) $-(B C)]
312+ ?- gates
313+ [f g] |= x=A (g (f x))
314+
315+++ corl |= gates=[$-(B C) $-(A B)]
316+ ?- gates
317+ [f g] |= x=A (f (g x))
318+
319+++ cury |= args=[$-([A B] C) A]
320+ ?- args
321+ [f a] |= b=B (f a b)
322+
323+++ curr |= args=[$-([A B] C) B]
324+ ?- args
325+ [f b] |= a=A (f a b)
326+
327++$ cmd |$ [M]
328+ [%poke p=poke reply=$-((unit @t) M)]
329+ [%go url=@t]
330+ [%wait gap=@dr msg=M]
331+ [%now reply=$-(@da M)]
332+ [%who reply=$-(@p M)]
333+
334+++ gth |= args=[A A] (gth-atom.internal args)
335+++ add |= args=[A A] (add-atom.internal args)
336+++ dec |= atom=A (dec-atom.internal atom)
337+
338++$ ask |$ [M] (ask.internal M)
339+++ pure |= x=M ^- (ask M) [%pure x]
tests/golden/prelude-unit-list-transforms/tokens.txt+1994−1518
@@ -1,1098 +1,1120 @@
1−2:1 glyph ++
1+1:1 glyph /=
2−2:4 name same
2+1:4 name internal
3−2:9 glyph |=
3+1:13 glyph /
4−2:12 name x
4+1:14 tight knot lib
5−2:13 tight glyph =
5+1:17 tight glyph /
6−2:14 tight tvar A
6+1:18 tight knot jibb
7−2:16 name x
7+1:22 tight glyph /
8−4:1 NEWLINE
8+1:23 tight knot internal
9−4:1 glyph ++
9+2:1 NEWLINE
10−4:4 name head
10+2:1 glyph +$
11−4:9 glyph |=
11+2:4 name poke
12−4:12 name p
12+2:9 wing poke.internal
13−4:13 tight glyph =
13+3:1 NEWLINE
14−4:14 tight glyph [
14+3:1 glyph +$
15−4:15 tight tvar A
15+3:4 name qath
16−4:17 tvar B
16+3:9 wing qath.internal
17−4:18 tight glyph ]
17+7:1 NEWLINE
18−5:3 INDENT
18+7:1 glyph ++
19−5:3 glyph ?-
19+7:4 name same
20−5:6 name p
20+7:9 glyph |=
21−6:5 INDENT
21+7:12 name x
22−6:5 glyph [
22+7:13 tight glyph =
23−6:6 tight name a
23+7:14 tight tvar A
24−6:8 name b
24+7:16 name x
25−6:9 tight glyph ]
25+9:1 NEWLINE
26−6:11 name a
26+9:1 glyph ++
27−8:1 DEDENT
27+9:4 name head
28−8:1 DEDENT
28+9:9 glyph |=
29−8:1 NEWLINE
29+9:12 name p
30−8:1 glyph ++
30+9:13 tight glyph =
31−8:4 name tail
31+9:14 tight glyph [
32−8:9 glyph |=
32+9:15 tight tvar A
33−8:12 name p
33+9:17 tvar B
34−8:13 tight glyph =
34+9:18 tight glyph ]
35−8:14 tight glyph [
35+10:3 INDENT
36−8:15 tight tvar A
36+10:3 glyph ?-
37−8:17 tvar B
37+10:6 name p
38−8:18 tight glyph ]
38+11:5 INDENT
39−9:3 INDENT
39+11:5 glyph [
40−9:3 glyph ?-
40+11:6 tight name a
41−9:6 name p
41+11:8 name b
42−10:5 INDENT
42+11:9 tight glyph ]
43−10:5 glyph [
43+11:11 name a
44−10:6 tight name a
44+13:1 DEDENT
45−10:8 name b
45+13:1 DEDENT
46−10:9 tight glyph ]
46+13:1 NEWLINE
47−10:11 name b
47+13:1 glyph ++
48−12:1 DEDENT
48+13:4 name tail
49−12:1 DEDENT
49+13:9 glyph |=
50−12:1 NEWLINE
50+13:12 name p
51−12:1 glyph ++
51+13:13 tight glyph =
52−12:4 name not
52+13:14 tight glyph [
53−12:8 glyph |=
53+13:15 tight tvar A
54−12:11 name b
54+13:17 tvar B
55−12:12 tight glyph =
55+13:18 tight glyph ]
56−12:13 tight glyph ?
56+14:3 INDENT
57−13:3 INDENT
57+14:3 glyph ?-
58−13:3 glyph ?-
58+14:6 name p
59−13:6 name b
59+15:5 INDENT
60−14:5 INDENT
60+15:5 glyph [
61−14:5 lit %.y
61+15:6 tight name a
62−14:9 lit %.n
62+15:8 name b
63−15:5 NEWLINE
63+15:9 tight glyph ]
64−15:5 lit %.n
64+15:11 name b
65−15:9 lit %.y
6617:1 DEDENT
6517:1 DEDENT
6717:1 DEDENT
6617:1 DEDENT
6817:1 NEWLINE
6717:1 NEWLINE
69−17:1 glyph +$
68+17:1 glyph ++
70−17:4 name list
69+17:4 name not
71−17:9 glyph |$
70+17:8 glyph |=
72−17:12 glyph [
71+17:11 name b
73−17:13 tight tvar A
72+17:12 tight glyph =
74−17:14 tight glyph ]
73+17:13 tight glyph ?
7518:3 INDENT
7418:3 INDENT
76−18:3 lit ~
75+18:3 glyph ?-
77−19:3 NEWLINE
76+18:6 name b
78−19:3 glyph [
77+19:5 INDENT
79−19:4 tight name i
78+19:5 lit %.y
80−19:5 tight glyph =
79+19:9 lit %.n
81−19:6 tight tvar A
80+20:5 NEWLINE
82−19:8 name t
81+20:5 lit %.n
83−19:9 tight glyph =
82+20:9 lit %.y
84−19:10 tight glyph (
83+22:1 DEDENT
85−19:11 tight name list
84+22:1 DEDENT
86−19:16 tvar A
85+22:1 NEWLINE
87−19:17 tight glyph )
86+22:1 glyph +$
88−19:18 tight glyph ]
87+22:4 name list
89−21:1 DEDENT
88+22:9 glyph |$
90−21:1 NEWLINE
89+22:12 glyph [
91−21:1 glyph +$
90+22:13 tight tvar A
92−21:4 name unit
91+22:14 tight glyph ]
93−21:9 glyph |$
92+23:3 INDENT
94−21:12 glyph [
93+23:3 lit ~
95−21:13 tight tvar A
94+24:3 NEWLINE
96−21:14 tight glyph ]
95+24:3 glyph [
97−22:3 INDENT
96+24:4 tight name i
98−22:3 lit ~
97+24:5 tight glyph =
99−23:3 NEWLINE
98+24:6 tight tvar A
100−23:3 glyph [
99+24:8 name t
101−23:4 tight lit ~
100+24:9 tight glyph =
102−23:6 name u
101+24:10 tight glyph (
103−23:7 tight glyph =
102+24:11 tight name list
104−23:8 tight tvar A
103+24:16 tvar A
105−23:9 tight glyph ]
104+24:17 tight glyph )
106−25:1 DEDENT
105+24:18 tight glyph ]
107−25:1 NEWLINE
106+26:1 DEDENT
108−25:1 glyph ++
107+26:1 NEWLINE
109−25:4 name fall
108+26:1 glyph +$
110−25:9 glyph |=
109+26:4 name unit
111−25:12 name args
110+26:9 glyph |$
112−25:16 tight glyph =
111+26:12 glyph [
113−25:17 tight glyph [
112+26:13 tight tvar A
114−25:18 tight glyph (
113+26:14 tight glyph ]
115−25:19 tight name unit
114+27:3 INDENT
116−25:24 tvar A
115+27:3 lit ~
117−25:25 tight glyph )
116+28:3 NEWLINE
118−25:27 tvar A
117+28:3 glyph [
119−25:28 tight glyph ]
118+28:4 tight lit ~
120−26:3 INDENT
119+28:6 name u
121−26:3 glyph ?-
120+28:7 tight glyph =
122−26:6 name args
121+28:8 tight tvar A
123−27:5 INDENT
122+28:9 tight glyph ]
124−27:5 glyph [
123+30:1 DEDENT
125−27:6 tight name maybe
124+30:1 NEWLINE
126−27:12 name fallback
125+30:1 glyph ++
127−27:20 tight glyph ]
126+30:4 name fall
128−28:7 INDENT
127+30:9 glyph |=
129−28:7 glyph ?-
128+30:12 name args
130−28:10 name maybe
129+30:16 tight glyph =
131−29:9 INDENT
130+30:17 tight glyph [
132−29:9 lit ~
131+30:18 tight glyph (
133−29:11 name fallback
132+30:19 tight name unit
134−30:9 NEWLINE
133+30:24 tvar A
135−30:9 glyph [
134+30:25 tight glyph )
136−30:10 tight lit ~
135+30:27 tvar A
137−30:12 name value
136+30:28 tight glyph ]
138−30:17 tight glyph ]
137+31:3 INDENT
139−30:19 name value
138+31:3 glyph ?-
140−32:1 DEDENT
139+31:6 name args
141−32:1 DEDENT
140+32:5 INDENT
142−32:1 DEDENT
141+32:5 glyph [
143−32:1 DEDENT
142+32:6 tight name maybe
144−32:1 NEWLINE
143+32:12 name fallback
145−32:1 glyph ++
144+32:20 tight glyph ]
146−32:4 name need
145+33:7 INDENT
147−32:9 glyph |=
146+33:7 glyph ?-
148−32:12 name maybe
147+33:10 name maybe
149−32:17 tight glyph =
148+34:9 INDENT
150−32:18 tight glyph (
149+34:9 lit ~
151−32:19 tight name unit
150+34:11 name fallback
152−32:24 tvar A
151+35:9 NEWLINE
153−32:25 tight glyph )
152+35:9 glyph [
154−33:3 INDENT
153+35:10 tight lit ~
155−33:3 glyph ?-
154+35:12 name value
156−33:6 name maybe
155+35:17 tight glyph ]
157−34:5 INDENT
156+35:19 name value
158−34:5 lit ~
157+37:1 DEDENT
159−34:7 glyph !!
158+37:1 DEDENT
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
16637:1 DEDENT
15937:1 DEDENT
16737:1 DEDENT
16037:1 DEDENT
16837:1 NEWLINE
16137:1 NEWLINE
16937:1 glyph ++
16237:1 glyph ++
170−37:4 name weld
163+37:4 name need
17137:9 glyph |=
16437:9 glyph |=
172−37:12 name args
165+37:12 name maybe
173−37:16 tight glyph =
166+37:17 tight glyph =
174−37:17 tight glyph [
17537:18 tight glyph (
16737:18 tight glyph (
176−37:19 tight name list
168+37:19 tight name unit
17737:24 tvar A
16937:24 tvar A
17837:25 tight glyph )
17037: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 ]
18438:3 INDENT
17138:3 INDENT
18538:3 glyph ?-
17238:3 glyph ?-
186−38:6 name args
173+38:6 name maybe
18739:5 INDENT
17439:5 INDENT
188−39:5 glyph [
175+39:5 lit ~
189−39:6 tight name xs
176+39:7 glyph !!
190−39:9 name ys
177+40:5 NEWLINE
191−39:11 tight glyph ]
178+40:5 glyph [
192−40:7 INDENT
179+40:6 tight lit ~
193−40:7 glyph ^-
180+40:8 name value
194−40:10 glyph (
181+40:13 tight glyph ]
195−40:11 tight name list
182+40:15 name value
196−40:16 tvar A
183+42:1 DEDENT
197−40:17 tight glyph )
184+42:1 DEDENT
198−41:9 INDENT
185+42:1 NEWLINE
199−41:9 glyph ?-
186+42:1 glyph ++
200−41:12 name xs
187+42:4 name weld
201−42:11 INDENT
188+42:9 glyph |=
202−42:11 lit ~
189+42:12 name args
203−42:13 name ys
190+42:16 tight glyph =
204−43:11 NEWLINE
191+42:17 tight glyph [
205−43:11 glyph [
192+42:18 tight glyph (
206−43:12 tight name item
193+42:19 tight name list
207−43:17 name rest
194+42:24 tvar A
208−43:21 tight glyph ]
195+42:25 tight glyph )
209−43:23 glyph [
196+42:27 glyph (
210−43:24 tight name item
197+42:28 tight name list
211−43:29 glyph (
198+42:33 tvar A
212−43:30 tight name weld
199+42:34 tight glyph )
213−43:35 name rest
200+42:35 tight glyph ]
214−43:40 name ys
201+43:3 INDENT
215−43:42 tight glyph )
202+43:3 glyph ?-
216−43:43 tight glyph ]
203+43:6 name args
217−45:1 DEDENT
204+44:5 INDENT
218−45:1 DEDENT
205+44:5 glyph [
219−45:1 DEDENT
206+44:6 tight name xs
220−45:1 DEDENT
207+44:9 name ys
221−45:1 DEDENT
208+44:11 tight glyph ]
222−45:1 NEWLINE
209+45:7 INDENT
223−45:1 glyph ++
210+45:7 glyph ^-
224−45:4 name turn
211+45:10 glyph (
225−45:9 glyph |=
212+45:11 tight name list
226−45:12 name args
213+45:16 tvar A
227−45:16 tight glyph =
214+45:17 tight glyph )
228−45:17 tight glyph [
215+46:9 INDENT
229−45:18 tight glyph (
216+46:9 glyph ?-
230−45:19 tight name list
217+46:12 name xs
231−45:24 tvar A
218+47:11 INDENT
232−45:25 tight glyph )
219+47:11 lit ~
233−45:27 glyph $-(
220+47:13 name ys
234−45:30 tight tvar A
221+48:11 NEWLINE
235−45:32 tvar B
222+48:11 glyph [
236−45:33 tight glyph )
223+48:12 tight name item
237−45:34 tight glyph ]
224+48:17 name rest
238−46:3 INDENT
225+48:21 tight glyph ]
239−46:3 glyph ?-
226+48:23 glyph [
240−46:6 name args
227+48:24 tight name item
241−47:5 INDENT
228+48:29 glyph (
242−47:5 glyph [
229+48:30 tight name weld
243−47:6 tight name xs
230+48:35 name rest
244−47:9 name f
231+48:40 name ys
245−47:10 tight glyph ]
232+48:42 tight glyph )
246−48:7 INDENT
233+48:43 tight glyph ]
247−48:7 glyph ^-
234+50:1 DEDENT
248−48:10 glyph (
235+50:1 DEDENT
249−48:11 tight name list
236+50:1 DEDENT
250−48:16 tvar B
237+50:1 DEDENT
251−48:17 tight glyph )
238+50:1 DEDENT
252−49:9 INDENT
239+50:1 NEWLINE
253−49:9 glyph ?-
240+50:1 glyph ++
254−49:12 name xs
241+50:4 name turn
255−50:11 INDENT
242+50:9 glyph |=
256−50:11 lit ~
243+50:12 name args
257−50:13 lit ~
244+50:16 tight glyph =
258−51:11 NEWLINE
245+50:17 tight glyph [
259−51:11 glyph [
246+50:18 tight glyph (
260−51:12 tight name item
247+50:19 tight name list
261−51:17 name rest
248+50:24 tvar A
262−51:21 tight glyph ]
249+50:25 tight glyph )
263−51:23 glyph [
250+50:27 glyph $-(
264−51:24 tight glyph (
251+50:30 tight tvar A
265−51:25 tight name f
252+50:32 tvar B
266−51:27 name item
253+50:33 tight glyph )
267−51:31 tight glyph )
254+50:34 tight glyph ]
268−51:33 glyph (
255+51:3 INDENT
269−51:34 tight name turn
256+51:3 glyph ?-
270−51:39 name rest
257+51:6 name args
271−51:44 name f
258+52:5 INDENT
272−51:45 tight glyph )
259+52:5 glyph [
273−51:46 tight glyph ]
260+52:6 tight name xs
274−53:1 DEDENT
261+52:9 name f
275−53:1 DEDENT
262+52:10 tight glyph ]
276−53:1 DEDENT
263+53:7 INDENT
277−53:1 DEDENT
264+53:7 glyph ^-
278−53:1 DEDENT
265+53:10 glyph (
279−53:1 NEWLINE
266+53:11 tight name list
280−53:1 glyph +$
267+53:16 tvar B
281−53:4 name dime
268+53:17 tight glyph )
282−53:9 glyph [
269+54:9 INDENT
283−53:10 tight name p
270+54:9 glyph ?-
284−53:11 tight glyph =
271+54:12 name xs
285−53:12 tight aura @ta
272+55:11 INDENT
286−53:16 name q
273+55:11 lit ~
287−53:17 tight glyph =
274+55:13 lit ~
288−53:18 tight aura @
275+56:11 NEWLINE
289−53:19 tight glyph ]
276+56:11 glyph [
290−55:1 NEWLINE
277+56:12 tight name item
291−55:1 glyph +$
278+56:17 name rest
292−55:4 name hair
279+56:21 tight glyph ]
293−55:9 glyph [
280+56:23 glyph [
294−55:10 tight name p
281+56:24 tight glyph (
295−55:11 tight glyph =
282+56:25 tight name f
296−55:12 tight aura @ud
283+56:27 name item
297−55:16 name q
284+56:31 tight glyph )
298−55:17 tight glyph =
285+56:33 glyph (
299−55:18 tight aura @ud
286+56:34 tight name turn
300−55:21 tight glyph ]
287+56:39 name rest
301−57:1 NEWLINE
288+56:44 name f
302−57:1 glyph +$
289+56:45 tight glyph )
303−57:4 name pint
290+56:46 tight glyph ]
304−57:9 glyph [
291+58:1 DEDENT
305−57:10 tight name p
292+58:1 DEDENT
306−57:11 tight glyph =
293+58:1 DEDENT
307−57:12 tight glyph [
294+58:1 DEDENT
308−57:13 tight name p
295+58:1 DEDENT
309−57:14 tight glyph =
296+58:1 NEWLINE
310−57:15 tight aura @
297+58:1 glyph +$
311−57:17 name q
298+58:4 name dime
312−57:18 tight glyph =
299+58:9 glyph [
313−57:19 tight aura @
300+58:10 tight name p
314−57:20 tight glyph ]
301+58:11 tight glyph =
315−57:22 name q
302+58:12 tight aura @ta
316−57:23 tight glyph =
303+58:16 name q
317−57:24 tight glyph [
304+58:17 tight glyph =
318−57:25 tight name p
305+58:18 tight aura @
319−57:26 tight glyph =
306+58:19 tight glyph ]
320−57:27 tight aura @
307+60:1 NEWLINE
321−57:29 name q
308+60:1 glyph +$
322−57:30 tight glyph =
309+60:4 name hair
323−57:31 tight aura @
310+60:9 glyph [
324−57:32 tight glyph ]
311+60:10 tight name p
325−57:33 tight glyph ]
312+60:11 tight glyph =
326−59:1 NEWLINE
313+60:12 tight aura @ud
327−59:1 glyph +$
314+60:16 name q
328−59:4 name coin
315+60:17 tight glyph =
329−60:3 INDENT
316+60:18 tight aura @ud
330−60:3 glyph [
317+60:21 tight glyph ]
331−60:4 tight lit %$
318+62:1 NEWLINE
332−60:7 name p
319+62:1 glyph +$
333−60:8 tight glyph =
320+62:4 name pint
334−60:9 tight name dime
321+62:9 glyph [
335−60:13 tight glyph ]
322+62:10 tight name p
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
34762:11 tight glyph =
32362:11 tight glyph =
348−62:12 tight glyph (
324+62:12 tight glyph [
349−62:13 tight name list
325+62:13 tight name p
350−62:18 name coin
326+62:14 tight glyph =
351−62:22 tight glyph )
327+62:15 tight aura @
352−62:23 tight glyph ]
328+62:17 name q
353−64:1 DEDENT
329+62:18 tight glyph =
330+62:19 tight aura @
331+62:20 tight glyph ]
332+62:22 name q
333+62:23 tight glyph =
334+62:24 tight glyph [
335+62:25 tight name p
336+62:26 tight glyph =
337+62:27 tight aura @
338+62:29 name q
339+62:30 tight glyph =
340+62:31 tight aura @
341+62:32 tight glyph ]
342+62:33 tight glyph ]
35464:1 NEWLINE
34364:1 NEWLINE
35564:1 glyph +$
34464:1 glyph +$
356−64:4 name pair
345+64:4 name coin
357−64:9 glyph |$
346+65:3 INDENT
358−64:12 glyph [
347+65:3 glyph [
359−64:13 tight tvar A
348+65:4 tight lit %$
360−64:15 tvar B
349+65:7 name p
361−64:16 tight glyph ]
350+65:8 tight glyph =
362−64:18 glyph [
351+65:9 tight name dime
363−64:19 tight name p
352+65:13 tight glyph ]
364−64:20 tight glyph =
353+66:3 NEWLINE
365−64:21 tight tvar A
354+66:3 glyph [
366−64:23 name q
355+66:4 tight lit %blob
367−64:24 tight glyph =
356+66:10 name p
368−64:25 tight tvar B
357+66:11 tight glyph =
369−64:26 tight glyph ]
358+66:12 tight glyph *
370−66:1 NEWLINE
359+66:13 tight glyph ]
371−66:1 glyph +$
360+67:3 NEWLINE
372−66:4 name trel
361+67:3 glyph [
373−66:9 glyph |$
362+67:4 tight lit %many
374−66:12 glyph [
363+67:10 name p
375−66:13 tight tvar A
364+67:11 tight glyph =
376−66:15 tvar B
365+67:12 tight glyph (
377−66:17 tvar C
366+67:13 tight name list
378−66:18 tight glyph ]
367+67:18 name coin
379−66:20 glyph [
368+67:22 tight glyph )
380−66:21 tight name p
369+67:23 tight glyph ]
381−66:22 tight glyph =
370+69:1 DEDENT
382−66:23 tight tvar A
371+69:1 NEWLINE
383−66:25 name q
372+69:1 glyph +$
384−66:26 tight glyph =
373+69:4 name pair
385−66:27 tight tvar B
374+69:9 glyph |$
386−66:29 name r
375+69:12 glyph [
387−66:30 tight glyph =
376+69:13 tight tvar A
388−66:31 tight tvar C
377+69:15 tvar B
389−66:32 tight glyph ]
378+69:16 tight glyph ]
390−68:1 NEWLINE
379+69:18 glyph [
391−68:1 glyph +$
380+69:19 tight name p
392−68:4 name qual
381+69:20 tight glyph =
393−68:9 glyph |$
382+69:21 tight tvar A
394−68:12 glyph [
383+69:23 name q
395−68:13 tight tvar A
384+69:24 tight glyph =
396−68:15 tvar B
385+69:25 tight tvar B
397−68:17 tvar C
386+69:26 tight glyph ]
398−68:19 tvar D
387+71:1 NEWLINE
399−68:20 tight glyph ]
388+71:1 glyph +$
400−68:22 glyph [
389+71:4 name trel
401−68:23 tight name p
390+71:9 glyph |$
402−68:24 tight glyph =
391+71:12 glyph [
403−68:25 tight tvar A
392+71:13 tight tvar A
404−68:27 name q
393+71:15 tvar B
405−68:28 tight glyph =
394+71:17 tvar C
406−68:29 tight tvar B
395+71:18 tight glyph ]
407−68:31 name r
396+71:20 glyph [
408−68:32 tight glyph =
397+71:21 tight name p
409−68:33 tight tvar C
398+71:22 tight glyph =
410−68:35 name s
399+71:23 tight tvar A
411−68:36 tight glyph =
400+71:25 name q
412−68:37 tight tvar D
401+71:26 tight glyph =
413−68:38 tight glyph ]
402+71:27 tight tvar B
414−70:1 NEWLINE
403+71:29 name r
415−70:1 glyph +$
404+71:30 tight glyph =
416−70:4 name cord
405+71:31 tight tvar C
417−70:9 aura @t
406+71:32 tight glyph ]
418−72:1 NEWLINE
407+73:1 NEWLINE
419−72:1 glyph +$
408+73:1 glyph +$
420−72:4 name knot
409+73:4 name qual
421−72:9 aura @ta
410+73:9 glyph |$
422−74:1 NEWLINE
411+73:12 glyph [
423−74:1 glyph +$
412+73:13 tight tvar A
424−74:4 name tape
413+73:15 tvar B
425−74:9 glyph (
414+73:17 tvar C
426−74:10 tight name list
415+73:19 tvar D
427−74:15 aura @tD
416+73:20 tight glyph ]
428−74:18 tight glyph )
417+73:22 glyph [
429−76:1 NEWLINE
418+73:23 tight name p
430−76:1 glyph +$
419+73:24 tight glyph =
431−76:4 name path
420+73:25 tight tvar A
432−76:9 glyph (
421+73:27 name q
433−76:10 tight name list
422+73:28 tight glyph =
434−76:15 name knot
423+73:29 tight tvar B
435−76:19 tight glyph )
424+73:31 name r
436−78:1 NEWLINE
425+73:32 tight glyph =
437−78:1 glyph +$
426+73:33 tight tvar C
438−78:4 name tank
427+73:35 name s
439−79:3 INDENT
428+73:36 tight glyph =
440−79:3 name cord
429+73:37 tight tvar D
441−80:3 NEWLINE
430+73:38 tight glyph ]
442−80:3 glyph [
431+75:1 NEWLINE
443−80:4 tight lit %leaf
432+75:1 glyph +$
444−80:10 name p
433+75:4 name cord
445−80:11 tight glyph =
434+75:9 aura @t
446−80:12 tight name tape
435+77:1 NEWLINE
447−80:16 tight glyph ]
436+77:1 glyph +$
448−81:3 NEWLINE
437+77:4 name knot
449−81:3 glyph [
438+77:9 aura @ta
450−81:4 tight lit %palm
439+79:1 NEWLINE
451−81:10 name p
440+79:1 glyph +$
452−81:11 tight glyph =
441+79:4 name tape
453−81:12 tight glyph (
442+79:9 glyph (
454−81:13 tight name qual
443+79:10 tight name list
455−81:18 name tape
444+79:15 aura @tD
456−81:23 name tape
445+79:18 tight glyph )
457−81:28 name tape
446+81:1 NEWLINE
458−81:33 name tape
447+81:1 glyph +$
459−81:37 tight glyph )
448+81:4 name path
460−81:39 name q
449+81:9 glyph (
461−81:40 tight glyph =
450+81:10 tight name list
462−81:41 tight glyph (
451+81:15 name knot
463−81:42 tight name list
452+81:19 tight glyph )
464−81:47 name tank
453+83:1 NEWLINE
465−81:51 tight glyph )
454+83:1 glyph +$
466−81:52 tight glyph ]
455+83:4 name tank
467−82:3 NEWLINE
456+84:3 INDENT
468−82:3 glyph [
457+84:3 name cord
469−82:4 tight lit %rose
458+85:3 NEWLINE
470−82:10 name p
459+85:3 glyph [
471−82:11 tight glyph =
460+85:4 tight lit %leaf
472−82:12 tight glyph (
461+85:10 name p
473−82:13 tight name trel
462+85:11 tight glyph =
474−82:18 name tape
463+85:12 tight name tape
475−82:23 name tape
464+85:16 tight glyph ]
476−82:28 name tape
465+86:3 NEWLINE
477−82:32 tight glyph )
466+86:3 glyph [
478−82:34 name q
467+86:4 tight lit %palm
479−82:35 tight glyph =
468+86:10 name p
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
50286:11 tight glyph =
46986:11 tight glyph =
503−86:12 tight name hair
470+86:12 tight glyph (
504−86:17 name q
471+86:13 tight name qual
505−86:18 tight glyph =
472+86:18 name tape
506−86:19 tight glyph (
473+86:23 name tape
507−86:20 tight name unit
474+86:28 name tape
508−86:25 glyph [
475+86:33 name tape
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 ]
51686:37 tight glyph )
47686:37 tight glyph )
517−86:38 tight glyph ]
477+86:39 name q
518−88:1 NEWLINE
478+86:40 tight glyph =
519−88:1 glyph +$
479+86:41 tight glyph (
520−88:4 name rule
480+86:42 tight name list
521−88:9 glyph $-(
481+86:47 name tank
522−88:12 tight name nail
482+86:51 tight glyph )
523−88:17 name edge
483+86:52 tight glyph ]
524−88:21 tight glyph )
484+87:3 NEWLINE
525−90:1 NEWLINE
485+87:3 glyph [
526−90:1 glyph +$
486+87:4 tight lit %rose
527−90:4 name spot
487+87:10 name p
528−90:9 glyph [
488+87:11 tight glyph =
529−90:10 tight name p
489+87:12 tight glyph (
530−90:11 tight glyph =
490+87:13 tight name trel
531−90:12 tight name path
491+87:18 name tape
532−90:17 name q
492+87:23 name tape
533−90:18 tight glyph =
493+87:28 name tape
534−90:19 tight name pint
494+87:32 tight glyph )
535−90:23 tight glyph ]
495+87:34 name q
536−92:1 NEWLINE
496+87:35 tight glyph =
537−92:1 glyph +$
497+87:36 tight glyph (
538−92:4 name toon
498+87:37 tight name list
539−93:3 INDENT
499+87:42 name tank
540−93:3 glyph [
500+87:46 tight glyph )
541−93:4 tight lit %0
501+87:47 tight glyph ]
542−93:7 name p
502+89:1 DEDENT
543−93:8 tight glyph =
503+89:1 NEWLINE
544−93:9 tight glyph *
504+89:1 glyph +$
545−93:10 tight glyph ]
505+89:4 name nail
546−94:3 NEWLINE
506+89:9 glyph [
547−94:3 glyph [
507+89:10 tight name p
548−94:4 tight lit %1
508+89:11 tight glyph =
549−94:7 name p
509+89:12 tight name hair
550−94:8 tight glyph =
510+89:17 name q
551−94:9 tight glyph *
511+89:18 tight glyph =
552−94:10 tight glyph ]
512+89:19 tight name tape
553−95:3 NEWLINE
513+89:23 tight glyph ]
554−95:3 glyph [
514+91:1 NEWLINE
555−95:4 tight lit %2
515+91:1 glyph +$
556−95:7 name p
516+91:4 name edge
557−95:8 tight glyph =
517+91:9 glyph [
558−95:9 tight glyph (
518+91:10 tight name p
559−95:10 tight name list
519+91:11 tight glyph =
560−95:15 name tank
520+91:12 tight name hair
561−95:19 tight glyph )
521+91:17 name q
562−95:20 tight glyph ]
522+91:18 tight glyph =
563−97:1 DEDENT
523+91:19 tight glyph (
524+91:20 tight name unit
525+91:25 glyph [
526+91:26 tight name p
527+91:27 tight glyph =
528+91:28 tight glyph *
529+91:30 name q
530+91:31 tight glyph =
531+91:32 tight name nail
532+91:36 tight glyph ]
533+91:37 tight glyph )
534+91:38 tight glyph ]
535+93:1 NEWLINE
536+93:1 glyph +$
537+93:4 name rule
538+93:9 glyph $-(
539+93:12 tight name nail
540+93:17 name edge
541+93:21 tight glyph )
542+95:1 NEWLINE
543+95:1 glyph +$
544+95:4 name spot
545+95:9 glyph [
546+95:10 tight name p
547+95:11 tight glyph =
548+95:12 tight name path
549+95:17 name q
550+95:18 tight glyph =
551+95:19 tight name pint
552+95:23 tight glyph ]
56497:1 NEWLINE
55397:1 NEWLINE
56597:1 glyph +$
55497:1 glyph +$
566−97:4 name like
555+97:4 name toon
567−97:9 glyph |$
556+98:3 INDENT
568−97:12 glyph [
557+98:3 glyph [
569−97:13 tight tvar A
558+98:4 tight lit %0
570−97:14 tight glyph ]
559+98:7 name p
571−97:16 glyph [
560+98:8 tight glyph =
572−97:17 tight name p
561+98:9 tight glyph *
573−97:18 tight glyph =
562+98:10 tight glyph ]
574−97:19 tight name hair
563+99:3 NEWLINE
575−97:24 name q
564+99:3 glyph [
576−97:25 tight glyph =
565+99:4 tight lit %1
577−97:26 tight glyph (
566+99:7 name p
578−97:27 tight name unit
567+99:8 tight glyph =
579−97:32 glyph [
568+99:9 tight glyph *
580−97:33 tight name p
569+99:10 tight glyph ]
581−97:34 tight glyph =
570+100:3 NEWLINE
582−97:35 tight tvar A
571+100:3 glyph [
583−97:37 name q
572+100:4 tight lit %2
584−97:38 tight glyph =
573+100:7 name p
585−97:39 tight name nail
574+100:8 tight glyph =
586−97:43 tight glyph ]
575+100:9 tight glyph (
587−97:44 tight glyph )
576+100:10 tight name list
588−97:45 tight glyph ]
577+100:15 name tank
589−99:1 NEWLINE
578+100:19 tight glyph )
590−99:1 glyph ++
579+100:20 tight glyph ]
591−99:4 name wonk
580+102:1 DEDENT
592−99:9 glyph |=
581+102:1 NEWLINE
593−99:12 name veq
582+102:1 glyph +$
594−99:15 tight glyph =
583+102:4 name like
595−99:16 tight glyph (
584+102:9 glyph |$
596−99:17 tight name like
585+102:12 glyph [
597−99:22 tvar A
586+102:13 tight tvar A
598−99:23 tight glyph )
587+102:14 tight glyph ]
599−100:3 INDENT
588+102:16 glyph [
600−100:3 glyph ?-
589+102:17 tight name p
601−100:6 wing q.veq
590+102:18 tight glyph =
602−101:5 INDENT
591+102:19 tight name hair
603−101:5 lit ~
592+102:24 name q
604−101:7 glyph !!
593+102:25 tight glyph =
605−102:5 NEWLINE
594+102:26 tight glyph (
606−102:5 glyph [
595+102:27 tight name unit
607−102:6 tight lit ~
596+102:32 glyph [
608−102:8 name product
597+102:33 tight name p
609−102:15 tight glyph ]
598+102:34 tight glyph =
610−102:17 wing p.product
599+102:35 tight tvar A
611−104:1 DEDENT
600+102:37 name q
612−104:1 DEDENT
601+102:38 tight glyph =
602+102:39 tight name nail
603+102:43 tight glyph ]
604+102:44 tight glyph )
605+102:45 tight glyph ]
613104:1 NEWLINE
606104:1 NEWLINE
614−104:1 glyph +$
607+104:1 glyph ++
615−104:4 name lone
608+104:4 name like
616−104:9 glyph |$
609+104:9 glyph |=
617104:12 glyph [
610104:12 glyph [
618−104:13 tight tvar A
611+104:13 tight name f
619−104:14 tight glyph ]
612+104:14 tight glyph =
620−104:16 glyph [
613+104:15 tight glyph $-(
621−104:17 tight name p
614+104:18 tight tvar A
622−104:18 tight glyph =
615+104:20 tvar B
623−104:19 tight tvar A
616+104:21 tight glyph )
624−104:20 tight glyph ]
617+104:23 name result
625−106:1 NEWLINE
618+104:29 tight glyph =
626−106:1 glyph +$
619+104:30 tight glyph (
627−106:4 name lest
620+104:31 tight name like
628−106:9 glyph |$
621+104:36 tvar A
629−106:12 glyph [
622+104:37 tight glyph )
630−106:13 tight tvar A
623+104:38 tight glyph ]
631−106:14 tight glyph ]
624+105:3 INDENT
632−106:16 glyph [
625+105:3 glyph ++
633−106:17 tight name i
626+105:6 name mapped
634−106:18 tight glyph =
627+106:5 INDENT
635−106:19 tight tvar A
628+106:5 glyph ^-
636−106:21 name t
629+106:8 glyph (
637−106:22 tight glyph =
630+106:9 tight name unit
638−106:23 tight glyph (
631+106:14 glyph [
639−106:24 tight name list
632+106:15 tight name p
640−106:29 tvar A
633+106:16 tight glyph =
641−106:30 tight glyph )
634+106:17 tight tvar B
642−106:31 tight glyph ]
635+106:19 name q
643−108:1 NEWLINE
636+106:20 tight glyph =
644−108:1 glyph +$
637+106:21 tight name nail
645−108:4 name pole
638+106:25 tight glyph ]
646−108:9 glyph |$
639+106:26 tight glyph )
647−108:12 glyph [
640+107:7 INDENT
648−108:13 tight tvar A
641+107:7 glyph ?-
649−108:14 tight glyph ]
642+107:10 wing q.result
650−109:3 INDENT
643+108:9 INDENT
651−109:3 lit ~
644+108:9 lit ~
645+108:11 lit ~
646+109:9 NEWLINE
647+109:9 glyph [
648+109:10 tight lit ~
649+109:12 name value
650+109:17 tight glyph ]
651+109:19 glyph `
652+109:20 tight glyph [
653+109:21 tight name p
654+109:22 tight glyph =
655+109:23 tight glyph (
656+109:24 tight name f
657+109:26 wing p.value
658+109:33 tight glyph )
659+109:35 name q
660+109:36 tight glyph =
661+109:37 tight wing q.value
662+109:44 tight glyph ]
663+110:3 DEDENT
664+110:3 DEDENT
665+110:3 DEDENT
652110:3 NEWLINE
666110:3 NEWLINE
653−110:3 glyph [
667+110:3 glyph ^-
654−110:4 tight tvar A
655110:6 glyph (
668110:6 glyph (
656−110:7 tight name pole
669+110:7 tight name like
657−110:12 tvar A
670+110:12 tvar B
658110:13 tight glyph )
671110:13 tight glyph )
659−110:14 tight glyph ]
672+110:15 glyph [
673+110:16 tight name p
674+110:17 tight glyph =
675+110:18 tight wing p.result
676+110:27 name q
677+110:28 tight glyph =
678+110:29 tight name mapped
679+110:35 tight glyph ]
660112:1 DEDENT
680112:1 DEDENT
661112:1 NEWLINE
681112:1 NEWLINE
662−112:1 glyph +$
682+112:1 glyph ++
663−112:4 name quip
683+112:4 name wonk
664−112:9 glyph |$
684+112:9 glyph |=
665−112:12 glyph [
685+112:12 name veq
666−112:13 tight tvar A
686+112:15 tight glyph =
667−112:15 tvar B
687+112:16 tight glyph (
668−112:16 tight glyph ]
688+112:17 tight name like
669−112:18 glyph [
689+112:22 tvar A
670−112:19 tight glyph (
690+112:23 tight glyph )
671−112:20 tight name list
691+113:3 INDENT
672−112:25 tvar A
692+113:3 glyph ?-
673−112:26 tight glyph )
693+113:6 wing q.veq
674−112:28 tvar B
694+114:5 INDENT
675−112:29 tight glyph ]
695+114:5 lit ~
676−114:1 NEWLINE
696+114:7 glyph !!
677−114:1 glyph +$
697+115:5 NEWLINE
678−114:4 name tree
698+115:5 glyph [
679−114:9 glyph |$
699+115:6 tight lit ~
680−114:12 glyph [
700+115:8 name product
681−114:13 tight tvar A
701+115:15 tight glyph ]
682−114:14 tight glyph ]
702+115:17 wing p.product
683−115:3 INDENT
703+117:1 DEDENT
684−115:3 lit ~
704+117:1 DEDENT
685−116:3 NEWLINE
705+117:1 NEWLINE
686−116:3 glyph [
706+117:1 glyph +$
687−116:4 tight name n
707+117:4 name lone
688−116:5 tight glyph =
708+117:9 glyph |$
689−116:6 tight tvar A
709+117:12 glyph [
690−116:8 name l
710+117:13 tight tvar A
691−116:9 tight glyph =
711+117:14 tight glyph ]
692−116:10 tight glyph (
712+117:16 glyph [
693−116:11 tight name tree
713+117:17 tight name p
694−116:16 tvar A
714+117:18 tight glyph =
695−116:17 tight glyph )
715+117:19 tight tvar A
696−116:19 name r
716+117:20 tight glyph ]
697−116:20 tight glyph =
717+119:1 NEWLINE
698−116:21 tight glyph (
718+119:1 glyph +$
699−116:22 tight name tree
719+119:4 name lest
700−116:27 tvar A
720+119:9 glyph |$
701−116:28 tight glyph )
721+119:12 glyph [
702−116:29 tight glyph ]
722+119:13 tight tvar A
703−118:1 DEDENT
723+119:14 tight glyph ]
704−118:1 NEWLINE
724+119:16 glyph [
705−118:1 glyph +$
725+119:17 tight name i
706−118:4 name each
726+119:18 tight glyph =
707−118:9 glyph |$
727+119:19 tight tvar A
708−118:12 glyph [
728+119:21 name t
709−118:13 tight tvar A
729+119:22 tight glyph =
710−118:15 tvar B
730+119:23 tight glyph (
711−118:16 tight glyph ]
731+119:24 tight name list
712−119:3 INDENT
732+119:29 tvar A
713−119:3 glyph [
733+119:30 tight glyph )
714−119:4 tight lit %|
734+119:31 tight glyph ]
715−119:7 name p
735+121:1 NEWLINE
716−119:8 tight glyph =
736+121:1 glyph +$
717−119:9 tight tvar B
737+121:4 name pole
718−119:10 tight glyph ]
738+121:9 glyph |$
719−120:3 NEWLINE
739+121:12 glyph [
720−120:3 glyph [
740+121:13 tight tvar A
721−120:4 tight lit %&
741+121:14 tight glyph ]
722−120:7 name p
742+122:3 INDENT
723−120:8 tight glyph =
743+122:3 lit ~
724−120:9 tight tvar A
744+123:3 NEWLINE
725−120:10 tight glyph ]
745+123:3 glyph [
726−122:1 DEDENT
746+123:4 tight tvar A
727−122:1 NEWLINE
747+123:6 glyph (
728−122:1 glyph +$
748+123:7 tight name pole
729−122:4 name bloq
749+123:12 tvar A
730−122:9 aura @
750+123:13 tight glyph )
731−124:1 NEWLINE
751+123:14 tight glyph ]
732−124:1 glyph ++
752+125:1 DEDENT
733−124:4 name some
753+125:1 NEWLINE
734−124:9 glyph |=
754+125:1 glyph +$
735−124:12 name item
755+125:4 name quip
736−124:16 tight glyph =
756+125:9 glyph |$
737−124:17 tight tvar A
757+125:12 glyph [
738−124:19 glyph `
758+125:13 tight tvar A
739−124:20 tight name item
759+125:15 tvar B
740−126:1 NEWLINE
760+125:16 tight glyph ]
741−126:1 glyph ++
761+125:18 glyph [
742−126:4 name lure
762+125:19 tight glyph (
743−126:9 glyph |=
763+125:20 tight name list
744−126:12 name item
764+125:25 tvar A
745−126:16 tight glyph =
765+125:26 tight glyph )
746−126:17 tight tvar A
766+125:28 tvar B
747−127:3 INDENT
767+125:29 tight glyph ]
748−127:3 glyph ^-
768+127:1 NEWLINE
749−127:6 glyph (
769+127:1 glyph +$
750−127:7 tight name list
770+127:4 name tree
751−127:12 tvar A
771+127:9 glyph |$
752−127:13 tight glyph )
772+127:12 glyph [
753−127:15 glyph [
773+127:13 tight tvar A
754−127:16 tight name item
774+127:14 tight glyph ]
755−127:21 lit ~
775+128:3 INDENT
756−127:22 tight glyph ]
776+128:3 lit ~
757−129:1 DEDENT
777+129:3 NEWLINE
758−129:1 NEWLINE
778+129:3 glyph [
759−129:1 glyph ++
779+129:4 tight name n
760−129:4 name snoc
780+129:5 tight glyph =
761−129:9 glyph |=
781+129:6 tight tvar A
762−129:12 name args
782+129:8 name l
763−129:16 tight glyph =
783+129:9 tight glyph =
764−129:17 tight glyph [
784+129:10 tight glyph (
765−129:18 tight glyph (
785+129:11 tight name tree
766−129:19 tight name list
786+129:16 tvar A
767−129:24 tvar A
787+129:17 tight glyph )
768−129:25 tight glyph )
788+129:19 name r
789+129:20 tight glyph =
790+129:21 tight glyph (
791+129:22 tight name tree
769129:27 tvar A
792129:27 tvar A
770−129:28 tight glyph ]
793+129:28 tight glyph )
771−130:3 INDENT
794+129:29 tight glyph ]
772−130:3 glyph ?-
795+131:1 DEDENT
773−130:6 name args
796+131:1 NEWLINE
774−131:5 INDENT
797+131:1 glyph +$
775−131:5 glyph [
798+131:4 name each
776−131:6 tight name xs
799+131:9 glyph |$
777−131:9 name item
800+131:12 glyph [
778−131:13 tight glyph ]
801+131:13 tight tvar A
779−131:15 glyph (
802+131:15 tvar B
780−131:16 tight name weld
803+131:16 tight glyph ]
781−131:21 name xs
804+132:3 INDENT
782−131:24 glyph [
805+132:3 glyph [
783−131:25 tight name item
806+132:4 tight lit %|
784−131:30 lit ~
807+132:7 name p
785−131:31 tight glyph ]
808+132:8 tight glyph =
786−131:32 tight glyph )
809+132:9 tight tvar B
787−133:1 DEDENT
810+132:10 tight glyph ]
788−133:1 DEDENT
811+133:3 NEWLINE
789−133:1 NEWLINE
812+133:3 glyph [
790−133:1 glyph ++
813+133:4 tight lit %&
791−133:4 name flop
814+133:7 name p
792−133:9 glyph |=
815+133:8 tight glyph =
793−133:12 name xs
816+133:9 tight tvar A
794−133:14 tight glyph =
817+133:10 tight glyph ]
795−133:15 tight glyph (
818+135:1 DEDENT
796−133:16 tight name list
819+135:1 NEWLINE
797−133:21 tvar A
820+135:1 glyph +$
798−133:22 tight glyph )
821+135:4 name bloq
799−134:3 INDENT
822+135:9 aura @
800−134:3 glyph ++
823+137:1 NEWLINE
801−134:6 name reverse-into
824+137:1 glyph ++
802−134:19 glyph |=
825+137:4 name some
803−134:22 name args
826+137:9 glyph |=
804−134:26 tight glyph =
827+137:12 name item
805−134:27 tight glyph [
828+137:16 tight glyph =
806−134:28 tight glyph (
829+137:17 tight tvar A
807−134:29 tight name list
830+137:19 glyph `
808−134:34 tvar A
831+137:20 tight name item
809−134:35 tight glyph )
832+139:1 NEWLINE
810−134:37 glyph (
833+139:1 glyph ++
811−134:38 tight name list
834+139:4 name lure
812−134:43 tvar A
835+139:9 glyph |=
813−134:44 tight glyph )
836+139:12 name item
814−134:45 tight glyph ]
837+139:16 tight glyph =
815−135:5 INDENT
838+139:17 tight tvar A
816−135:5 glyph ?-
839+140:3 INDENT
817−135:8 name args
840+140:3 glyph ^-
818−136:7 INDENT
841+140:6 glyph (
819−136:7 glyph [
842+140:7 tight name list
820−136:8 tight name rest
843+140:12 tvar A
821−136:13 name acc
844+140:13 tight glyph )
822−136:16 tight glyph ]
845+140:15 glyph [
823−137:9 INDENT
846+140:16 tight name item
824−137:9 glyph ?-
847+140:21 lit ~
825−137:12 name rest
848+140:22 tight glyph ]
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 )
852142:1 DEDENT
849142:1 DEDENT
853142:1 NEWLINE
850142:1 NEWLINE
854142:1 glyph ++
851142:1 glyph ++
855−142:4 name drop
852+142:4 name snoc
856142:9 glyph |=
853142:9 glyph |=
857−142:12 name maybe
854+142:12 name args
858−142:17 tight glyph =
855+142:16 tight glyph =
856+142:17 tight glyph [
859142:18 tight glyph (
857142:18 tight glyph (
860−142:19 tight name unit
858+142:19 tight name list
861142:24 tvar A
859142:24 tvar A
862142:25 tight glyph )
860142:25 tight glyph )
861+142:27 tvar A
862+142:28 tight glyph ]
863143:3 INDENT
863143:3 INDENT
864143:3 glyph ?-
864143:3 glyph ?-
865−143:6 name maybe
865+143:6 name args
866144:5 INDENT
866144:5 INDENT
867−144:5 lit ~
867+144:5 glyph [
868−144:7 lit ~
868+144:6 tight name xs
869−145:5 NEWLINE
869+144:9 name item
870−145:5 glyph [
870+144:13 tight glyph ]
871−145:6 tight lit ~
871+144:15 glyph (
872−145:8 name value
872+144:16 tight name weld
873−145:13 tight glyph ]
873+144:21 name xs
874−145:15 glyph [
874+144:24 glyph [
875−145:16 tight name value
875+144:25 tight name item
876−145:22 lit ~
876+144:30 lit ~
877−145:23 tight glyph ]
877+144:31 tight glyph ]
878−147:1 DEDENT
878+144:32 tight glyph )
879−147:1 DEDENT
879+146:1 DEDENT
880−147:1 NEWLINE
880+146:1 DEDENT
881−147:1 glyph ++
881+146:1 NEWLINE
882−147:4 name bind
882+146:1 glyph ++
883−147:9 glyph |=
883+146:4 name flop
884−147:12 name args
884+146:9 glyph |=
885−147:16 tight glyph =
885+146:12 name xs
886−147:17 tight glyph [
886+146:14 tight glyph =
887−147:18 tight glyph (
887+146:15 tight glyph (
888−147:19 tight name unit
888+146:16 tight name list
889−147:24 tvar A
889+146:21 tvar A
890−147:25 tight glyph )
890+146:22 tight glyph )
891−147:27 glyph $-(
891+147:3 INDENT
892−147:30 tight tvar A
892+147:3 glyph ++
893−147:32 tvar B
893+147:6 name reverse-into
894−147:33 tight glyph )
894+147:19 glyph |=
895−147:34 tight glyph ]
895+147:22 name args
896−148:3 INDENT
896+147:26 tight glyph =
897−148:3 glyph ?-
897+147:27 tight glyph [
898−148:6 name args
898+147:28 tight glyph (
899−149:5 INDENT
899+147:29 tight name list
900−149:5 glyph [
900+147:34 tvar A
901−149:6 tight name maybe
901+147:35 tight glyph )
902−149:12 name f
902+147:37 glyph (
903−149:13 tight glyph ]
903+147:38 tight name list
904−150:7 INDENT
904+147:43 tvar A
905−150:7 glyph ?-
905+147:44 tight glyph )
906−150:10 name maybe
906+147:45 tight glyph ]
907−151:9 INDENT
907+148:5 INDENT
908−151:9 lit ~
908+148:5 glyph ?-
909+148:8 name args
910+149:7 INDENT
911+149:7 glyph [
912+149:8 tight name rest
913+149:13 name acc
914+149:16 tight glyph ]
915+150:9 INDENT
916+150:9 glyph ?-
917+150:12 name rest
918+151:11 INDENT
909151:11 lit ~
919151:11 lit ~
910−152:9 NEWLINE
920+151:13 name acc
911−152:9 glyph [
921+152:11 NEWLINE
912−152:10 tight lit ~
922+152:11 glyph [
913−152:12 name value
923+152:12 tight name item
914−152:17 tight glyph ]
924+152:17 name more
915−152:19 glyph `
925+152:21 tight glyph ]
916−152:20 tight glyph (
926+152:23 glyph (
917−152:21 tight name f
927+152:24 tight name reverse-into
918−152:23 name value
928+152:37 name more
919−152:28 tight glyph )
929+152:42 glyph [
920−154:1 DEDENT
930+152:43 tight name item
921−154:1 DEDENT
931+152:48 name acc
922−154:1 DEDENT
932+152:51 tight glyph ]
923−154:1 DEDENT
933+152:52 tight glyph )
924−154:1 NEWLINE
934+153:3 DEDENT
925−154:1 glyph ++
935+153:3 DEDENT
926−154:4 name biff
936+153:3 DEDENT
927−154:9 glyph |=
937+153:3 DEDENT
928−154:12 name args
938+153:3 NEWLINE
929−154:16 tight glyph =
939+153:3 glyph (
930−154:17 tight glyph [
940+153:4 tight name reverse-into
931−154:18 tight glyph (
941+153:17 name xs
932−154:19 tight name unit
942+153:20 lit ~
933−154:24 tvar A
943+153:21 tight glyph )
934−154:25 tight glyph )
944+155:1 DEDENT
935−154:27 glyph $-(
945+155:1 NEWLINE
936−154:30 tight tvar A
946+155:1 glyph ++
937−154:32 glyph (
947+155:4 name drop
938−154:33 tight name unit
948+155:9 glyph |=
939−154:38 tvar B
949+155:12 name maybe
940−154:39 tight glyph )
950+155:17 tight glyph =
941−154:40 tight glyph )
951+155:18 tight glyph (
942−154:41 tight glyph ]
952+155:19 tight name unit
943−155:3 INDENT
953+155:24 tvar A
944−155:3 glyph ?-
954+155:25 tight glyph )
945−155:6 name args
955+156:3 INDENT
946−156:5 INDENT
956+156:3 glyph ^-
947−156:5 glyph [
957+156:6 glyph (
948−156:6 tight name maybe
958+156:7 tight name list
949−156:12 name f
959+156:12 tvar A
950−156:13 tight glyph ]
960+156:13 tight glyph )
951−157:7 INDENT
961+157:5 INDENT
952−157:7 glyph ?-
962+157:5 glyph ?-
953−157:10 name maybe
963+157:8 name maybe
954−158:9 INDENT
964+158:7 INDENT
965+158:7 lit ~
955158:9 lit ~
966158:9 lit ~
956−158:11 lit ~
967+159:7 NEWLINE
957−159:9 NEWLINE
968+159:7 glyph [
958−159:9 glyph [
969+159:8 tight lit ~
959−159:10 tight lit ~
970+159:10 name value
960−159:12 name value
971+159:15 tight glyph ]
961−159:17 tight glyph ]
972+159:17 glyph [
962−159:19 glyph (
973+159:18 tight name value
963−159:20 tight name f
974+159:24 lit ~
964−159:22 name value
975+159:25 tight glyph ]
965−159:27 tight glyph )
966−161:1 DEDENT
967161:1 DEDENT
976161:1 DEDENT
968161:1 DEDENT
977161:1 DEDENT
969161:1 DEDENT
978161:1 DEDENT
970161:1 NEWLINE
979161:1 NEWLINE
971161:1 glyph ++
980161:1 glyph ++
972−161:4 name both
981+161:4 name bond
973161:9 glyph |=
982161:9 glyph |=
974−161:12 name args
983+161:12 name fallback
975−161:16 tight glyph =
984+161:20 tight glyph =
976−161:17 tight glyph [
985+161:21 tight glyph $-(
977−161:18 tight glyph (
986+161:24 tight lit ~
978−161:19 tight name unit
987+161:26 tvar A
979−161:24 tvar A
988+161:27 tight glyph )
980−161:25 tight glyph )
981−161:27 glyph (
982−161:28 tight name unit
983−161:33 tvar B
984−161:34 tight glyph )
985−161:35 tight glyph ]
986162:3 INDENT
989162:3 INDENT
987−162:3 glyph ?-
990+162:3 glyph |=
988−162:6 name args
991+162:6 name maybe
992+162:11 tight glyph =
993+162:12 tight glyph (
994+162:13 tight name unit
995+162:18 tvar A
996+162:19 tight glyph )
989163:5 INDENT
997163:5 INDENT
990−163:5 glyph [
998+163:5 glyph ?-
991−163:6 tight name first
999+163:8 name maybe
992−163:12 name second
993−163:18 tight glyph ]
994164:7 INDENT
1000164:7 INDENT
995−164:7 glyph ?-
1001+164:7 lit ~
996−164:10 name first
1002+164:9 glyph (
997−165:9 INDENT
1003+164:10 tight name fallback
998−165:9 lit ~
1004+164:19 lit ~
999−165:11 lit ~
1005+164:20 tight glyph )
1000−166:9 NEWLINE
1006+165:7 NEWLINE
1001−166:9 glyph [
1007+165:7 glyph [
1002−166:10 tight lit ~
1008+165:8 tight lit ~
1003−166:12 name a
1009+165:10 name value
1004−166:13 tight glyph ]
1010+165:15 tight glyph ]
1005−167:11 INDENT
1011+165:17 name value
1006−167:11 glyph ?-
1012+167:1 DEDENT
1007−167:14 name second
1013+167:1 DEDENT
1008−168:13 INDENT
1014+167:1 DEDENT
1009−168:13 lit ~
1015+167:1 NEWLINE
1010−168:15 lit ~
1016+167:1 glyph ++
1011−169:13 NEWLINE
1017+167:4 name bind
1012−169:13 glyph [
1018+167:9 glyph |=
1013−169:14 tight lit ~
1019+167:12 name args
1014−169:16 name b
1020+167:16 tight glyph =
1015−169:17 tight glyph ]
1021+167:17 tight glyph [
1016−169:19 glyph `
1022+167:18 tight glyph (
1017−169:20 tight glyph [
1023+167:19 tight name unit
1018−169:21 tight name a
1024+167:24 tvar A
1019−169:23 name b
1025+167:25 tight glyph )
1020−169:24 tight glyph ]
1026+167:27 glyph $-(
1021−171:1 DEDENT
1027+167:30 tight tvar A
1022−171:1 DEDENT
1028+167:32 tvar B
1023−171:1 DEDENT
1029+167:33 tight glyph )
1024−171:1 DEDENT
1030+167:34 tight glyph ]
1025−171:1 DEDENT
1031+168:3 INDENT
1026−171:1 DEDENT
1032+168:3 glyph ?-
1027−171:1 NEWLINE
1033+168:6 name args
1028−171:1 glyph ++
1034+169:5 INDENT
1029−171:4 name clap
1035+169:5 glyph [
1030−171:9 glyph |=
1036+169:6 tight name maybe
1031−171:12 name args
1037+169:12 name f
1032−171:16 tight glyph =
1038+169:13 tight glyph ]
1033−171:17 tight glyph [
1039+169:15 glyph ^-
1034−171:18 tight glyph (
1040+169:18 glyph (
1035−171:19 tight name unit
1041+169:19 tight name unit
1036−171:24 tvar A
1042+169:24 tvar B
1037−171:25 tight glyph )
1043+169:25 tight glyph )
1038−171:27 glyph (
1044+170:7 INDENT
1039−171:28 tight name unit
1045+170:7 glyph ?-
1040−171:33 tvar A
1046+170:10 name maybe
1041−171:34 tight glyph )
1047+171:9 INDENT
1042−171:36 glyph $-(
1048+171:9 lit ~
1043−171:39 tight glyph [
1049+171:11 lit ~
1044−171:40 tight tvar A
1050+172:9 NEWLINE
1045−171:42 tvar A
1051+172:9 glyph [
1046−171:43 tight glyph ]
1052+172:10 tight lit ~
1047−171:45 tvar A
1053+172:12 name value
1048−171:46 tight glyph )
1054+172:17 tight glyph ]
1049−171:47 tight glyph ]
1055+172:19 glyph `
1050−172:3 INDENT
1056+172:20 tight glyph (
1051−172:3 glyph ?-
1057+172:21 tight name f
1052−172:6 name args
1058+172:23 name value
1053−173:5 INDENT
1059+172:28 tight glyph )
1054−173:5 glyph [
1060+174:1 DEDENT
1055−173:6 tight name first
1061+174:1 DEDENT
1056−173:12 name second
1062+174:1 DEDENT
1057−173:19 name combine
1063+174:1 DEDENT
1058−173:26 tight glyph ]
1064+174:1 NEWLINE
1059−174:7 INDENT
1065+174:1 glyph ++
1060−174:7 glyph ?-
1066+174:4 name biff
1061−174:10 name first
1067+174:9 glyph |=
1062−175:9 INDENT
1068+174:12 name args
1063−175:9 lit ~
1069+174:16 tight glyph =
1064−175:11 name second
1070+174:17 tight glyph [
1065−176:9 NEWLINE
1071+174:18 tight glyph (
1066−176:9 glyph [
1072+174:19 tight name unit
1067−176:10 tight lit ~
1073+174:24 tvar A
1068−176:12 name a
1074+174:25 tight glyph )
1075+174:27 glyph $-(
1076+174:30 tight tvar A
1077+174:32 glyph (
1078+174:33 tight name unit
1079+174:38 tvar B
1080+174:39 tight glyph )
1081+174:40 tight glyph )
1082+174:41 tight glyph ]
1083+175:3 INDENT
1084+175:3 glyph ?-
1085+175:6 name args
1086+176:5 INDENT
1087+176:5 glyph [
1088+176:6 tight name maybe
1089+176:12 name f
1069176:13 tight glyph ]
1090176:13 tight glyph ]
1070−177:11 INDENT
1091+176:15 glyph ^-
1071−177:11 glyph ?-
1092+176:18 glyph (
1072−177:14 name second
1093+176:19 tight name unit
1073−178:13 INDENT
1094+176:24 tvar B
1074−178:13 lit ~
1095+176:25 tight glyph )
1075−178:15 name first
1096+177:7 INDENT
1076−179:13 NEWLINE
1097+177:7 glyph ?-
1077−179:13 glyph [
1098+177:10 name maybe
1078−179:14 tight lit ~
1099+178:9 INDENT
1079−179:16 name b
1100+178:9 lit ~
1101+178:11 lit ~
1102+179:9 NEWLINE
1103+179:9 glyph [
1104+179:10 tight lit ~
1105+179:12 name value
1080179:17 tight glyph ]
1106179:17 tight glyph ]
1081−179:19 glyph `
1107+179:19 glyph (
1082−179:20 tight glyph (
1108+179:20 tight name f
1083−179:21 tight name combine
1109+179:22 name value
1084−179:29 name a
1110+179:27 tight glyph )
1085−179:31 name b
1086−179:32 tight glyph )
1087−181:1 DEDENT
1088−181:1 DEDENT
1089181:1 DEDENT
1111181:1 DEDENT
1090181:1 DEDENT
1112181:1 DEDENT
1091181:1 DEDENT
1113181:1 DEDENT
1092181:1 DEDENT
1114181:1 DEDENT
1093181:1 NEWLINE
1115181:1 NEWLINE
1094181:1 glyph ++
1116181:1 glyph ++
1095−181:4 name clef
1117+181:4 name both
1096181:9 glyph |=
1118181:9 glyph |=
1097181:12 name args
1119181:12 name args
1098181:16 tight glyph =
1120181:16 tight glyph =
@@ -1105,17 +1127,7 @@
1105181:28 tight name unit
1127181:28 tight name unit
1106181:33 tvar B
1128181:33 tvar B
1107181:34 tight glyph )
1129181:34 tight glyph )
1108−181:36 glyph $-(
1130+181:35 tight glyph ]
1109−181:39 tight glyph [
1110−181:40 tight tvar A
1111−181:42 tvar B
1112−181:43 tight glyph ]
1113−181:45 glyph (
1114−181:46 tight name unit
1115−181:51 tvar C
1116−181:52 tight glyph )
1117−181:53 tight glyph )
1118−181:54 tight glyph ]
1119182:3 INDENT
1131182:3 INDENT
1120182:3 glyph ?-
1132182:3 glyph ?-
1121182:6 name args
1133182:6 name args
@@ -1123,8 +1135,15 @@
1123183:5 glyph [
1135183:5 glyph [
1124183:6 tight name first
1136183:6 tight name first
1125183:12 name second
1137183:12 name second
1126−183:19 name combine
1138+183:18 tight glyph ]
1127−183:26 tight glyph ]
1139+183:20 glyph ^-
1140+183:23 glyph (
1141+183:24 tight name unit
1142+183:29 glyph [
1143+183:30 tight tvar A
1144+183:32 tvar B
1145+183:33 tight glyph ]
1146+183:34 tight glyph )
1128184:7 INDENT
1147184:7 INDENT
1129184:7 glyph ?-
1148184:7 glyph ?-
1130184:10 name first
1149184:10 name first
@@ -1147,11 +1166,11 @@
1147189:14 tight lit ~
1166189:14 tight lit ~
1148189:16 name b
1167189:16 name b
1149189:17 tight glyph ]
1168189:17 tight glyph ]
1150−189:19 glyph (
1169+189:19 glyph `
1151−189:20 tight name combine
1170+189:20 tight glyph [
1152−189:28 name a
1171+189:21 tight name a
1153−189:30 name b
1172+189:23 name b
1154−189:31 tight glyph )
1173+189:24 tight glyph ]
1155191:1 DEDENT
1174191:1 DEDENT
1156191:1 DEDENT
1175191:1 DEDENT
1157191:1 DEDENT
1176191:1 DEDENT
@@ -1160,62 +1179,69 @@
1160191:1 DEDENT
1179191:1 DEDENT
1161191:1 NEWLINE
1180191:1 NEWLINE
1162191:1 glyph ++
1181191:1 glyph ++
1163−191:4 name skim
1182+191:4 name clap
1164191:9 glyph |=
1183191:9 glyph |=
1165191:12 name args
1184191:12 name args
1166191:16 tight glyph =
1185191:16 tight glyph =
1167191:17 tight glyph [
1186191:17 tight glyph [
1168191:18 tight glyph (
1187191:18 tight glyph (
1169−191:19 tight name list
1188+191:19 tight name unit
1170191:24 tvar A
1189191:24 tvar A
1171191:25 tight glyph )
1190191:25 tight glyph )
1172−191:27 glyph $-(
1191+191:27 glyph (
1173−191:30 tight tvar A
1192+191:28 tight name unit
1174−191:32 glyph ?
1193+191:33 tvar A
1175−191:33 tight glyph )
1194+191:34 tight glyph )
1176−191:34 tight glyph ]
1195+191:36 glyph $-(
1196+191:39 tight glyph [
1197+191:40 tight tvar A
1198+191:42 tvar A
1199+191:43 tight glyph ]
1200+191:45 tvar A
1201+191:46 tight glyph )
1202+191:47 tight glyph ]
1177192:3 INDENT
1203192:3 INDENT
1178192:3 glyph ?-
1204192:3 glyph ?-
1179192:6 name args
1205192:6 name args
1180193:5 INDENT
1206193:5 INDENT
1181193:5 glyph [
1207193:5 glyph [
1182−193:6 tight name xs
1208+193:6 tight name first
1183−193:9 name predicate
1209+193:12 name second
1184−193:18 tight glyph ]
1210+193:19 name combine
1211+193:26 tight glyph ]
1212+193:28 glyph ^-
1213+193:31 glyph (
1214+193:32 tight name unit
1215+193:37 tvar A
1216+193:38 tight glyph )
1185194:7 INDENT
1217194:7 INDENT
1186194:7 glyph ?-
1218194:7 glyph ?-
1187−194:10 name xs
1219+194:10 name first
1188195:9 INDENT
1220195:9 INDENT
1189195:9 lit ~
1221195:9 lit ~
1190−195:11 lit ~
1222+195:11 name second
1191196:9 NEWLINE
1223196:9 NEWLINE
1192196:9 glyph [
1224196:9 glyph [
1193−196:10 tight name item
1225+196:10 tight lit ~
1194−196:15 name rest
1226+196:12 name a
1195−196:19 tight glyph ]
1227+196:13 tight glyph ]
1196197:11 INDENT
1228197:11 INDENT
1197197:11 glyph ?-
1229197:11 glyph ?-
1198−197:14 glyph (
1230+197:14 name second
1199−197:15 tight name predicate
1200−197:25 name item
1201−197:29 tight glyph )
1202198:13 INDENT
1231198:13 INDENT
1203−198:13 lit %.y
1232+198:13 lit ~
1204−198:17 glyph [
1233+198:15 name first
1205−198:18 tight name item
1206−198:23 glyph (
1207−198:24 tight name skim
1208−198:29 name rest
1209−198:34 name predicate
1210−198:43 tight glyph )
1211−198:44 tight glyph ]
1212199:13 NEWLINE
1234199:13 NEWLINE
1213−199:13 lit %.n
1235+199:13 glyph [
1214−199:17 glyph (
1236+199:14 tight lit ~
1215−199:18 tight name skim
1237+199:16 name b
1216−199:23 name rest
1238+199:17 tight glyph ]
1217−199:28 name predicate
1239+199:19 glyph `
1218−199:37 tight glyph )
1240+199:20 tight glyph (
1241+199:21 tight name combine
1242+199:29 name a
1243+199:31 name b
1244+199:32 tight glyph )
1219201:1 DEDENT
1245201:1 DEDENT
1220201:1 DEDENT
1246201:1 DEDENT
1221201:1 DEDENT
1247201:1 DEDENT
@@ -1224,62 +1250,71 @@
1224201:1 DEDENT
1250201:1 DEDENT
1225201:1 NEWLINE
1251201:1 NEWLINE
1226201:1 glyph ++
1252201:1 glyph ++
1227−201:4 name skip
1253+201:4 name clef
1228201:9 glyph |=
1254201:9 glyph |=
1229201:12 name args
1255201:12 name args
1230201:16 tight glyph =
1256201:16 tight glyph =
1231201:17 tight glyph [
1257201:17 tight glyph [
1232201:18 tight glyph (
1258201:18 tight glyph (
1233−201:19 tight name list
1259+201:19 tight name unit
1234201:24 tvar A
1260201:24 tvar A
1235201:25 tight glyph )
1261201:25 tight glyph )
1236−201:27 glyph $-(
1262+201:27 glyph (
1237−201:30 tight tvar A
1263+201:28 tight name unit
1238−201:32 glyph ?
1264+201:33 tvar B
1239−201:33 tight glyph )
1265+201:34 tight glyph )
1240−201:34 tight glyph ]
1266+201:36 glyph $-(
1267+201:39 tight glyph [
1268+201:40 tight tvar A
1269+201:42 tvar B
1270+201:43 tight glyph ]
1271+201:45 glyph (
1272+201:46 tight name unit
1273+201:51 tvar C
1274+201:52 tight glyph )
1275+201:53 tight glyph )
1276+201:54 tight glyph ]
1241202:3 INDENT
1277202:3 INDENT
1242202:3 glyph ?-
1278202:3 glyph ?-
1243202:6 name args
1279202:6 name args
1244203:5 INDENT
1280203:5 INDENT
1245203:5 glyph [
1281203:5 glyph [
1246−203:6 tight name xs
1282+203:6 tight name first
1247−203:9 name predicate
1283+203:12 name second
1248−203:18 tight glyph ]
1284+203:19 name combine
1285+203:26 tight glyph ]
1286+203:28 glyph ^-
1287+203:31 glyph (
1288+203:32 tight name unit
1289+203:37 tvar C
1290+203:38 tight glyph )
1249204:7 INDENT
1291204:7 INDENT
1250204:7 glyph ?-
1292204:7 glyph ?-
1251−204:10 name xs
1293+204:10 name first
1252205:9 INDENT
1294205:9 INDENT
1253205:9 lit ~
1295205:9 lit ~
1254205:11 lit ~
1296205:11 lit ~
1255206:9 NEWLINE
1297206:9 NEWLINE
1256206:9 glyph [
1298206:9 glyph [
1257−206:10 tight name item
1299+206:10 tight lit ~
1258−206:15 name rest
1300+206:12 name a
1259−206:19 tight glyph ]
1301+206:13 tight glyph ]
1260207:11 INDENT
1302207:11 INDENT
1261207:11 glyph ?-
1303207:11 glyph ?-
1262−207:14 glyph (
1304+207:14 name second
1263−207:15 tight name predicate
1264−207:25 name item
1265−207:29 tight glyph )
1266208:13 INDENT
1305208:13 INDENT
1267−208:13 lit %.y
1306+208:13 lit ~
1268−208:17 glyph (
1307+208:15 lit ~
1269−208:18 tight name skip
1270−208:23 name rest
1271−208:28 name predicate
1272−208:37 tight glyph )
1273209:13 NEWLINE
1308209:13 NEWLINE
1274−209:13 lit %.n
1309+209:13 glyph [
1275−209:17 glyph [
1310+209:14 tight lit ~
1276−209:18 tight name item
1311+209:16 name b
1277−209:23 glyph (
1312+209:17 tight glyph ]
1278−209:24 tight name skip
1313+209:19 glyph (
1279−209:29 name rest
1314+209:20 tight name combine
1280−209:34 name predicate
1315+209:28 name a
1281−209:43 tight glyph )
1316+209:30 name b
1282−209:44 tight glyph ]
1317+209:31 tight glyph )
1283211:1 DEDENT
1318211:1 DEDENT
1284211:1 DEDENT
1319211:1 DEDENT
1285211:1 DEDENT
1320211:1 DEDENT
@@ -1288,7 +1323,7 @@
1288211:1 DEDENT
1323211:1 DEDENT
1289211:1 NEWLINE
1324211:1 NEWLINE
1290211:1 glyph ++
1325211:1 glyph ++
1291−211:4 name levy
1326+211:4 name skim
1292211:9 glyph |=
1327211:9 glyph |=
1293211:12 name args
1328211:12 name args
1294211:16 tight glyph =
1329211:16 tight glyph =
@@ -1310,33 +1345,45 @@
1310213:6 tight name xs
1345213:6 tight name xs
1311213:9 name predicate
1346213:9 name predicate
1312213:18 tight glyph ]
1347213:18 tight glyph ]
1313−214:7 INDENT
1348+213:20 glyph ^-
1314−214:7 glyph ?-
1349+213:23 glyph (
1315−214:10 name xs
1350+213:24 tight name list
1316−215:9 INDENT
1351+213:29 tvar A
1317−215:9 lit ~
1352+213:30 tight glyph )
1318−215:11 lit %.y
1353+214:9 INDENT
1319−216:9 NEWLINE
1354+214:9 glyph ?-
1320−216:9 glyph [
1355+214:12 name xs
1321−216:10 tight name item
1356+215:11 INDENT
1322−216:15 name rest
1357+215:11 lit ~
1323−216:19 tight glyph ]
1358+215:13 lit ~
1324−217:11 INDENT
1359+216:11 NEWLINE
1325−217:11 glyph ?-
1360+216:11 glyph [
1326−217:14 glyph (
1361+216:12 tight name item
1327−217:15 tight name predicate
1362+216:17 name rest
1328−217:25 name item
1363+216:21 tight glyph ]
1329−217:29 tight glyph )
1364+217:13 INDENT
1330−218:13 INDENT
1365+217:13 glyph ?-
1331−218:13 lit %.y
1366+217:16 glyph (
1332−218:17 glyph (
1367+217:17 tight name predicate
1333−218:18 tight name levy
1368+217:27 name item
1334−218:23 name rest
1369+217:31 tight glyph )
1335−218:28 name predicate
1370+218:15 INDENT
1336−218:37 tight glyph )
1371+218:15 lit %.y
1337−219:13 NEWLINE
1372+218:19 glyph [
1338−219:13 lit %.n
1373+218:20 tight name item
1339−219:17 lit %.n
1374+218:25 glyph (
1375+218:26 tight name skim
1376+218:31 name rest
1377+218:36 name predicate
1378+218:45 tight glyph )
1379+218:46 tight glyph ]
1380+219:15 NEWLINE
1381+219:15 lit %.n
1382+219:19 glyph (
1383+219:20 tight name skim
1384+219:25 name rest
1385+219:30 name predicate
1386+219:39 tight glyph )
1340221:1 DEDENT
1387221:1 DEDENT
1341221:1 DEDENT
1388221:1 DEDENT
1342221:1 DEDENT
1389221:1 DEDENT
@@ -1345,7 +1392,7 @@
1345221:1 DEDENT
1392221:1 DEDENT
1346221:1 NEWLINE
1393221:1 NEWLINE
1347221:1 glyph ++
1394221:1 glyph ++
1348−221:4 name lien
1395+221:4 name skip
1349221:9 glyph |=
1396221:9 glyph |=
1350221:12 name args
1397221:12 name args
1351221:16 tight glyph =
1398221:16 tight glyph =
@@ -1367,33 +1414,45 @@
1367223:6 tight name xs
1414223:6 tight name xs
1368223:9 name predicate
1415223:9 name predicate
1369223:18 tight glyph ]
1416223:18 tight glyph ]
1370−224:7 INDENT
1417+223:20 glyph ^-
1371−224:7 glyph ?-
1418+223:23 glyph (
1372−224:10 name xs
1419+223:24 tight name list
1373−225:9 INDENT
1420+223:29 tvar A
1374−225:9 lit ~
1421+223:30 tight glyph )
1375−225:11 lit %.n
1422+224:9 INDENT
1376−226:9 NEWLINE
1423+224:9 glyph ?-
1377−226:9 glyph [
1424+224:12 name xs
1378−226:10 tight name item
1425+225:11 INDENT
1379−226:15 name rest
1426+225:11 lit ~
1380−226:19 tight glyph ]
1427+225:13 lit ~
1381−227:11 INDENT
1428+226:11 NEWLINE
1382−227:11 glyph ?-
1429+226:11 glyph [
1383−227:14 glyph (
1430+226:12 tight name item
1384−227:15 tight name predicate
1431+226:17 name rest
1385−227:25 name item
1432+226:21 tight glyph ]
1386−227:29 tight glyph )
1433+227:13 INDENT
1387−228:13 INDENT
1434+227:13 glyph ?-
1388−228:13 lit %.y
1435+227:16 glyph (
1389−228:17 lit %.y
1436+227:17 tight name predicate
1390−229:13 NEWLINE
1437+227:27 name item
1391−229:13 lit %.n
1438+227:31 tight glyph )
1392−229:17 glyph (
1439+228:15 INDENT
1393−229:18 tight name lien
1440+228:15 lit %.y
1394−229:23 name rest
1441+228:19 glyph (
1395−229:28 name predicate
1442+228:20 tight name skip
1396−229:37 tight glyph )
1443+228:25 name rest
1444+228:30 name predicate
1445+228:39 tight glyph )
1446+229:15 NEWLINE
1447+229:15 lit %.n
1448+229:19 glyph [
1449+229:20 tight name item
1450+229:25 glyph (
1451+229:26 tight name skip
1452+229:31 name rest
1453+229:36 name predicate
1454+229:45 tight glyph )
1455+229:46 tight glyph ]
1397231:1 DEDENT
1456231:1 DEDENT
1398231:1 DEDENT
1457231:1 DEDENT
1399231:1 DEDENT
1458231:1 DEDENT
@@ -1402,7 +1461,7 @@
1402231:1 DEDENT
1461231:1 DEDENT
1403231:1 NEWLINE
1462231:1 NEWLINE
1404231:1 glyph ++
1463231:1 glyph ++
1405−231:4 name roll
1464+231:4 name levy
1406231:9 glyph |=
1465231:9 glyph |=
1407231:12 name args
1466231:12 name args
1408231:16 tight glyph =
1467231:16 tight glyph =
@@ -1411,348 +1470,765 @@
1411231:19 tight name list
1470231:19 tight name list
1412231:24 tvar A
1471231:24 tvar A
1413231:25 tight glyph )
1472231:25 tight glyph )
1414−231:27 tvar B
1473+231:27 glyph $-(
1415−231:29 glyph $-(
1474+231:30 tight tvar A
1416−231:32 tight glyph [
1475+231:32 glyph ?
1417−231:33 tight tvar A
1476+231:33 tight glyph )
1418−231:35 tvar B
1477+231:34 tight glyph ]
1419−231:36 tight glyph ]
1420−231:38 tvar B
1421−231:39 tight glyph )
1422−231:40 tight glyph ]
1423232:3 INDENT
1478232:3 INDENT
1424−232:3 glyph ?-
1479+232:3 glyph ^-
1425−232:6 name args
1480+232:6 glyph ?
1426233:5 INDENT
1481233:5 INDENT
1427−233:5 glyph [
1482+233:5 glyph ?-
1428−233:6 tight name xs
1483+233:8 name args
1429−233:9 name start
1430−233:15 name combine
1431−233:22 tight glyph ]
1432234:7 INDENT
1484234:7 INDENT
1433−234:7 glyph ?-
1485+234:7 glyph [
1434−234:10 name xs
1486+234:8 tight name xs
1487+234:11 name predicate
1488+234:20 tight glyph ]
1435235:9 INDENT
1489235:9 INDENT
1436−235:9 lit ~
1490+235:9 glyph ?-
1437−235:11 name start
1491+235:12 name xs
1438−236:9 NEWLINE
1492+236:11 INDENT
1439−236:9 glyph [
1493+236:11 lit ~
1440−236:10 tight name item
1494+236:13 lit %.y
1441−236:15 name rest
1495+237:11 NEWLINE
1442−236:19 tight glyph ]
1496+237:11 glyph [
1443−236:21 glyph (
1497+237:12 tight name item
1444−236:22 tight name roll
1498+237:17 name rest
1445−236:27 name rest
1499+237:21 tight glyph ]
1446−236:32 glyph (
1500+238:13 INDENT
1447−236:33 tight name combine
1501+238:13 glyph ?-
1448−236:41 name item
1502+238:16 glyph (
1449−236:46 name start
1503+238:17 tight name predicate
1450−236:51 tight glyph )
1504+238:27 name item
1451−236:53 name combine
1505+238:31 tight glyph )
1452−236:60 tight glyph )
1506+239:15 INDENT
1453−238:1 DEDENT
1507+239:15 lit %.y
1454−238:1 DEDENT
1508+239:19 glyph (
1455−238:1 DEDENT
1509+239:20 tight name levy
1456−238:1 DEDENT
1510+239:25 name rest
1457−238:1 NEWLINE
1511+239:30 name predicate
1458−238:1 glyph ++
1512+239:39 tight glyph )
1459−238:4 name reel
1513+240:15 NEWLINE
1460−238:9 glyph |=
1514+240:15 lit %.n
1461−238:12 name args
1515+240:19 lit %.n
1462−238:16 tight glyph =
1516+242:1 DEDENT
1463−238:17 tight glyph [
1517+242:1 DEDENT
1464−238:18 tight glyph (
1518+242:1 DEDENT
1465−238:19 tight name list
1519+242:1 DEDENT
1466−238:24 tvar A
1520+242:1 DEDENT
1467−238:25 tight glyph )
1521+242:1 DEDENT
1468−238:27 tvar B
1522+242:1 DEDENT
1469−238:29 glyph $-(
1523+242:1 NEWLINE
1470−238:32 tight glyph [
1524+242:1 glyph ++
1471−238:33 tight tvar A
1525+242:4 name lien
1472−238:35 tvar B
1526+242:9 glyph |=
1473−238:36 tight glyph ]
1527+242:12 name args
1474−238:38 tvar B
1528+242:16 tight glyph =
1475−238:39 tight glyph )
1529+242:17 tight glyph [
1476−238:40 tight glyph ]
1530+242:18 tight glyph (
1477−239:3 INDENT
1531+242:19 tight name list
1478−239:3 glyph ?-
1532+242:24 tvar A
1479−239:6 name args
1533+242:25 tight glyph )
1480−240:5 INDENT
1534+242:27 glyph $-(
1481−240:5 glyph [
1535+242:30 tight tvar A
1482−240:6 tight name xs
1536+242:32 glyph ?
1483−240:9 name start
1537+242:33 tight glyph )
1484−240:15 name combine
1538+242:34 tight glyph ]
1485−240:22 tight glyph ]
1539+243:3 INDENT
1486−241:7 INDENT
1540+243:3 glyph ^-
1487−241:7 glyph ?-
1541+243:6 glyph ?
1488−241:10 name xs
1542+244:5 INDENT
1489−242:9 INDENT
1543+244:5 glyph ?-
1490−242:9 lit ~
1544+244:8 name args
1491−242:11 name start
1545+245:7 INDENT
1492−243:9 NEWLINE
1546+245:7 glyph [
1493−243:9 glyph [
1547+245:8 tight name xs
1494−243:10 tight name item
1548+245:11 name predicate
1495−243:15 name rest
1549+245:20 tight glyph ]
1496−243:19 tight glyph ]
1550+246:9 INDENT
1497−243:21 glyph (
1551+246:9 glyph ?-
1498−243:22 tight name combine
1552+246:12 name xs
1499−243:30 name item
1553+247:11 INDENT
1500−243:35 glyph (
1554+247:11 lit ~
1501−243:36 tight name reel
1555+247:13 lit %.n
1502−243:41 name rest
1556+248:11 NEWLINE
1503−243:46 name start
1557+248:11 glyph [
1504−243:52 name combine
1558+248:12 tight name item
1505−243:59 tight glyph )
1559+248:17 name rest
1506−243:60 tight glyph )
1560+248:21 tight glyph ]
1507−245:1 DEDENT
1561+249:13 INDENT
1508−245:1 DEDENT
1562+249:13 glyph ?-
1509−245:1 DEDENT
1563+249:16 glyph (
1510−245:1 DEDENT
1564+249:17 tight name predicate
1511−245:1 NEWLINE
1565+249:27 name item
1512−245:1 glyph ++
1566+249:31 tight glyph )
1513−245:4 name flit
1567+250:15 INDENT
1514−245:9 glyph |=
1568+250:15 lit %.y
1515−245:12 name predicate
1569+250:19 lit %.y
1516−245:21 tight glyph =
1570+251:15 NEWLINE
1517−245:22 tight glyph $-(
1571+251:15 lit %.n
1518−245:25 tight tvar A
1572+251:19 glyph (
1519−245:27 glyph ?
1573+251:20 tight name lien
1520−245:28 tight glyph )
1574+251:25 name rest
1521−246:3 INDENT
1575+251:30 name predicate
1522−246:3 glyph |=
1523−246:6 name value
1524−246:11 tight glyph =
1525−246:12 tight tvar A
1526−247:5 INDENT
1527−247:5 glyph ?-
1528−247:8 glyph (
1529−247:9 tight name predicate
1530−247:19 name value
1531−247:24 tight glyph )
1532−248:7 INDENT
1533−248:7 lit %.y
1534−248:11 glyph `
1535−248:12 tight name value
1536−249:7 NEWLINE
1537−249:7 lit %.n
1538−249:11 lit ~
1539−251:1 DEDENT
1540−251:1 DEDENT
1541−251:1 DEDENT
1542−251:1 NEWLINE
1543−251:1 glyph ++
1544−251:4 name murn
1545−251:9 glyph |=
1546−251:12 name args
1547−251:16 tight glyph =
1548−251:17 tight glyph [
1549−251:18 tight glyph (
1550−251:19 tight name list
1551−251:24 tvar A
1552−251:25 tight glyph )
1553−251:27 glyph $-(
1554−251:30 tight tvar A
1555−251:32 glyph (
1556−251:33 tight name unit
1557−251:38 tvar B
1558251:39 tight glyph )
1576251:39 tight glyph )
1559−251:40 tight glyph )
1577+253:1 DEDENT
1560−251:41 tight glyph ]
1578+253:1 DEDENT
1561−252:3 INDENT
1579+253:1 DEDENT
1562−252:3 glyph ?-
1580+253:1 DEDENT
1563−252:6 name args
1581+253:1 DEDENT
1564−253:5 INDENT
1582+253:1 DEDENT
1565−253:5 glyph [
1583+253:1 DEDENT
1566−253:6 tight name xs
1584+253:1 NEWLINE
1567−253:9 name f
1585+253:1 glyph ++
1568−253:10 tight glyph ]
1586+253:4 name roll
1569−254:7 INDENT
1587+253:9 glyph |=
1570−254:7 glyph ?-
1588+253:12 name args
1571−254:10 name xs
1589+253:16 tight glyph =
1572−255:9 INDENT
1590+253:17 tight glyph [
1573−255:9 lit ~
1591+253:18 tight glyph (
1574−255:11 lit ~
1592+253:19 tight name list
1575−256:9 NEWLINE
1593+253:24 tvar A
1576−256:9 glyph [
1594+253:25 tight glyph )
1577−256:10 tight name item
1595+253:27 tvar B
1578−256:15 name rest
1596+253:29 glyph $-(
1579−256:19 tight glyph ]
1597+253:32 tight glyph [
1580−257:11 INDENT
1598+253:33 tight tvar A
1581−257:11 glyph ?-
1599+253:35 tvar B
1582−257:14 glyph (
1600+253:36 tight glyph ]
1583−257:15 tight name f
1601+253:38 tvar B
1584−257:17 name item
1602+253:39 tight glyph )
1585−257:21 tight glyph )
1603+253:40 tight glyph ]
1586−258:13 INDENT
1604+254:3 INDENT
1587−258:13 lit ~
1605+254:3 glyph ?-
1588−258:15 glyph (
1606+254:6 name args
1589−258:16 tight name murn
1607+255:5 INDENT
1590−258:21 name rest
1608+255:5 glyph [
1591−258:26 name f
1609+255:6 tight name xs
1592−258:27 tight glyph )
1610+255:9 name start
1593−259:13 NEWLINE
1611+255:15 name combine
1594−259:13 glyph [
1612+255:22 tight glyph ]
1595−259:14 tight lit ~
1613+256:7 INDENT
1596−259:16 name value
1614+256:7 glyph ?-
1597−259:21 tight glyph ]
1615+256:10 name xs
1598−259:23 glyph [
1616+257:9 INDENT
1599−259:24 tight name value
1617+257:9 lit ~
1600−259:30 glyph (
1618+257:11 name start
1601−259:31 tight name murn
1619+258:9 NEWLINE
1602−259:36 name rest
1620+258:9 glyph [
1603−259:41 name f
1621+258:10 tight name item
1604−259:42 tight glyph )
1622+258:15 name rest
1605−259:43 tight glyph ]
1623+258:19 tight glyph ]
1606−261:1 DEDENT
1624+258:21 glyph (
1607−261:1 DEDENT
1625+258:22 tight name roll
1608−261:1 DEDENT
1626+258:27 name rest
1609−261:1 DEDENT
1627+258:32 glyph (
1610−261:1 DEDENT
1628+258:33 tight name combine
1611−261:1 DEDENT
1629+258:41 name item
1612−261:1 NEWLINE
1630+258:46 name start
1613−261:1 glyph ++
1631+258:51 tight glyph )
1614−261:4 name join
1632+258:53 name combine
1615−261:9 glyph |=
1633+258:60 tight glyph )
1616−261:12 name args
1634+260:1 DEDENT
1617−261:16 tight glyph =
1635+260:1 DEDENT
1618−261:17 tight glyph [
1636+260:1 DEDENT
1619−261:18 tight tvar A
1637+260:1 DEDENT
1620−261:20 glyph (
1638+260:1 NEWLINE
1621−261:21 tight name list
1639+260:1 glyph ++
1622−261:26 tvar A
1640+260:4 name reel
1623−261:27 tight glyph )
1641+260:9 glyph |=
1624−261:28 tight glyph ]
1642+260:12 name args
1625−262:3 INDENT
1643+260:16 tight glyph =
1626−262:3 glyph ?-
1644+260:17 tight glyph [
1627−262:6 name args
1645+260:18 tight glyph (
1628−263:5 INDENT
1646+260:19 tight name list
1629−263:5 glyph [
1647+260:24 tvar A
1630−263:6 tight name separator
1648+260:25 tight glyph )
1631−263:16 name xs
1649+260:27 tvar B
1632−263:18 tight glyph ]
1650+260:29 glyph $-(
1633−264:7 INDENT
1651+260:32 tight glyph [
1634−264:7 glyph ?-
1652+260:33 tight tvar A
1635−264:10 name xs
1653+260:35 tvar B
1636−265:9 INDENT
1654+260:36 tight glyph ]
1637−265:9 lit ~
1655+260:38 tvar B
1638−265:11 lit ~
1656+260:39 tight glyph )
1639−266:9 NEWLINE
1657+260:40 tight glyph ]
1640−266:9 glyph [
1658+261:3 INDENT
1641−266:10 tight name item
1659+261:3 glyph ?-
1642−266:15 name rest
1660+261:6 name args
1643−266:19 tight glyph ]
1661+262:5 INDENT
1644−267:11 INDENT
1662+262:5 glyph [
1645−267:11 glyph ?-
1663+262:6 tight name xs
1646−267:14 name rest
1664+262:9 name start
1647−268:13 INDENT
1665+262:15 name combine
1648−268:13 lit ~
1666+262:22 tight glyph ]
1649−268:15 glyph [
1667+263:7 INDENT
1650−268:16 tight name item
1668+263:7 glyph ?-
1651−268:21 lit ~
1669+263:10 name xs
1652−268:22 tight glyph ]
1670+264:9 INDENT
1653−269:13 NEWLINE
1671+264:9 lit ~
1654−269:13 glyph [
1672+264:11 name start
1655−269:14 tight name next
1673+265:9 NEWLINE
1656−269:19 name more
1674+265:9 glyph [
1657−269:23 tight glyph ]
1675+265:10 tight name item
1658−269:25 glyph [
1676+265:15 name rest
1659−269:26 tight name item
1677+265:19 tight glyph ]
1660−269:31 glyph [
1678+265:21 glyph (
1661−269:32 tight name separator
1679+265:22 tight name combine
1662−269:42 glyph (
1680+265:30 name item
1663−269:43 tight name join
1681+265:35 glyph (
1664−269:48 name separator
1682+265:36 tight name reel
1665−269:58 name rest
1683+265:41 name rest
1666−269:62 tight glyph )
1684+265:46 name start
1667−269:63 tight glyph ]
1685+265:52 name combine
1668−269:64 tight glyph ]
1686+265:59 tight glyph )
1669−271:1 DEDENT
1687+265:60 tight glyph )
1670−271:1 DEDENT
1688+267:1 DEDENT
1671−271:1 DEDENT
1689+267:1 DEDENT
1672−271:1 DEDENT
1690+267:1 DEDENT
1673−271:1 DEDENT
1691+267:1 DEDENT
1674−271:1 DEDENT
1692+267:1 NEWLINE
1675−271:1 NEWLINE
1693+267:1 glyph ++
1676−271:1 glyph ++
1694+267:4 name flit
1677−271:4 name snip
1695+267:9 glyph |=
1678−271:9 glyph |=
1696+267:12 name predicate
1679−271:12 name xs
1697+267:21 tight glyph =
1680−271:14 tight glyph =
1698+267:22 tight glyph $-(
1681−271:15 tight glyph (
1699+267:25 tight tvar A
1682−271:16 tight name list
1700+267:27 glyph ?
1683−271:21 tvar A
1701+267:28 tight glyph )
1684−271:22 tight glyph )
1702+268:3 INDENT
1685−272:3 INDENT
1703+268:3 glyph |=
1686−272:3 glyph ?-
1704+268:6 name value
1687−272:6 name xs
1705+268:11 tight glyph =
1688−273:5 INDENT
1706+268:12 tight tvar A
1689−273:5 lit ~
1707+269:5 INDENT
1690−273:7 lit ~
1708+269:5 glyph ^-
1691−274:5 NEWLINE
1709+269:8 glyph (
1692−274:5 glyph [
1710+269:9 tight name unit
1693−274:6 tight name item
1711+269:14 tvar A
1694−274:11 name rest
1712+269:15 tight glyph )
1695−274:15 tight glyph ]
1713+270:7 INDENT
1696−275:7 INDENT
1714+270:7 glyph ?-
1697−275:7 glyph ?-
1715+270:10 glyph (
1698−275:10 name rest
1716+270:11 tight name predicate
1699−276:9 INDENT
1717+270:21 name value
1700−276:9 lit ~
1718+270:26 tight glyph )
1701−276:11 lit ~
1719+271:9 INDENT
1702−277:9 NEWLINE
1720+271:9 lit %.y
1703−277:9 glyph [
1721+271:13 glyph `
1704−277:10 tight name next
1722+271:14 tight name value
1705−277:15 name more
1723+272:9 NEWLINE
1706−277:19 tight glyph ]
1724+272:9 lit %.n
1707−277:21 glyph [
1725+272:13 lit ~
1708−277:22 tight name item
1726+274:1 DEDENT
1709−277:27 glyph (
1727+274:1 DEDENT
1710−277:28 tight name snip
1728+274:1 DEDENT
1711−277:33 name rest
1729+274:1 DEDENT
1712−277:37 tight glyph )
1730+274:1 NEWLINE
1713−277:38 tight glyph ]
1731+274:1 glyph ++
1714−279:1 DEDENT
1732+274:4 name murn
1715−279:1 DEDENT
1733+274:9 glyph |=
1716−279:1 DEDENT
1734+274:12 name args
1717−279:1 DEDENT
1735+274:16 tight glyph =
1718−279:1 NEWLINE
1736+274:17 tight glyph [
1719−279:1 glyph ++
1737+274:18 tight glyph (
1720−279:4 name rear
1738+274:19 tight name list
1721−279:9 glyph |=
1739+274:24 tvar A
1722−279:12 name xs
1740+274:25 tight glyph )
1723−279:14 tight glyph =
1741+274:27 glyph $-(
1724−279:15 tight glyph (
1742+274:30 tight tvar A
1725−279:16 tight name list
1743+274:32 glyph (
1726−279:21 tvar A
1744+274:33 tight name unit
1727−279:22 tight glyph )
1745+274:38 tvar B
1728−280:3 INDENT
1746+274:39 tight glyph )
1729−280:3 glyph ?-
1747+274:40 tight glyph )
1730−280:6 name xs
1748+274:41 tight glyph ]
1731−281:5 INDENT
1749+275:3 INDENT
1732−281:5 lit ~
1750+275:3 glyph ?-
1733−281:7 glyph !!
1751+275:6 name args
1734−282:5 NEWLINE
1752+276:5 INDENT
1735−282:5 glyph [
1753+276:5 glyph [
1736−282:6 tight name item
1754+276:6 tight name xs
1737−282:11 name rest
1755+276:9 name f
1738−282:15 tight glyph ]
1756+276:10 tight glyph ]
1739−283:7 INDENT
1757+276:12 glyph ^-
1740−283:7 glyph ?-
1758+276:15 glyph (
1741−283:10 name rest
1759+276:16 tight name list
1742−284:9 INDENT
1760+276:21 tvar B
1743−284:9 lit ~
1761+276:22 tight glyph )
1744−284:11 name item
1762+277:9 INDENT
1745−285:9 NEWLINE
1763+277:9 glyph ?-
1746−285:9 glyph [
1764+277:12 name xs
1747−285:10 tight name next
1765+278:11 INDENT
1748−285:15 name more
1766+278:11 lit ~
1749−285:19 tight glyph ]
1767+278:13 lit ~
1750−285:21 glyph (
1768+279:11 NEWLINE
1751−285:22 tight name rear
1769+279:11 glyph [
1752−285:27 name rest
1770+279:12 tight name item
1753−285:31 tight glyph )
1771+279:17 name rest
1754−285:32 DEDENT
1772+279:21 tight glyph ]
1755−285:32 DEDENT
1773+280:13 INDENT
1756−285:32 DEDENT
1774+280:13 glyph ?-
1757−285:32 DEDENT
1775+280:16 glyph (
1758−285:32 NEWLINE
1776+280:17 tight name f
1777+280:19 name item
1778+280:23 tight glyph )
1779+281:15 INDENT
1780+281:15 lit ~
1781+281:17 glyph (
1782+281:18 tight name murn
1783+281:23 name rest
1784+281:28 name f
1785+281:29 tight glyph )
1786+282:15 NEWLINE
1787+282:15 glyph [
1788+282:16 tight lit ~
1789+282:18 name value
1790+282:23 tight glyph ]
1791+282:25 glyph [
1792+282:26 tight name value
1793+282:32 glyph (
1794+282:33 tight name murn
1795+282:38 name rest
1796+282:43 name f
1797+282:44 tight glyph )
1798+282:45 tight glyph ]
1799+284:1 DEDENT
1800+284:1 DEDENT
1801+284:1 DEDENT
1802+284:1 DEDENT
1803+284:1 DEDENT
1804+284:1 DEDENT
1805+284:1 NEWLINE
1806+284:1 glyph ++
1807+284:4 name join
1808+284:9 glyph |=
1809+284:12 name args
1810+284:16 tight glyph =
1811+284:17 tight glyph [
1812+284:18 tight tvar A
1813+284:20 glyph (
1814+284:21 tight name list
1815+284:26 tvar A
1816+284:27 tight glyph )
1817+284:28 tight glyph ]
1818+285:3 INDENT
1819+285:3 glyph ?-
1820+285:6 name args
1821+286:5 INDENT
1822+286:5 glyph [
1823+286:6 tight name separator
1824+286:16 name xs
1825+286:18 tight glyph ]
1826+286:20 glyph ^-
1827+286:23 glyph (
1828+286:24 tight name list
1829+286:29 tvar A
1830+286:30 tight glyph )
1831+287:9 INDENT
1832+287:9 glyph ?-
1833+287:12 name xs
1834+288:11 INDENT
1835+288:11 lit ~
1836+288:13 lit ~
1837+289:11 NEWLINE
1838+289:11 glyph [
1839+289:12 tight name item
1840+289:17 name rest
1841+289:21 tight glyph ]
1842+290:13 INDENT
1843+290:13 glyph ?-
1844+290:16 name rest
1845+291:15 INDENT
1846+291:15 lit ~
1847+291:17 glyph [
1848+291:18 tight name item
1849+291:23 lit ~
1850+291:24 tight glyph ]
1851+292:15 NEWLINE
1852+292:15 glyph [
1853+292:16 tight name next
1854+292:21 name more
1855+292:25 tight glyph ]
1856+292:27 glyph [
1857+292:28 tight name item
1858+292:33 glyph [
1859+292:34 tight name separator
1860+292:44 glyph (
1861+292:45 tight name join
1862+292:50 name separator
1863+292:60 name rest
1864+292:64 tight glyph )
1865+292:65 tight glyph ]
1866+292:66 tight glyph ]
1867+294:1 DEDENT
1868+294:1 DEDENT
1869+294:1 DEDENT
1870+294:1 DEDENT
1871+294:1 DEDENT
1872+294:1 DEDENT
1873+294:1 NEWLINE
1874+294:1 glyph ++
1875+294:4 name snip
1876+294:9 glyph |=
1877+294:12 name xs
1878+294:14 tight glyph =
1879+294:15 tight glyph (
1880+294:16 tight name list
1881+294:21 tvar A
1882+294:22 tight glyph )
1883+295:3 INDENT
1884+295:3 glyph ^-
1885+295:6 glyph (
1886+295:7 tight name list
1887+295:12 tvar A
1888+295:13 tight glyph )
1889+296:5 INDENT
1890+296:5 glyph ?-
1891+296:8 name xs
1892+297:7 INDENT
1893+297:7 lit ~
1894+297:9 lit ~
1895+298:7 NEWLINE
1896+298:7 glyph [
1897+298:8 tight name item
1898+298:13 name rest
1899+298:17 tight glyph ]
1900+299:9 INDENT
1901+299:9 glyph ?-
1902+299:12 name rest
1903+300:11 INDENT
1904+300:11 lit ~
1905+300:13 lit ~
1906+301:11 NEWLINE
1907+301:11 glyph [
1908+301:12 tight name next
1909+301:17 name more
1910+301:21 tight glyph ]
1911+301:23 glyph [
1912+301:24 tight name item
1913+301:29 glyph (
1914+301:30 tight name snip
1915+301:35 name rest
1916+301:39 tight glyph )
1917+301:40 tight glyph ]
1918+303:1 DEDENT
1919+303:1 DEDENT
1920+303:1 DEDENT
1921+303:1 DEDENT
1922+303:1 DEDENT
1923+303:1 NEWLINE
1924+303:1 glyph ++
1925+303:4 name rear
1926+303:9 glyph |=
1927+303:12 name xs
1928+303:14 tight glyph =
1929+303:15 tight glyph (
1930+303:16 tight name list
1931+303:21 tvar A
1932+303:22 tight glyph )
1933+304:3 INDENT
1934+304:3 glyph ?-
1935+304:6 name xs
1936+305:5 INDENT
1937+305:5 lit ~
1938+305:7 glyph !!
1939+306:5 NEWLINE
1940+306:5 glyph [
1941+306:6 tight name item
1942+306:11 name rest
1943+306:15 tight glyph ]
1944+307:7 INDENT
1945+307:7 glyph ?-
1946+307:10 name rest
1947+308:9 INDENT
1948+308:9 lit ~
1949+308:11 name item
1950+309:9 NEWLINE
1951+309:9 glyph [
1952+309:10 tight name next
1953+309:15 name more
1954+309:19 tight glyph ]
1955+309:21 glyph (
1956+309:22 tight name rear
1957+309:27 name rest
1958+309:31 tight glyph )
1959+311:1 DEDENT
1960+311:1 DEDENT
1961+311:1 DEDENT
1962+311:1 DEDENT
1963+311:1 NEWLINE
1964+311:1 glyph ++
1965+311:4 name cork
1966+311:9 glyph |=
1967+311:12 name gates
1968+311:17 tight glyph =
1969+311:18 tight glyph [
1970+311:19 tight glyph $-(
1971+311:22 tight tvar A
1972+311:24 tvar B
1973+311:25 tight glyph )
1974+311:27 glyph $-(
1975+311:30 tight tvar B
1976+311:32 tvar C
1977+311:33 tight glyph )
1978+311:34 tight glyph ]
1979+312:3 INDENT
1980+312:3 glyph ?-
1981+312:6 name gates
1982+313:5 INDENT
1983+313:5 glyph [
1984+313:6 tight name f
1985+313:8 name g
1986+313:9 tight glyph ]
1987+313:11 glyph |=
1988+313:14 name x
1989+313:15 tight glyph =
1990+313:16 tight tvar A
1991+313:18 glyph (
1992+313:19 tight name g
1993+313:21 glyph (
1994+313:22 tight name f
1995+313:24 name x
1996+313:25 tight glyph )
1997+313:26 tight glyph )
1998+315:1 DEDENT
1999+315:1 DEDENT
2000+315:1 NEWLINE
2001+315:1 glyph ++
2002+315:4 name corl
2003+315:9 glyph |=
2004+315:12 name gates
2005+315:17 tight glyph =
2006+315:18 tight glyph [
2007+315:19 tight glyph $-(
2008+315:22 tight tvar B
2009+315:24 tvar C
2010+315:25 tight glyph )
2011+315:27 glyph $-(
2012+315:30 tight tvar A
2013+315:32 tvar B
2014+315:33 tight glyph )
2015+315:34 tight glyph ]
2016+316:3 INDENT
2017+316:3 glyph ?-
2018+316:6 name gates
2019+317:5 INDENT
2020+317:5 glyph [
2021+317:6 tight name f
2022+317:8 name g
2023+317:9 tight glyph ]
2024+317:11 glyph |=
2025+317:14 name x
2026+317:15 tight glyph =
2027+317:16 tight tvar A
2028+317:18 glyph (
2029+317:19 tight name f
2030+317:21 glyph (
2031+317:22 tight name g
2032+317:24 name x
2033+317:25 tight glyph )
2034+317:26 tight glyph )
2035+319:1 DEDENT
2036+319:1 DEDENT
2037+319:1 NEWLINE
2038+319:1 glyph ++
2039+319:4 name cury
2040+319:9 glyph |=
2041+319:12 name args
2042+319:16 tight glyph =
2043+319:17 tight glyph [
2044+319:18 tight glyph $-(
2045+319:21 tight glyph [
2046+319:22 tight tvar A
2047+319:24 tvar B
2048+319:25 tight glyph ]
2049+319:27 tvar C
2050+319:28 tight glyph )
2051+319:30 tvar A
2052+319:31 tight glyph ]
2053+320:3 INDENT
2054+320:3 glyph ?-
2055+320:6 name args
2056+321:5 INDENT
2057+321:5 glyph [
2058+321:6 tight name f
2059+321:8 name a
2060+321:9 tight glyph ]
2061+321:11 glyph |=
2062+321:14 name b
2063+321:15 tight glyph =
2064+321:16 tight tvar B
2065+321:18 glyph (
2066+321:19 tight name f
2067+321:21 name a
2068+321:23 name b
2069+321:24 tight glyph )
2070+323:1 DEDENT
2071+323:1 DEDENT
2072+323:1 NEWLINE
2073+323:1 glyph ++
2074+323:4 name curr
2075+323:9 glyph |=
2076+323:12 name args
2077+323:16 tight glyph =
2078+323:17 tight glyph [
2079+323:18 tight glyph $-(
2080+323:21 tight glyph [
2081+323:22 tight tvar A
2082+323:24 tvar B
2083+323:25 tight glyph ]
2084+323:27 tvar C
2085+323:28 tight glyph )
2086+323:30 tvar B
2087+323:31 tight glyph ]
2088+324:3 INDENT
2089+324:3 glyph ?-
2090+324:6 name args
2091+325:5 INDENT
2092+325:5 glyph [
2093+325:6 tight name f
2094+325:8 name b
2095+325:9 tight glyph ]
2096+325:11 glyph |=
2097+325:14 name a
2098+325:15 tight glyph =
2099+325:16 tight tvar A
2100+325:18 glyph (
2101+325:19 tight name f
2102+325:21 name a
2103+325:23 name b
2104+325:24 tight glyph )
2105+327:1 DEDENT
2106+327:1 DEDENT
2107+327:1 NEWLINE
2108+327:1 glyph +$
2109+327:4 name cmd
2110+327:8 glyph |$
2111+327:11 glyph [
2112+327:12 tight tvar M
2113+327:13 tight glyph ]
2114+328:3 INDENT
2115+328:3 glyph [
2116+328:4 tight lit %poke
2117+328:10 name p
2118+328:11 tight glyph =
2119+328:12 tight name poke
2120+328:17 name reply
2121+328:22 tight glyph =
2122+328:23 tight glyph $-(
2123+328:26 tight glyph (
2124+328:27 tight name unit
2125+328:32 aura @t
2126+328:34 tight glyph )
2127+328:36 tvar M
2128+328:37 tight glyph )
2129+328:38 tight glyph ]
2130+329:3 NEWLINE
2131+329:3 glyph [
2132+329:4 tight lit %go
2133+329:8 name url
2134+329:11 tight glyph =
2135+329:12 tight aura @t
2136+329:14 tight glyph ]
2137+330:3 NEWLINE
2138+330:3 glyph [
2139+330:4 tight lit %wait
2140+330:10 name gap
2141+330:13 tight glyph =
2142+330:14 tight aura @dr
2143+330:18 name msg
2144+330:21 tight glyph =
2145+330:22 tight tvar M
2146+330:23 tight glyph ]
2147+331:3 NEWLINE
2148+331:3 glyph [
2149+331:4 tight lit %now
2150+331:9 name reply
2151+331:14 tight glyph =
2152+331:15 tight glyph $-(
2153+331:18 tight aura @da
2154+331:22 tvar M
2155+331:23 tight glyph )
2156+331:24 tight glyph ]
2157+332:3 NEWLINE
2158+332:3 glyph [
2159+332:4 tight lit %who
2160+332:9 name reply
2161+332:14 tight glyph =
2162+332:15 tight glyph $-(
2163+332:18 tight aura @p
2164+332:21 tvar M
2165+332:22 tight glyph )
2166+332:23 tight glyph ]
2167+334:1 DEDENT
2168+334:1 NEWLINE
2169+334:1 glyph ++
2170+334:4 name gth
2171+334:8 glyph |=
2172+334:11 name args
2173+334:15 tight glyph =
2174+334:16 tight glyph [
2175+334:17 tight tvar A
2176+334:19 tvar A
2177+334:20 tight glyph ]
2178+334:22 glyph (
2179+334:23 tight wing gth-atom.internal
2180+334:41 name args
2181+334:45 tight glyph )
2182+335:1 NEWLINE
2183+335:1 glyph ++
2184+335:4 name add
2185+335:8 glyph |=
2186+335:11 name args
2187+335:15 tight glyph =
2188+335:16 tight glyph [
2189+335:17 tight tvar A
2190+335:19 tvar A
2191+335:20 tight glyph ]
2192+335:22 glyph (
2193+335:23 tight wing add-atom.internal
2194+335:41 name args
2195+335:45 tight glyph )
2196+336:1 NEWLINE
2197+336:1 glyph ++
2198+336:4 name dec
2199+336:8 glyph |=
2200+336:11 name atom
2201+336:15 tight glyph =
2202+336:16 tight tvar A
2203+336:18 glyph (
2204+336:19 tight wing dec-atom.internal
2205+336:37 name atom
2206+336:41 tight glyph )
2207+338:1 NEWLINE
2208+338:1 glyph +$
2209+338:4 name ask
2210+338:8 glyph |$
2211+338:11 glyph [
2212+338:12 tight tvar M
2213+338:13 tight glyph ]
2214+338:15 glyph (
2215+338:16 tight wing ask.internal
2216+338:29 tvar M
2217+338:30 tight glyph )
2218+339:1 NEWLINE
2219+339:1 glyph ++
2220+339:4 name pure
2221+339:9 glyph |=
2222+339:12 name x
2223+339:13 tight glyph =
2224+339:14 tight tvar M
2225+339:16 glyph ^-
2226+339:19 glyph (
2227+339:20 tight name ask
2228+339:24 tvar M
2229+339:25 tight glyph )
2230+339:27 glyph [
2231+339:28 tight lit %pure
2232+339:34 name x
2233+339:35 tight glyph ]
2234+339:36 NEWLINE
tests/golden/prelude-unit-list-transforms/tree.txt+916−708
@@ -1,546 +1,551 @@
1(module
1(module
2− (value 2:1 same
2+ (jibb 1:1 internal /lib/jibb/internal)
3− (gate 2:9
3+ (mold 2:1 poke (ref 2:9 poke.internal))
4− (face 2:12 x (tvar 2:14 A))
4+ (mold 3:1 qath (ref 3:9 qath.internal))
5− (wing 2:16 x)))
5+ (value 7:1 same
6− (value 4:1 head
6+ (gate 7:9
7− (gate 4:9
7+ (face 7:12 x (tvar 7:14 A))
8− (face 4:12 p
8+ (wing 7:16 x)))
9− (cell 4:14 (tvar 4:15 A) (tvar 4:17 B)))
9+ (value 9:1 head
10− (body 5:3
10+ (gate 9:9
11− (branch 5:3
11+ (face 9:12 p
12− (wing 5:6 p)
12+ (cell 9:14 (tvar 9:15 A) (tvar 9:17 B)))
13− (arm 6:5
13+ (body 10:3
14− (cell 6:5 (bind 6:6 a) (bind 6:8 b))
14+ (branch 10:3
15− (wing 6:11 a))))))
15+ (wing 10:6 p)
16− (value 8:1 tail
16+ (arm 11:5
17− (gate 8:9
17+ (cell 11:5 (bind 11:6 a) (bind 11:8 b))
18− (face 8:12 p
18+ (wing 11:11 a))))))
19− (cell 8:14 (tvar 8:15 A) (tvar 8:17 B)))
19+ (value 13:1 tail
20− (body 9:3
20+ (gate 13:9
21− (branch 9:3
21+ (face 13:12 p
22− (wing 9:6 p)
22+ (cell 13:14 (tvar 13:15 A) (tvar 13:17 B)))
23− (arm 10:5
23+ (body 14:3
24− (cell 10:5 (bind 10:6 a) (bind 10:8 b))
24+ (branch 14:3
25− (wing 10:11 b))))))
25+ (wing 14:6 p)
26− (value 12:1 not
26+ (arm 15:5
27− (gate 12:8
27+ (cell 15:5 (bind 15:6 a) (bind 15:8 b))
28− (face 12:11 b (flag 12:13))
28+ (wing 15:11 b))))))
29− (body 13:3
29+ (value 17:1 not
30− (branch 13:3
30+ (gate 17:8
31− (wing 13:6 b)
31+ (face 17:11 b (flag 17:13))
32− (arm 14:5 (lit 14:5 %.y) (lit 14:9 %.n))
32+ (body 18:3
33− (arm 15:5 (lit 15:5 %.n) (lit 15:9 %.y))))))
33+ (branch 18:3
34− (mold 17:1 list
34+ (wing 18:6 b)
35− (generic 17:9 A
35+ (arm 19:5 (lit 19:5 %.y) (lit 19:9 %.n))
36− (union 18:3
36+ (arm 20:5 (lit 20:5 %.n) (lit 20:9 %.y))))))
37− (const 18:3 ~)
37+ (mold 22:1 list
38− (cell 19:3
38+ (generic 22:9 A
39− (face 19:4 i (tvar 19:6 A))
39+ (union 23:3
40− (face 19:8 t
40+ (const 23:3 ~)
41− (apply 19:10 list (tvar 19:16 A)))))))
41+ (cell 24:3
42− (mold 21:1 unit
42+ (face 24:4 i (tvar 24:6 A))
43− (generic 21:9 A
43+ (face 24:8 t
44− (union 22:3
44+ (apply 24:10 list (tvar 24:16 A)))))))
45− (const 22:3 ~)
45+ (mold 26:1 unit
46− (cell 23:3
46+ (generic 26:9 A
47− (const 23:4 ~)
47+ (union 27:3
48− (face 23:6 u (tvar 23:8 A))))))
48+ (const 27:3 ~)
49− (value 25:1 fall
49+ (cell 28:3
50− (gate 25:9
50+ (const 28:4 ~)
51− (face 25:12 args
51+ (face 28:6 u (tvar 28:8 A))))))
52− (cell 25:17
52+ (value 30:1 fall
53− (apply 25:18 unit (tvar 25:24 A))
53+ (gate 30:9
54− (tvar 25:27 A)))
54+ (face 30:12 args
55− (body 26:3
55+ (cell 30:17
56− (branch 26:3
56+ (apply 30:18 unit (tvar 30:24 A))
57− (wing 26:6 args)
57+ (tvar 30:27 A)))
58− (arm 27:5
58+ (body 31:3
59− (cell 27:5 (bind 27:6 maybe) (bind 27:12 fallback))
59+ (branch 31:3
60− (body 28:7
60+ (wing 31:6 args)
61− (branch 28:7
61+ (arm 32:5
62− (wing 28:10 maybe)
62+ (cell 32:5 (bind 32:6 maybe) (bind 32:12 fallback))
63− (arm 29:9 (lit 29:9 ~) (wing 29:11 fallback))
63+ (body 33:7
64− (arm 30:9
64+ (branch 33:7
65− (cell 30:9 (lit 30:10 ~) (bind 30:12 value))
65+ (wing 33:10 maybe)
66− (wing 30:19 value)))))))))
66+ (arm 34:9 (lit 34:9 ~) (wing 34:11 fallback))
67− (value 32:1 need
67+ (arm 35:9
68− (gate 32:9
68+ (cell 35:9 (lit 35:10 ~) (bind 35:12 value))
69− (face 32:12 maybe
69+ (wing 35:19 value)))))))))
70− (apply 32:18 unit (tvar 32:24 A)))
70+ (value 37:1 need
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
71 (gate 37:9
80− (face 37:12 args
72+ (face 37:12 maybe
81− (cell 37:17
73+ (apply 37:18 unit (tvar 37:24 A)))
82− (apply 37:18 list (tvar 37:24 A))
83− (apply 37:27 list (tvar 37:33 A))))
84 (body 38:3
74 (body 38:3
85 (branch 38:3
75 (branch 38:3
86− (wing 38:6 args)
76+ (wing 38:6 maybe)
87− (arm 39:5
77+ (arm 39:5 (lit 39:5 ~) (crash 39:7))
88− (cell 39:5 (bind 39:6 xs) (bind 39:9 ys))
78+ (arm 40:5
89− (body 40:7
79+ (cell 40:5 (lit 40:6 ~) (bind 40:8 value))
90− (cast 40:7
80+ (wing 40:15 value))))))
91− (apply 40:10 list (tvar 40:16 A))
81+ (value 42:1 weld
92− (body 41:9
82+ (gate 42:9
93− (branch 41:9
83+ (face 42:12 args
94− (wing 41:12 xs)
84+ (cell 42:17
95− (arm 42:11 (lit 42:11 ~) (wing 42:13 ys))
85+ (apply 42:18 list (tvar 42:24 A))
96− (arm 43:11
86+ (apply 42:27 list (tvar 42:33 A))))
97− (cell 43:11 (bind 43:12 item) (bind 43:17 rest))
87+ (body 43:3
98− (tuple 43:23
88+ (branch 43:3
99− (wing 43:24 item)
89+ (wing 43:6 args)
100− (group 43:29
90+ (arm 44:5
101− (call 43:30 (wing 43:30 weld) (wing 43:35 rest) (wing 43:40 ys))))))))))))))
91+ (cell 44:5 (bind 44:6 xs) (bind 44:9 ys))
102− (value 45:1 turn
92+ (body 45:7
103− (gate 45:9
93+ (cast 45:7
104− (face 45:12 args
94+ (apply 45:10 list (tvar 45:16 A))
105− (cell 45:17
95+ (body 46:9
106− (apply 45:18 list (tvar 45:24 A))
96+ (branch 46:9
107− (fn 45:27 (tvar 45:30 A) (tvar 45:32 B))))
97+ (wing 46:12 xs)
108− (body 46:3
98+ (arm 47:11 (lit 47:11 ~) (wing 47:13 ys))
109− (branch 46:3
99+ (arm 48:11
110− (wing 46:6 args)
100+ (cell 48:11 (bind 48:12 item) (bind 48:17 rest))
111− (arm 47:5
101+ (tuple 48:23
112− (cell 47:5 (bind 47:6 xs) (bind 47:9 f))
102+ (wing 48:24 item)
113− (body 48:7
103+ (group 48:29
114− (cast 48:7
104+ (call 48:30 (wing 48:30 weld) (wing 48:35 rest) (wing 48:40 ys))))))))))))))
115− (apply 48:10 list (tvar 48:16 B))
105+ (value 50:1 turn
116− (body 49:9
106+ (gate 50:9
117− (branch 49:9
107+ (face 50:12 args
118− (wing 49:12 xs)
108+ (cell 50:17
119− (arm 50:11 (lit 50:11 ~) (lit 50:13 ~))
109+ (apply 50:18 list (tvar 50:24 A))
120− (arm 51:11
110+ (fn 50:27 (tvar 50:30 A) (tvar 50:32 B))))
121− (cell 51:11 (bind 51:12 item) (bind 51:17 rest))
111+ (body 51:3
122− (tuple 51:23
112+ (branch 51:3
123− (group 51:24
113+ (wing 51:6 args)
124− (call 51:25 (wing 51:25 f) (wing 51:27 item)))
114+ (arm 52:5
125− (group 51:33
115+ (cell 52:5 (bind 52:6 xs) (bind 52:9 f))
126− (call 51:34 (wing 51:34 turn) (wing 51:39 rest) (wing 51:44 f))))))))))))))
116+ (body 53:7
127− (mold 53:1 dime
117+ (cast 53:7
128− (cell 53:9
118+ (apply 53:10 list (tvar 53:16 B))
129− (face 53:10 p (aura 53:12 @ta))
119+ (body 54:9
130− (face 53:16 q (aura 53:18 @))))
120+ (branch 54:9
131− (mold 55:1 hair
121+ (wing 54:12 xs)
132− (cell 55:9
122+ (arm 55:11 (lit 55:11 ~) (lit 55:13 ~))
133− (face 55:10 p (aura 55:12 @ud))
123+ (arm 56:11
134− (face 55:16 q (aura 55:18 @ud))))
124+ (cell 56:11 (bind 56:12 item) (bind 56:17 rest))
135− (mold 57:1 pint
125+ (tuple 56:23
136− (cell 57:9
126+ (group 56:24
137− (face 57:10 p
127+ (call 56:25 (wing 56:25 f) (wing 56:27 item)))
138− (cell 57:12
128+ (group 56:33
139− (face 57:13 p (aura 57:15 @))
129+ (call 56:34 (wing 56:34 turn) (wing 56:39 rest) (wing 56:44 f))))))))))))))
140− (face 57:17 q (aura 57:19 @))))
130+ (mold 58:1 dime
141− (face 57:22 q
131+ (cell 58:9
142− (cell 57:24
132+ (face 58:10 p (aura 58:12 @ta))
143− (face 57:25 p (aura 57:27 @))
133+ (face 58:16 q (aura 58:18 @))))
144− (face 57:29 q (aura 57:31 @))))))
134+ (mold 60:1 hair
145− (mold 59:1 coin
135+ (cell 60:9
146− (union 60:3
136+ (face 60:10 p (aura 60:12 @ud))
147− (cell 60:3
137+ (face 60:16 q (aura 60:18 @ud))))
148− (const 60:4 %$)
138+ (mold 62:1 pint
149− (face 60:7 p (ref 60:9 dime)))
139+ (cell 62:9
150− (cell 61:3
140+ (face 62:10 p
151− (const 61:4 %blob)
141+ (cell 62:12
152− (face 61:10 p (noun 61:12)))
142+ (face 62:13 p (aura 62:15 @))
153− (cell 62:3
143+ (face 62:17 q (aura 62:19 @))))
154− (const 62:4 %many)
144+ (face 62:22 q
155− (face 62:10 p
145+ (cell 62:24
156− (apply 62:12 list (ref 62:18 coin))))))
146+ (face 62:25 p (aura 62:27 @))
157− (mold 64:1 pair
147+ (face 62:29 q (aura 62:31 @))))))
158− (generic 64:9 A B
148+ (mold 64:1 coin
159− (cell 64:18
149+ (union 65:3
160− (face 64:19 p (tvar 64:21 A))
150+ (cell 65:3
161− (face 64:23 q (tvar 64:25 B)))))
151+ (const 65:4 %$)
162− (mold 66:1 trel
152+ (face 65:7 p (ref 65:9 dime)))
163− (generic 66:9 A B C
153+ (cell 66:3
164− (cell 66:20
154+ (const 66:4 %blob)
165− (face 66:21 p (tvar 66:23 A))
155+ (face 66:10 p (noun 66:12)))
166− (face 66:25 q (tvar 66:27 B))
156+ (cell 67:3
167− (face 66:29 r (tvar 66:31 C)))))
157+ (const 67:4 %many)
168− (mold 68:1 qual
158+ (face 67:10 p
169− (generic 68:9 A B C D
159+ (apply 67:12 list (ref 67:18 coin))))))
170− (cell 68:22
160+ (mold 69:1 pair
171− (face 68:23 p (tvar 68:25 A))
161+ (generic 69:9 A B
172− (face 68:27 q (tvar 68:29 B))
162+ (cell 69:18
173− (face 68:31 r (tvar 68:33 C))
163+ (face 69:19 p (tvar 69:21 A))
174− (face 68:35 s (tvar 68:37 D)))))
164+ (face 69:23 q (tvar 69:25 B)))))
175− (mold 70:1 cord (aura 70:9 @t))
165+ (mold 71:1 trel
176− (mold 72:1 knot (aura 72:9 @ta))
166+ (generic 71:9 A B C
177− (mold 74:1 tape
167+ (cell 71:20
178− (apply 74:9 list (aura 74:15 @tD)))
168+ (face 71:21 p (tvar 71:23 A))
179− (mold 76:1 path
169+ (face 71:25 q (tvar 71:27 B))
180− (apply 76:9 list (ref 76:15 knot)))
170+ (face 71:29 r (tvar 71:31 C)))))
181− (mold 78:1 tank
171+ (mold 73:1 qual
182− (union 79:3
172+ (generic 73:9 A B C D
183− (ref 79:3 cord)
173+ (cell 73:22
184− (cell 80:3
174+ (face 73:23 p (tvar 73:25 A))
185− (const 80:4 %leaf)
175+ (face 73:27 q (tvar 73:29 B))
186− (face 80:10 p (ref 80:12 tape)))
176+ (face 73:31 r (tvar 73:33 C))
187− (cell 81:3
177+ (face 73:35 s (tvar 73:37 D)))))
188− (const 81:4 %palm)
178+ (mold 75:1 cord (aura 75:9 @t))
189− (face 81:10 p
179+ (mold 77:1 knot (aura 77:9 @ta))
190− (apply 81:12 qual (ref 81:18 tape) (ref 81:23 tape) (ref 81:28 tape) (ref 81:33 tape)))
180+ (mold 79:1 tape
191− (face 81:39 q
181+ (apply 79:9 list (aura 79:15 @tD)))
192− (apply 81:41 list (ref 81:47 tank))))
182+ (mold 81:1 path
193− (cell 82:3
183+ (apply 81:9 list (ref 81:15 knot)))
194− (const 82:4 %rose)
184+ (mold 83:1 tank
195− (face 82:10 p
185+ (union 84:3
196− (apply 82:12 trel (ref 82:18 tape) (ref 82:23 tape) (ref 82:28 tape)))
186+ (ref 84:3 cord)
197− (face 82:34 q
187+ (cell 85:3
198− (apply 82:36 list (ref 82:42 tank))))))
188+ (const 85:4 %leaf)
199− (mold 84:1 nail
189+ (face 85:10 p (ref 85:12 tape)))
200− (cell 84:9
190+ (cell 86:3
201− (face 84:10 p (ref 84:12 hair))
191+ (const 86:4 %palm)
202− (face 84:17 q (ref 84:19 tape))))
192+ (face 86:10 p
203− (mold 86:1 edge
193+ (apply 86:12 qual (ref 86:18 tape) (ref 86:23 tape) (ref 86:28 tape) (ref 86:33 tape)))
204− (cell 86:9
194+ (face 86:39 q
205− (face 86:10 p (ref 86:12 hair))
195+ (apply 86:41 list (ref 86:47 tank))))
206− (face 86:17 q
196+ (cell 87:3
207− (apply 86:19 unit
197+ (const 87:4 %rose)
208− (cell 86:25
198+ (face 87:10 p
209− (face 86:26 p (noun 86:28))
199+ (apply 87:12 trel (ref 87:18 tape) (ref 87:23 tape) (ref 87:28 tape)))
210− (face 86:30 q (ref 86:32 nail)))))))
200+ (face 87:34 q
211− (mold 88:1 rule
201+ (apply 87:36 list (ref 87:42 tank))))))
212− (fn 88:9 (ref 88:12 nail) (ref 88:17 edge)))
202+ (mold 89:1 nail
213− (mold 90:1 spot
203+ (cell 89:9
214− (cell 90:9
204+ (face 89:10 p (ref 89:12 hair))
215− (face 90:10 p (ref 90:12 path))
205+ (face 89:17 q (ref 89:19 tape))))
216− (face 90:17 q (ref 90:19 pint))))
206+ (mold 91:1 edge
217− (mold 92:1 toon
207+ (cell 91:9
218− (union 93:3
208+ (face 91:10 p (ref 91:12 hair))
219− (cell 93:3
209+ (face 91:17 q
220− (const 93:4 %0)
210+ (apply 91:19 unit
221− (face 93:7 p (noun 93:9)))
211+ (cell 91:25
222− (cell 94:3
212+ (face 91:26 p (noun 91:28))
223− (const 94:4 %1)
213+ (face 91:30 q (ref 91:32 nail)))))))
224− (face 94:7 p (noun 94:9)))
214+ (mold 93:1 rule
225− (cell 95:3
215+ (fn 93:9 (ref 93:12 nail) (ref 93:17 edge)))
226− (const 95:4 %2)
216+ (mold 95:1 spot
227− (face 95:7 p
217+ (cell 95:9
228− (apply 95:9 list (ref 95:15 tank))))))
218+ (face 95:10 p (ref 95:12 path))
229− (mold 97:1 like
219+ (face 95:17 q (ref 95:19 pint))))
230− (generic 97:9 A
220+ (mold 97:1 toon
231− (cell 97:16
221+ (union 98:3
232− (face 97:17 p (ref 97:19 hair))
222+ (cell 98:3
233− (face 97:24 q
223+ (const 98:4 %0)
234− (apply 97:26 unit
224+ (face 98:7 p (noun 98:9)))
235− (cell 97:32
225+ (cell 99:3
236− (face 97:33 p (tvar 97:35 A))
226+ (const 99:4 %1)
237− (face 97:37 q (ref 97:39 nail))))))))
227+ (face 99:7 p (noun 99:9)))
238− (value 99:1 wonk
228+ (cell 100:3
239− (gate 99:9
229+ (const 100:4 %2)
240− (face 99:12 veq
230+ (face 100:7 p
241− (apply 99:16 like (tvar 99:22 A)))
231+ (apply 100:9 list (ref 100:15 tank))))))
242− (body 100:3
232+ (mold 102:1 like
243− (branch 100:3
233+ (generic 102:9 A
244− (wing 100:6 q.veq)
234+ (cell 102:16
245− (arm 101:5 (lit 101:5 ~) (crash 101:7))
235+ (face 102:17 p (ref 102:19 hair))
246− (arm 102:5
236+ (face 102:24 q
247− (cell 102:5 (lit 102:6 ~) (bind 102:8 product))
237+ (apply 102:26 unit
248− (wing 102:17 p.product))))))
238+ (cell 102:32
249− (mold 104:1 lone
239+ (face 102:33 p (tvar 102:35 A))
250− (generic 104:9 A
240+ (face 102:37 q (ref 102:39 nail))))))))
251− (cell 104:16
241+ (value 104:1 like
252− (face 104:17 p (tvar 104:19 A)))))
242+ (gate 104:9
253− (mold 106:1 lest
243+ (cell 104:12
254− (generic 106:9 A
244+ (face 104:13 f
255− (cell 106:16
245+ (fn 104:15 (tvar 104:18 A) (tvar 104:20 B)))
256− (face 106:17 i (tvar 106:19 A))
246+ (face 104:23 result
257− (face 106:21 t
247+ (apply 104:30 like (tvar 104:36 A))))
258− (apply 106:23 list (tvar 106:29 A))))))
248+ (body 105:3
259− (mold 108:1 pole
249+ (value 105:3 mapped
260− (generic 108:9 A
250+ (body 106:5
261− (union 109:3
251+ (cast 106:5
262− (const 109:3 ~)
252+ (apply 106:8 unit
263− (cell 110:3
253+ (cell 106:14
264− (tvar 110:4 A)
254+ (face 106:15 p (tvar 106:17 B))
265− (apply 110:6 pole (tvar 110:12 A))))))
255+ (face 106:19 q (ref 106:21 nail))))
266− (mold 112:1 quip
256+ (body 107:7
267− (generic 112:9 A B
257+ (branch 107:7
268− (cell 112:18
258+ (wing 107:10 q.result)
269− (apply 112:19 list (tvar 112:25 A))
259+ (arm 108:9 (lit 108:9 ~) (lit 108:11 ~))
270− (tvar 112:28 B))))
260+ (arm 109:9
271− (mold 114:1 tree
261+ (cell 109:9 (lit 109:10 ~) (bind 109:12 value))
272− (generic 114:9 A
262+ (unit 109:19
273− (union 115:3
263+ (tuple 109:20
274− (const 115:3 ~)
264+ (face 109:21 p
275− (cell 116:3
265+ (group 109:23
276− (face 116:4 n (tvar 116:6 A))
266+ (call 109:24 (wing 109:24 f) (wing 109:26 p.value))))
277− (face 116:8 l
267+ (face 109:35 q (wing 109:37 q.value))))))))))
278− (apply 116:10 tree (tvar 116:16 A)))
268+ (cast 110:3
279− (face 116:19 r
269+ (apply 110:6 like (tvar 110:12 B))
280− (apply 116:21 tree (tvar 116:27 A)))))))
270+ (tuple 110:15
281− (mold 118:1 each
271+ (face 110:16 p (wing 110:18 p.result))
282− (generic 118:9 A B
272+ (face 110:27 q (wing 110:29 mapped)))))))
283− (union 119:3
273+ (value 112:1 wonk
284− (cell 119:3
274+ (gate 112:9
285− (const 119:4 %|)
275+ (face 112:12 veq
286− (face 119:7 p (tvar 119:9 B)))
276+ (apply 112:16 like (tvar 112:22 A)))
287− (cell 120:3
277+ (body 113:3
288− (const 120:4 %&)
278+ (branch 113:3
289− (face 120:7 p (tvar 120:9 A))))))
279+ (wing 113:6 q.veq)
290− (mold 122:1 bloq (aura 122:9 @))
280+ (arm 114:5 (lit 114:5 ~) (crash 114:7))
291− (value 124:1 some
281+ (arm 115:5
292− (gate 124:9
282+ (cell 115:5 (lit 115:6 ~) (bind 115:8 product))
293− (face 124:12 item (tvar 124:17 A))
283+ (wing 115:17 p.product))))))
294− (unit 124:19 (wing 124:20 item))))
284+ (mold 117:1 lone
295− (value 126:1 lure
285+ (generic 117:9 A
296− (gate 126:9
286+ (cell 117:16
297− (face 126:12 item (tvar 126:17 A))
287+ (face 117:17 p (tvar 117:19 A)))))
298− (body 127:3
288+ (mold 119:1 lest
299− (cast 127:3
289+ (generic 119:9 A
300− (apply 127:6 list (tvar 127:12 A))
290+ (cell 119:16
301− (tuple 127:15 (wing 127:16 item) (lit 127:21 ~))))))
291+ (face 119:17 i (tvar 119:19 A))
302− (value 129:1 snoc
292+ (face 119:21 t
303− (gate 129:9
293+ (apply 119:23 list (tvar 119:29 A))))))
304− (face 129:12 args
294+ (mold 121:1 pole
305− (cell 129:17
295+ (generic 121:9 A
306− (apply 129:18 list (tvar 129:24 A))
296+ (union 122:3
307− (tvar 129:27 A)))
297+ (const 122:3 ~)
308− (body 130:3
298+ (cell 123:3
309− (branch 130:3
299+ (tvar 123:4 A)
310− (wing 130:6 args)
300+ (apply 123:6 pole (tvar 123:12 A))))))
311− (arm 131:5
301+ (mold 125:1 quip
312− (cell 131:5 (bind 131:6 xs) (bind 131:9 item))
302+ (generic 125:9 A B
313− (group 131:15
303+ (cell 125:18
314− (call 131:16
304+ (apply 125:19 list (tvar 125:25 A))
315− (wing 131:16 weld)
305+ (tvar 125:28 B))))
316− (wing 131:21 xs)
306+ (mold 127:1 tree
317− (tuple 131:24 (wing 131:25 item) (lit 131:30 ~)))))))))
307+ (generic 127:9 A
318− (value 133:1 flop
308+ (union 128:3
319− (gate 133:9
309+ (const 128:3 ~)
320− (face 133:12 xs
310+ (cell 129:3
321− (apply 133:15 list (tvar 133:21 A)))
311+ (face 129:4 n (tvar 129:6 A))
322− (body 134:3
312+ (face 129:8 l
323− (value 134:3 reverse-into
313+ (apply 129:10 tree (tvar 129:16 A)))
324− (gate 134:19
314+ (face 129:19 r
325− (face 134:22 args
315+ (apply 129:21 tree (tvar 129:27 A)))))))
326− (cell 134:27
316+ (mold 131:1 each
327− (apply 134:28 list (tvar 134:34 A))
317+ (generic 131:9 A B
328− (apply 134:37 list (tvar 134:43 A))))
318+ (union 132:3
329− (body 135:5
319+ (cell 132:3
330− (branch 135:5
320+ (const 132:4 %|)
331− (wing 135:8 args)
321+ (face 132:7 p (tvar 132:9 B)))
332− (arm 136:7
322+ (cell 133:3
333− (cell 136:7 (bind 136:8 rest) (bind 136:13 acc))
323+ (const 133:4 %&)
334− (body 137:9
324+ (face 133:7 p (tvar 133:9 A))))))
335− (branch 137:9
325+ (mold 135:1 bloq (aura 135:9 @))
336− (wing 137:12 rest)
326+ (value 137:1 some
337− (arm 138:11 (lit 138:11 ~) (wing 138:13 acc))
327+ (gate 137:9
338− (arm 139:11
328+ (face 137:12 item (tvar 137:17 A))
339− (cell 139:11 (bind 139:12 item) (bind 139:17 more))
329+ (unit 137:19 (wing 137:20 item))))
340− (group 139:23
330+ (value 139:1 lure
341− (call 139:24
331+ (gate 139:9
342− (wing 139:24 reverse-into)
332+ (face 139:12 item (tvar 139:17 A))
343− (wing 139:37 more)
333+ (body 140:3
344− (tuple 139:42 (wing 139:43 item) (wing 139:48 acc))))))))))))
334+ (cast 140:3
345− (group 140:3
335+ (apply 140:6 list (tvar 140:12 A))
346− (call 140:4 (wing 140:4 reverse-into) (wing 140:17 xs) (lit 140:20 ~))))))
336+ (tuple 140:15 (wing 140:16 item) (lit 140:21 ~))))))
347− (value 142:1 drop
337+ (value 142:1 snoc
348 (gate 142:9
338 (gate 142:9
349− (face 142:12 maybe
339+ (face 142:12 args
350− (apply 142:18 unit (tvar 142:24 A)))
340+ (cell 142:17
341+ (apply 142:18 list (tvar 142:24 A))
342+ (tvar 142:27 A)))
351 (body 143:3
343 (body 143:3
352 (branch 143:3
344 (branch 143:3
353− (wing 143:6 maybe)
345+ (wing 143:6 args)
354− (arm 144:5 (lit 144:5 ~) (lit 144:7 ~))
346+ (arm 144:5
355− (arm 145:5
347+ (cell 144:5 (bind 144:6 xs) (bind 144:9 item))
356− (cell 145:5 (lit 145:6 ~) (bind 145:8 value))
348+ (group 144:15
357− (tuple 145:15 (wing 145:16 value) (lit 145:22 ~)))))))
349+ (call 144:16
358− (value 147:1 bind
350+ (wing 144:16 weld)
359− (gate 147:9
351+ (wing 144:21 xs)
360− (face 147:12 args
352+ (tuple 144:24 (wing 144:25 item) (lit 144:30 ~)))))))))
361− (cell 147:17
353+ (value 146:1 flop
362− (apply 147:18 unit (tvar 147:24 A))
354+ (gate 146:9
363− (fn 147:27 (tvar 147:30 A) (tvar 147:32 B))))
355+ (face 146:12 xs
364− (body 148:3
356+ (apply 146:15 list (tvar 146:21 A)))
365− (branch 148:3
357+ (body 147:3
366− (wing 148:6 args)
358+ (value 147:3 reverse-into
367− (arm 149:5
359+ (gate 147:19
368− (cell 149:5 (bind 149:6 maybe) (bind 149:12 f))
360+ (face 147:22 args
369− (body 150:7
361+ (cell 147:27
370− (branch 150:7
362+ (apply 147:28 list (tvar 147:34 A))
371− (wing 150:10 maybe)
363+ (apply 147:37 list (tvar 147:43 A))))
372− (arm 151:9 (lit 151:9 ~) (lit 151:11 ~))
364+ (body 148:5
373− (arm 152:9
365+ (branch 148:5
374− (cell 152:9 (lit 152:10 ~) (bind 152:12 value))
366+ (wing 148:8 args)
375− (unit 152:19
367+ (arm 149:7
376− (group 152:20
368+ (cell 149:7 (bind 149:8 rest) (bind 149:13 acc))
377− (call 152:21 (wing 152:21 f) (wing 152:23 value))))))))))))
369+ (body 150:9
378− (value 154:1 biff
370+ (branch 150:9
379− (gate 154:9
371+ (wing 150:12 rest)
380− (face 154:12 args
372+ (arm 151:11 (lit 151:11 ~) (wing 151:13 acc))
381− (cell 154:17
373+ (arm 152:11
382− (apply 154:18 unit (tvar 154:24 A))
374+ (cell 152:11 (bind 152:12 item) (bind 152:17 more))
383− (fn 154:27
375+ (group 152:23
384− (tvar 154:30 A)
376+ (call 152:24
385− (apply 154:32 unit (tvar 154:38 B)))))
377+ (wing 152:24 reverse-into)
386− (body 155:3
378+ (wing 152:37 more)
387− (branch 155:3
379+ (tuple 152:42 (wing 152:43 item) (wing 152:48 acc))))))))))))
388− (wing 155:6 args)
380+ (group 153:3
389− (arm 156:5
381+ (call 153:4 (wing 153:4 reverse-into) (wing 153:17 xs) (lit 153:20 ~))))))
390− (cell 156:5 (bind 156:6 maybe) (bind 156:12 f))
382+ (value 155:1 drop
391− (body 157:7
383+ (gate 155:9
392− (branch 157:7
384+ (face 155:12 maybe
393− (wing 157:10 maybe)
385+ (apply 155:18 unit (tvar 155:24 A)))
394− (arm 158:9 (lit 158:9 ~) (lit 158:11 ~))
386+ (body 156:3
395− (arm 159:9
387+ (cast 156:3
396− (cell 159:9 (lit 159:10 ~) (bind 159:12 value))
388+ (apply 156:6 list (tvar 156:12 A))
397− (group 159:19
389+ (body 157:5
398− (call 159:20 (wing 159:20 f) (wing 159:22 value)))))))))))
390+ (branch 157:5
399− (value 161:1 both
391+ (wing 157:8 maybe)
392+ (arm 158:7 (lit 158:7 ~) (lit 158:9 ~))
393+ (arm 159:7
394+ (cell 159:7 (lit 159:8 ~) (bind 159:10 value))
395+ (tuple 159:17 (wing 159:18 value) (lit 159:24 ~)))))))))
396+ (value 161:1 bond
400 (gate 161:9
397 (gate 161:9
401− (face 161:12 args
398+ (face 161:12 fallback
402− (cell 161:17
399+ (fn 161:21 (const 161:24 ~) (tvar 161:26 A)))
403− (apply 161:18 unit (tvar 161:24 A))
404− (apply 161:27 unit (tvar 161:33 B))))
405 (body 162:3
400 (body 162:3
406− (branch 162:3
401+ (gate 162:3
407− (wing 162:6 args)
402+ (face 162:6 maybe
408− (arm 163:5
403+ (apply 162:12 unit (tvar 162:18 A)))
409− (cell 163:5 (bind 163:6 first) (bind 163:12 second))
404+ (body 163:5
410− (body 164:7
405+ (branch 163:5
411− (branch 164:7
406+ (wing 163:8 maybe)
412− (wing 164:10 first)
407+ (arm 164:7
413− (arm 165:9 (lit 165:9 ~) (lit 165:11 ~))
408+ (lit 164:7 ~)
414− (arm 166:9
409+ (group 164:9
415− (cell 166:9 (lit 166:10 ~) (bind 166:12 a))
410+ (call 164:10 (wing 164:10 fallback) (lit 164:19 ~))))
416− (body 167:11
411+ (arm 165:7
417− (branch 167:11
412+ (cell 165:7 (lit 165:8 ~) (bind 165:10 value))
418− (wing 167:14 second)
413+ (wing 165:17 value))))))))
419− (arm 168:13 (lit 168:13 ~) (lit 168:15 ~))
414+ (value 167:1 bind
420− (arm 169:13
415+ (gate 167:9
421− (cell 169:13 (lit 169:14 ~) (bind 169:16 b))
416+ (face 167:12 args
422− (unit 169:19
417+ (cell 167:17
423− (tuple 169:20 (wing 169:21 a) (wing 169:23 b))))))))))))))
418+ (apply 167:18 unit (tvar 167:24 A))
424− (value 171:1 clap
419+ (fn 167:27 (tvar 167:30 A) (tvar 167:32 B))))
425− (gate 171:9
420+ (body 168:3
426− (face 171:12 args
421+ (branch 168:3
427− (cell 171:17
422+ (wing 168:6 args)
428− (apply 171:18 unit (tvar 171:24 A))
423+ (arm 169:5
429− (apply 171:27 unit (tvar 171:33 A))
424+ (cell 169:5 (bind 169:6 maybe) (bind 169:12 f))
430− (fn 171:36
425+ (cast 169:15
431− (cell 171:39 (tvar 171:40 A) (tvar 171:42 A))
426+ (apply 169:18 unit (tvar 169:24 B))
432− (tvar 171:45 A))))
427+ (body 170:7
433− (body 172:3
428+ (branch 170:7
434− (branch 172:3
429+ (wing 170:10 maybe)
435− (wing 172:6 args)
430+ (arm 171:9 (lit 171:9 ~) (lit 171:11 ~))
436− (arm 173:5
431+ (arm 172:9
437− (cell 173:5 (bind 173:6 first) (bind 173:12 second) (bind 173:19 combine))
432+ (cell 172:9 (lit 172:10 ~) (bind 172:12 value))
438− (body 174:7
433+ (unit 172:19
439− (branch 174:7
434+ (group 172:20
440− (wing 174:10 first)
435+ (call 172:21 (wing 172:21 f) (wing 172:23 value)))))))))))))
441− (arm 175:9 (lit 175:9 ~) (wing 175:11 second))
436+ (value 174:1 biff
442− (arm 176:9
437+ (gate 174:9
443− (cell 176:9 (lit 176:10 ~) (bind 176:12 a))
438+ (face 174:12 args
444− (body 177:11
439+ (cell 174:17
445− (branch 177:11
440+ (apply 174:18 unit (tvar 174:24 A))
446− (wing 177:14 second)
441+ (fn 174:27
447− (arm 178:13 (lit 178:13 ~) (wing 178:15 first))
442+ (tvar 174:30 A)
448− (arm 179:13
443+ (apply 174:32 unit (tvar 174:38 B)))))
449− (cell 179:13 (lit 179:14 ~) (bind 179:16 b))
444+ (body 175:3
450− (unit 179:19
445+ (branch 175:3
451− (group 179:20
446+ (wing 175:6 args)
452− (call 179:21 (wing 179:21 combine) (wing 179:29 a) (wing 179:31 b)))))))))))))))
447+ (arm 176:5
453− (value 181:1 clef
448+ (cell 176:5 (bind 176:6 maybe) (bind 176:12 f))
449+ (cast 176:15
450+ (apply 176:18 unit (tvar 176:24 B))
451+ (body 177:7
452+ (branch 177:7
453+ (wing 177:10 maybe)
454+ (arm 178:9 (lit 178:9 ~) (lit 178:11 ~))
455+ (arm 179:9
456+ (cell 179:9 (lit 179:10 ~) (bind 179:12 value))
457+ (group 179:19
458+ (call 179:20 (wing 179:20 f) (wing 179:22 value))))))))))))
459+ (value 181:1 both
454 (gate 181:9
460 (gate 181:9
455 (face 181:12 args
461 (face 181:12 args
456 (cell 181:17
462 (cell 181:17
457 (apply 181:18 unit (tvar 181:24 A))
463 (apply 181:18 unit (tvar 181:24 A))
458− (apply 181:27 unit (tvar 181:33 B))
464+ (apply 181:27 unit (tvar 181:33 B))))
459− (fn 181:36
460− (cell 181:39 (tvar 181:40 A) (tvar 181:42 B))
461− (apply 181:45 unit (tvar 181:51 C)))))
462 (body 182:3
465 (body 182:3
463 (branch 182:3
466 (branch 182:3
464 (wing 182:6 args)
467 (wing 182:6 args)
465 (arm 183:5
468 (arm 183:5
466− (cell 183:5 (bind 183:6 first) (bind 183:12 second) (bind 183:19 combine))
469+ (cell 183:5 (bind 183:6 first) (bind 183:12 second))
467− (body 184:7
470+ (cast 183:20
468− (branch 184:7
471+ (apply 183:23 unit
469− (wing 184:10 first)
472+ (cell 183:29 (tvar 183:30 A) (tvar 183:32 B)))
470− (arm 185:9 (lit 185:9 ~) (lit 185:11 ~))
473+ (body 184:7
471− (arm 186:9
474+ (branch 184:7
472− (cell 186:9 (lit 186:10 ~) (bind 186:12 a))
475+ (wing 184:10 first)
473− (body 187:11
476+ (arm 185:9 (lit 185:9 ~) (lit 185:11 ~))
474− (branch 187:11
477+ (arm 186:9
475− (wing 187:14 second)
478+ (cell 186:9 (lit 186:10 ~) (bind 186:12 a))
476− (arm 188:13 (lit 188:13 ~) (lit 188:15 ~))
479+ (body 187:11
477− (arm 189:13
480+ (branch 187:11
478− (cell 189:13 (lit 189:14 ~) (bind 189:16 b))
481+ (wing 187:14 second)
479− (group 189:19
482+ (arm 188:13 (lit 188:13 ~) (lit 188:15 ~))
480− (call 189:20 (wing 189:20 combine) (wing 189:28 a) (wing 189:30 b))))))))))))))
483+ (arm 189:13
481− (value 191:1 skim
484+ (cell 189:13 (lit 189:14 ~) (bind 189:16 b))
485+ (unit 189:19
486+ (tuple 189:20 (wing 189:21 a) (wing 189:23 b)))))))))))))))
487+ (value 191:1 clap
482 (gate 191:9
488 (gate 191:9
483 (face 191:12 args
489 (face 191:12 args
484 (cell 191:17
490 (cell 191:17
485− (apply 191:18 list (tvar 191:24 A))
491+ (apply 191:18 unit (tvar 191:24 A))
486− (fn 191:27 (tvar 191:30 A) (flag 191:32))))
492+ (apply 191:27 unit (tvar 191:33 A))
493+ (fn 191:36
494+ (cell 191:39 (tvar 191:40 A) (tvar 191:42 A))
495+ (tvar 191:45 A))))
487 (body 192:3
496 (body 192:3
488 (branch 192:3
497 (branch 192:3
489 (wing 192:6 args)
498 (wing 192:6 args)
490 (arm 193:5
499 (arm 193:5
491− (cell 193:5 (bind 193:6 xs) (bind 193:9 predicate))
500+ (cell 193:5 (bind 193:6 first) (bind 193:12 second) (bind 193:19 combine))
492− (body 194:7
501+ (cast 193:28
493− (branch 194:7
502+ (apply 193:31 unit (tvar 193:37 A))
494− (wing 194:10 xs)
503+ (body 194:7
495− (arm 195:9 (lit 195:9 ~) (lit 195:11 ~))
504+ (branch 194:7
496− (arm 196:9
505+ (wing 194:10 first)
497− (cell 196:9 (bind 196:10 item) (bind 196:15 rest))
506+ (arm 195:9 (lit 195:9 ~) (wing 195:11 second))
498− (body 197:11
507+ (arm 196:9
499− (branch 197:11
508+ (cell 196:9 (lit 196:10 ~) (bind 196:12 a))
500− (group 197:14
509+ (body 197:11
501− (call 197:15 (wing 197:15 predicate) (wing 197:25 item)))
510+ (branch 197:11
502− (arm 198:13
511+ (wing 197:14 second)
503− (lit 198:13 %.y)
512+ (arm 198:13 (lit 198:13 ~) (wing 198:15 first))
504− (tuple 198:17
513+ (arm 199:13
505− (wing 198:18 item)
514+ (cell 199:13 (lit 199:14 ~) (bind 199:16 b))
506− (group 198:23
515+ (unit 199:19
507− (call 198:24 (wing 198:24 skim) (wing 198:29 rest) (wing 198:34 predicate)))))
516+ (group 199:20
508− (arm 199:13
517+ (call 199:21 (wing 199:21 combine) (wing 199:29 a) (wing 199:31 b))))))))))))))))
509− (lit 199:13 %.n)
518+ (value 201:1 clef
510− (group 199:17
511− (call 199:18 (wing 199:18 skim) (wing 199:23 rest) (wing 199:28 predicate))))))))))))))
512− (value 201:1 skip
513 (gate 201:9
519 (gate 201:9
514 (face 201:12 args
520 (face 201:12 args
515 (cell 201:17
521 (cell 201:17
516− (apply 201:18 list (tvar 201:24 A))
522+ (apply 201:18 unit (tvar 201:24 A))
517− (fn 201:27 (tvar 201:30 A) (flag 201:32))))
523+ (apply 201:27 unit (tvar 201:33 B))
524+ (fn 201:36
525+ (cell 201:39 (tvar 201:40 A) (tvar 201:42 B))
526+ (apply 201:45 unit (tvar 201:51 C)))))
518 (body 202:3
527 (body 202:3
519 (branch 202:3
528 (branch 202:3
520 (wing 202:6 args)
529 (wing 202:6 args)
521 (arm 203:5
530 (arm 203:5
522− (cell 203:5 (bind 203:6 xs) (bind 203:9 predicate))
531+ (cell 203:5 (bind 203:6 first) (bind 203:12 second) (bind 203:19 combine))
523− (body 204:7
532+ (cast 203:28
524− (branch 204:7
533+ (apply 203:31 unit (tvar 203:37 C))
525− (wing 204:10 xs)
534+ (body 204:7
526− (arm 205:9 (lit 205:9 ~) (lit 205:11 ~))
535+ (branch 204:7
527− (arm 206:9
536+ (wing 204:10 first)
528− (cell 206:9 (bind 206:10 item) (bind 206:15 rest))
537+ (arm 205:9 (lit 205:9 ~) (lit 205:11 ~))
529− (body 207:11
538+ (arm 206:9
530− (branch 207:11
539+ (cell 206:9 (lit 206:10 ~) (bind 206:12 a))
531− (group 207:14
540+ (body 207:11
532− (call 207:15 (wing 207:15 predicate) (wing 207:25 item)))
541+ (branch 207:11
533− (arm 208:13
542+ (wing 207:14 second)
534− (lit 208:13 %.y)
543+ (arm 208:13 (lit 208:13 ~) (lit 208:15 ~))
535− (group 208:17
544+ (arm 209:13
536− (call 208:18 (wing 208:18 skip) (wing 208:23 rest) (wing 208:28 predicate))))
545+ (cell 209:13 (lit 209:14 ~) (bind 209:16 b))
537− (arm 209:13
546+ (group 209:19
538− (lit 209:13 %.n)
547+ (call 209:20 (wing 209:20 combine) (wing 209:28 a) (wing 209:30 b)))))))))))))))
539− (tuple 209:17
548+ (value 211:1 skim
540− (wing 209:18 item)
541− (group 209:23
542− (call 209:24 (wing 209:24 skip) (wing 209:29 rest) (wing 209:34 predicate)))))))))))))))
543− (value 211:1 levy
544 (gate 211:9
549 (gate 211:9
545 (face 211:12 args
550 (face 211:12 args
546 (cell 211:17
551 (cell 211:17
@@ -551,22 +556,29 @@
551 (wing 212:6 args)
556 (wing 212:6 args)
552 (arm 213:5
557 (arm 213:5
553 (cell 213:5 (bind 213:6 xs) (bind 213:9 predicate))
558 (cell 213:5 (bind 213:6 xs) (bind 213:9 predicate))
554− (body 214:7
559+ (cast 213:20
555− (branch 214:7
560+ (apply 213:23 list (tvar 213:29 A))
556− (wing 214:10 xs)
561+ (body 214:9
557− (arm 215:9 (lit 215:9 ~) (lit 215:11 %.y))
562+ (branch 214:9
558− (arm 216:9
563+ (wing 214:12 xs)
559− (cell 216:9 (bind 216:10 item) (bind 216:15 rest))
564+ (arm 215:11 (lit 215:11 ~) (lit 215:13 ~))
560− (body 217:11
565+ (arm 216:11
561− (branch 217:11
566+ (cell 216:11 (bind 216:12 item) (bind 216:17 rest))
562− (group 217:14
567+ (body 217:13
563− (call 217:15 (wing 217:15 predicate) (wing 217:25 item)))
568+ (branch 217:13
564− (arm 218:13
569+ (group 217:16
565− (lit 218:13 %.y)
570+ (call 217:17 (wing 217:17 predicate) (wing 217:27 item)))
566− (group 218:17
571+ (arm 218:15
567− (call 218:18 (wing 218:18 levy) (wing 218:23 rest) (wing 218:28 predicate))))
572+ (lit 218:15 %.y)
568− (arm 219:13 (lit 219:13 %.n) (lit 219:17 %.n))))))))))))
573+ (tuple 218:19
569− (value 221:1 lien
574+ (wing 218:20 item)
575+ (group 218:25
576+ (call 218:26 (wing 218:26 skim) (wing 218:31 rest) (wing 218:36 predicate)))))
577+ (arm 219:15
578+ (lit 219:15 %.n)
579+ (group 219:19
580+ (call 219:20 (wing 219:20 skim) (wing 219:25 rest) (wing 219:30 predicate)))))))))))))))
581+ (value 221:1 skip
570 (gate 221:9
582 (gate 221:9
571 (face 221:12 args
583 (face 221:12 args
572 (cell 221:17
584 (cell 221:17
@@ -577,188 +589,384 @@
577 (wing 222:6 args)
589 (wing 222:6 args)
578 (arm 223:5
590 (arm 223:5
579 (cell 223:5 (bind 223:6 xs) (bind 223:9 predicate))
591 (cell 223:5 (bind 223:6 xs) (bind 223:9 predicate))
580− (body 224:7
592+ (cast 223:20
581− (branch 224:7
593+ (apply 223:23 list (tvar 223:29 A))
582− (wing 224:10 xs)
594+ (body 224:9
583− (arm 225:9 (lit 225:9 ~) (lit 225:11 %.n))
595+ (branch 224:9
584− (arm 226:9
596+ (wing 224:12 xs)
585− (cell 226:9 (bind 226:10 item) (bind 226:15 rest))
597+ (arm 225:11 (lit 225:11 ~) (lit 225:13 ~))
586− (body 227:11
598+ (arm 226:11
587− (branch 227:11
599+ (cell 226:11 (bind 226:12 item) (bind 226:17 rest))
588− (group 227:14
600+ (body 227:13
589− (call 227:15 (wing 227:15 predicate) (wing 227:25 item)))
601+ (branch 227:13
590− (arm 228:13 (lit 228:13 %.y) (lit 228:17 %.y))
602+ (group 227:16
591− (arm 229:13
603+ (call 227:17 (wing 227:17 predicate) (wing 227:27 item)))
592− (lit 229:13 %.n)
604+ (arm 228:15
593− (group 229:17
605+ (lit 228:15 %.y)
594− (call 229:18 (wing 229:18 lien) (wing 229:23 rest) (wing 229:28 predicate))))))))))))))
606+ (group 228:19
595− (value 231:1 roll
607+ (call 228:20 (wing 228:20 skip) (wing 228:25 rest) (wing 228:30 predicate))))
608+ (arm 229:15
609+ (lit 229:15 %.n)
610+ (tuple 229:19
611+ (wing 229:20 item)
612+ (group 229:25
613+ (call 229:26 (wing 229:26 skip) (wing 229:31 rest) (wing 229:36 predicate))))))))))))))))
614+ (value 231:1 levy
596 (gate 231:9
615 (gate 231:9
597 (face 231:12 args
616 (face 231:12 args
598 (cell 231:17
617 (cell 231:17
599 (apply 231:18 list (tvar 231:24 A))
618 (apply 231:18 list (tvar 231:24 A))
600− (tvar 231:27 B)
619+ (fn 231:27 (tvar 231:30 A) (flag 231:32))))
601− (fn 231:29
602− (cell 231:32 (tvar 231:33 A) (tvar 231:35 B))
603− (tvar 231:38 B))))
604 (body 232:3
620 (body 232:3
605− (branch 232:3
621+ (cast 232:3
606− (wing 232:6 args)
622+ (flag 232:6)
607− (arm 233:5
623+ (body 233:5
608− (cell 233:5 (bind 233:6 xs) (bind 233:9 start) (bind 233:15 combine))
624+ (branch 233:5
609− (body 234:7
625+ (wing 233:8 args)
610− (branch 234:7
626+ (arm 234:7
611− (wing 234:10 xs)
627+ (cell 234:7 (bind 234:8 xs) (bind 234:11 predicate))
612− (arm 235:9 (lit 235:9 ~) (wing 235:11 start))
628+ (body 235:9
613− (arm 236:9
629+ (branch 235:9
614− (cell 236:9 (bind 236:10 item) (bind 236:15 rest))
630+ (wing 235:12 xs)
615− (group 236:21
631+ (arm 236:11 (lit 236:11 ~) (lit 236:13 %.y))
616− (call 236:22
632+ (arm 237:11
617− (wing 236:22 roll)
633+ (cell 237:11 (bind 237:12 item) (bind 237:17 rest))
618− (wing 236:27 rest)
634+ (body 238:13
619− (group 236:32
635+ (branch 238:13
620− (call 236:33 (wing 236:33 combine) (wing 236:41 item) (wing 236:46 start)))
636+ (group 238:16
621− (wing 236:53 combine)))))))))))
637+ (call 238:17 (wing 238:17 predicate) (wing 238:27 item)))
622− (value 238:1 reel
638+ (arm 239:15
623− (gate 238:9
639+ (lit 239:15 %.y)
624− (face 238:12 args
640+ (group 239:19
625− (cell 238:17
641+ (call 239:20 (wing 239:20 levy) (wing 239:25 rest) (wing 239:30 predicate))))
626− (apply 238:18 list (tvar 238:24 A))
642+ (arm 240:15 (lit 240:15 %.n) (lit 240:19 %.n))))))))))))))
627− (tvar 238:27 B)
643+ (value 242:1 lien
628− (fn 238:29
644+ (gate 242:9
629− (cell 238:32 (tvar 238:33 A) (tvar 238:35 B))
645+ (face 242:12 args
630− (tvar 238:38 B))))
646+ (cell 242:17
631− (body 239:3
647+ (apply 242:18 list (tvar 242:24 A))
632− (branch 239:3
648+ (fn 242:27 (tvar 242:30 A) (flag 242:32))))
633− (wing 239:6 args)
649+ (body 243:3
634− (arm 240:5
650+ (cast 243:3
635− (cell 240:5 (bind 240:6 xs) (bind 240:9 start) (bind 240:15 combine))
651+ (flag 243:6)
636− (body 241:7
652+ (body 244:5
637− (branch 241:7
653+ (branch 244:5
638− (wing 241:10 xs)
654+ (wing 244:8 args)
639− (arm 242:9 (lit 242:9 ~) (wing 242:11 start))
655+ (arm 245:7
640− (arm 243:9
656+ (cell 245:7 (bind 245:8 xs) (bind 245:11 predicate))
641− (cell 243:9 (bind 243:10 item) (bind 243:15 rest))
657+ (body 246:9
642− (group 243:21
658+ (branch 246:9
643− (call 243:22
659+ (wing 246:12 xs)
644− (wing 243:22 combine)
660+ (arm 247:11 (lit 247:11 ~) (lit 247:13 %.n))
645− (wing 243:30 item)
661+ (arm 248:11
646− (group 243:35
662+ (cell 248:11 (bind 248:12 item) (bind 248:17 rest))
647− (call 243:36 (wing 243:36 reel) (wing 243:41 rest) (wing 243:46 start) (wing 243:52 combine)))))))))))))
663+ (body 249:13
648− (value 245:1 flit
664+ (branch 249:13
649− (gate 245:9
665+ (group 249:16
650− (face 245:12 predicate
666+ (call 249:17 (wing 249:17 predicate) (wing 249:27 item)))
651− (fn 245:22 (tvar 245:25 A) (flag 245:27)))
667+ (arm 250:15 (lit 250:15 %.y) (lit 250:19 %.y))
652− (body 246:3
668+ (arm 251:15
653− (gate 246:3
669+ (lit 251:15 %.n)
654− (face 246:6 value (tvar 246:12 A))
670+ (group 251:19
655− (body 247:5
671+ (call 251:20 (wing 251:20 lien) (wing 251:25 rest) (wing 251:30 predicate))))))))))))))))
656− (branch 247:5
672+ (value 253:1 roll
657− (group 247:8
673+ (gate 253:9
658− (call 247:9 (wing 247:9 predicate) (wing 247:19 value)))
674+ (face 253:12 args
659− (arm 248:7
675+ (cell 253:17
660− (lit 248:7 %.y)
676+ (apply 253:18 list (tvar 253:24 A))
661− (unit 248:11 (wing 248:12 value)))
677+ (tvar 253:27 B)
662− (arm 249:7 (lit 249:7 %.n) (lit 249:11 ~))))))))
678+ (fn 253:29
663− (value 251:1 murn
679+ (cell 253:32 (tvar 253:33 A) (tvar 253:35 B))
664− (gate 251:9
680+ (tvar 253:38 B))))
665− (face 251:12 args
681+ (body 254:3
666− (cell 251:17
682+ (branch 254:3
667− (apply 251:18 list (tvar 251:24 A))
683+ (wing 254:6 args)
668− (fn 251:27
684+ (arm 255:5
669− (tvar 251:30 A)
685+ (cell 255:5 (bind 255:6 xs) (bind 255:9 start) (bind 255:15 combine))
670− (apply 251:32 unit (tvar 251:38 B)))))
686+ (body 256:7
671− (body 252:3
687+ (branch 256:7
672− (branch 252:3
688+ (wing 256:10 xs)
673− (wing 252:6 args)
689+ (arm 257:9 (lit 257:9 ~) (wing 257:11 start))
674− (arm 253:5
690+ (arm 258:9
675− (cell 253:5 (bind 253:6 xs) (bind 253:9 f))
691+ (cell 258:9 (bind 258:10 item) (bind 258:15 rest))
676− (body 254:7
692+ (group 258:21
677− (branch 254:7
693+ (call 258:22
678− (wing 254:10 xs)
694+ (wing 258:22 roll)
679− (arm 255:9 (lit 255:9 ~) (lit 255:11 ~))
695+ (wing 258:27 rest)
680− (arm 256:9
696+ (group 258:32
681− (cell 256:9 (bind 256:10 item) (bind 256:15 rest))
697+ (call 258:33 (wing 258:33 combine) (wing 258:41 item) (wing 258:46 start)))
682− (body 257:11
698+ (wing 258:53 combine)))))))))))
683− (branch 257:11
699+ (value 260:1 reel
684− (group 257:14
700+ (gate 260:9
685− (call 257:15 (wing 257:15 f) (wing 257:17 item)))
701+ (face 260:12 args
686− (arm 258:13
702+ (cell 260:17
687− (lit 258:13 ~)
703+ (apply 260:18 list (tvar 260:24 A))
688− (group 258:15
704+ (tvar 260:27 B)
689− (call 258:16 (wing 258:16 murn) (wing 258:21 rest) (wing 258:26 f))))
705+ (fn 260:29
690− (arm 259:13
706+ (cell 260:32 (tvar 260:33 A) (tvar 260:35 B))
691− (cell 259:13 (lit 259:14 ~) (bind 259:16 value))
707+ (tvar 260:38 B))))
692− (tuple 259:23
708+ (body 261:3
693− (wing 259:24 value)
709+ (branch 261:3
694− (group 259:30
710+ (wing 261:6 args)
695− (call 259:31 (wing 259:31 murn) (wing 259:36 rest) (wing 259:41 f)))))))))))))))
711+ (arm 262:5
696− (value 261:1 join
712+ (cell 262:5 (bind 262:6 xs) (bind 262:9 start) (bind 262:15 combine))
697− (gate 261:9
713+ (body 263:7
698− (face 261:12 args
714+ (branch 263:7
699− (cell 261:17
715+ (wing 263:10 xs)
700− (tvar 261:18 A)
716+ (arm 264:9 (lit 264:9 ~) (wing 264:11 start))
701− (apply 261:20 list (tvar 261:26 A))))
717+ (arm 265:9
702− (body 262:3
718+ (cell 265:9 (bind 265:10 item) (bind 265:15 rest))
703− (branch 262:3
719+ (group 265:21
704− (wing 262:6 args)
720+ (call 265:22
705− (arm 263:5
721+ (wing 265:22 combine)
706− (cell 263:5 (bind 263:6 separator) (bind 263:16 xs))
722+ (wing 265:30 item)
707− (body 264:7
723+ (group 265:35
708− (branch 264:7
724+ (call 265:36 (wing 265:36 reel) (wing 265:41 rest) (wing 265:46 start) (wing 265:52 combine)))))))))))))
709− (wing 264:10 xs)
725+ (value 267:1 flit
710− (arm 265:9 (lit 265:9 ~) (lit 265:11 ~))
726+ (gate 267:9
711− (arm 266:9
727+ (face 267:12 predicate
712− (cell 266:9 (bind 266:10 item) (bind 266:15 rest))
728+ (fn 267:22 (tvar 267:25 A) (flag 267:27)))
713− (body 267:11
729+ (body 268:3
714− (branch 267:11
730+ (gate 268:3
715− (wing 267:14 rest)
731+ (face 268:6 value (tvar 268:12 A))
716− (arm 268:13
732+ (body 269:5
717− (lit 268:13 ~)
733+ (cast 269:5
718− (tuple 268:15 (wing 268:16 item) (lit 268:21 ~)))
734+ (apply 269:8 unit (tvar 269:14 A))
719− (arm 269:13
735+ (body 270:7
720− (cell 269:13 (bind 269:14 next) (bind 269:19 more))
736+ (branch 270:7
721− (tuple 269:25
737+ (group 270:10
722− (wing 269:26 item)
738+ (call 270:11 (wing 270:11 predicate) (wing 270:21 value)))
723− (tuple 269:31
739+ (arm 271:9
724− (wing 269:32 separator)
740+ (lit 271:9 %.y)
725− (group 269:42
741+ (unit 271:13 (wing 271:14 value)))
726− (call 269:43 (wing 269:43 join) (wing 269:48 separator) (wing 269:58 rest))))))))))))))))
742+ (arm 272:9 (lit 272:9 %.n) (lit 272:13 ~))))))))))
727− (value 271:1 snip
743+ (value 274:1 murn
728− (gate 271:9
744+ (gate 274:9
729− (face 271:12 xs
745+ (face 274:12 args
730− (apply 271:15 list (tvar 271:21 A)))
746+ (cell 274:17
731− (body 272:3
747+ (apply 274:18 list (tvar 274:24 A))
732− (branch 272:3
748+ (fn 274:27
733− (wing 272:6 xs)
749+ (tvar 274:30 A)
734− (arm 273:5 (lit 273:5 ~) (lit 273:7 ~))
750+ (apply 274:32 unit (tvar 274:38 B)))))
735− (arm 274:5
751+ (body 275:3
736− (cell 274:5 (bind 274:6 item) (bind 274:11 rest))
752+ (branch 275:3
737− (body 275:7
753+ (wing 275:6 args)
738− (branch 275:7
754+ (arm 276:5
739− (wing 275:10 rest)
755+ (cell 276:5 (bind 276:6 xs) (bind 276:9 f))
740− (arm 276:9 (lit 276:9 ~) (lit 276:11 ~))
756+ (cast 276:12
741− (arm 277:9
757+ (apply 276:15 list (tvar 276:21 B))
742− (cell 277:9 (bind 277:10 next) (bind 277:15 more))
758+ (body 277:9
743− (tuple 277:21
759+ (branch 277:9
744− (wing 277:22 item)
760+ (wing 277:12 xs)
745− (group 277:27
761+ (arm 278:11 (lit 278:11 ~) (lit 278:13 ~))
746− (call 277:28 (wing 277:28 snip) (wing 277:33 rest))))))))))))
762+ (arm 279:11
747− (value 279:1 rear
763+ (cell 279:11 (bind 279:12 item) (bind 279:17 rest))
748− (gate 279:9
764+ (body 280:13
749− (face 279:12 xs
765+ (branch 280:13
750− (apply 279:15 list (tvar 279:21 A)))
766+ (group 280:16
751− (body 280:3
767+ (call 280:17 (wing 280:17 f) (wing 280:19 item)))
752− (branch 280:3
768+ (arm 281:15
753− (wing 280:6 xs)
769+ (lit 281:15 ~)
754− (arm 281:5 (lit 281:5 ~) (crash 281:7))
770+ (group 281:17
755− (arm 282:5
771+ (call 281:18 (wing 281:18 murn) (wing 281:23 rest) (wing 281:28 f))))
756− (cell 282:5 (bind 282:6 item) (bind 282:11 rest))
772+ (arm 282:15
757− (body 283:7
773+ (cell 282:15 (lit 282:16 ~) (bind 282:18 value))
758− (branch 283:7
774+ (tuple 282:25
759− (wing 283:10 rest)
775+ (wing 282:26 value)
760− (arm 284:9 (lit 284:9 ~) (wing 284:11 item))
776+ (group 282:32
761− (arm 285:9
777+ (call 282:33 (wing 282:33 murn) (wing 282:38 rest) (wing 282:43 f))))))))))))))))
762− (cell 285:9 (bind 285:10 next) (bind 285:15 more))
778+ (value 284:1 join
763− (group 285:21
779+ (gate 284:9
764− (call 285:22 (wing 285:22 rear) (wing 285:27 rest))))))))))))
780+ (face 284:12 args
781+ (cell 284:17
782+ (tvar 284:18 A)
783+ (apply 284:20 list (tvar 284:26 A))))
784+ (body 285:3
785+ (branch 285:3
786+ (wing 285:6 args)
787+ (arm 286:5
788+ (cell 286:5 (bind 286:6 separator) (bind 286:16 xs))
789+ (cast 286:20
790+ (apply 286:23 list (tvar 286:29 A))
791+ (body 287:9
792+ (branch 287:9
793+ (wing 287:12 xs)
794+ (arm 288:11 (lit 288:11 ~) (lit 288:13 ~))
795+ (arm 289:11
796+ (cell 289:11 (bind 289:12 item) (bind 289:17 rest))
797+ (body 290:13
798+ (branch 290:13
799+ (wing 290:16 rest)
800+ (arm 291:15
801+ (lit 291:15 ~)
802+ (tuple 291:17 (wing 291:18 item) (lit 291:23 ~)))
803+ (arm 292:15
804+ (cell 292:15 (bind 292:16 next) (bind 292:21 more))
805+ (tuple 292:27
806+ (wing 292:28 item)
807+ (tuple 292:33
808+ (wing 292:34 separator)
809+ (group 292:44
810+ (call 292:45 (wing 292:45 join) (wing 292:50 separator) (wing 292:60 rest)))))))))))))))))
811+ (value 294:1 snip
812+ (gate 294:9
813+ (face 294:12 xs
814+ (apply 294:15 list (tvar 294:21 A)))
815+ (body 295:3
816+ (cast 295:3
817+ (apply 295:6 list (tvar 295:12 A))
818+ (body 296:5
819+ (branch 296:5
820+ (wing 296:8 xs)
821+ (arm 297:7 (lit 297:7 ~) (lit 297:9 ~))
822+ (arm 298:7
823+ (cell 298:7 (bind 298:8 item) (bind 298:13 rest))
824+ (body 299:9
825+ (branch 299:9
826+ (wing 299:12 rest)
827+ (arm 300:11 (lit 300:11 ~) (lit 300:13 ~))
828+ (arm 301:11
829+ (cell 301:11 (bind 301:12 next) (bind 301:17 more))
830+ (tuple 301:23
831+ (wing 301:24 item)
832+ (group 301:29
833+ (call 301:30 (wing 301:30 snip) (wing 301:35 rest))))))))))))))
834+ (value 303:1 rear
835+ (gate 303:9
836+ (face 303:12 xs
837+ (apply 303:15 list (tvar 303:21 A)))
838+ (body 304:3
839+ (branch 304:3
840+ (wing 304:6 xs)
841+ (arm 305:5 (lit 305:5 ~) (crash 305:7))
842+ (arm 306:5
843+ (cell 306:5 (bind 306:6 item) (bind 306:11 rest))
844+ (body 307:7
845+ (branch 307:7
846+ (wing 307:10 rest)
847+ (arm 308:9 (lit 308:9 ~) (wing 308:11 item))
848+ (arm 309:9
849+ (cell 309:9 (bind 309:10 next) (bind 309:15 more))
850+ (group 309:21
851+ (call 309:22 (wing 309:22 rear) (wing 309:27 rest)))))))))))
852+ (value 311:1 cork
853+ (gate 311:9
854+ (face 311:12 gates
855+ (cell 311:18
856+ (fn 311:19 (tvar 311:22 A) (tvar 311:24 B))
857+ (fn 311:27 (tvar 311:30 B) (tvar 311:32 C))))
858+ (body 312:3
859+ (branch 312:3
860+ (wing 312:6 gates)
861+ (arm 313:5
862+ (cell 313:5 (bind 313:6 f) (bind 313:8 g))
863+ (gate 313:11
864+ (face 313:14 x (tvar 313:16 A))
865+ (group 313:18
866+ (call 313:19
867+ (wing 313:19 g)
868+ (group 313:21
869+ (call 313:22 (wing 313:22 f) (wing 313:24 x)))))))))))
870+ (value 315:1 corl
871+ (gate 315:9
872+ (face 315:12 gates
873+ (cell 315:18
874+ (fn 315:19 (tvar 315:22 B) (tvar 315:24 C))
875+ (fn 315:27 (tvar 315:30 A) (tvar 315:32 B))))
876+ (body 316:3
877+ (branch 316:3
878+ (wing 316:6 gates)
879+ (arm 317:5
880+ (cell 317:5 (bind 317:6 f) (bind 317:8 g))
881+ (gate 317:11
882+ (face 317:14 x (tvar 317:16 A))
883+ (group 317:18
884+ (call 317:19
885+ (wing 317:19 f)
886+ (group 317:21
887+ (call 317:22 (wing 317:22 g) (wing 317:24 x)))))))))))
888+ (value 319:1 cury
889+ (gate 319:9
890+ (face 319:12 args
891+ (cell 319:17
892+ (fn 319:18
893+ (cell 319:21 (tvar 319:22 A) (tvar 319:24 B))
894+ (tvar 319:27 C))
895+ (tvar 319:30 A)))
896+ (body 320:3
897+ (branch 320:3
898+ (wing 320:6 args)
899+ (arm 321:5
900+ (cell 321:5 (bind 321:6 f) (bind 321:8 a))
901+ (gate 321:11
902+ (face 321:14 b (tvar 321:16 B))
903+ (group 321:18
904+ (call 321:19 (wing 321:19 f) (wing 321:21 a) (wing 321:23 b)))))))))
905+ (value 323:1 curr
906+ (gate 323:9
907+ (face 323:12 args
908+ (cell 323:17
909+ (fn 323:18
910+ (cell 323:21 (tvar 323:22 A) (tvar 323:24 B))
911+ (tvar 323:27 C))
912+ (tvar 323:30 B)))
913+ (body 324:3
914+ (branch 324:3
915+ (wing 324:6 args)
916+ (arm 325:5
917+ (cell 325:5 (bind 325:6 f) (bind 325:8 b))
918+ (gate 325:11
919+ (face 325:14 a (tvar 325:16 A))
920+ (group 325:18
921+ (call 325:19 (wing 325:19 f) (wing 325:21 a) (wing 325:23 b)))))))))
922+ (mold 327:1 cmd
923+ (generic 327:8 M
924+ (union 328:3
925+ (cell 328:3
926+ (const 328:4 %poke)
927+ (face 328:10 p (ref 328:12 poke))
928+ (face 328:17 reply
929+ (fn 328:23
930+ (apply 328:26 unit (aura 328:32 @t))
931+ (tvar 328:36 M))))
932+ (cell 329:3
933+ (const 329:4 %go)
934+ (face 329:8 url (aura 329:12 @t)))
935+ (cell 330:3
936+ (const 330:4 %wait)
937+ (face 330:10 gap (aura 330:14 @dr))
938+ (face 330:18 msg (tvar 330:22 M)))
939+ (cell 331:3
940+ (const 331:4 %now)
941+ (face 331:9 reply
942+ (fn 331:15 (aura 331:18 @da) (tvar 331:22 M))))
943+ (cell 332:3
944+ (const 332:4 %who)
945+ (face 332:9 reply
946+ (fn 332:15 (aura 332:18 @p) (tvar 332:21 M)))))))
947+ (value 334:1 gth
948+ (gate 334:8
949+ (face 334:11 args
950+ (cell 334:16 (tvar 334:17 A) (tvar 334:19 A)))
951+ (group 334:22
952+ (call 334:23 (wing 334:23 gth-atom.internal) (wing 334:41 args)))))
953+ (value 335:1 add
954+ (gate 335:8
955+ (face 335:11 args
956+ (cell 335:16 (tvar 335:17 A) (tvar 335:19 A)))
957+ (group 335:22
958+ (call 335:23 (wing 335:23 add-atom.internal) (wing 335:41 args)))))
959+ (value 336:1 dec
960+ (gate 336:8
961+ (face 336:11 atom (tvar 336:16 A))
962+ (group 336:18
963+ (call 336:19 (wing 336:19 dec-atom.internal) (wing 336:37 atom)))))
964+ (mold 338:1 ask
965+ (generic 338:8 M
966+ (apply 338:15 ask.internal (tvar 338:29 M))))
967+ (value 339:1 pure
968+ (gate 339:9
969+ (face 339:12 x (tvar 339:14 M))
970+ (cast 339:16
971+ (apply 339:19 ask (tvar 339:24 M))
972+ (tuple 339:27 (lit 339:28 %pure) (wing 339:34 x))))))
tests/golden/prelude-unit-list-transforms/types.txt+22−8
@@ -1,4 +1,6 @@
1partial inference; module not checked
1partial inference; module not checked
2++$ poke: not checked
3++$ qath: not checked
2++ same: $-(A A)
4++ same: $-(A A)
3++ head: $-([A B] A)
5++ head: $-([A B] A)
4++ tail: $-([A B] B)
6++ tail: $-([A B] B)
@@ -27,6 +29,7 @@ partial inference; module not checked
27+$ spot: not checked
29+$ spot: not checked
28+$ toon: cases proven disjoint; mold not checked
30+$ toon: cases proven disjoint; mold not checked
29+$ like: not checked
31+$ like: not checked
32+++ like: sample mold is not supported by partial inference
30++ wonk: sample mold is not supported by partial inference
33++ wonk: sample mold is not supported by partial inference
31+$ lone: not checked
34+$ lone: not checked
32+$ lest: not checked
35+$ lest: not checked
@@ -35,24 +38,35 @@ partial inference; module not checked
35+$ tree: cases proven disjoint; mold not checked
38+$ tree: cases proven disjoint; mold not checked
36+$ each: cases proven disjoint; mold not checked
39+$ each: cases proven disjoint; mold not checked
37+$ bloq: not checked
40+$ bloq: not checked
38−++ some: expression is not supported by partial inference
41+++ some: unit construction needs the standard prelude in partial inference
39++ lure: cast mold is not supported by partial inference
42++ lure: cast mold is not supported by partial inference
40++ snoc: sample mold is not supported by partial inference
43++ snoc: sample mold is not supported by partial inference
41++ flop: sample mold is not supported by partial inference
44++ flop: sample mold is not supported by partial inference
42−++ drop: unit branch results need unsupported inference
45+++ drop: cast mold is not supported by partial inference
43−++ bind: expression is not supported by partial inference
46+++ bond: $-($-(~ A) $-((unit A) A))
44−++ biff: unit branch results need unsupported inference
47+++ bind: unit construction needs the standard prelude in partial inference
45−++ both: expression is not supported by partial inference
48+++ biff: $-([(unit A) $-(A (unit B))] (unit B))
46−++ clap: branch pattern is not supported by partial inference
49+++ both: unit construction needs the standard prelude in partial inference
47−++ clef: branch pattern is not supported by partial inference
50+++ clap: unit construction needs the standard prelude in partial inference
51+++ clef: $-([(unit A) [(unit B) $-([A B] (unit C))]] (unit C))
48++ skim: sample mold is not supported by partial inference
52++ skim: sample mold is not supported by partial inference
49++ skip: sample mold is not supported by partial inference
53++ skip: sample mold is not supported by partial inference
50++ levy: sample mold is not supported by partial inference
54++ levy: sample mold is not supported by partial inference
51++ lien: sample mold is not supported by partial inference
55++ lien: sample mold is not supported by partial inference
52++ roll: sample mold is not supported by partial inference
56++ roll: sample mold is not supported by partial inference
53++ reel: sample mold is not supported by partial inference
57++ reel: sample mold is not supported by partial inference
54−++ flit: expression is not supported by partial inference
58+++ flit: unit construction needs the standard prelude in partial inference
55++ murn: sample mold is not supported by partial inference
59++ murn: sample mold is not supported by partial inference
56++ join: sample mold is not supported by partial inference
60++ join: sample mold is not supported by partial inference
57++ snip: sample mold is not supported by partial inference
61++ snip: sample mold is not supported by partial inference
58++ rear: sample mold is not supported by partial inference
62++ rear: sample mold is not supported by partial inference
63+++ cork: $-([$-(A B) $-(B C)] $-(A C))
64+++ corl: $-([$-(A B) $-(C A)] $-(C B))
65+++ cury: $-([$-([A B] C) A] $-(B C))
66+++ curr: $-([$-([A B] C) B] $-(A C))
67++$ cmd: cases proven disjoint; mold not checked
68+++ gth: field access is not supported by partial inference
69+++ add: field access is not supported by partial inference
70+++ dec: field access is not supported by partial inference
71++$ ask: not checked
72+++ pure: cast mold is not supported by partial inference
tests/golden/types-arithmetic-combined/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: docs/spec/grammar.md, Molds, Atoms: "Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not."
2+tests: Both inc operand orders retain non-loobean restrictions through aliases, concrete and generic holes, numeric defaulting, pending tags and @/? boundary checks.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-arithmetic-combined/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Opt in to the actual source-backed prelude.
tests/golden/types-arithmetic-combined/source.jibbnew file+56
@@ -0,0 +1,56 @@
1+++ inc |= n=A (add n 1)
2+++ inc-reverse |= n=A (add 1 n)
3+++ inc-decimal ^- @ud (inc 2)
4+++ inc-hex ^- @ux (inc 0x2)
5+++ reverse-decimal ^- @ud (inc-reverse 2)
6+++ reverse-hex ^- @ux (inc-reverse 0x2)
7+++ default (add 1 2)
8+++ decrease-decimal ^- @ud (dec 2)
9+++ decrease-hex ^- @ux (dec 0x2)
10+++ bool-add (add %.n %.n)
11+++ bool-dec (dec %.n)
12+++ bool-reverse (add 1 %.y)
13+++ bool-inc (inc %.y)
14+++ bool-gate |= x=? (inc x)
15+++ bool-result ^- ? (add 1 1)
16+++ compare-bool (gth %.n %.y)
17+++ mixed (add ~zod "hi")
18+++ cells (add [1 2] [3 4])
19+++ distinct |= [a=A b=B] (add a b)
20+++ shared |= [a=A b=A] (add a b)
21+++ capture |= n=A
22+ ++ inner |= x=A (add n 1)
23+ (inner n)
24+++ nested |= n=A |= x=A (add n 1)
25+++ unrelated
26+ ~& %dangling
27+ (add 1 2)
28+++ identity |= x=A x
29+++ identity-bool (identity %.y)
30+++ alias-inc inc
31+++ alias-decimal ^- @ud (alias-inc 2)
32+++ alias-hex ^- @ux (alias-inc 0x2)
33+++ alias-bool (alias-inc %.y)
34+++ explicit-loobean-result |= n=A ^- ? (add n 1)
35+++ any-then-bool |= [x=@ b=?] (add x b)
36+++ bool-then-any |= [b=? x=@] (add b x)
37+++ any-dec |= x=@ (dec x)
38+++ any-plus-number |= x=@ (add x 1)
39+++ number-plus-any |= x=@ (add 1 x)
40+++ any-self |= x=@ (add x x)
41+++ hole-concrete |= n=_ ^- @ud (add n 1)
42+++ hole-written |= n=A ^- _ (add n 1)
43+++ hole-unresolved |= n=_ (add n 1)
44+++ standalone (add 1 2)
45+++ discarded-number
46+ ~& 2
47+ (add 1 2)
48+++ numeric-capture |= x
49+ ++ inner (add x 1)
50+ ^- @ux x
51+++ numeric-capture-reversed |= x
52+ ++ inner (add 1 x)
53+ ^- @ux x
54+++ bound-later |= x=A
55+ ++ inner (add x 1)
56+ x
tests/golden/types-arithmetic-combined/tokens.txtnew file+511
@@ -0,0 +1,511 @@
1+1:1 glyph ++
2+1:4 name inc
3+1:8 glyph |=
4+1:11 name n
5+1:12 tight glyph =
6+1:13 tight tvar A
7+1:15 glyph (
8+1:16 tight name add
9+1:20 name n
10+1:22 lit 1
11+1:23 tight glyph )
12+2:1 NEWLINE
13+2:1 glyph ++
14+2:4 name inc-reverse
15+2:16 glyph |=
16+2:19 name n
17+2:20 tight glyph =
18+2:21 tight tvar A
19+2:23 glyph (
20+2:24 tight name add
21+2:28 lit 1
22+2:30 name n
23+2:31 tight glyph )
24+3:1 NEWLINE
25+3:1 glyph ++
26+3:4 name inc-decimal
27+3:16 glyph ^-
28+3:19 aura @ud
29+3:23 glyph (
30+3:24 tight name inc
31+3:28 lit 2
32+3:29 tight glyph )
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name inc-hex
36+4:12 glyph ^-
37+4:15 aura @ux
38+4:19 glyph (
39+4:20 tight name inc
40+4:24 lit 0x2
41+4:27 tight glyph )
42+5:1 NEWLINE
43+5:1 glyph ++
44+5:4 name reverse-decimal
45+5:20 glyph ^-
46+5:23 aura @ud
47+5:27 glyph (
48+5:28 tight name inc-reverse
49+5:40 lit 2
50+5:41 tight glyph )
51+6:1 NEWLINE
52+6:1 glyph ++
53+6:4 name reverse-hex
54+6:16 glyph ^-
55+6:19 aura @ux
56+6:23 glyph (
57+6:24 tight name inc-reverse
58+6:36 lit 0x2
59+6:39 tight glyph )
60+7:1 NEWLINE
61+7:1 glyph ++
62+7:4 name default
63+7:12 glyph (
64+7:13 tight name add
65+7:17 lit 1
66+7:19 lit 2
67+7:20 tight glyph )
68+8:1 NEWLINE
69+8:1 glyph ++
70+8:4 name decrease-decimal
71+8:21 glyph ^-
72+8:24 aura @ud
73+8:28 glyph (
74+8:29 tight name dec
75+8:33 lit 2
76+8:34 tight glyph )
77+9:1 NEWLINE
78+9:1 glyph ++
79+9:4 name decrease-hex
80+9:17 glyph ^-
81+9:20 aura @ux
82+9:24 glyph (
83+9:25 tight name dec
84+9:29 lit 0x2
85+9:32 tight glyph )
86+10:1 NEWLINE
87+10:1 glyph ++
88+10:4 name bool-add
89+10:13 glyph (
90+10:14 tight name add
91+10:18 lit %.n
92+10:22 lit %.n
93+10:25 tight glyph )
94+11:1 NEWLINE
95+11:1 glyph ++
96+11:4 name bool-dec
97+11:13 glyph (
98+11:14 tight name dec
99+11:18 lit %.n
100+11:21 tight glyph )
101+12:1 NEWLINE
102+12:1 glyph ++
103+12:4 name bool-reverse
104+12:17 glyph (
105+12:18 tight name add
106+12:22 lit 1
107+12:24 lit %.y
108+12:27 tight glyph )
109+13:1 NEWLINE
110+13:1 glyph ++
111+13:4 name bool-inc
112+13:13 glyph (
113+13:14 tight name inc
114+13:18 lit %.y
115+13:21 tight glyph )
116+14:1 NEWLINE
117+14:1 glyph ++
118+14:4 name bool-gate
119+14:14 glyph |=
120+14:17 name x
121+14:18 tight glyph =
122+14:19 tight glyph ?
123+14:21 glyph (
124+14:22 tight name inc
125+14:26 name x
126+14:27 tight glyph )
127+15:1 NEWLINE
128+15:1 glyph ++
129+15:4 name bool-result
130+15:16 glyph ^-
131+15:19 glyph ?
132+15:21 glyph (
133+15:22 tight name add
134+15:26 lit 1
135+15:28 lit 1
136+15:29 tight glyph )
137+16:1 NEWLINE
138+16:1 glyph ++
139+16:4 name compare-bool
140+16:17 glyph (
141+16:18 tight name gth
142+16:22 lit %.n
143+16:26 lit %.y
144+16:29 tight glyph )
145+17:1 NEWLINE
146+17:1 glyph ++
147+17:4 name mixed
148+17:10 glyph (
149+17:11 tight name add
150+17:15 lit ~zod
151+17:20 str "hi"
152+17:24 tight glyph )
153+18:1 NEWLINE
154+18:1 glyph ++
155+18:4 name cells
156+18:10 glyph (
157+18:11 tight name add
158+18:15 glyph [
159+18:16 tight lit 1
160+18:18 lit 2
161+18:19 tight glyph ]
162+18:21 glyph [
163+18:22 tight lit 3
164+18:24 lit 4
165+18:25 tight glyph ]
166+18:26 tight glyph )
167+19:1 NEWLINE
168+19:1 glyph ++
169+19:4 name distinct
170+19:13 glyph |=
171+19:16 glyph [
172+19:17 tight name a
173+19:18 tight glyph =
174+19:19 tight tvar A
175+19:21 name b
176+19:22 tight glyph =
177+19:23 tight tvar B
178+19:24 tight glyph ]
179+19:26 glyph (
180+19:27 tight name add
181+19:31 name a
182+19:33 name b
183+19:34 tight glyph )
184+20:1 NEWLINE
185+20:1 glyph ++
186+20:4 name shared
187+20:11 glyph |=
188+20:14 glyph [
189+20:15 tight name a
190+20:16 tight glyph =
191+20:17 tight tvar A
192+20:19 name b
193+20:20 tight glyph =
194+20:21 tight tvar A
195+20:22 tight glyph ]
196+20:24 glyph (
197+20:25 tight name add
198+20:29 name a
199+20:31 name b
200+20:32 tight glyph )
201+21:1 NEWLINE
202+21:1 glyph ++
203+21:4 name capture
204+21:12 glyph |=
205+21:15 name n
206+21:16 tight glyph =
207+21:17 tight tvar A
208+22:3 INDENT
209+22:3 glyph ++
210+22:6 name inner
211+22:12 glyph |=
212+22:15 name x
213+22:16 tight glyph =
214+22:17 tight tvar A
215+22:19 glyph (
216+22:20 tight name add
217+22:24 name n
218+22:26 lit 1
219+22:27 tight glyph )
220+23:3 NEWLINE
221+23:3 glyph (
222+23:4 tight name inner
223+23:10 name n
224+23:11 tight glyph )
225+24:1 DEDENT
226+24:1 NEWLINE
227+24:1 glyph ++
228+24:4 name nested
229+24:11 glyph |=
230+24:14 name n
231+24:15 tight glyph =
232+24:16 tight tvar A
233+24:18 glyph |=
234+24:21 name x
235+24:22 tight glyph =
236+24:23 tight tvar A
237+24:25 glyph (
238+24:26 tight name add
239+24:30 name n
240+24:32 lit 1
241+24:33 tight glyph )
242+25:1 NEWLINE
243+25:1 glyph ++
244+25:4 name unrelated
245+26:3 INDENT
246+26:3 glyph ~&
247+26:6 lit %dangling
248+27:5 INDENT
249+27:5 glyph (
250+27:6 tight name add
251+27:10 lit 1
252+27:12 lit 2
253+27:13 tight glyph )
254+28:1 DEDENT
255+28:1 DEDENT
256+28:1 NEWLINE
257+28:1 glyph ++
258+28:4 name identity
259+28:13 glyph |=
260+28:16 name x
261+28:17 tight glyph =
262+28:18 tight tvar A
263+28:20 name x
264+29:1 NEWLINE
265+29:1 glyph ++
266+29:4 name identity-bool
267+29:18 glyph (
268+29:19 tight name identity
269+29:28 lit %.y
270+29:31 tight glyph )
271+30:1 NEWLINE
272+30:1 glyph ++
273+30:4 name alias-inc
274+30:14 name inc
275+31:1 NEWLINE
276+31:1 glyph ++
277+31:4 name alias-decimal
278+31:18 glyph ^-
279+31:21 aura @ud
280+31:25 glyph (
281+31:26 tight name alias-inc
282+31:36 lit 2
283+31:37 tight glyph )
284+32:1 NEWLINE
285+32:1 glyph ++
286+32:4 name alias-hex
287+32:14 glyph ^-
288+32:17 aura @ux
289+32:21 glyph (
290+32:22 tight name alias-inc
291+32:32 lit 0x2
292+32:35 tight glyph )
293+33:1 NEWLINE
294+33:1 glyph ++
295+33:4 name alias-bool
296+33:15 glyph (
297+33:16 tight name alias-inc
298+33:26 lit %.y
299+33:29 tight glyph )
300+34:1 NEWLINE
301+34:1 glyph ++
302+34:4 name explicit-loobean-result
303+34:28 glyph |=
304+34:31 name n
305+34:32 tight glyph =
306+34:33 tight tvar A
307+34:35 glyph ^-
308+34:38 glyph ?
309+34:40 glyph (
310+34:41 tight name add
311+34:45 name n
312+34:47 lit 1
313+34:48 tight glyph )
314+35:1 NEWLINE
315+35:1 glyph ++
316+35:4 name any-then-bool
317+35:18 glyph |=
318+35:21 glyph [
319+35:22 tight name x
320+35:23 tight glyph =
321+35:24 tight aura @
322+35:26 name b
323+35:27 tight glyph =
324+35:28 tight glyph ?
325+35:29 tight glyph ]
326+35:31 glyph (
327+35:32 tight name add
328+35:36 name x
329+35:38 name b
330+35:39 tight glyph )
331+36:1 NEWLINE
332+36:1 glyph ++
333+36:4 name bool-then-any
334+36:18 glyph |=
335+36:21 glyph [
336+36:22 tight name b
337+36:23 tight glyph =
338+36:24 tight glyph ?
339+36:26 name x
340+36:27 tight glyph =
341+36:28 tight aura @
342+36:29 tight glyph ]
343+36:31 glyph (
344+36:32 tight name add
345+36:36 name b
346+36:38 name x
347+36:39 tight glyph )
348+37:1 NEWLINE
349+37:1 glyph ++
350+37:4 name any-dec
351+37:12 glyph |=
352+37:15 name x
353+37:16 tight glyph =
354+37:17 tight aura @
355+37:19 glyph (
356+37:20 tight name dec
357+37:24 name x
358+37:25 tight glyph )
359+38:1 NEWLINE
360+38:1 glyph ++
361+38:4 name any-plus-number
362+38:20 glyph |=
363+38:23 name x
364+38:24 tight glyph =
365+38:25 tight aura @
366+38:27 glyph (
367+38:28 tight name add
368+38:32 name x
369+38:34 lit 1
370+38:35 tight glyph )
371+39:1 NEWLINE
372+39:1 glyph ++
373+39:4 name number-plus-any
374+39:20 glyph |=
375+39:23 name x
376+39:24 tight glyph =
377+39:25 tight aura @
378+39:27 glyph (
379+39:28 tight name add
380+39:32 lit 1
381+39:34 name x
382+39:35 tight glyph )
383+40:1 NEWLINE
384+40:1 glyph ++
385+40:4 name any-self
386+40:13 glyph |=
387+40:16 name x
388+40:17 tight glyph =
389+40:18 tight aura @
390+40:20 glyph (
391+40:21 tight name add
392+40:25 name x
393+40:27 name x
394+40:28 tight glyph )
395+41:1 NEWLINE
396+41:1 glyph ++
397+41:4 name hole-concrete
398+41:18 glyph |=
399+41:21 name n
400+41:22 tight glyph =
401+41:23 tight glyph _
402+41:25 glyph ^-
403+41:28 aura @ud
404+41:32 glyph (
405+41:33 tight name add
406+41:37 name n
407+41:39 lit 1
408+41:40 tight glyph )
409+42:1 NEWLINE
410+42:1 glyph ++
411+42:4 name hole-written
412+42:17 glyph |=
413+42:20 name n
414+42:21 tight glyph =
415+42:22 tight tvar A
416+42:24 glyph ^-
417+42:27 glyph _
418+42:29 glyph (
419+42:30 tight name add
420+42:34 name n
421+42:36 lit 1
422+42:37 tight glyph )
423+43:1 NEWLINE
424+43:1 glyph ++
425+43:4 name hole-unresolved
426+43:20 glyph |=
427+43:23 name n
428+43:24 tight glyph =
429+43:25 tight glyph _
430+43:27 glyph (
431+43:28 tight name add
432+43:32 name n
433+43:34 lit 1
434+43:35 tight glyph )
435+44:1 NEWLINE
436+44:1 glyph ++
437+44:4 name standalone
438+44:15 glyph (
439+44:16 tight name add
440+44:20 lit 1
441+44:22 lit 2
442+44:23 tight glyph )
443+45:1 NEWLINE
444+45:1 glyph ++
445+45:4 name discarded-number
446+46:3 INDENT
447+46:3 glyph ~&
448+46:6 lit 2
449+47:5 INDENT
450+47:5 glyph (
451+47:6 tight name add
452+47:10 lit 1
453+47:12 lit 2
454+47:13 tight glyph )
455+48:1 DEDENT
456+48:1 DEDENT
457+48:1 NEWLINE
458+48:1 glyph ++
459+48:4 name numeric-capture
460+48:20 glyph |=
461+48:23 name x
462+49:3 INDENT
463+49:3 glyph ++
464+49:6 name inner
465+49:12 glyph (
466+49:13 tight name add
467+49:17 name x
468+49:19 lit 1
469+49:20 tight glyph )
470+50:3 NEWLINE
471+50:3 glyph ^-
472+50:6 aura @ux
473+50:10 name x
474+51:1 DEDENT
475+51:1 NEWLINE
476+51:1 glyph ++
477+51:4 name numeric-capture-reversed
478+51:29 glyph |=
479+51:32 name x
480+52:3 INDENT
481+52:3 glyph ++
482+52:6 name inner
483+52:12 glyph (
484+52:13 tight name add
485+52:17 lit 1
486+52:19 name x
487+52:20 tight glyph )
488+53:3 NEWLINE
489+53:3 glyph ^-
490+53:6 aura @ux
491+53:10 name x
492+54:1 DEDENT
493+54:1 NEWLINE
494+54:1 glyph ++
495+54:4 name bound-later
496+54:16 glyph |=
497+54:19 name x
498+54:20 tight glyph =
499+54:21 tight tvar A
500+55:3 INDENT
501+55:3 glyph ++
502+55:6 name inner
503+55:12 glyph (
504+55:13 tight name add
505+55:17 name x
506+55:19 lit 1
507+55:20 tight glyph )
508+56:3 NEWLINE
509+56:3 name x
510+56:4 DEDENT
511+56:4 NEWLINE
tests/golden/types-arithmetic-combined/tree.txtnew file+232
@@ -0,0 +1,232 @@
1+(module
2+ (value 1:1 inc
3+ (gate 1:8
4+ (face 1:11 n (tvar 1:13 A))
5+ (group 1:15
6+ (call 1:16 (wing 1:16 add) (wing 1:20 n) (lit 1:22 1)))))
7+ (value 2:1 inc-reverse
8+ (gate 2:16
9+ (face 2:19 n (tvar 2:21 A))
10+ (group 2:23
11+ (call 2:24 (wing 2:24 add) (lit 2:28 1) (wing 2:30 n)))))
12+ (value 3:1 inc-decimal
13+ (cast 3:16
14+ (aura 3:19 @ud)
15+ (group 3:23
16+ (call 3:24 (wing 3:24 inc) (lit 3:28 2)))))
17+ (value 4:1 inc-hex
18+ (cast 4:12
19+ (aura 4:15 @ux)
20+ (group 4:19
21+ (call 4:20 (wing 4:20 inc) (lit 4:24 0x2)))))
22+ (value 5:1 reverse-decimal
23+ (cast 5:20
24+ (aura 5:23 @ud)
25+ (group 5:27
26+ (call 5:28 (wing 5:28 inc-reverse) (lit 5:40 2)))))
27+ (value 6:1 reverse-hex
28+ (cast 6:16
29+ (aura 6:19 @ux)
30+ (group 6:23
31+ (call 6:24 (wing 6:24 inc-reverse) (lit 6:36 0x2)))))
32+ (value 7:1 default
33+ (group 7:12
34+ (call 7:13 (wing 7:13 add) (lit 7:17 1) (lit 7:19 2))))
35+ (value 8:1 decrease-decimal
36+ (cast 8:21
37+ (aura 8:24 @ud)
38+ (group 8:28
39+ (call 8:29 (wing 8:29 dec) (lit 8:33 2)))))
40+ (value 9:1 decrease-hex
41+ (cast 9:17
42+ (aura 9:20 @ux)
43+ (group 9:24
44+ (call 9:25 (wing 9:25 dec) (lit 9:29 0x2)))))
45+ (value 10:1 bool-add
46+ (group 10:13
47+ (call 10:14 (wing 10:14 add) (lit 10:18 %.n) (lit 10:22 %.n))))
48+ (value 11:1 bool-dec
49+ (group 11:13
50+ (call 11:14 (wing 11:14 dec) (lit 11:18 %.n))))
51+ (value 12:1 bool-reverse
52+ (group 12:17
53+ (call 12:18 (wing 12:18 add) (lit 12:22 1) (lit 12:24 %.y))))
54+ (value 13:1 bool-inc
55+ (group 13:13
56+ (call 13:14 (wing 13:14 inc) (lit 13:18 %.y))))
57+ (value 14:1 bool-gate
58+ (gate 14:14
59+ (face 14:17 x (flag 14:19))
60+ (group 14:21
61+ (call 14:22 (wing 14:22 inc) (wing 14:26 x)))))
62+ (value 15:1 bool-result
63+ (cast 15:16
64+ (flag 15:19)
65+ (group 15:21
66+ (call 15:22 (wing 15:22 add) (lit 15:26 1) (lit 15:28 1)))))
67+ (value 16:1 compare-bool
68+ (group 16:17
69+ (call 16:18 (wing 16:18 gth) (lit 16:22 %.n) (lit 16:26 %.y))))
70+ (value 17:1 mixed
71+ (group 17:10
72+ (call 17:11 (wing 17:11 add) (lit 17:15 ~zod) (str 17:20 "hi"))))
73+ (value 18:1 cells
74+ (group 18:10
75+ (call 18:11
76+ (wing 18:11 add)
77+ (tuple 18:15 (lit 18:16 1) (lit 18:18 2))
78+ (tuple 18:21 (lit 18:22 3) (lit 18:24 4)))))
79+ (value 19:1 distinct
80+ (gate 19:13
81+ (cell 19:16
82+ (face 19:17 a (tvar 19:19 A))
83+ (face 19:21 b (tvar 19:23 B)))
84+ (group 19:26
85+ (call 19:27 (wing 19:27 add) (wing 19:31 a) (wing 19:33 b)))))
86+ (value 20:1 shared
87+ (gate 20:11
88+ (cell 20:14
89+ (face 20:15 a (tvar 20:17 A))
90+ (face 20:19 b (tvar 20:21 A)))
91+ (group 20:24
92+ (call 20:25 (wing 20:25 add) (wing 20:29 a) (wing 20:31 b)))))
93+ (value 21:1 capture
94+ (gate 21:12
95+ (face 21:15 n (tvar 21:17 A))
96+ (body 22:3
97+ (value 22:3 inner
98+ (gate 22:12
99+ (face 22:15 x (tvar 22:17 A))
100+ (group 22:19
101+ (call 22:20 (wing 22:20 add) (wing 22:24 n) (lit 22:26 1)))))
102+ (group 23:3
103+ (call 23:4 (wing 23:4 inner) (wing 23:10 n))))))
104+ (value 24:1 nested
105+ (gate 24:11
106+ (face 24:14 n (tvar 24:16 A))
107+ (gate 24:18
108+ (face 24:21 x (tvar 24:23 A))
109+ (group 24:25
110+ (call 24:26 (wing 24:26 add) (wing 24:30 n) (lit 24:32 1))))))
111+ (value 25:1 unrelated
112+ (body 26:3
113+ (trace 26:3
114+ (lit 26:6 %dangling)
115+ (body 27:5
116+ (group 27:5
117+ (call 27:6 (wing 27:6 add) (lit 27:10 1) (lit 27:12 2)))))))
118+ (value 28:1 identity
119+ (gate 28:13
120+ (face 28:16 x (tvar 28:18 A))
121+ (wing 28:20 x)))
122+ (value 29:1 identity-bool
123+ (group 29:18
124+ (call 29:19 (wing 29:19 identity) (lit 29:28 %.y))))
125+ (value 30:1 alias-inc (wing 30:14 inc))
126+ (value 31:1 alias-decimal
127+ (cast 31:18
128+ (aura 31:21 @ud)
129+ (group 31:25
130+ (call 31:26 (wing 31:26 alias-inc) (lit 31:36 2)))))
131+ (value 32:1 alias-hex
132+ (cast 32:14
133+ (aura 32:17 @ux)
134+ (group 32:21
135+ (call 32:22 (wing 32:22 alias-inc) (lit 32:32 0x2)))))
136+ (value 33:1 alias-bool
137+ (group 33:15
138+ (call 33:16 (wing 33:16 alias-inc) (lit 33:26 %.y))))
139+ (value 34:1 explicit-loobean-result
140+ (gate 34:28
141+ (face 34:31 n (tvar 34:33 A))
142+ (cast 34:35
143+ (flag 34:38)
144+ (group 34:40
145+ (call 34:41 (wing 34:41 add) (wing 34:45 n) (lit 34:47 1))))))
146+ (value 35:1 any-then-bool
147+ (gate 35:18
148+ (cell 35:21
149+ (face 35:22 x (aura 35:24 @))
150+ (face 35:26 b (flag 35:28)))
151+ (group 35:31
152+ (call 35:32 (wing 35:32 add) (wing 35:36 x) (wing 35:38 b)))))
153+ (value 36:1 bool-then-any
154+ (gate 36:18
155+ (cell 36:21
156+ (face 36:22 b (flag 36:24))
157+ (face 36:26 x (aura 36:28 @)))
158+ (group 36:31
159+ (call 36:32 (wing 36:32 add) (wing 36:36 b) (wing 36:38 x)))))
160+ (value 37:1 any-dec
161+ (gate 37:12
162+ (face 37:15 x (aura 37:17 @))
163+ (group 37:19
164+ (call 37:20 (wing 37:20 dec) (wing 37:24 x)))))
165+ (value 38:1 any-plus-number
166+ (gate 38:20
167+ (face 38:23 x (aura 38:25 @))
168+ (group 38:27
169+ (call 38:28 (wing 38:28 add) (wing 38:32 x) (lit 38:34 1)))))
170+ (value 39:1 number-plus-any
171+ (gate 39:20
172+ (face 39:23 x (aura 39:25 @))
173+ (group 39:27
174+ (call 39:28 (wing 39:28 add) (lit 39:32 1) (wing 39:34 x)))))
175+ (value 40:1 any-self
176+ (gate 40:13
177+ (face 40:16 x (aura 40:18 @))
178+ (group 40:20
179+ (call 40:21 (wing 40:21 add) (wing 40:25 x) (wing 40:27 x)))))
180+ (value 41:1 hole-concrete
181+ (gate 41:18
182+ (face 41:21 n (hole 41:23))
183+ (cast 41:25
184+ (aura 41:28 @ud)
185+ (group 41:32
186+ (call 41:33 (wing 41:33 add) (wing 41:37 n) (lit 41:39 1))))))
187+ (value 42:1 hole-written
188+ (gate 42:17
189+ (face 42:20 n (tvar 42:22 A))
190+ (cast 42:24
191+ (hole 42:27)
192+ (group 42:29
193+ (call 42:30 (wing 42:30 add) (wing 42:34 n) (lit 42:36 1))))))
194+ (value 43:1 hole-unresolved
195+ (gate 43:20
196+ (face 43:23 n (hole 43:25))
197+ (group 43:27
198+ (call 43:28 (wing 43:28 add) (wing 43:32 n) (lit 43:34 1)))))
199+ (value 44:1 standalone
200+ (group 44:15
201+ (call 44:16 (wing 44:16 add) (lit 44:20 1) (lit 44:22 2))))
202+ (value 45:1 discarded-number
203+ (body 46:3
204+ (trace 46:3
205+ (lit 46:6 2)
206+ (body 47:5
207+ (group 47:5
208+ (call 47:6 (wing 47:6 add) (lit 47:10 1) (lit 47:12 2)))))))
209+ (value 48:1 numeric-capture
210+ (gate 48:20
211+ (bind 48:23 x)
212+ (body 49:3
213+ (value 49:3 inner
214+ (group 49:12
215+ (call 49:13 (wing 49:13 add) (wing 49:17 x) (lit 49:19 1))))
216+ (cast 50:3 (aura 50:6 @ux) (wing 50:10 x)))))
217+ (value 51:1 numeric-capture-reversed
218+ (gate 51:29
219+ (bind 51:32 x)
220+ (body 52:3
221+ (value 52:3 inner
222+ (group 52:12
223+ (call 52:13 (wing 52:13 add) (lit 52:17 1) (wing 52:19 x))))
224+ (cast 53:3 (aura 53:6 @ux) (wing 53:10 x)))))
225+ (value 54:1 bound-later
226+ (gate 54:16
227+ (face 54:19 x (tvar 54:21 A))
228+ (body 55:3
229+ (value 55:3 inner
230+ (group 55:12
231+ (call 55:13 (wing 55:13 add) (wing 55:17 x) (lit 55:19 1))))
232+ (wing 56:3 x)))))
tests/golden/types-arithmetic-combined/types.txtnew file+120
@@ -0,0 +1,120 @@
1+partial inference; module not checked
2+++ inc: $-(A A) where A is an atom other than ?
3+++ inc-reverse: $-(A A) where A is an atom other than ?
4+++ inc-decimal: @ud
5+++ inc-hex: @ux
6+++ reverse-decimal: @ud
7+++ reverse-hex: @ux
8+++ default: @ud
9+++ decrease-decimal: @ud
10+++ decrease-hex: @ux
11+++ bool-add: call's sample and argument types do not unify
12+/tests/golden/types-arithmetic-combined/source.jibb:10:14: called gate has type $-([A A] A) where A is an atom other than ?
13+++ bool-add (add %.n %.n)
14+ ^
15+/tests/golden/types-arithmetic-combined/source.jibb:10:18: argument has type ?
16+++ bool-add (add %.n %.n)
17+ ^
18+++ bool-dec: call's sample and argument types do not unify
19+/tests/golden/types-arithmetic-combined/source.jibb:11:14: called gate has type $-(A A) where A is an atom other than ?
20+++ bool-dec (dec %.n)
21+ ^
22+/tests/golden/types-arithmetic-combined/source.jibb:11:18: argument has type ?
23+++ bool-dec (dec %.n)
24+ ^
25+++ bool-reverse: call's sample and argument types do not unify
26+/tests/golden/types-arithmetic-combined/source.jibb:12:18: called gate has type $-([A A] A) where A is an atom other than ?
27+++ bool-reverse (add 1 %.y)
28+ ^
29+/tests/golden/types-arithmetic-combined/source.jibb:12:22: argument
30+++ bool-reverse (add 1 %.y)
31+ ^
32+++ bool-inc: call's sample and argument types do not unify
33+/tests/golden/types-arithmetic-combined/source.jibb:13:14: called gate has type $-(A A) where A is an atom other than ?
34+++ bool-inc (inc %.y)
35+ ^
36+/tests/golden/types-arithmetic-combined/source.jibb:13:18: argument has type ?
37+++ bool-inc (inc %.y)
38+ ^
39+++ bool-gate: call's sample and argument types do not unify
40+/tests/golden/types-arithmetic-combined/source.jibb:14:22: called gate has type $-(A A) where A is an atom other than ?
41+++ bool-gate |= x=? (inc x)
42+ ^
43+/tests/golden/types-arithmetic-combined/source.jibb:14:26: argument has type ?
44+++ bool-gate |= x=? (inc x)
45+ ^
46+++ bool-result: cast mold and expression type do not unify
47+/tests/golden/types-arithmetic-combined/source.jibb:15:19: cast mold has type ?
48+++ bool-result ^- ? (add 1 1)
49+ ^
50+/tests/golden/types-arithmetic-combined/source.jibb:15:21: expression
51+++ bool-result ^- ? (add 1 1)
52+ ^
53+++ compare-bool: ?
54+++ mixed: call's sample and argument types do not unify
55+/tests/golden/types-arithmetic-combined/source.jibb:17:11: called gate has type $-([A A] A) where A is an atom other than ?
56+++ mixed (add ~zod "hi")
57+ ^
58+/tests/golden/types-arithmetic-combined/source.jibb:17:15: argument has type [@p @t]
59+++ mixed (add ~zod "hi")
60+ ^
61+++ cells: call's sample and argument types do not unify
62+/tests/golden/types-arithmetic-combined/source.jibb:18:11: called gate has type $-([A A] A) where A is an atom other than ?
63+++ cells (add [1 2] [3 4])
64+ ^
65+/tests/golden/types-arithmetic-combined/source.jibb:18:15: argument
66+++ cells (add [1 2] [3 4])
67+ ^
68+++ distinct: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
69+/tests/golden/types-arithmetic-combined/source.jibb:19:19: first type variable
70+++ distinct |= [a=A b=B] (add a b)
71+ ^
72+/tests/golden/types-arithmetic-combined/source.jibb:19:23: second type variable
73+++ distinct |= [a=A b=B] (add a b)
74+ ^
75+++ shared: $-([a=A b=A] A) where A is an atom other than ?
76+++ capture: explicit capital constraints are not supported by partial inference
77+++ nested: $-(A $-(A A)) where A is an atom other than ?
78+++ unrelated: tag needs context in partial inference
79+++ identity: $-(A A)
80+++ identity-bool: ?
81+++ alias-inc: $-(A A) where A is an atom other than ?
82+++ alias-decimal: @ud
83+++ alias-hex: @ux
84+++ alias-bool: call's sample and argument types do not unify
85+/tests/golden/types-arithmetic-combined/source.jibb:33:16: called gate has type $-(A A) where A is an atom other than ?
86+++ alias-bool (alias-inc %.y)
87+ ^
88+/tests/golden/types-arithmetic-combined/source.jibb:33:26: argument has type ?
89+++ alias-bool (alias-inc %.y)
90+ ^
91+++ explicit-loobean-result: cast mold and expression type do not unify
92+/tests/golden/types-arithmetic-combined/source.jibb:34:38: cast mold has type ?
93+++ explicit-loobean-result |= n=A ^- ? (add n 1)
94+ ^
95+/tests/golden/types-arithmetic-combined/source.jibb:34:40: expression
96+++ explicit-loobean-result |= n=A ^- ? (add n 1)
97+ ^
98+++ any-then-bool: call constraint is not supported by partial inference
99+++ bool-then-any: call's sample and argument types do not unify
100+/tests/golden/types-arithmetic-combined/source.jibb:36:32: called gate has type $-([A A] A) where A is an atom other than ?
101+++ bool-then-any |= [b=? x=@] (add b x)
102+ ^
103+/tests/golden/types-arithmetic-combined/source.jibb:36:36: argument has type ?
104+++ bool-then-any |= [b=? x=@] (add b x)
105+ ^
106+++ any-dec: call constraint is not supported by partial inference
107+++ any-plus-number: call constraint is not supported by partial inference
108+++ number-plus-any: call constraint is not supported by partial inference
109+++ any-self: call constraint is not supported by partial inference
110+++ hole-concrete: $-(@ud @ud)
111+++ hole-written: $-(A A) where A is an atom other than ?
112+++ hole-unresolved: type hole needs unsupported inference
113+/tests/golden/types-arithmetic-combined/source.jibb:43:25: type hole
114+++ hole-unresolved |= n=_ (add n 1)
115+ ^
116+++ standalone: @ud
117+++ discarded-number: @ud
118+++ numeric-capture: local definitions need unsupported inference
119+++ numeric-capture-reversed: local definitions need unsupported inference
120+++ bound-later: explicit capital constraints are not supported by partial inference
tests/golden/types-arithmetic-generic/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: docs/spec/grammar.md, Molds, Atoms: "Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not."
2+tests: Generic add and dec, aliases and captured variables retain the restriction; ordinary identity and comparison still accept loobeans.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-arithmetic-generic/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Opt in to the actual source-backed prelude.
tests/golden/types-arithmetic-generic/source.jibbnew file+21
@@ -0,0 +1,21 @@
1+++ sum |= [a=A b=A] (add a b)
2+++ decreasing |= x=A (dec x)
3+++ forward sum
4+++ text-aura ^- @t (sum "a" "b")
5+++ ship-aura ^- @p (sum ~zod ~nec)
6+++ decimal ^- @ud (sum 1 2)
7+++ hex ^- @ux (sum 0x1 0x2)
8+++ decrease-dec ^- @ud (decreasing 2)
9+++ decrease-hex ^- @ux (decreasing 0x2)
10+++ bad-sum (sum %.y %.n)
11+++ bad-dec (decreasing %.y)
12+++ bad-alias (forward %.y %.n)
13+++ compare (gth %.y %.n)
14+++ identity |= x=A x
15+++ accept-bool (identity %.y)
16+++ capture |= x=A
17+ ++ nested |= y=A (add x y)
18+ (nested x)
19+++ mixed |= [x=@ b=?] (sum x b)
20+++ opposite |= [b=? x=@] (sum b x)
21+++ any-dec |= x=@ (decreasing x)
tests/golden/types-arithmetic-generic/tokens.txtnew file+206
@@ -0,0 +1,206 @@
1+1:1 glyph ++
2+1:4 name sum
3+1:8 glyph |=
4+1:11 glyph [
5+1:12 tight name a
6+1:13 tight glyph =
7+1:14 tight tvar A
8+1:16 name b
9+1:17 tight glyph =
10+1:18 tight tvar A
11+1:19 tight glyph ]
12+1:21 glyph (
13+1:22 tight name add
14+1:26 name a
15+1:28 name b
16+1:29 tight glyph )
17+2:1 NEWLINE
18+2:1 glyph ++
19+2:4 name decreasing
20+2:15 glyph |=
21+2:18 name x
22+2:19 tight glyph =
23+2:20 tight tvar A
24+2:22 glyph (
25+2:23 tight name dec
26+2:27 name x
27+2:28 tight glyph )
28+3:1 NEWLINE
29+3:1 glyph ++
30+3:4 name forward
31+3:12 name sum
32+4:1 NEWLINE
33+4:1 glyph ++
34+4:4 name text-aura
35+4:14 glyph ^-
36+4:17 aura @t
37+4:20 glyph (
38+4:21 tight name sum
39+4:25 str "a"
40+4:29 str "b"
41+4:32 tight glyph )
42+5:1 NEWLINE
43+5:1 glyph ++
44+5:4 name ship-aura
45+5:14 glyph ^-
46+5:17 aura @p
47+5:20 glyph (
48+5:21 tight name sum
49+5:25 lit ~zod
50+5:30 lit ~nec
51+5:34 tight glyph )
52+6:1 NEWLINE
53+6:1 glyph ++
54+6:4 name decimal
55+6:12 glyph ^-
56+6:15 aura @ud
57+6:19 glyph (
58+6:20 tight name sum
59+6:24 lit 1
60+6:26 lit 2
61+6:27 tight glyph )
62+7:1 NEWLINE
63+7:1 glyph ++
64+7:4 name hex
65+7:8 glyph ^-
66+7:11 aura @ux
67+7:15 glyph (
68+7:16 tight name sum
69+7:20 lit 0x1
70+7:24 lit 0x2
71+7:27 tight glyph )
72+8:1 NEWLINE
73+8:1 glyph ++
74+8:4 name decrease-dec
75+8:17 glyph ^-
76+8:20 aura @ud
77+8:24 glyph (
78+8:25 tight name decreasing
79+8:36 lit 2
80+8:37 tight glyph )
81+9:1 NEWLINE
82+9:1 glyph ++
83+9:4 name decrease-hex
84+9:17 glyph ^-
85+9:20 aura @ux
86+9:24 glyph (
87+9:25 tight name decreasing
88+9:36 lit 0x2
89+9:39 tight glyph )
90+10:1 NEWLINE
91+10:1 glyph ++
92+10:4 name bad-sum
93+10:12 glyph (
94+10:13 tight name sum
95+10:17 lit %.y
96+10:21 lit %.n
97+10:24 tight glyph )
98+11:1 NEWLINE
99+11:1 glyph ++
100+11:4 name bad-dec
101+11:12 glyph (
102+11:13 tight name decreasing
103+11:24 lit %.y
104+11:27 tight glyph )
105+12:1 NEWLINE
106+12:1 glyph ++
107+12:4 name bad-alias
108+12:14 glyph (
109+12:15 tight name forward
110+12:23 lit %.y
111+12:27 lit %.n
112+12:30 tight glyph )
113+13:1 NEWLINE
114+13:1 glyph ++
115+13:4 name compare
116+13:12 glyph (
117+13:13 tight name gth
118+13:17 lit %.y
119+13:21 lit %.n
120+13:24 tight glyph )
121+14:1 NEWLINE
122+14:1 glyph ++
123+14:4 name identity
124+14:13 glyph |=
125+14:16 name x
126+14:17 tight glyph =
127+14:18 tight tvar A
128+14:20 name x
129+15:1 NEWLINE
130+15:1 glyph ++
131+15:4 name accept-bool
132+15:16 glyph (
133+15:17 tight name identity
134+15:26 lit %.y
135+15:29 tight glyph )
136+16:1 NEWLINE
137+16:1 glyph ++
138+16:4 name capture
139+16:12 glyph |=
140+16:15 name x
141+16:16 tight glyph =
142+16:17 tight tvar A
143+17:3 INDENT
144+17:3 glyph ++
145+17:6 name nested
146+17:13 glyph |=
147+17:16 name y
148+17:17 tight glyph =
149+17:18 tight tvar A
150+17:20 glyph (
151+17:21 tight name add
152+17:25 name x
153+17:27 name y
154+17:28 tight glyph )
155+18:3 NEWLINE
156+18:3 glyph (
157+18:4 tight name nested
158+18:11 name x
159+18:12 tight glyph )
160+19:1 DEDENT
161+19:1 NEWLINE
162+19:1 glyph ++
163+19:4 name mixed
164+19:10 glyph |=
165+19:13 glyph [
166+19:14 tight name x
167+19:15 tight glyph =
168+19:16 tight aura @
169+19:18 name b
170+19:19 tight glyph =
171+19:20 tight glyph ?
172+19:21 tight glyph ]
173+19:23 glyph (
174+19:24 tight name sum
175+19:28 name x
176+19:30 name b
177+19:31 tight glyph )
178+20:1 NEWLINE
179+20:1 glyph ++
180+20:4 name opposite
181+20:13 glyph |=
182+20:16 glyph [
183+20:17 tight name b
184+20:18 tight glyph =
185+20:19 tight glyph ?
186+20:21 name x
187+20:22 tight glyph =
188+20:23 tight aura @
189+20:24 tight glyph ]
190+20:26 glyph (
191+20:27 tight name sum
192+20:31 name b
193+20:33 name x
194+20:34 tight glyph )
195+21:1 NEWLINE
196+21:1 glyph ++
197+21:4 name any-dec
198+21:12 glyph |=
199+21:15 name x
200+21:16 tight glyph =
201+21:17 tight aura @
202+21:19 glyph (
203+21:20 tight name decreasing
204+21:31 name x
205+21:32 tight glyph )
206+21:33 NEWLINE
tests/golden/types-arithmetic-generic/tree.txtnew file+93
@@ -0,0 +1,93 @@
1+(module
2+ (value 1:1 sum
3+ (gate 1:8
4+ (cell 1:11
5+ (face 1:12 a (tvar 1:14 A))
6+ (face 1:16 b (tvar 1:18 A)))
7+ (group 1:21
8+ (call 1:22 (wing 1:22 add) (wing 1:26 a) (wing 1:28 b)))))
9+ (value 2:1 decreasing
10+ (gate 2:15
11+ (face 2:18 x (tvar 2:20 A))
12+ (group 2:22
13+ (call 2:23 (wing 2:23 dec) (wing 2:27 x)))))
14+ (value 3:1 forward (wing 3:12 sum))
15+ (value 4:1 text-aura
16+ (cast 4:14
17+ (aura 4:17 @t)
18+ (group 4:20
19+ (call 4:21 (wing 4:21 sum) (str 4:25 "a") (str 4:29 "b")))))
20+ (value 5:1 ship-aura
21+ (cast 5:14
22+ (aura 5:17 @p)
23+ (group 5:20
24+ (call 5:21 (wing 5:21 sum) (lit 5:25 ~zod) (lit 5:30 ~nec)))))
25+ (value 6:1 decimal
26+ (cast 6:12
27+ (aura 6:15 @ud)
28+ (group 6:19
29+ (call 6:20 (wing 6:20 sum) (lit 6:24 1) (lit 6:26 2)))))
30+ (value 7:1 hex
31+ (cast 7:8
32+ (aura 7:11 @ux)
33+ (group 7:15
34+ (call 7:16 (wing 7:16 sum) (lit 7:20 0x1) (lit 7:24 0x2)))))
35+ (value 8:1 decrease-dec
36+ (cast 8:17
37+ (aura 8:20 @ud)
38+ (group 8:24
39+ (call 8:25 (wing 8:25 decreasing) (lit 8:36 2)))))
40+ (value 9:1 decrease-hex
41+ (cast 9:17
42+ (aura 9:20 @ux)
43+ (group 9:24
44+ (call 9:25 (wing 9:25 decreasing) (lit 9:36 0x2)))))
45+ (value 10:1 bad-sum
46+ (group 10:12
47+ (call 10:13 (wing 10:13 sum) (lit 10:17 %.y) (lit 10:21 %.n))))
48+ (value 11:1 bad-dec
49+ (group 11:12
50+ (call 11:13 (wing 11:13 decreasing) (lit 11:24 %.y))))
51+ (value 12:1 bad-alias
52+ (group 12:14
53+ (call 12:15 (wing 12:15 forward) (lit 12:23 %.y) (lit 12:27 %.n))))
54+ (value 13:1 compare
55+ (group 13:12
56+ (call 13:13 (wing 13:13 gth) (lit 13:17 %.y) (lit 13:21 %.n))))
57+ (value 14:1 identity
58+ (gate 14:13
59+ (face 14:16 x (tvar 14:18 A))
60+ (wing 14:20 x)))
61+ (value 15:1 accept-bool
62+ (group 15:16
63+ (call 15:17 (wing 15:17 identity) (lit 15:26 %.y))))
64+ (value 16:1 capture
65+ (gate 16:12
66+ (face 16:15 x (tvar 16:17 A))
67+ (body 17:3
68+ (value 17:3 nested
69+ (gate 17:13
70+ (face 17:16 y (tvar 17:18 A))
71+ (group 17:20
72+ (call 17:21 (wing 17:21 add) (wing 17:25 x) (wing 17:27 y)))))
73+ (group 18:3
74+ (call 18:4 (wing 18:4 nested) (wing 18:11 x))))))
75+ (value 19:1 mixed
76+ (gate 19:10
77+ (cell 19:13
78+ (face 19:14 x (aura 19:16 @))
79+ (face 19:18 b (flag 19:20)))
80+ (group 19:23
81+ (call 19:24 (wing 19:24 sum) (wing 19:28 x) (wing 19:30 b)))))
82+ (value 20:1 opposite
83+ (gate 20:13
84+ (cell 20:16
85+ (face 20:17 b (flag 20:19))
86+ (face 20:21 x (aura 20:23 @)))
87+ (group 20:26
88+ (call 20:27 (wing 20:27 sum) (wing 20:31 b) (wing 20:33 x)))))
89+ (value 21:1 any-dec
90+ (gate 21:12
91+ (face 21:15 x (aura 21:17 @))
92+ (group 21:19
93+ (call 21:20 (wing 21:20 decreasing) (wing 21:31 x))))))
tests/golden/types-arithmetic-generic/types.txtnew file+44
@@ -0,0 +1,44 @@
1+partial inference; module not checked
2+++ sum: $-([a=A b=A] A) where A is an atom other than ?
3+++ decreasing: $-(A A) where A is an atom other than ?
4+++ forward: $-([a=A b=A] A) where A is an atom other than ?
5+++ text-aura: @t
6+++ ship-aura: @p
7+++ decimal: @ud
8+++ hex: @ux
9+++ decrease-dec: @ud
10+++ decrease-hex: @ux
11+++ bad-sum: call's sample and argument types do not unify
12+/tests/golden/types-arithmetic-generic/source.jibb:10:13: called gate has type $-([a=A b=A] A) where A is an atom other than ?
13+++ bad-sum (sum %.y %.n)
14+ ^
15+/tests/golden/types-arithmetic-generic/source.jibb:10:17: argument has type ?
16+++ bad-sum (sum %.y %.n)
17+ ^
18+++ bad-dec: call's sample and argument types do not unify
19+/tests/golden/types-arithmetic-generic/source.jibb:11:13: called gate has type $-(A A) where A is an atom other than ?
20+++ bad-dec (decreasing %.y)
21+ ^
22+/tests/golden/types-arithmetic-generic/source.jibb:11:24: argument has type ?
23+++ bad-dec (decreasing %.y)
24+ ^
25+++ bad-alias: call's sample and argument types do not unify
26+/tests/golden/types-arithmetic-generic/source.jibb:12:15: called gate has type $-([a=A b=A] A) where A is an atom other than ?
27+++ bad-alias (forward %.y %.n)
28+ ^
29+/tests/golden/types-arithmetic-generic/source.jibb:12:23: argument has type ?
30+++ bad-alias (forward %.y %.n)
31+ ^
32+++ compare: ?
33+++ identity: $-(A A)
34+++ accept-bool: ?
35+++ capture: $-(A A) where A is an atom other than ?
36+++ mixed: call constraint is not supported by partial inference
37+++ opposite: call's sample and argument types do not unify
38+/tests/golden/types-arithmetic-generic/source.jibb:20:27: called gate has type $-([a=A b=A] A) where A is an atom other than ?
39+++ opposite |= [b=? x=@] (sum b x)
40+ ^
41+/tests/golden/types-arithmetic-generic/source.jibb:20:31: argument has type ?
42+++ opposite |= [b=? x=@] (sum b x)
43+ ^
44+++ any-dec: call constraint is not supported by partial inference
tests/golden/types-arithmetic-module/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: docs/spec/grammar.md, Molds, Atoms: "Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not."
2+tests: Imported generic arithmetic and aliases preserve restrictions under independent instantiation and reject loobeans; broad @ stays unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-arithmetic-module/module-trees.txtnew file+26
@@ -0,0 +1,26 @@
1+/ui/math.jibb
2+(module
3+ (value 1:1 sum
4+ (gate 1:8
5+ (cell 1:11
6+ (face 1:12 a (tvar 1:14 A))
7+ (face 1:16 b (tvar 1:18 A)))
8+ (group 1:21
9+ (call 1:22 (wing 1:22 add) (wing 1:26 a) (wing 1:28 b)))))
10+ (value 2:1 down
11+ (gate 2:9
12+ (face 2:12 x (tvar 2:14 A))
13+ (group 2:16
14+ (call 2:17 (wing 2:17 dec) (wing 2:21 x)))))
15+ (value 3:1 alias (wing 3:10 sum))
16+ (value 4:1 inc
17+ (gate 4:8
18+ (face 4:11 n (tvar 4:13 A))
19+ (group 4:15
20+ (call 4:16 (wing 4:16 add) (wing 4:20 n) (lit 4:22 1)))))
21+ (value 5:1 inc-reverse
22+ (gate 5:16
23+ (face 5:19 n (tvar 5:21 A))
24+ (group 5:23
25+ (call 5:24 (wing 5:24 add) (lit 5:28 1) (wing 5:30 n)))))
26+ (value 6:1 alias-inc (wing 6:14 inc)))
tests/golden/types-arithmetic-module/modules.txtnew file+1
@@ -0,0 +1 @@
1+/ui/math.jibb
tests/golden/types-arithmetic-module/modules/ui/math.jibbnew file+6
@@ -0,0 +1,6 @@
1+++ sum |= [a=A b=A] (add a b)
2+++ down |= x=A (dec x)
3+++ alias sum
4+++ inc |= n=A (add n 1)
5+++ inc-reverse |= n=A (add 1 n)
6+++ alias-inc inc
tests/golden/types-arithmetic-module/source.jibbnew file+16
@@ -0,0 +1,16 @@
1+/= math /ui/math
2+++ decimal ^- @ud (sum.math 1 2)
3+++ hex ^- @ux (sum.math 0x1 0x2)
4+++ text ^- @t (alias.math "a" "b")
5+++ ship ^- @p (down.math ~zod)
6+++ reject-bool (sum.math %.y %.n)
7+++ reject-down (down.math %.y)
8+++ reject-alias (alias.math %.n %.y)
9+++ reject-any |= x=@ (down.math x)
10+++ nested |= x=A
11+ ++ local |= y=A (sum.math x y)
12+ (local x)
13+++ inc-decimal ^- @ud (inc.math 2)
14+++ inc-hex ^- @ux (inc-reverse.math 0x2)
15+++ inc-bool (inc.math %.y)
16+++ alias-bool (alias-inc.math %.n)
tests/golden/types-arithmetic-module/tokens.txtnew file+137
@@ -0,0 +1,137 @@
1+1:1 glyph /=
2+1:4 name math
3+1:9 glyph /
4+1:10 tight knot ui
5+1:12 tight glyph /
6+1:13 tight knot math
7+2:1 NEWLINE
8+2:1 glyph ++
9+2:4 name decimal
10+2:12 glyph ^-
11+2:15 aura @ud
12+2:19 glyph (
13+2:20 tight wing sum.math
14+2:29 lit 1
15+2:31 lit 2
16+2:32 tight glyph )
17+3:1 NEWLINE
18+3:1 glyph ++
19+3:4 name hex
20+3:8 glyph ^-
21+3:11 aura @ux
22+3:15 glyph (
23+3:16 tight wing sum.math
24+3:25 lit 0x1
25+3:29 lit 0x2
26+3:32 tight glyph )
27+4:1 NEWLINE
28+4:1 glyph ++
29+4:4 name text
30+4:9 glyph ^-
31+4:12 aura @t
32+4:15 glyph (
33+4:16 tight wing alias.math
34+4:27 str "a"
35+4:31 str "b"
36+4:34 tight glyph )
37+5:1 NEWLINE
38+5:1 glyph ++
39+5:4 name ship
40+5:9 glyph ^-
41+5:12 aura @p
42+5:15 glyph (
43+5:16 tight wing down.math
44+5:26 lit ~zod
45+5:30 tight glyph )
46+6:1 NEWLINE
47+6:1 glyph ++
48+6:4 name reject-bool
49+6:16 glyph (
50+6:17 tight wing sum.math
51+6:26 lit %.y
52+6:30 lit %.n
53+6:33 tight glyph )
54+7:1 NEWLINE
55+7:1 glyph ++
56+7:4 name reject-down
57+7:16 glyph (
58+7:17 tight wing down.math
59+7:27 lit %.y
60+7:30 tight glyph )
61+8:1 NEWLINE
62+8:1 glyph ++
63+8:4 name reject-alias
64+8:17 glyph (
65+8:18 tight wing alias.math
66+8:29 lit %.n
67+8:33 lit %.y
68+8:36 tight glyph )
69+9:1 NEWLINE
70+9:1 glyph ++
71+9:4 name reject-any
72+9:15 glyph |=
73+9:18 name x
74+9:19 tight glyph =
75+9:20 tight aura @
76+9:22 glyph (
77+9:23 tight wing down.math
78+9:33 name x
79+9:34 tight glyph )
80+10:1 NEWLINE
81+10:1 glyph ++
82+10:4 name nested
83+10:11 glyph |=
84+10:14 name x
85+10:15 tight glyph =
86+10:16 tight tvar A
87+11:3 INDENT
88+11:3 glyph ++
89+11:6 name local
90+11:12 glyph |=
91+11:15 name y
92+11:16 tight glyph =
93+11:17 tight tvar A
94+11:19 glyph (
95+11:20 tight wing sum.math
96+11:29 name x
97+11:31 name y
98+11:32 tight glyph )
99+12:3 NEWLINE
100+12:3 glyph (
101+12:4 tight name local
102+12:10 name x
103+12:11 tight glyph )
104+13:1 DEDENT
105+13:1 NEWLINE
106+13:1 glyph ++
107+13:4 name inc-decimal
108+13:16 glyph ^-
109+13:19 aura @ud
110+13:23 glyph (
111+13:24 tight wing inc.math
112+13:33 lit 2
113+13:34 tight glyph )
114+14:1 NEWLINE
115+14:1 glyph ++
116+14:4 name inc-hex
117+14:12 glyph ^-
118+14:15 aura @ux
119+14:19 glyph (
120+14:20 tight wing inc-reverse.math
121+14:37 lit 0x2
122+14:40 tight glyph )
123+15:1 NEWLINE
124+15:1 glyph ++
125+15:4 name inc-bool
126+15:13 glyph (
127+15:14 tight wing inc.math
128+15:23 lit %.y
129+15:26 tight glyph )
130+16:1 NEWLINE
131+16:1 glyph ++
132+16:4 name alias-bool
133+16:15 glyph (
134+16:16 tight wing alias-inc.math
135+16:31 lit %.n
136+16:34 tight glyph )
137+16:35 NEWLINE
tests/golden/types-arithmetic-module/tree.txtnew file+63
@@ -0,0 +1,63 @@
1+(module
2+ (jibb 1:1 math /ui/math)
3+ (value 2:1 decimal
4+ (cast 2:12
5+ (aura 2:15 @ud)
6+ (group 2:19
7+ (call 2:20 (wing 2:20 sum.math) (lit 2:29 1) (lit 2:31 2)))))
8+ (value 3:1 hex
9+ (cast 3:8
10+ (aura 3:11 @ux)
11+ (group 3:15
12+ (call 3:16 (wing 3:16 sum.math) (lit 3:25 0x1) (lit 3:29 0x2)))))
13+ (value 4:1 text
14+ (cast 4:9
15+ (aura 4:12 @t)
16+ (group 4:15
17+ (call 4:16 (wing 4:16 alias.math) (str 4:27 "a") (str 4:31 "b")))))
18+ (value 5:1 ship
19+ (cast 5:9
20+ (aura 5:12 @p)
21+ (group 5:15
22+ (call 5:16 (wing 5:16 down.math) (lit 5:26 ~zod)))))
23+ (value 6:1 reject-bool
24+ (group 6:16
25+ (call 6:17 (wing 6:17 sum.math) (lit 6:26 %.y) (lit 6:30 %.n))))
26+ (value 7:1 reject-down
27+ (group 7:16
28+ (call 7:17 (wing 7:17 down.math) (lit 7:27 %.y))))
29+ (value 8:1 reject-alias
30+ (group 8:17
31+ (call 8:18 (wing 8:18 alias.math) (lit 8:29 %.n) (lit 8:33 %.y))))
32+ (value 9:1 reject-any
33+ (gate 9:15
34+ (face 9:18 x (aura 9:20 @))
35+ (group 9:22
36+ (call 9:23 (wing 9:23 down.math) (wing 9:33 x)))))
37+ (value 10:1 nested
38+ (gate 10:11
39+ (face 10:14 x (tvar 10:16 A))
40+ (body 11:3
41+ (value 11:3 local
42+ (gate 11:12
43+ (face 11:15 y (tvar 11:17 A))
44+ (group 11:19
45+ (call 11:20 (wing 11:20 sum.math) (wing 11:29 x) (wing 11:31 y)))))
46+ (group 12:3
47+ (call 12:4 (wing 12:4 local) (wing 12:10 x))))))
48+ (value 13:1 inc-decimal
49+ (cast 13:16
50+ (aura 13:19 @ud)
51+ (group 13:23
52+ (call 13:24 (wing 13:24 inc.math) (lit 13:33 2)))))
53+ (value 14:1 inc-hex
54+ (cast 14:12
55+ (aura 14:15 @ux)
56+ (group 14:19
57+ (call 14:20 (wing 14:20 inc-reverse.math) (lit 14:37 0x2)))))
58+ (value 15:1 inc-bool
59+ (group 15:13
60+ (call 15:14 (wing 15:14 inc.math) (lit 15:23 %.y))))
61+ (value 16:1 alias-bool
62+ (group 16:15
63+ (call 16:16 (wing 16:16 alias-inc.math) (lit 16:31 %.n)))))
tests/golden/types-arithmetic-module/types.txtnew file+44
@@ -0,0 +1,44 @@
1+partial inference; module not checked
2+++ decimal: @ud
3+++ hex: @ux
4+++ text: @t
5+++ ship: @p
6+++ reject-bool: call's sample and argument types do not unify
7+/tests/golden/types-arithmetic-module/source.jibb:6:17: called gate has type $-([a=A b=A] A) where A is an atom other than ?
8+++ reject-bool (sum.math %.y %.n)
9+ ^
10+/tests/golden/types-arithmetic-module/source.jibb:6:26: argument has type ?
11+++ reject-bool (sum.math %.y %.n)
12+ ^
13+++ reject-down: call's sample and argument types do not unify
14+/tests/golden/types-arithmetic-module/source.jibb:7:17: called gate has type $-(A A) where A is an atom other than ?
15+++ reject-down (down.math %.y)
16+ ^
17+/tests/golden/types-arithmetic-module/source.jibb:7:27: argument has type ?
18+++ reject-down (down.math %.y)
19+ ^
20+++ reject-alias: call's sample and argument types do not unify
21+/tests/golden/types-arithmetic-module/source.jibb:8:18: called gate has type $-([a=A b=A] A) where A is an atom other than ?
22+++ reject-alias (alias.math %.n %.y)
23+ ^
24+/tests/golden/types-arithmetic-module/source.jibb:8:29: argument has type ?
25+++ reject-alias (alias.math %.n %.y)
26+ ^
27+++ reject-any: call constraint is not supported by partial inference
28+++ nested: local definitions need unsupported inference
29+++ inc-decimal: @ud
30+++ inc-hex: @ux
31+++ inc-bool: call's sample and argument types do not unify
32+/tests/golden/types-arithmetic-module/source.jibb:15:14: called gate has type $-(A A) where A is an atom other than ?
33+++ inc-bool (inc.math %.y)
34+ ^
35+/tests/golden/types-arithmetic-module/source.jibb:15:23: argument has type ?
36+++ inc-bool (inc.math %.y)
37+ ^
38+++ alias-bool: call's sample and argument types do not unify
39+/tests/golden/types-arithmetic-module/source.jibb:16:16: called gate has type $-(A A) where A is an atom other than ?
40+++ alias-bool (alias-inc.math %.n)
41+ ^
42+/tests/golden/types-arithmetic-module/source.jibb:16:31: argument has type ?
43+++ alias-bool (alias-inc.math %.n)
44+ ^
tests/golden/types-arithmetic-proj-qath/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: docs/spec/grammar.md, Molds, Atoms: "Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not."
2+tests: Arithmetic retains non-loobean constraints through wider and single-field projected records and qath values; incompatible auras, loobean operands, and scalar binder faces do not silently infer.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-arithmetic-proj-qath/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Opt in to the actual source-backed prelude.
tests/golden/types-arithmetic-proj-qath/source.jibbnew file+18
@@ -0,0 +1,18 @@
1+++ project-increment |= r=[a=A b=@t c=@ud]
2+ ^- [a=A b=@t] (proj [a=(add a.r 1) b=b.r c=c.r])
3+++ good ^- [a=@ux b=@t] (project-increment [a=0x7 b="x" c=0])
4+++ flag (project-increment [a=%.y b="x" c=0])
5+++ mixed (add ~zod "x")
6+++ path-and-number [path=%/foo number=(add 1 2)]
7+++ path-value |= p=qath [path=p number=(add 1 2)]
8+++ with-path |= r=[a=A b=qath c=@ud]
9+ ^- [a=A b=qath] (proj [a=(dec a.r) b=b.r c=c.r])
10+++ wrong-width ^- [a=@ud b=@t] [a=(add 1 2) b="x" c=0]
11+++ select-one |= r=[a=A b=@t]
12+ ^- [a=A] (proj [a=(add a.r 1) b=b.r])
13+++ select-one-ux ^- [a=@ux] (select-one [a=0x7 b="x"])
14+++ select-one-bool (select-one [a=%.y b="x"])
15+++ scalar |= x=@t x
16+++ no-binder-field (scalar (proj [x="ok" y=~zod]))
17+++ select-one-nested |= r=[a=A b=@t]
18+ ^- [outer=[a=A] marker=@ud] [outer=(proj [a=(add a.r 1) b=b.r]) marker=0]
tests/golden/types-arithmetic-proj-qath/tokens.txtnew file+351
@@ -0,0 +1,351 @@
1+1:1 glyph ++
2+1:4 name project-increment
3+1:22 glyph |=
4+1:25 name r
5+1:26 tight glyph =
6+1:27 tight glyph [
7+1:28 tight name a
8+1:29 tight glyph =
9+1:30 tight tvar A
10+1:32 name b
11+1:33 tight glyph =
12+1:34 tight aura @t
13+1:37 name c
14+1:38 tight glyph =
15+1:39 tight aura @ud
16+1:42 tight glyph ]
17+2:3 INDENT
18+2:3 glyph ^-
19+2:6 glyph [
20+2:7 tight name a
21+2:8 tight glyph =
22+2:9 tight tvar A
23+2:11 name b
24+2:12 tight glyph =
25+2:13 tight aura @t
26+2:15 tight glyph ]
27+2:17 glyph (
28+2:18 tight name proj
29+2:23 glyph [
30+2:24 tight name a
31+2:25 tight glyph =
32+2:26 tight glyph (
33+2:27 tight name add
34+2:31 wing a.r
35+2:35 lit 1
36+2:36 tight glyph )
37+2:38 name b
38+2:39 tight glyph =
39+2:40 tight wing b.r
40+2:44 name c
41+2:45 tight glyph =
42+2:46 tight wing c.r
43+2:49 tight glyph ]
44+2:50 tight glyph )
45+3:1 DEDENT
46+3:1 NEWLINE
47+3:1 glyph ++
48+3:4 name good
49+3:9 glyph ^-
50+3:12 glyph [
51+3:13 tight name a
52+3:14 tight glyph =
53+3:15 tight aura @ux
54+3:19 name b
55+3:20 tight glyph =
56+3:21 tight aura @t
57+3:23 tight glyph ]
58+3:25 glyph (
59+3:26 tight name project-increment
60+3:44 glyph [
61+3:45 tight name a
62+3:46 tight glyph =
63+3:47 tight lit 0x7
64+3:51 name b
65+3:52 tight glyph =
66+3:53 tight str "x"
67+3:57 name c
68+3:58 tight glyph =
69+3:59 tight lit 0
70+3:60 tight glyph ]
71+3:61 tight glyph )
72+4:1 NEWLINE
73+4:1 glyph ++
74+4:4 name flag
75+4:9 glyph (
76+4:10 tight name project-increment
77+4:28 glyph [
78+4:29 tight name a
79+4:30 tight glyph =
80+4:31 tight lit %.y
81+4:35 name b
82+4:36 tight glyph =
83+4:37 tight str "x"
84+4:41 name c
85+4:42 tight glyph =
86+4:43 tight lit 0
87+4:44 tight glyph ]
88+4:45 tight glyph )
89+5:1 NEWLINE
90+5:1 glyph ++
91+5:4 name mixed
92+5:10 glyph (
93+5:11 tight name add
94+5:15 lit ~zod
95+5:20 str "x"
96+5:23 tight glyph )
97+6:1 NEWLINE
98+6:1 glyph ++
99+6:4 name path-and-number
100+6:20 glyph [
101+6:21 tight name path
102+6:25 tight glyph =
103+6:26 tight glyph %/
104+6:28 tight knot foo
105+6:32 name number
106+6:38 tight glyph =
107+6:39 tight glyph (
108+6:40 tight name add
109+6:44 lit 1
110+6:46 lit 2
111+6:47 tight glyph )
112+6:48 tight glyph ]
113+7:1 NEWLINE
114+7:1 glyph ++
115+7:4 name path-value
116+7:15 glyph |=
117+7:18 name p
118+7:19 tight glyph =
119+7:20 tight name qath
120+7:25 glyph [
121+7:26 tight name path
122+7:30 tight glyph =
123+7:31 tight name p
124+7:33 name number
125+7:39 tight glyph =
126+7:40 tight glyph (
127+7:41 tight name add
128+7:45 lit 1
129+7:47 lit 2
130+7:48 tight glyph )
131+7:49 tight glyph ]
132+8:1 NEWLINE
133+8:1 glyph ++
134+8:4 name with-path
135+8:14 glyph |=
136+8:17 name r
137+8:18 tight glyph =
138+8:19 tight glyph [
139+8:20 tight name a
140+8:21 tight glyph =
141+8:22 tight tvar A
142+8:24 name b
143+8:25 tight glyph =
144+8:26 tight name qath
145+8:31 name c
146+8:32 tight glyph =
147+8:33 tight aura @ud
148+8:36 tight glyph ]
149+9:3 INDENT
150+9:3 glyph ^-
151+9:6 glyph [
152+9:7 tight name a
153+9:8 tight glyph =
154+9:9 tight tvar A
155+9:11 name b
156+9:12 tight glyph =
157+9:13 tight name qath
158+9:17 tight glyph ]
159+9:19 glyph (
160+9:20 tight name proj
161+9:25 glyph [
162+9:26 tight name a
163+9:27 tight glyph =
164+9:28 tight glyph (
165+9:29 tight name dec
166+9:33 wing a.r
167+9:36 tight glyph )
168+9:38 name b
169+9:39 tight glyph =
170+9:40 tight wing b.r
171+9:44 name c
172+9:45 tight glyph =
173+9:46 tight wing c.r
174+9:49 tight glyph ]
175+9:50 tight glyph )
176+10:1 DEDENT
177+10:1 NEWLINE
178+10:1 glyph ++
179+10:4 name wrong-width
180+10:16 glyph ^-
181+10:19 glyph [
182+10:20 tight name a
183+10:21 tight glyph =
184+10:22 tight aura @ud
185+10:26 name b
186+10:27 tight glyph =
187+10:28 tight aura @t
188+10:30 tight glyph ]
189+10:32 glyph [
190+10:33 tight name a
191+10:34 tight glyph =
192+10:35 tight glyph (
193+10:36 tight name add
194+10:40 lit 1
195+10:42 lit 2
196+10:43 tight glyph )
197+10:45 name b
198+10:46 tight glyph =
199+10:47 tight str "x"
200+10:51 name c
201+10:52 tight glyph =
202+10:53 tight lit 0
203+10:54 tight glyph ]
204+11:1 NEWLINE
205+11:1 glyph ++
206+11:4 name select-one
207+11:15 glyph |=
208+11:18 name r
209+11:19 tight glyph =
210+11:20 tight glyph [
211+11:21 tight name a
212+11:22 tight glyph =
213+11:23 tight tvar A
214+11:25 name b
215+11:26 tight glyph =
216+11:27 tight aura @t
217+11:29 tight glyph ]
218+12:3 INDENT
219+12:3 glyph ^-
220+12:6 glyph [
221+12:7 tight name a
222+12:8 tight glyph =
223+12:9 tight tvar A
224+12:10 tight glyph ]
225+12:12 glyph (
226+12:13 tight name proj
227+12:18 glyph [
228+12:19 tight name a
229+12:20 tight glyph =
230+12:21 tight glyph (
231+12:22 tight name add
232+12:26 wing a.r
233+12:30 lit 1
234+12:31 tight glyph )
235+12:33 name b
236+12:34 tight glyph =
237+12:35 tight wing b.r
238+12:38 tight glyph ]
239+12:39 tight glyph )
240+13:1 DEDENT
241+13:1 NEWLINE
242+13:1 glyph ++
243+13:4 name select-one-ux
244+13:18 glyph ^-
245+13:21 glyph [
246+13:22 tight name a
247+13:23 tight glyph =
248+13:24 tight aura @ux
249+13:27 tight glyph ]
250+13:29 glyph (
251+13:30 tight name select-one
252+13:41 glyph [
253+13:42 tight name a
254+13:43 tight glyph =
255+13:44 tight lit 0x7
256+13:48 name b
257+13:49 tight glyph =
258+13:50 tight str "x"
259+13:53 tight glyph ]
260+13:54 tight glyph )
261+14:1 NEWLINE
262+14:1 glyph ++
263+14:4 name select-one-bool
264+14:20 glyph (
265+14:21 tight name select-one
266+14:32 glyph [
267+14:33 tight name a
268+14:34 tight glyph =
269+14:35 tight lit %.y
270+14:39 name b
271+14:40 tight glyph =
272+14:41 tight str "x"
273+14:44 tight glyph ]
274+14:45 tight glyph )
275+15:1 NEWLINE
276+15:1 glyph ++
277+15:4 name scalar
278+15:11 glyph |=
279+15:14 name x
280+15:15 tight glyph =
281+15:16 tight aura @t
282+15:19 name x
283+16:1 NEWLINE
284+16:1 glyph ++
285+16:4 name no-binder-field
286+16:20 glyph (
287+16:21 tight name scalar
288+16:28 glyph (
289+16:29 tight name proj
290+16:34 glyph [
291+16:35 tight name x
292+16:36 tight glyph =
293+16:37 tight str "ok"
294+16:42 name y
295+16:43 tight glyph =
296+16:44 tight lit ~zod
297+16:48 tight glyph ]
298+16:49 tight glyph )
299+16:50 tight glyph )
300+17:1 NEWLINE
301+17:1 glyph ++
302+17:4 name select-one-nested
303+17:22 glyph |=
304+17:25 name r
305+17:26 tight glyph =
306+17:27 tight glyph [
307+17:28 tight name a
308+17:29 tight glyph =
309+17:30 tight tvar A
310+17:32 name b
311+17:33 tight glyph =
312+17:34 tight aura @t
313+17:36 tight glyph ]
314+18:3 INDENT
315+18:3 glyph ^-
316+18:6 glyph [
317+18:7 tight name outer
318+18:12 tight glyph =
319+18:13 tight glyph [
320+18:14 tight name a
321+18:15 tight glyph =
322+18:16 tight tvar A
323+18:17 tight glyph ]
324+18:19 name marker
325+18:25 tight glyph =
326+18:26 tight aura @ud
327+18:29 tight glyph ]
328+18:31 glyph [
329+18:32 tight name outer
330+18:37 tight glyph =
331+18:38 tight glyph (
332+18:39 tight name proj
333+18:44 glyph [
334+18:45 tight name a
335+18:46 tight glyph =
336+18:47 tight glyph (
337+18:48 tight name add
338+18:52 wing a.r
339+18:56 lit 1
340+18:57 tight glyph )
341+18:59 name b
342+18:60 tight glyph =
343+18:61 tight wing b.r
344+18:64 tight glyph ]
345+18:65 tight glyph )
346+18:67 name marker
347+18:73 tight glyph =
348+18:74 tight lit 0
349+18:75 tight glyph ]
350+18:76 DEDENT
351+18:76 NEWLINE
tests/golden/types-arithmetic-proj-qath/tree.txtnew file+164
@@ -0,0 +1,164 @@
1+(module
2+ (value 1:1 project-increment
3+ (gate 1:22
4+ (face 1:25 r
5+ (cell 1:27
6+ (face 1:28 a (tvar 1:30 A))
7+ (face 1:32 b (aura 1:34 @t))
8+ (face 1:37 c (aura 1:39 @ud))))
9+ (body 2:3
10+ (cast 2:3
11+ (cell 2:6
12+ (face 2:7 a (tvar 2:9 A))
13+ (face 2:11 b (aura 2:13 @t)))
14+ (group 2:17
15+ (call 2:18
16+ (wing 2:18 proj)
17+ (tuple 2:23
18+ (face 2:24 a
19+ (group 2:26
20+ (call 2:27 (wing 2:27 add) (wing 2:31 a.r) (lit 2:35 1))))
21+ (face 2:38 b (wing 2:40 b.r))
22+ (face 2:44 c (wing 2:46 c.r)))))))))
23+ (value 3:1 good
24+ (cast 3:9
25+ (cell 3:12
26+ (face 3:13 a (aura 3:15 @ux))
27+ (face 3:19 b (aura 3:21 @t)))
28+ (group 3:25
29+ (call 3:26
30+ (wing 3:26 project-increment)
31+ (tuple 3:44
32+ (face 3:45 a (lit 3:47 0x7))
33+ (face 3:51 b (str 3:53 "x"))
34+ (face 3:57 c (lit 3:59 0)))))))
35+ (value 4:1 flag
36+ (group 4:9
37+ (call 4:10
38+ (wing 4:10 project-increment)
39+ (tuple 4:28
40+ (face 4:29 a (lit 4:31 %.y))
41+ (face 4:35 b (str 4:37 "x"))
42+ (face 4:41 c (lit 4:43 0))))))
43+ (value 5:1 mixed
44+ (group 5:10
45+ (call 5:11 (wing 5:11 add) (lit 5:15 ~zod) (str 5:20 "x"))))
46+ (value 6:1 path-and-number
47+ (tuple 6:20
48+ (face 6:21 path (qath 6:26 foo))
49+ (face 6:32 number
50+ (group 6:39
51+ (call 6:40 (wing 6:40 add) (lit 6:44 1) (lit 6:46 2))))))
52+ (value 7:1 path-value
53+ (gate 7:15
54+ (face 7:18 p (ref 7:20 qath))
55+ (tuple 7:25
56+ (face 7:26 path (wing 7:31 p))
57+ (face 7:33 number
58+ (group 7:40
59+ (call 7:41 (wing 7:41 add) (lit 7:45 1) (lit 7:47 2)))))))
60+ (value 8:1 with-path
61+ (gate 8:14
62+ (face 8:17 r
63+ (cell 8:19
64+ (face 8:20 a (tvar 8:22 A))
65+ (face 8:24 b (ref 8:26 qath))
66+ (face 8:31 c (aura 8:33 @ud))))
67+ (body 9:3
68+ (cast 9:3
69+ (cell 9:6
70+ (face 9:7 a (tvar 9:9 A))
71+ (face 9:11 b (ref 9:13 qath)))
72+ (group 9:19
73+ (call 9:20
74+ (wing 9:20 proj)
75+ (tuple 9:25
76+ (face 9:26 a
77+ (group 9:28
78+ (call 9:29 (wing 9:29 dec) (wing 9:33 a.r))))
79+ (face 9:38 b (wing 9:40 b.r))
80+ (face 9:44 c (wing 9:46 c.r)))))))))
81+ (value 10:1 wrong-width
82+ (cast 10:16
83+ (cell 10:19
84+ (face 10:20 a (aura 10:22 @ud))
85+ (face 10:26 b (aura 10:28 @t)))
86+ (tuple 10:32
87+ (face 10:33 a
88+ (group 10:35
89+ (call 10:36 (wing 10:36 add) (lit 10:40 1) (lit 10:42 2))))
90+ (face 10:45 b (str 10:47 "x"))
91+ (face 10:51 c (lit 10:53 0)))))
92+ (value 11:1 select-one
93+ (gate 11:15
94+ (face 11:18 r
95+ (cell 11:20
96+ (face 11:21 a (tvar 11:23 A))
97+ (face 11:25 b (aura 11:27 @t))))
98+ (body 12:3
99+ (cast 12:3
100+ (cell 12:6
101+ (face 12:7 a (tvar 12:9 A)))
102+ (group 12:12
103+ (call 12:13
104+ (wing 12:13 proj)
105+ (tuple 12:18
106+ (face 12:19 a
107+ (group 12:21
108+ (call 12:22 (wing 12:22 add) (wing 12:26 a.r) (lit 12:30 1))))
109+ (face 12:33 b (wing 12:35 b.r)))))))))
110+ (value 13:1 select-one-ux
111+ (cast 13:18
112+ (cell 13:21
113+ (face 13:22 a (aura 13:24 @ux)))
114+ (group 13:29
115+ (call 13:30
116+ (wing 13:30 select-one)
117+ (tuple 13:41
118+ (face 13:42 a (lit 13:44 0x7))
119+ (face 13:48 b (str 13:50 "x")))))))
120+ (value 14:1 select-one-bool
121+ (group 14:20
122+ (call 14:21
123+ (wing 14:21 select-one)
124+ (tuple 14:32
125+ (face 14:33 a (lit 14:35 %.y))
126+ (face 14:39 b (str 14:41 "x"))))))
127+ (value 15:1 scalar
128+ (gate 15:11
129+ (face 15:14 x (aura 15:16 @t))
130+ (wing 15:19 x)))
131+ (value 16:1 no-binder-field
132+ (group 16:20
133+ (call 16:21
134+ (wing 16:21 scalar)
135+ (group 16:28
136+ (call 16:29
137+ (wing 16:29 proj)
138+ (tuple 16:34
139+ (face 16:35 x (str 16:37 "ok"))
140+ (face 16:42 y (lit 16:44 ~zod))))))))
141+ (value 17:1 select-one-nested
142+ (gate 17:22
143+ (face 17:25 r
144+ (cell 17:27
145+ (face 17:28 a (tvar 17:30 A))
146+ (face 17:32 b (aura 17:34 @t))))
147+ (body 18:3
148+ (cast 18:3
149+ (cell 18:6
150+ (face 18:7 outer
151+ (cell 18:13
152+ (face 18:14 a (tvar 18:16 A))))
153+ (face 18:19 marker (aura 18:26 @ud)))
154+ (tuple 18:31
155+ (face 18:32 outer
156+ (group 18:38
157+ (call 18:39
158+ (wing 18:39 proj)
159+ (tuple 18:44
160+ (face 18:45 a
161+ (group 18:47
162+ (call 18:48 (wing 18:48 add) (wing 18:52 a.r) (lit 18:56 1))))
163+ (face 18:59 b (wing 18:61 b.r))))))
164+ (face 18:67 marker (lit 18:74 0))))))))
tests/golden/types-arithmetic-proj-qath/types.txtnew file+33
@@ -0,0 +1,33 @@
1+partial inference; module not checked
2+++ project-increment: $-([a=A [b=@t c=@ud]] [a=A b=@t]) where A is an atom other than ?
3+++ good: [a=@ux b=@t]
4+++ flag: call's sample and argument types do not unify
5+/tests/golden/types-arithmetic-proj-qath/source.jibb:4:10: called gate has type $-([a=A [b=@t c=@ud]] [a=A b=@t]) where A is an atom other than ?
6+++ flag (project-increment [a=%.y b="x" c=0])
7+ ^
8+/tests/golden/types-arithmetic-proj-qath/source.jibb:4:28: argument
9+++ flag (project-increment [a=%.y b="x" c=0])
10+ ^
11+++ mixed: call's sample and argument types do not unify
12+/tests/golden/types-arithmetic-proj-qath/source.jibb:5:11: called gate has type $-([A A] A) where A is an atom other than ?
13+++ mixed (add ~zod "x")
14+ ^
15+/tests/golden/types-arithmetic-proj-qath/source.jibb:5:15: argument has type [@p @t]
16+++ mixed (add ~zod "x")
17+ ^
18+++ path-and-number: [path=qath number=@ud]
19+++ path-value: unresolved aura-variable inference
20+++ with-path: $-([a=A [b=qath c=@ud]] [a=A b=qath]) where A is an atom other than ?
21+++ wrong-width: record width constraint needs unsupported inference
22+++ select-one: $-([a=A b=@t] [a=A]) where A is an atom other than ?
23+++ select-one-ux: [a=@ux]
24+++ select-one-bool: call's sample and argument types do not unify
25+/tests/golden/types-arithmetic-proj-qath/source.jibb:14:21: called gate has type $-([a=A b=@t] [a=A]) where A is an atom other than ?
26+++ select-one-bool (select-one [a=%.y b="x"])
27+ ^
28+/tests/golden/types-arithmetic-proj-qath/source.jibb:14:32: argument has type [a=? b=@t]
29+++ select-one-bool (select-one [a=%.y b="x"])
30+ ^
31+++ scalar: $-(@t @t)
32+++ no-binder-field: proj needs an expected record type
33+++ select-one-nested: $-([a=A b=@t] [outer=[a=A] marker=@ud]) where A is an atom other than ?
tests/golden/types-arithmetic-scopes/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: docs/spec/grammar.md, Molds, Atoms: "Arithmetic rejects loobean operands: `?` contains only 0 and 1, while an arithmetic result need not."
2+tests: Independent aura instantiation, shared and distinct capitals, nested/local captures, pending literals and direct/mutual recursion preserve the constraint or fail closed.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-arithmetic-scopes/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Opt in to the actual source-backed prelude.
tests/golden/types-arithmetic-scopes/source.jibbnew file+22
@@ -0,0 +1,22 @@
1+++ inc |= n=A (add n 1)
2+++ inc-r |= n=A (add 1 n)
3+++ text-case ^- @t (inc "x")
4+++ ship-case ^- @p (inc ~zod)
5+++ shared-case |= [a=A b=A] (add a b)
6+++ distinct |= [a=A b=B] (add a b)
7+++ nested |= n=A |= x=A (add n 1)
8+++ local-fresh |= outer=@t
9+ ++ inner |= n=A (add n 1)
10+ [(inner "a") (inner ~zod)]
11+++ local-capture |= outer=A
12+ ++ inner |= n=A (add outer 1)
13+ (inner outer)
14+++ trace-tag
15+ ~& %dangling
16+ (add 1 2)
17+++ trace-number
18+ ~& 4
19+ (add 1 2)
20+++ recurse |= n=A (add n (recurse n))
21+++ mutual-a |= n=A (add n (mutual-b n))
22+++ mutual-b |= n=A (add n (mutual-a n))
tests/golden/types-arithmetic-scopes/tokens.txtnew file+221
@@ -0,0 +1,221 @@
1+1:1 glyph ++
2+1:4 name inc
3+1:8 glyph |=
4+1:11 name n
5+1:12 tight glyph =
6+1:13 tight tvar A
7+1:15 glyph (
8+1:16 tight name add
9+1:20 name n
10+1:22 lit 1
11+1:23 tight glyph )
12+2:1 NEWLINE
13+2:1 glyph ++
14+2:4 name inc-r
15+2:10 glyph |=
16+2:13 name n
17+2:14 tight glyph =
18+2:15 tight tvar A
19+2:17 glyph (
20+2:18 tight name add
21+2:22 lit 1
22+2:24 name n
23+2:25 tight glyph )
24+3:1 NEWLINE
25+3:1 glyph ++
26+3:4 name text-case
27+3:14 glyph ^-
28+3:17 aura @t
29+3:20 glyph (
30+3:21 tight name inc
31+3:25 str "x"
32+3:28 tight glyph )
33+4:1 NEWLINE
34+4:1 glyph ++
35+4:4 name ship-case
36+4:14 glyph ^-
37+4:17 aura @p
38+4:20 glyph (
39+4:21 tight name inc
40+4:25 lit ~zod
41+4:29 tight glyph )
42+5:1 NEWLINE
43+5:1 glyph ++
44+5:4 name shared-case
45+5:16 glyph |=
46+5:19 glyph [
47+5:20 tight name a
48+5:21 tight glyph =
49+5:22 tight tvar A
50+5:24 name b
51+5:25 tight glyph =
52+5:26 tight tvar A
53+5:27 tight glyph ]
54+5:29 glyph (
55+5:30 tight name add
56+5:34 name a
57+5:36 name b
58+5:37 tight glyph )
59+6:1 NEWLINE
60+6:1 glyph ++
61+6:4 name distinct
62+6:13 glyph |=
63+6:16 glyph [
64+6:17 tight name a
65+6:18 tight glyph =
66+6:19 tight tvar A
67+6:21 name b
68+6:22 tight glyph =
69+6:23 tight tvar B
70+6:24 tight glyph ]
71+6:26 glyph (
72+6:27 tight name add
73+6:31 name a
74+6:33 name b
75+6:34 tight glyph )
76+7:1 NEWLINE
77+7:1 glyph ++
78+7:4 name nested
79+7:11 glyph |=
80+7:14 name n
81+7:15 tight glyph =
82+7:16 tight tvar A
83+7:18 glyph |=
84+7:21 name x
85+7:22 tight glyph =
86+7:23 tight tvar A
87+7:25 glyph (
88+7:26 tight name add
89+7:30 name n
90+7:32 lit 1
91+7:33 tight glyph )
92+8:1 NEWLINE
93+8:1 glyph ++
94+8:4 name local-fresh
95+8:16 glyph |=
96+8:19 name outer
97+8:24 tight glyph =
98+8:25 tight aura @t
99+9:3 INDENT
100+9:3 glyph ++
101+9:6 name inner
102+9:12 glyph |=
103+9:15 name n
104+9:16 tight glyph =
105+9:17 tight tvar A
106+9:19 glyph (
107+9:20 tight name add
108+9:24 name n
109+9:26 lit 1
110+9:27 tight glyph )
111+10:3 NEWLINE
112+10:3 glyph [
113+10:4 tight glyph (
114+10:5 tight name inner
115+10:11 str "a"
116+10:14 tight glyph )
117+10:16 glyph (
118+10:17 tight name inner
119+10:23 lit ~zod
120+10:27 tight glyph )
121+10:28 tight glyph ]
122+11:1 DEDENT
123+11:1 NEWLINE
124+11:1 glyph ++
125+11:4 name local-capture
126+11:18 glyph |=
127+11:21 name outer
128+11:26 tight glyph =
129+11:27 tight tvar A
130+12:3 INDENT
131+12:3 glyph ++
132+12:6 name inner
133+12:12 glyph |=
134+12:15 name n
135+12:16 tight glyph =
136+12:17 tight tvar A
137+12:19 glyph (
138+12:20 tight name add
139+12:24 name outer
140+12:30 lit 1
141+12:31 tight glyph )
142+13:3 NEWLINE
143+13:3 glyph (
144+13:4 tight name inner
145+13:10 name outer
146+13:15 tight glyph )
147+14:1 DEDENT
148+14:1 NEWLINE
149+14:1 glyph ++
150+14:4 name trace-tag
151+15:3 INDENT
152+15:3 glyph ~&
153+15:6 lit %dangling
154+16:5 INDENT
155+16:5 glyph (
156+16:6 tight name add
157+16:10 lit 1
158+16:12 lit 2
159+16:13 tight glyph )
160+17:1 DEDENT
161+17:1 DEDENT
162+17:1 NEWLINE
163+17:1 glyph ++
164+17:4 name trace-number
165+18:3 INDENT
166+18:3 glyph ~&
167+18:6 lit 4
168+19:5 INDENT
169+19:5 glyph (
170+19:6 tight name add
171+19:10 lit 1
172+19:12 lit 2
173+19:13 tight glyph )
174+20:1 DEDENT
175+20:1 DEDENT
176+20:1 NEWLINE
177+20:1 glyph ++
178+20:4 name recurse
179+20:12 glyph |=
180+20:15 name n
181+20:16 tight glyph =
182+20:17 tight tvar A
183+20:19 glyph (
184+20:20 tight name add
185+20:24 name n
186+20:26 glyph (
187+20:27 tight name recurse
188+20:35 name n
189+20:36 tight glyph )
190+20:37 tight glyph )
191+21:1 NEWLINE
192+21:1 glyph ++
193+21:4 name mutual-a
194+21:13 glyph |=
195+21:16 name n
196+21:17 tight glyph =
197+21:18 tight tvar A
198+21:20 glyph (
199+21:21 tight name add
200+21:25 name n
201+21:27 glyph (
202+21:28 tight name mutual-b
203+21:37 name n
204+21:38 tight glyph )
205+21:39 tight glyph )
206+22:1 NEWLINE
207+22:1 glyph ++
208+22:4 name mutual-b
209+22:13 glyph |=
210+22:16 name n
211+22:17 tight glyph =
212+22:18 tight tvar A
213+22:20 glyph (
214+22:21 tight name add
215+22:25 name n
216+22:27 glyph (
217+22:28 tight name mutual-a
218+22:37 name n
219+22:38 tight glyph )
220+22:39 tight glyph )
221+22:40 NEWLINE
tests/golden/types-arithmetic-scopes/tree.txtnew file+108
@@ -0,0 +1,108 @@
1+(module
2+ (value 1:1 inc
3+ (gate 1:8
4+ (face 1:11 n (tvar 1:13 A))
5+ (group 1:15
6+ (call 1:16 (wing 1:16 add) (wing 1:20 n) (lit 1:22 1)))))
7+ (value 2:1 inc-r
8+ (gate 2:10
9+ (face 2:13 n (tvar 2:15 A))
10+ (group 2:17
11+ (call 2:18 (wing 2:18 add) (lit 2:22 1) (wing 2:24 n)))))
12+ (value 3:1 text-case
13+ (cast 3:14
14+ (aura 3:17 @t)
15+ (group 3:20
16+ (call 3:21 (wing 3:21 inc) (str 3:25 "x")))))
17+ (value 4:1 ship-case
18+ (cast 4:14
19+ (aura 4:17 @p)
20+ (group 4:20
21+ (call 4:21 (wing 4:21 inc) (lit 4:25 ~zod)))))
22+ (value 5:1 shared-case
23+ (gate 5:16
24+ (cell 5:19
25+ (face 5:20 a (tvar 5:22 A))
26+ (face 5:24 b (tvar 5:26 A)))
27+ (group 5:29
28+ (call 5:30 (wing 5:30 add) (wing 5:34 a) (wing 5:36 b)))))
29+ (value 6:1 distinct
30+ (gate 6:13
31+ (cell 6:16
32+ (face 6:17 a (tvar 6:19 A))
33+ (face 6:21 b (tvar 6:23 B)))
34+ (group 6:26
35+ (call 6:27 (wing 6:27 add) (wing 6:31 a) (wing 6:33 b)))))
36+ (value 7:1 nested
37+ (gate 7:11
38+ (face 7:14 n (tvar 7:16 A))
39+ (gate 7:18
40+ (face 7:21 x (tvar 7:23 A))
41+ (group 7:25
42+ (call 7:26 (wing 7:26 add) (wing 7:30 n) (lit 7:32 1))))))
43+ (value 8:1 local-fresh
44+ (gate 8:16
45+ (face 8:19 outer (aura 8:25 @t))
46+ (body 9:3
47+ (value 9:3 inner
48+ (gate 9:12
49+ (face 9:15 n (tvar 9:17 A))
50+ (group 9:19
51+ (call 9:20 (wing 9:20 add) (wing 9:24 n) (lit 9:26 1)))))
52+ (tuple 10:3
53+ (group 10:4
54+ (call 10:5 (wing 10:5 inner) (str 10:11 "a")))
55+ (group 10:16
56+ (call 10:17 (wing 10:17 inner) (lit 10:23 ~zod)))))))
57+ (value 11:1 local-capture
58+ (gate 11:18
59+ (face 11:21 outer (tvar 11:27 A))
60+ (body 12:3
61+ (value 12:3 inner
62+ (gate 12:12
63+ (face 12:15 n (tvar 12:17 A))
64+ (group 12:19
65+ (call 12:20 (wing 12:20 add) (wing 12:24 outer) (lit 12:30 1)))))
66+ (group 13:3
67+ (call 13:4 (wing 13:4 inner) (wing 13:10 outer))))))
68+ (value 14:1 trace-tag
69+ (body 15:3
70+ (trace 15:3
71+ (lit 15:6 %dangling)
72+ (body 16:5
73+ (group 16:5
74+ (call 16:6 (wing 16:6 add) (lit 16:10 1) (lit 16:12 2)))))))
75+ (value 17:1 trace-number
76+ (body 18:3
77+ (trace 18:3
78+ (lit 18:6 4)
79+ (body 19:5
80+ (group 19:5
81+ (call 19:6 (wing 19:6 add) (lit 19:10 1) (lit 19:12 2)))))))
82+ (value 20:1 recurse
83+ (gate 20:12
84+ (face 20:15 n (tvar 20:17 A))
85+ (group 20:19
86+ (call 20:20
87+ (wing 20:20 add)
88+ (wing 20:24 n)
89+ (group 20:26
90+ (call 20:27 (wing 20:27 recurse) (wing 20:35 n)))))))
91+ (value 21:1 mutual-a
92+ (gate 21:13
93+ (face 21:16 n (tvar 21:18 A))
94+ (group 21:20
95+ (call 21:21
96+ (wing 21:21 add)
97+ (wing 21:25 n)
98+ (group 21:27
99+ (call 21:28 (wing 21:28 mutual-b) (wing 21:37 n)))))))
100+ (value 22:1 mutual-b
101+ (gate 22:13
102+ (face 22:16 n (tvar 22:18 A))
103+ (group 22:20
104+ (call 22:21
105+ (wing 22:21 add)
106+ (wing 22:25 n)
107+ (group 22:27
108+ (call 22:28 (wing 22:28 mutual-a) (wing 22:37 n))))))))
tests/golden/types-arithmetic-scopes/types.txtnew file+21
@@ -0,0 +1,21 @@
1+partial inference; module not checked
2+++ inc: $-(A A) where A is an atom other than ?
3+++ inc-r: $-(A A) where A is an atom other than ?
4+++ text-case: @t
5+++ ship-case: @p
6+++ shared-case: $-([a=A b=A] A) where A is an atom other than ?
7+++ distinct: distinct type variables `A` and `B` must not be forced equal; use the same capital for a shared type
8+/tests/golden/types-arithmetic-scopes/source.jibb:6:19: first type variable
9+++ distinct |= [a=A b=B] (add a b)
10+ ^
11+/tests/golden/types-arithmetic-scopes/source.jibb:6:23: second type variable
12+++ distinct |= [a=A b=B] (add a b)
13+ ^
14+++ nested: $-(A $-(A A)) where A is an atom other than ?
15+++ local-fresh: $-(@t [@t @p])
16+++ local-capture: explicit capital constraints are not supported by partial inference
17+++ trace-tag: tag needs context in partial inference
18+++ trace-number: @ud
19+++ recurse: $-(A A) where A is an atom other than ?
20+++ mutual-a: $-(A A) where A is an atom other than ?
21+++ mutual-b: $-(A A) where A is an atom other than ?
tests/golden/types-cell-branch-context/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Branching and Molds — branch arms share the expected result type; unresolved tags need context; written record faces remain part of values.
2+tests: Closed cell result context flows into bounded loobean branches. The checker preserves previously inferred cases and faces, leaves wrong or inconsistent fields, unresolved tags, and open generic context unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-cell-branch-context/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the actual source-backed prelude.
tests/golden/types-cell-branch-context/source.jibbnew file+37
@@ -0,0 +1,37 @@
1+++ choose |= flag=?
2+ ^- [@t (unit @t)] ?- flag
3+ %.y ["yes" ~]
4+ %.n ["no" ~]
5+++ bad |= flag=?
6+ ^- [@t (unit @t)] ?- flag
7+ %.y ["yes" ~]
8+ %.n [~zod ~]
9+++ pending |= flag=?
10+ ^- [@t (unit @t)] ?- flag
11+ %.y ["yes" ~]
12+ %.n [%waiting ~]
13+++ already |= flag=?
14+ ^- [@t @t] ?- flag
15+ %.y ["yes" "a"]
16+ %.n ["no" "b"]
17++$ rec [name=@t place=(unit @t)]
18+++ named |= flag=?
19+ ^- rec ?- flag
20+ %.y [name="yes" place=~]
21+ %.n [name="no" place=~]
22+++ wrong |= flag=?
23+ ^- rec ?- flag
24+ %.y [name="yes" place=~]
25+ %.n [other="no" place=~]
26+++ different |= flag=?
27+ ^- rec ?- flag
28+ %.y [name="yes" place=~]
29+ %.n ["no" ~]
30+++ open |= [flag=? value=A]
31+ ^- [A (unit A)] ?- flag
32+ %.y [value ~]
33+ %.n [value ~]
34+++ waiting |= flag=?
35+ ^- rec ?- flag
36+ %.y [name="yes" place=~]
37+ %.n [name=%waiting place=~]
tests/golden/types-cell-branch-context/tokens.txtnew file+308
@@ -0,0 +1,308 @@
1+1:1 glyph ++
2+1:4 name choose
3+1:11 glyph |=
4+1:14 name flag
5+1:18 tight glyph =
6+1:19 tight glyph ?
7+2:3 INDENT
8+2:3 glyph ^-
9+2:6 glyph [
10+2:7 tight aura @t
11+2:10 glyph (
12+2:11 tight name unit
13+2:16 aura @t
14+2:18 tight glyph )
15+2:19 tight glyph ]
16+2:21 glyph ?-
17+2:24 name flag
18+3:5 INDENT
19+3:5 lit %.y
20+3:9 glyph [
21+3:10 tight str "yes"
22+3:16 lit ~
23+3:17 tight glyph ]
24+4:5 NEWLINE
25+4:5 lit %.n
26+4:9 glyph [
27+4:10 tight str "no"
28+4:15 lit ~
29+4:16 tight glyph ]
30+5:1 DEDENT
31+5:1 DEDENT
32+5:1 NEWLINE
33+5:1 glyph ++
34+5:4 name bad
35+5:8 glyph |=
36+5:11 name flag
37+5:15 tight glyph =
38+5:16 tight glyph ?
39+6:3 INDENT
40+6:3 glyph ^-
41+6:6 glyph [
42+6:7 tight aura @t
43+6:10 glyph (
44+6:11 tight name unit
45+6:16 aura @t
46+6:18 tight glyph )
47+6:19 tight glyph ]
48+6:21 glyph ?-
49+6:24 name flag
50+7:5 INDENT
51+7:5 lit %.y
52+7:9 glyph [
53+7:10 tight str "yes"
54+7:16 lit ~
55+7:17 tight glyph ]
56+8:5 NEWLINE
57+8:5 lit %.n
58+8:9 glyph [
59+8:10 tight lit ~zod
60+8:15 lit ~
61+8:16 tight glyph ]
62+9:1 DEDENT
63+9:1 DEDENT
64+9:1 NEWLINE
65+9:1 glyph ++
66+9:4 name pending
67+9:12 glyph |=
68+9:15 name flag
69+9:19 tight glyph =
70+9:20 tight glyph ?
71+10:3 INDENT
72+10:3 glyph ^-
73+10:6 glyph [
74+10:7 tight aura @t
75+10:10 glyph (
76+10:11 tight name unit
77+10:16 aura @t
78+10:18 tight glyph )
79+10:19 tight glyph ]
80+10:21 glyph ?-
81+10:24 name flag
82+11:5 INDENT
83+11:5 lit %.y
84+11:9 glyph [
85+11:10 tight str "yes"
86+11:16 lit ~
87+11:17 tight glyph ]
88+12:5 NEWLINE
89+12:5 lit %.n
90+12:9 glyph [
91+12:10 tight lit %waiting
92+12:19 lit ~
93+12:20 tight glyph ]
94+13:1 DEDENT
95+13:1 DEDENT
96+13:1 NEWLINE
97+13:1 glyph ++
98+13:4 name already
99+13:12 glyph |=
100+13:15 name flag
101+13:19 tight glyph =
102+13:20 tight glyph ?
103+14:3 INDENT
104+14:3 glyph ^-
105+14:6 glyph [
106+14:7 tight aura @t
107+14:10 aura @t
108+14:12 tight glyph ]
109+14:14 glyph ?-
110+14:17 name flag
111+15:5 INDENT
112+15:5 lit %.y
113+15:9 glyph [
114+15:10 tight str "yes"
115+15:16 str "a"
116+15:19 tight glyph ]
117+16:5 NEWLINE
118+16:5 lit %.n
119+16:9 glyph [
120+16:10 tight str "no"
121+16:15 str "b"
122+16:18 tight glyph ]
123+17:1 DEDENT
124+17:1 DEDENT
125+17:1 NEWLINE
126+17:1 glyph +$
127+17:4 name rec
128+17:8 glyph [
129+17:9 tight name name
130+17:13 tight glyph =
131+17:14 tight aura @t
132+17:17 name place
133+17:22 tight glyph =
134+17:23 tight glyph (
135+17:24 tight name unit
136+17:29 aura @t
137+17:31 tight glyph )
138+17:32 tight glyph ]
139+18:1 NEWLINE
140+18:1 glyph ++
141+18:4 name named
142+18:10 glyph |=
143+18:13 name flag
144+18:17 tight glyph =
145+18:18 tight glyph ?
146+19:3 INDENT
147+19:3 glyph ^-
148+19:6 name rec
149+19:10 glyph ?-
150+19:13 name flag
151+20:5 INDENT
152+20:5 lit %.y
153+20:9 glyph [
154+20:10 tight name name
155+20:14 tight glyph =
156+20:15 tight str "yes"
157+20:21 name place
158+20:26 tight glyph =
159+20:27 tight lit ~
160+20:28 tight glyph ]
161+21:5 NEWLINE
162+21:5 lit %.n
163+21:9 glyph [
164+21:10 tight name name
165+21:14 tight glyph =
166+21:15 tight str "no"
167+21:20 name place
168+21:25 tight glyph =
169+21:26 tight lit ~
170+21:27 tight glyph ]
171+22:1 DEDENT
172+22:1 DEDENT
173+22:1 NEWLINE
174+22:1 glyph ++
175+22:4 name wrong
176+22:10 glyph |=
177+22:13 name flag
178+22:17 tight glyph =
179+22:18 tight glyph ?
180+23:3 INDENT
181+23:3 glyph ^-
182+23:6 name rec
183+23:10 glyph ?-
184+23:13 name flag
185+24:5 INDENT
186+24:5 lit %.y
187+24:9 glyph [
188+24:10 tight name name
189+24:14 tight glyph =
190+24:15 tight str "yes"
191+24:21 name place
192+24:26 tight glyph =
193+24:27 tight lit ~
194+24:28 tight glyph ]
195+25:5 NEWLINE
196+25:5 lit %.n
197+25:9 glyph [
198+25:10 tight name other
199+25:15 tight glyph =
200+25:16 tight str "no"
201+25:21 name place
202+25:26 tight glyph =
203+25:27 tight lit ~
204+25:28 tight glyph ]
205+26:1 DEDENT
206+26:1 DEDENT
207+26:1 NEWLINE
208+26:1 glyph ++
209+26:4 name different
210+26:14 glyph |=
211+26:17 name flag
212+26:21 tight glyph =
213+26:22 tight glyph ?
214+27:3 INDENT
215+27:3 glyph ^-
216+27:6 name rec
217+27:10 glyph ?-
218+27:13 name flag
219+28:5 INDENT
220+28:5 lit %.y
221+28:9 glyph [
222+28:10 tight name name
223+28:14 tight glyph =
224+28:15 tight str "yes"
225+28:21 name place
226+28:26 tight glyph =
227+28:27 tight lit ~
228+28:28 tight glyph ]
229+29:5 NEWLINE
230+29:5 lit %.n
231+29:9 glyph [
232+29:10 tight str "no"
233+29:15 lit ~
234+29:16 tight glyph ]
235+30:1 DEDENT
236+30:1 DEDENT
237+30:1 NEWLINE
238+30:1 glyph ++
239+30:4 name open
240+30:9 glyph |=
241+30:12 glyph [
242+30:13 tight name flag
243+30:17 tight glyph =
244+30:18 tight glyph ?
245+30:20 name value
246+30:25 tight glyph =
247+30:26 tight tvar A
248+30:27 tight glyph ]
249+31:3 INDENT
250+31:3 glyph ^-
251+31:6 glyph [
252+31:7 tight tvar A
253+31:9 glyph (
254+31:10 tight name unit
255+31:15 tvar A
256+31:16 tight glyph )
257+31:17 tight glyph ]
258+31:19 glyph ?-
259+31:22 name flag
260+32:5 INDENT
261+32:5 lit %.y
262+32:9 glyph [
263+32:10 tight name value
264+32:16 lit ~
265+32:17 tight glyph ]
266+33:5 NEWLINE
267+33:5 lit %.n
268+33:9 glyph [
269+33:10 tight name value
270+33:16 lit ~
271+33:17 tight glyph ]
272+34:1 DEDENT
273+34:1 DEDENT
274+34:1 NEWLINE
275+34:1 glyph ++
276+34:4 name waiting
277+34:12 glyph |=
278+34:15 name flag
279+34:19 tight glyph =
280+34:20 tight glyph ?
281+35:3 INDENT
282+35:3 glyph ^-
283+35:6 name rec
284+35:10 glyph ?-
285+35:13 name flag
286+36:5 INDENT
287+36:5 lit %.y
288+36:9 glyph [
289+36:10 tight name name
290+36:14 tight glyph =
291+36:15 tight str "yes"
292+36:21 name place
293+36:26 tight glyph =
294+36:27 tight lit ~
295+36:28 tight glyph ]
296+37:5 NEWLINE
297+37:5 lit %.n
298+37:9 glyph [
299+37:10 tight name name
300+37:14 tight glyph =
301+37:15 tight lit %waiting
302+37:24 name place
303+37:29 tight glyph =
304+37:30 tight lit ~
305+37:31 tight glyph ]
306+37:32 DEDENT
307+37:32 DEDENT
308+37:32 NEWLINE
tests/golden/types-cell-branch-context/tree.txtnew file+156
@@ -0,0 +1,156 @@
1+(module
2+ (value 1:1 choose
3+ (gate 1:11
4+ (face 1:14 flag (flag 1:19))
5+ (body 2:3
6+ (cast 2:3
7+ (cell 2:6
8+ (aura 2:7 @t)
9+ (apply 2:10 unit (aura 2:16 @t)))
10+ (branch 2:21
11+ (wing 2:24 flag)
12+ (arm 3:5
13+ (lit 3:5 %.y)
14+ (tuple 3:9 (str 3:10 "yes") (lit 3:16 ~)))
15+ (arm 4:5
16+ (lit 4:5 %.n)
17+ (tuple 4:9 (str 4:10 "no") (lit 4:15 ~))))))))
18+ (value 5:1 bad
19+ (gate 5:8
20+ (face 5:11 flag (flag 5:16))
21+ (body 6:3
22+ (cast 6:3
23+ (cell 6:6
24+ (aura 6:7 @t)
25+ (apply 6:10 unit (aura 6:16 @t)))
26+ (branch 6:21
27+ (wing 6:24 flag)
28+ (arm 7:5
29+ (lit 7:5 %.y)
30+ (tuple 7:9 (str 7:10 "yes") (lit 7:16 ~)))
31+ (arm 8:5
32+ (lit 8:5 %.n)
33+ (tuple 8:9 (lit 8:10 ~zod) (lit 8:15 ~))))))))
34+ (value 9:1 pending
35+ (gate 9:12
36+ (face 9:15 flag (flag 9:20))
37+ (body 10:3
38+ (cast 10:3
39+ (cell 10:6
40+ (aura 10:7 @t)
41+ (apply 10:10 unit (aura 10:16 @t)))
42+ (branch 10:21
43+ (wing 10:24 flag)
44+ (arm 11:5
45+ (lit 11:5 %.y)
46+ (tuple 11:9 (str 11:10 "yes") (lit 11:16 ~)))
47+ (arm 12:5
48+ (lit 12:5 %.n)
49+ (tuple 12:9 (lit 12:10 %waiting) (lit 12:19 ~))))))))
50+ (value 13:1 already
51+ (gate 13:12
52+ (face 13:15 flag (flag 13:20))
53+ (body 14:3
54+ (cast 14:3
55+ (cell 14:6 (aura 14:7 @t) (aura 14:10 @t))
56+ (branch 14:14
57+ (wing 14:17 flag)
58+ (arm 15:5
59+ (lit 15:5 %.y)
60+ (tuple 15:9 (str 15:10 "yes") (str 15:16 "a")))
61+ (arm 16:5
62+ (lit 16:5 %.n)
63+ (tuple 16:9 (str 16:10 "no") (str 16:15 "b"))))))))
64+ (mold 17:1 rec
65+ (cell 17:8
66+ (face 17:9 name (aura 17:14 @t))
67+ (face 17:17 place
68+ (apply 17:23 unit (aura 17:29 @t)))))
69+ (value 18:1 named
70+ (gate 18:10
71+ (face 18:13 flag (flag 18:18))
72+ (body 19:3
73+ (cast 19:3
74+ (ref 19:6 rec)
75+ (branch 19:10
76+ (wing 19:13 flag)
77+ (arm 20:5
78+ (lit 20:5 %.y)
79+ (tuple 20:9
80+ (face 20:10 name (str 20:15 "yes"))
81+ (face 20:21 place (lit 20:27 ~))))
82+ (arm 21:5
83+ (lit 21:5 %.n)
84+ (tuple 21:9
85+ (face 21:10 name (str 21:15 "no"))
86+ (face 21:20 place (lit 21:26 ~)))))))))
87+ (value 22:1 wrong
88+ (gate 22:10
89+ (face 22:13 flag (flag 22:18))
90+ (body 23:3
91+ (cast 23:3
92+ (ref 23:6 rec)
93+ (branch 23:10
94+ (wing 23:13 flag)
95+ (arm 24:5
96+ (lit 24:5 %.y)
97+ (tuple 24:9
98+ (face 24:10 name (str 24:15 "yes"))
99+ (face 24:21 place (lit 24:27 ~))))
100+ (arm 25:5
101+ (lit 25:5 %.n)
102+ (tuple 25:9
103+ (face 25:10 other (str 25:16 "no"))
104+ (face 25:21 place (lit 25:27 ~)))))))))
105+ (value 26:1 different
106+ (gate 26:14
107+ (face 26:17 flag (flag 26:22))
108+ (body 27:3
109+ (cast 27:3
110+ (ref 27:6 rec)
111+ (branch 27:10
112+ (wing 27:13 flag)
113+ (arm 28:5
114+ (lit 28:5 %.y)
115+ (tuple 28:9
116+ (face 28:10 name (str 28:15 "yes"))
117+ (face 28:21 place (lit 28:27 ~))))
118+ (arm 29:5
119+ (lit 29:5 %.n)
120+ (tuple 29:9 (str 29:10 "no") (lit 29:15 ~))))))))
121+ (value 30:1 open
122+ (gate 30:9
123+ (cell 30:12
124+ (face 30:13 flag (flag 30:18))
125+ (face 30:20 value (tvar 30:26 A)))
126+ (body 31:3
127+ (cast 31:3
128+ (cell 31:6
129+ (tvar 31:7 A)
130+ (apply 31:9 unit (tvar 31:15 A)))
131+ (branch 31:19
132+ (wing 31:22 flag)
133+ (arm 32:5
134+ (lit 32:5 %.y)
135+ (tuple 32:9 (wing 32:10 value) (lit 32:16 ~)))
136+ (arm 33:5
137+ (lit 33:5 %.n)
138+ (tuple 33:9 (wing 33:10 value) (lit 33:16 ~))))))))
139+ (value 34:1 waiting
140+ (gate 34:12
141+ (face 34:15 flag (flag 34:20))
142+ (body 35:3
143+ (cast 35:3
144+ (ref 35:6 rec)
145+ (branch 35:10
146+ (wing 35:13 flag)
147+ (arm 36:5
148+ (lit 36:5 %.y)
149+ (tuple 36:9
150+ (face 36:10 name (str 36:15 "yes"))
151+ (face 36:21 place (lit 36:27 ~))))
152+ (arm 37:5
153+ (lit 37:5 %.n)
154+ (tuple 37:9
155+ (face 37:10 name (lit 37:15 %waiting))
156+ (face 37:24 place (lit 37:30 ~))))))))))
tests/golden/types-cell-branch-context/types.txtnew file+11
@@ -0,0 +1,11 @@
1+partial inference; module not checked
2+++ choose: $-(? [@t (unit @t)])
3+++ bad: branch tag or union context is not supported by partial inference
4+++ pending: branch tag or union context is not supported by partial inference
5+++ already: $-(? [@t @t])
6++$ rec: not checked
7+++ named: $-(? [name=@t place=(unit @t)])
8+++ wrong: branch tag or union context is not supported by partial inference
9+++ different: branch tag or union context is not supported by partial inference
10+++ open: branch widening is not supported by partial inference
11+++ waiting: branch tag or union context is not supported by partial inference
tests/golden/types-cell-pattern-many/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Patterns: a name binds anew and the last position of a cell pattern binds the rest; Modules: no name may shadow one already in scope.
2+tests: A complete single-arm cell pattern of binders follows the right-nested cell spine, preserving polymorphism and the final tail. Duplicate or shadowed binders and definite non-cell subjects fail; uncertain union/collection spines and other patterns stay unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-cell-pattern-many/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the prepared prelude.
tests/golden/types-cell-pattern-many/source.jibbnew file+41
@@ -0,0 +1,41 @@
1+++ three |= args=[@t @p ?]
2+ ?- args
3+ [a b c] c
4+++ four |= args=[@t @p ? @ux]
5+ ?- args
6+ [a b c d] d
7+++ rest |= args=[@t @p [? @ux]]
8+ ?- args
9+ [a b c] c
10+++ infer |= x
11+ ?- x
12+ [a b c] [c b a]
13+++ duplicate |= args=[@t @p ?]
14+ ?- args
15+ [a b a] a
16+++ shadow |= args=[@t @p ?]
17+ ?- args
18+ [args b c] b
19+++ prelude-shadow |= args=[@t @p ?]
20+ ?- args
21+ [a not c] c
22+++ atom |= args=@t
23+ ?- args
24+ [a b c] a
25+++ too-many |= args=[@t @p]
26+ ?- args
27+ [a b c] a
28+++ record |= args=[a=@t b=@p c=?]
29+ ?- args
30+ [a b c] a
31+++ nested |= args=[@t [@p ?] @ux]
32+ ?- args
33+ [a [b c] d] d
34+++ wildcard |= args=[@t @p ?]
35+ ?- args
36+ [a * c] c
37+++ pending |= args=[@t @p ?]
38+ ?- args
39+ [a b c]
40+ ~& %unused
41+ c
tests/golden/types-cell-pattern-many/tokens.txtnew file+315
@@ -0,0 +1,315 @@
1+1:1 glyph ++
2+1:4 name three
3+1:10 glyph |=
4+1:13 name args
5+1:17 tight glyph =
6+1:18 tight glyph [
7+1:19 tight aura @t
8+1:22 aura @p
9+1:25 glyph ?
10+1:26 tight glyph ]
11+2:3 INDENT
12+2:3 glyph ?-
13+2:6 name args
14+3:5 INDENT
15+3:5 glyph [
16+3:6 tight name a
17+3:8 name b
18+3:10 name c
19+3:11 tight glyph ]
20+3:13 name c
21+4:1 DEDENT
22+4:1 DEDENT
23+4:1 NEWLINE
24+4:1 glyph ++
25+4:4 name four
26+4:9 glyph |=
27+4:12 name args
28+4:16 tight glyph =
29+4:17 tight glyph [
30+4:18 tight aura @t
31+4:21 aura @p
32+4:24 glyph ?
33+4:26 aura @ux
34+4:29 tight glyph ]
35+5:3 INDENT
36+5:3 glyph ?-
37+5:6 name args
38+6:5 INDENT
39+6:5 glyph [
40+6:6 tight name a
41+6:8 name b
42+6:10 name c
43+6:12 name d
44+6:13 tight glyph ]
45+6:15 name d
46+7:1 DEDENT
47+7:1 DEDENT
48+7:1 NEWLINE
49+7:1 glyph ++
50+7:4 name rest
51+7:9 glyph |=
52+7:12 name args
53+7:16 tight glyph =
54+7:17 tight glyph [
55+7:18 tight aura @t
56+7:21 aura @p
57+7:24 glyph [
58+7:25 tight glyph ?
59+7:27 aura @ux
60+7:30 tight glyph ]
61+7:31 tight glyph ]
62+8:3 INDENT
63+8:3 glyph ?-
64+8:6 name args
65+9:5 INDENT
66+9:5 glyph [
67+9:6 tight name a
68+9:8 name b
69+9:10 name c
70+9:11 tight glyph ]
71+9:13 name c
72+10:1 DEDENT
73+10:1 DEDENT
74+10:1 NEWLINE
75+10:1 glyph ++
76+10:4 name infer
77+10:10 glyph |=
78+10:13 name x
79+11:3 INDENT
80+11:3 glyph ?-
81+11:6 name x
82+12:5 INDENT
83+12:5 glyph [
84+12:6 tight name a
85+12:8 name b
86+12:10 name c
87+12:11 tight glyph ]
88+12:13 glyph [
89+12:14 tight name c
90+12:16 name b
91+12:18 name a
92+12:19 tight glyph ]
93+13:1 DEDENT
94+13:1 DEDENT
95+13:1 NEWLINE
96+13:1 glyph ++
97+13:4 name duplicate
98+13:14 glyph |=
99+13:17 name args
100+13:21 tight glyph =
101+13:22 tight glyph [
102+13:23 tight aura @t
103+13:26 aura @p
104+13:29 glyph ?
105+13:30 tight glyph ]
106+14:3 INDENT
107+14:3 glyph ?-
108+14:6 name args
109+15:5 INDENT
110+15:5 glyph [
111+15:6 tight name a
112+15:8 name b
113+15:10 name a
114+15:11 tight glyph ]
115+15:13 name a
116+16:1 DEDENT
117+16:1 DEDENT
118+16:1 NEWLINE
119+16:1 glyph ++
120+16:4 name shadow
121+16:11 glyph |=
122+16:14 name args
123+16:18 tight glyph =
124+16:19 tight glyph [
125+16:20 tight aura @t
126+16:23 aura @p
127+16:26 glyph ?
128+16:27 tight glyph ]
129+17:3 INDENT
130+17:3 glyph ?-
131+17:6 name args
132+18:5 INDENT
133+18:5 glyph [
134+18:6 tight name args
135+18:11 name b
136+18:13 name c
137+18:14 tight glyph ]
138+18:16 name b
139+19:1 DEDENT
140+19:1 DEDENT
141+19:1 NEWLINE
142+19:1 glyph ++
143+19:4 name prelude-shadow
144+19:19 glyph |=
145+19:22 name args
146+19:26 tight glyph =
147+19:27 tight glyph [
148+19:28 tight aura @t
149+19:31 aura @p
150+19:34 glyph ?
151+19:35 tight glyph ]
152+20:3 INDENT
153+20:3 glyph ?-
154+20:6 name args
155+21:5 INDENT
156+21:5 glyph [
157+21:6 tight name a
158+21:8 name not
159+21:12 name c
160+21:13 tight glyph ]
161+21:15 name c
162+22:1 DEDENT
163+22:1 DEDENT
164+22:1 NEWLINE
165+22:1 glyph ++
166+22:4 name atom
167+22:9 glyph |=
168+22:12 name args
169+22:16 tight glyph =
170+22:17 tight aura @t
171+23:3 INDENT
172+23:3 glyph ?-
173+23:6 name args
174+24:5 INDENT
175+24:5 glyph [
176+24:6 tight name a
177+24:8 name b
178+24:10 name c
179+24:11 tight glyph ]
180+24:13 name a
181+25:1 DEDENT
182+25:1 DEDENT
183+25:1 NEWLINE
184+25:1 glyph ++
185+25:4 name too-many
186+25:13 glyph |=
187+25:16 name args
188+25:20 tight glyph =
189+25:21 tight glyph [
190+25:22 tight aura @t
191+25:25 aura @p
192+25:27 tight glyph ]
193+26:3 INDENT
194+26:3 glyph ?-
195+26:6 name args
196+27:5 INDENT
197+27:5 glyph [
198+27:6 tight name a
199+27:8 name b
200+27:10 name c
201+27:11 tight glyph ]
202+27:13 name a
203+28:1 DEDENT
204+28:1 DEDENT
205+28:1 NEWLINE
206+28:1 glyph ++
207+28:4 name record
208+28:11 glyph |=
209+28:14 name args
210+28:18 tight glyph =
211+28:19 tight glyph [
212+28:20 tight name a
213+28:21 tight glyph =
214+28:22 tight aura @t
215+28:25 name b
216+28:26 tight glyph =
217+28:27 tight aura @p
218+28:30 name c
219+28:31 tight glyph =
220+28:32 tight glyph ?
221+28:33 tight glyph ]
222+29:3 INDENT
223+29:3 glyph ?-
224+29:6 name args
225+30:5 INDENT
226+30:5 glyph [
227+30:6 tight name a
228+30:8 name b
229+30:10 name c
230+30:11 tight glyph ]
231+30:13 name a
232+31:1 DEDENT
233+31:1 DEDENT
234+31:1 NEWLINE
235+31:1 glyph ++
236+31:4 name nested
237+31:11 glyph |=
238+31:14 name args
239+31:18 tight glyph =
240+31:19 tight glyph [
241+31:20 tight aura @t
242+31:23 glyph [
243+31:24 tight aura @p
244+31:27 glyph ?
245+31:28 tight glyph ]
246+31:30 aura @ux
247+31:33 tight glyph ]
248+32:3 INDENT
249+32:3 glyph ?-
250+32:6 name args
251+33:5 INDENT
252+33:5 glyph [
253+33:6 tight name a
254+33:8 glyph [
255+33:9 tight name b
256+33:11 name c
257+33:12 tight glyph ]
258+33:14 name d
259+33:15 tight glyph ]
260+33:17 name d
261+34:1 DEDENT
262+34:1 DEDENT
263+34:1 NEWLINE
264+34:1 glyph ++
265+34:4 name wildcard
266+34:13 glyph |=
267+34:16 name args
268+34:20 tight glyph =
269+34:21 tight glyph [
270+34:22 tight aura @t
271+34:25 aura @p
272+34:28 glyph ?
273+34:29 tight glyph ]
274+35:3 INDENT
275+35:3 glyph ?-
276+35:6 name args
277+36:5 INDENT
278+36:5 glyph [
279+36:6 tight name a
280+36:8 glyph *
281+36:10 name c
282+36:11 tight glyph ]
283+36:13 name c
284+37:1 DEDENT
285+37:1 DEDENT
286+37:1 NEWLINE
287+37:1 glyph ++
288+37:4 name pending
289+37:12 glyph |=
290+37:15 name args
291+37:19 tight glyph =
292+37:20 tight glyph [
293+37:21 tight aura @t
294+37:24 aura @p
295+37:27 glyph ?
296+37:28 tight glyph ]
297+38:3 INDENT
298+38:3 glyph ?-
299+38:6 name args
300+39:5 INDENT
301+39:5 glyph [
302+39:6 tight name a
303+39:8 name b
304+39:10 name c
305+39:11 tight glyph ]
306+40:7 INDENT
307+40:7 glyph ~&
308+40:10 lit %unused
309+41:9 INDENT
310+41:9 name c
311+41:10 DEDENT
312+41:10 DEDENT
313+41:10 DEDENT
314+41:10 DEDENT
315+41:10 NEWLINE
tests/golden/types-cell-pattern-many/tree.txtnew file+144
@@ -0,0 +1,144 @@
1+(module
2+ (value 1:1 three
3+ (gate 1:10
4+ (face 1:13 args
5+ (cell 1:18 (aura 1:19 @t) (aura 1:22 @p) (flag 1:25)))
6+ (body 2:3
7+ (branch 2:3
8+ (wing 2:6 args)
9+ (arm 3:5
10+ (cell 3:5 (bind 3:6 a) (bind 3:8 b) (bind 3:10 c))
11+ (wing 3:13 c))))))
12+ (value 4:1 four
13+ (gate 4:9
14+ (face 4:12 args
15+ (cell 4:17 (aura 4:18 @t) (aura 4:21 @p) (flag 4:24) (aura 4:26 @ux)))
16+ (body 5:3
17+ (branch 5:3
18+ (wing 5:6 args)
19+ (arm 6:5
20+ (cell 6:5 (bind 6:6 a) (bind 6:8 b) (bind 6:10 c) (bind 6:12 d))
21+ (wing 6:15 d))))))
22+ (value 7:1 rest
23+ (gate 7:9
24+ (face 7:12 args
25+ (cell 7:17
26+ (aura 7:18 @t)
27+ (aura 7:21 @p)
28+ (cell 7:24 (flag 7:25) (aura 7:27 @ux))))
29+ (body 8:3
30+ (branch 8:3
31+ (wing 8:6 args)
32+ (arm 9:5
33+ (cell 9:5 (bind 9:6 a) (bind 9:8 b) (bind 9:10 c))
34+ (wing 9:13 c))))))
35+ (value 10:1 infer
36+ (gate 10:10
37+ (bind 10:13 x)
38+ (body 11:3
39+ (branch 11:3
40+ (wing 11:6 x)
41+ (arm 12:5
42+ (cell 12:5 (bind 12:6 a) (bind 12:8 b) (bind 12:10 c))
43+ (tuple 12:13 (wing 12:14 c) (wing 12:16 b) (wing 12:18 a)))))))
44+ (value 13:1 duplicate
45+ (gate 13:14
46+ (face 13:17 args
47+ (cell 13:22 (aura 13:23 @t) (aura 13:26 @p) (flag 13:29)))
48+ (body 14:3
49+ (branch 14:3
50+ (wing 14:6 args)
51+ (arm 15:5
52+ (cell 15:5 (bind 15:6 a) (bind 15:8 b) (bind 15:10 a))
53+ (wing 15:13 a))))))
54+ (value 16:1 shadow
55+ (gate 16:11
56+ (face 16:14 args
57+ (cell 16:19 (aura 16:20 @t) (aura 16:23 @p) (flag 16:26)))
58+ (body 17:3
59+ (branch 17:3
60+ (wing 17:6 args)
61+ (arm 18:5
62+ (cell 18:5 (bind 18:6 args) (bind 18:11 b) (bind 18:13 c))
63+ (wing 18:16 b))))))
64+ (value 19:1 prelude-shadow
65+ (gate 19:19
66+ (face 19:22 args
67+ (cell 19:27 (aura 19:28 @t) (aura 19:31 @p) (flag 19:34)))
68+ (body 20:3
69+ (branch 20:3
70+ (wing 20:6 args)
71+ (arm 21:5
72+ (cell 21:5 (bind 21:6 a) (bind 21:8 not) (bind 21:12 c))
73+ (wing 21:15 c))))))
74+ (value 22:1 atom
75+ (gate 22:9
76+ (face 22:12 args (aura 22:17 @t))
77+ (body 23:3
78+ (branch 23:3
79+ (wing 23:6 args)
80+ (arm 24:5
81+ (cell 24:5 (bind 24:6 a) (bind 24:8 b) (bind 24:10 c))
82+ (wing 24:13 a))))))
83+ (value 25:1 too-many
84+ (gate 25:13
85+ (face 25:16 args
86+ (cell 25:21 (aura 25:22 @t) (aura 25:25 @p)))
87+ (body 26:3
88+ (branch 26:3
89+ (wing 26:6 args)
90+ (arm 27:5
91+ (cell 27:5 (bind 27:6 a) (bind 27:8 b) (bind 27:10 c))
92+ (wing 27:13 a))))))
93+ (value 28:1 record
94+ (gate 28:11
95+ (face 28:14 args
96+ (cell 28:19
97+ (face 28:20 a (aura 28:22 @t))
98+ (face 28:25 b (aura 28:27 @p))
99+ (face 28:30 c (flag 28:32))))
100+ (body 29:3
101+ (branch 29:3
102+ (wing 29:6 args)
103+ (arm 30:5
104+ (cell 30:5 (bind 30:6 a) (bind 30:8 b) (bind 30:10 c))
105+ (wing 30:13 a))))))
106+ (value 31:1 nested
107+ (gate 31:11
108+ (face 31:14 args
109+ (cell 31:19
110+ (aura 31:20 @t)
111+ (cell 31:23 (aura 31:24 @p) (flag 31:27))
112+ (aura 31:30 @ux)))
113+ (body 32:3
114+ (branch 32:3
115+ (wing 32:6 args)
116+ (arm 33:5
117+ (cell 33:5
118+ (bind 33:6 a)
119+ (cell 33:8 (bind 33:9 b) (bind 33:11 c))
120+ (bind 33:14 d))
121+ (wing 33:17 d))))))
122+ (value 34:1 wildcard
123+ (gate 34:13
124+ (face 34:16 args
125+ (cell 34:21 (aura 34:22 @t) (aura 34:25 @p) (flag 34:28)))
126+ (body 35:3
127+ (branch 35:3
128+ (wing 35:6 args)
129+ (arm 36:5
130+ (cell 36:5 (bind 36:6 a) (any 36:8) (bind 36:10 c))
131+ (wing 36:13 c))))))
132+ (value 37:1 pending
133+ (gate 37:12
134+ (face 37:15 args
135+ (cell 37:20 (aura 37:21 @t) (aura 37:24 @p) (flag 37:27)))
136+ (body 38:3
137+ (branch 38:3
138+ (wing 38:6 args)
139+ (arm 39:5
140+ (cell 39:5 (bind 39:6 a) (bind 39:8 b) (bind 39:10 c))
141+ (body 40:7
142+ (trace 40:7
143+ (lit 40:10 %unused)
144+ (body 41:9 (wing 41:9 c))))))))))
tests/golden/types-cell-pattern-many/types.txtnew file+14
@@ -0,0 +1,14 @@
1+partial inference; module not checked
2+++ three: $-([@t [@p ?]] ?)
3+++ four: $-([@t [@p [? @ux]]] @ux)
4+++ rest: $-([@t [@p [? @ux]]] [? @ux])
5+++ infer: $-([A [B C]] [C [B A]])
6+++ duplicate: pattern shadows a name
7+++ shadow: pattern shadows a name
8+++ prelude-shadow: pattern shadows a name
9+++ atom: cell pattern does not match the subject type
10+++ too-many: cell pattern does not match the subject type
11+++ record: record patterns are not supported by partial inference
12+++ nested: $-([@t [[@p ?] @ux]] @ux)
13+++ wildcard: $-([@t [@p ?]] ?)
14+++ pending: tag needs context in partial inference
tests/golden/types-cell-pattern-schemes/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Patterns: a name binds anew and the last position of a cell pattern binds the rest; Modules: no name may shadow one already in scope.
2+tests: A complete single-arm cell pattern of binders follows the right-nested cell spine, preserving polymorphism and the final tail. Duplicate or shadowed binders and definite non-cell subjects fail; uncertain union/collection spines and other patterns stay unsupported.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-cell-pattern-schemes/modules.txtnew file+1
@@ -0,0 +1 @@
1+# Use the prepared prelude.
tests/golden/types-cell-pattern-schemes/source.jibbnew file+23
@@ -0,0 +1,23 @@
1++$ union
2+ [%go @t @p]
3+ %stop
4+++ maybe-union |= x=union
5+ ?- x
6+ [a b c] a
7+++ maybe-list |= x=(list @t)
8+ ?- x
9+ [a b c] a
10+++ identity |= x
11+ ?- x
12+ [a b c] [a b c]
13+++ text (identity "hi" ~zod %.y)
14+++ ship (identity ~zod "hi" %.n)
15+++ shared |= x=[A A A]
16+ ?- x
17+ [a b c] [a b c]
18+++ wrong (shared "hi" ~zod "ok")
19+++ local-shadow |= outer=@t
20+ ++ local |= x=[@t @p ?]
21+ ?- x
22+ [a outer c] c
23+ (local ["x" ~zod %.n])
tests/golden/types-cell-pattern-schemes/tokens.txtnew file+168

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/tree.txtnew file+70

This diff is too big to show here.

tests/golden/types-cell-pattern-schemes/types.txtnew file+16

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/tokens.txtnew file+126

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-cell-pattern-tail/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-constructor-context/about.txtnew file+1

This diff is too big to show here.

tests/golden/types-constructor-context/source.jibbnew file+37

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-constructor-context/tree.txtnew file+130

This diff is too big to show here.

tests/golden/types-constructor-context/types.txtnew file+54

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-deferred-call-context/source.jibbnew file+56

This diff is too big to show here.

tests/golden/types-deferred-call-context/tokens.txtnew file+557

This diff is too big to show here.

tests/golden/types-deferred-call-context/tree.txtnew file+272

This diff is too big to show here.

tests/golden/types-deferred-call-context/types.txtnew file+82

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/tokens.txtnew file+179

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/tree.txtnew file+75

This diff is too big to show here.

tests/golden/types-equal-head-disjoint/types.txtnew file+34

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-flag-branch-context/source.jibbnew file+83

This diff is too big to show here.

tests/golden/types-flag-branch-context/tokens.txtnew file+496

This diff is too big to show here.

tests/golden/types-flag-branch-context/tree.txtnew file+244

This diff is too big to show here.

tests/golden/types-flag-branch-context/types.txtnew file+33

This diff is too big to show here.

tests/golden/types-generic-result-context/about.txtnew file+1

This diff is too big to show here.

tests/golden/types-generic-result-context/source.jibbnew file+24

This diff is too big to show here.

tests/golden/types-generic-result-context/tokens.txtnew file+233

This diff is too big to show here.

tests/golden/types-generic-result-context/tree.txtnew file+86

This diff is too big to show here.

tests/golden/types-generic-result-context/types.txtnew file+22

This diff is too big to show here.

tests/golden/types-generic-union-errors/types.txt+3−3

This diff is too big to show here.

tests/golden/types-hole-concrete/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-concrete/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-hole-concrete/tokens.txtnew file+54

This diff is too big to show here.

tests/golden/types-hole-concrete/tree.txtnew file+22

This diff is too big to show here.

tests/golden/types-hole-concrete/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-generic-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-generic-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-generic-mold/tokens.txtnew file+26

This diff is too big to show here.

tests/golden/types-hole-generic-mold/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-hole-generic-mold/types.txtnew file+6

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-hole-local-boundary/source.jibbnew file+16

This diff is too big to show here.

tests/golden/types-hole-local-boundary/tokens.txtnew file+118

This diff is too big to show here.

tests/golden/types-hole-local-boundary/tree.txtnew file+55

This diff is too big to show here.

tests/golden/types-hole-local-boundary/types.txtnew file+17

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-hole-module-boundary/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-hole-module-boundary/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-module-boundary/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-hole-module-boundary/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-hole-module-boundary/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-hole-named-complex/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-named-complex/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-named-complex/tokens.txtnew file+20

This diff is too big to show here.

tests/golden/types-hole-named-complex/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-hole-named-complex/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/tokens.txtnew file+127

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/tree.txtnew file+62

This diff is too big to show here.

tests/golden/types-hole-numeric-capture/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/tokens.txtnew file+19

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-hole-unbound-mold/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-hole-unsupported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-unsupported/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-unsupported/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-hole-unsupported/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-hole-unsupported/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-generic/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-generic/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-generic/tokens.txtnew file+71

This diff is too big to show here.

tests/golden/types-hole-user-generic/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-hole-user-generic/types.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-user-named/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-named/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-hole-user-named/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-hole-user-named/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-hole-user-named/types.txtnew file+6

This diff is too big to show here.

tests/golden/types-hole-user-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-hole-user-value/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-hole-user-value/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-hole-user-value/tree.txtnew file+10

This diff is too big to show here.

tests/golden/types-hole-user-value/types.txtnew file+7

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-import-hoon-flags/imports.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-flags/source.jibbnew file+14

This diff is too big to show here.

tests/golden/types-import-hoon-flags/sur/flags.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-hoon-flags/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-import-hoon-flags/tree.txtnew file+41

This diff is too big to show here.

tests/golden/types-import-hoon-flags/types.txtnew file+24

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-import-hoon-noun/imports.txtnew file+4

This diff is too big to show here.

tests/golden/types-import-hoon-noun/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-import-hoon-noun/sur/fixture.txtnew file+6

This diff is too big to show here.

tests/golden/types-import-hoon-noun/tokens.txtnew file+60

This diff is too big to show here.

tests/golden/types-import-hoon-noun/tree.txtnew file+28

This diff is too big to show here.

tests/golden/types-import-hoon-noun/types.txtnew file+8

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-import-tlon-notes/imports.txtnew file+7

This diff is too big to show here.

tests/golden/types-import-tlon-notes/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-import-tlon-notes/sur/notes.txtnew file+433

This diff is too big to show here.

tests/golden/types-import-tlon-notes/tokens.txtnew file+59

This diff is too big to show here.

tests/golden/types-import-tlon-notes/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-import-tlon-notes/types.txtnew file+8

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-list-open-constraints/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-list-open-constraints/tokens.txtnew file+178

This diff is too big to show here.

tests/golden/types-list-open-constraints/tree.txtnew file+68

This diff is too big to show here.

tests/golden/types-list-open-constraints/types.txtnew file+30

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-list-open/tokens.txtnew file+94

This diff is too big to show here.

tests/golden/types-list-open/tree.txtnew file+36

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-list-patterns/about.txt+1−1

This diff is too big to show here.

tests/golden/types-list-patterns/types.txt+1−1

This diff is too big to show here.

tests/golden/types-list-zero-fit/about.txt+1−1

This diff is too big to show here.

tests/golden/types-list-zero-fit/types.txt+3−3

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/tokens.txtnew file+177

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/tree.txtnew file+78

This diff is too big to show here.

tests/golden/types-literal-constructor-nouns/types.txtnew file+45

This diff is too big to show here.

tests/golden/types-local-recursive/about.txt+1−1

This diff is too big to show here.

tests/golden/types-local-recursive/types.txt+1−1

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/tokens.txtnew file+404

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/tree.txtnew file+204

This diff is too big to show here.

tests/golden/types-local-scc-adversarial/types.txtnew file+17

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/tokens.txtnew file+143

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/tree.txtnew file+52

This diff is too big to show here.

tests/golden/types-loobean-singleton-source/types.txtnew file+65

This diff is too big to show here.

tests/golden/types-loobean-union-context/about.txtnew file+2

This diff is too big to show here.

tests/golden/types-loobean-union-context/source.jibbnew file+28

This diff is too big to show here.

tests/golden/types-loobean-union-context/tokens.txtnew file+136

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-loobean-union-context/types.txtnew file+35

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-field-duplicate/about.txtnew file+4

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-duplicate/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-module-field-duplicate/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-duplicate/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-module-field-duplicate/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-field-duplicate/types.txtnew file+8

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/module-trees.txtnew file+12

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-module-field-nonrecord/types.txtnew file+2

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-path/module-trees.txtnew file+12

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-path/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-path/tokens.txtnew file+45

This diff is too big to show here.

tests/golden/types-module-field-path/tree.txtnew file+14

This diff is too big to show here.

tests/golden/types-module-field-path/types.txtnew file+9

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-shadow/module-trees.txtnew file+12

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-module-field-shadow/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-shadow/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-module-field-shadow/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-module-field-shadow/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-module-field-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-multi-call/types.txt+1−1

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-nested-missing-tag/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-nested-missing-tag/tokens.txtnew file+184

This diff is too big to show here.

tests/golden/types-nested-missing-tag/tree.txtnew file+79

This diff is too big to show here.

tests/golden/types-nested-missing-tag/types.txtnew file+71

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-nested-noun-context/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-nested-noun-context/tokens.txtnew file+363

This diff is too big to show here.

tests/golden/types-nested-noun-context/tree.txtnew file+162

This diff is too big to show here.

tests/golden/types-nested-noun-context/types.txtnew file+34

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/source.jibbnew file+30

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/tokens.txtnew file+271

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/tree.txtnew file+136

This diff is too big to show here.

tests/golden/types-nested-shallow-preserve/types.txtnew file+33

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-nested-union-context/source.jibbnew file+59

This diff is too big to show here.

tests/golden/types-nested-union-context/tokens.txtnew file+660

This diff is too big to show here.

tests/golden/types-nested-union-context/tree.txtnew file+302

This diff is too big to show here.

tests/golden/types-nested-union-context/types.txtnew file+49

This diff is too big to show here.

tests/golden/types-null-context/about.txt+1−1

This diff is too big to show here.

tests/golden/types-null-context/source.jibb+1−1

This diff is too big to show here.

tests/golden/types-null-context/tokens.txt+8−8

This diff is too big to show here.

tests/golden/types-null-context/tree.txt+4−4

This diff is too big to show here.

tests/golden/types-null-context/types.txt+1−7

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-pair-context/source.jibbnew file+32

This diff is too big to show here.

tests/golden/types-pair-context/tokens.txtnew file+217

This diff is too big to show here.

tests/golden/types-pair-context/tree.txtnew file+86

This diff is too big to show here.

tests/golden/types-pair-context/types.txtnew file+43

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/tokens.txtnew file+108

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/tree.txtnew file+47

This diff is too big to show here.

tests/golden/types-partial-union-nested-nouns/types.txtnew file+25

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-positional-faces/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-positional-faces/tokens.txtnew file+394

This diff is too big to show here.

tests/golden/types-positional-faces/tree.txtnew file+197

This diff is too big to show here.

tests/golden/types-positional-faces/types.txtnew file+42

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/source.jibbnew file+23

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/tokens.txtnew file+201

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/tree.txtnew file+85

This diff is too big to show here.

tests/golden/types-prelude-arithmetic/types.txtnew file+50

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-ask/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-prelude-ask/tokens.txtnew file+804

This diff is too big to show here.

tests/golden/types-prelude-ask/tree.txtnew file+335

This diff is too big to show here.

tests/golden/types-prelude-ask/types.txtnew file+41

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-bond/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-bond/tokens.txtnew file+57

This diff is too big to show here.

tests/golden/types-prelude-bond/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-prelude-bond/types.txtnew file+7

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-cmd/source.jibbnew file+21

This diff is too big to show here.

tests/golden/types-prelude-cmd/tokens.txtnew file+285

This diff is too big to show here.

tests/golden/types-prelude-cmd/tree.txtnew file+122

This diff is too big to show here.

tests/golden/types-prelude-cmd/types.txtnew file+56

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-comparison/tokens.txtnew file+175

This diff is too big to show here.

tests/golden/types-prelude-comparison/tree.txtnew file+71

This diff is too big to show here.

tests/golden/types-prelude-comparison/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-prelude-direct/about.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-direct/types.txt+1−1

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-functional/tokens.txtnew file+145

This diff is too big to show here.

tests/golden/types-prelude-functional/tree.txtnew file+65

This diff is too big to show here.

tests/golden/types-prelude-functional/types.txtnew file+23

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/module-trees.txtnew file+10

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/modules/ui/alias-helper.jibbnew file+2

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/tokens.txtnew file+146

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/tree.txtnew file+51

This diff is too big to show here.

tests/golden/types-prelude-generic-alias/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-prelude-interface/about.txt+1−1

This diff is too big to show here.

tests/golden/types-prelude-interface/types.txt+1−1

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-lead-late/tokens.txtnew file+151

This diff is too big to show here.

tests/golden/types-prelude-lead-late/tree.txtnew file+83

This diff is too big to show here.

tests/golden/types-prelude-lead-late/types.txtnew file+17

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-lent/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-prelude-lent/tokens.txtnew file+76

This diff is too big to show here.

tests/golden/types-prelude-lent/tree.txtnew file+38

This diff is too big to show here.

tests/golden/types-prelude-lent/types.txtnew file+15

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-like/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-prelude-like/tokens.txtnew file+320

This diff is too big to show here.

tests/golden/types-prelude-like/tree.txtnew file+163

This diff is too big to show here.

tests/golden/types-prelude-like/types.txtnew file+18

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-list-alias/source.jibbnew file+7

This diff is too big to show here.

tests/golden/types-prelude-list-alias/tokens.txtnew file+68

This diff is too big to show here.

tests/golden/types-prelude-list-alias/tree.txtnew file+30

This diff is too big to show here.

tests/golden/types-prelude-list-alias/types.txtnew file+14

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/source.jibbnew file+15

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/tokens.txtnew file+182

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/tree.txtnew file+98

This diff is too big to show here.

tests/golden/types-prelude-list-helpers/types.txtnew file+34

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-predicates/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-predicates/tokens.txtnew file+91

This diff is too big to show here.

tests/golden/types-prelude-predicates/tree.txtnew file+49

This diff is too big to show here.

tests/golden/types-prelude-predicates/types.txtnew file+19

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/source.jibbnew file+20

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/tokens.txtnew file+211

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/tree.txtnew file+100

This diff is too big to show here.

tests/golden/types-prelude-sub-nested/types.txtnew file+27

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-sub/source.jibbnew file+37

This diff is too big to show here.

tests/golden/types-prelude-sub/tokens.txtnew file+380

This diff is too big to show here.

tests/golden/types-prelude-sub/tree.txtnew file+164

This diff is too big to show here.

tests/golden/types-prelude-sub/types.txtnew file+32

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-succ/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-prelude-succ/tokens.txtnew file+32

This diff is too big to show here.

tests/golden/types-prelude-succ/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-prelude-succ/types.txtnew file+11

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+15

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-prelude-zing/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-prelude-zing/tokens.txtnew file+92

This diff is too big to show here.

tests/golden/types-prelude-zing/tree.txtnew file+43

This diff is too big to show here.

tests/golden/types-prelude-zing/types.txtnew file+13

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-proj-explicit-context/source.jibbnew file+35

This diff is too big to show here.

tests/golden/types-proj-explicit-context/tokens.txtnew file+626

This diff is too big to show here.

tests/golden/types-proj-explicit-context/tree.txtnew file+287

This diff is too big to show here.

tests/golden/types-proj-explicit-context/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/tokens.txtnew file+119

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/tree.txtnew file+56

This diff is too big to show here.

tests/golden/types-proj-nested-no-implicit/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/module-trees.txtnew file+10

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-imported-definition/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/module-trees.txtnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/modules/ui/lib.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-jibb-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/tokens.txtnew file+10

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-proj-reserved-local-mold/types.txtnew file+2

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-proj-reserved-local/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-local/tokens.txtnew file+14

This diff is too big to show here.

tests/golden/types-proj-reserved-local/tree.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-local/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-mark-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-mold/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/tokens.txtnew file+21

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-proj-reserved-pattern/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/source.jibbnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/tokens.txtnew file+70

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/tree.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-reserved-positive/types.txtnew file+7

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/tree.txtnew file+5

This diff is too big to show here.

tests/golden/types-proj-reserved-sample/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-proj-reserved-sur-import/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/tokens.txtnew file+38

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/tree.txtnew file+18

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-pattern/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/source.jibbnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-sample/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/tokens.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-proj-reserved-unused-value/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-value/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-reserved-value/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-reserved-value/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-proj-reserved-value/tokens.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-reserved-value/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-proj-reserved-value/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/tokens.txtnew file+23

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-proj-single-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-proj-single-field/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-field/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-field/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-proj-single-field/tokens.txtnew file+499

This diff is too big to show here.

tests/golden/types-proj-single-field/tree.txtnew file+243

This diff is too big to show here.

tests/golden/types-proj-single-field/types.txtnew file+31

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/source.jibbnew file+22

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/tokens.txtnew file+210

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/tree.txtnew file+117

This diff is too big to show here.

tests/golden/types-proj-single-sample-face/types.txtnew file+9

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/source.jibbnew file+26

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/tokens.txtnew file+208

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/tree.txtnew file+107

This diff is too big to show here.

tests/golden/types-proj-single-wrapped/types.txtnew file+5

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-qath-faces/modules.txtnew file+1

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-qath-faces/tokens.txtnew file+130

This diff is too big to show here.

tests/golden/types-qath-faces/tree.txtnew file+59

This diff is too big to show here.

tests/golden/types-qath-faces/types.txtnew file+18

This diff is too big to show here.

tests/golden/types-qath-holes/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-qath-holes/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-qath-holes/source.jibbnew file+18

This diff is too big to show here.

tests/golden/types-qath-holes/tokens.txtnew file+178

This diff is too big to show here.

tests/golden/types-qath-holes/tree.txtnew file+78

This diff is too big to show here.

tests/golden/types-qath-holes/types.txtnew file+22

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-qath-module-identity/module-trees.txtnew file+44

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules.txtnew file+3

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/mid.jibbnew file+4

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/one.jibbnew file+7

This diff is too big to show here.

tests/golden/types-qath-module-identity/modules/ui/two.jibbnew file+4

This diff is too big to show here.

tests/golden/types-qath-module-identity/source.jibbnew file+15

This diff is too big to show here.

tests/golden/types-qath-module-identity/tokens.txtnew file+171

This diff is too big to show here.

tests/golden/types-qath-module-identity/tree.txtnew file+70

This diff is too big to show here.

tests/golden/types-qath-module-identity/types.txtnew file+18

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-qath-recursive/source.jibbnew file+19

This diff is too big to show here.

tests/golden/types-qath-recursive/tokens.txtnew file+145

This diff is too big to show here.

tests/golden/types-qath-recursive/tree.txtnew file+63

This diff is too big to show here.

tests/golden/types-qath-recursive/types.txtnew file+14

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+9

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

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-field-edit-separate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/tokens.txtnew file+51

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/tree.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-edit-separate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-field-expr-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/tokens.txtnew file+25

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/tree.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-expr-separate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/module-trees.txtnew file+7

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/modules/ui/lib.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-module-reachable/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-module-unused/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-module-unused/module-trees.txtnew file+10

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules/ui/good.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-module-unused/modules/ui/unused.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-module-unused/tokens.txtnew file+11

This diff is too big to show here.

tests/golden/types-record-field-module-unused/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-module-unused/types.txtnew file+2

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/tokens.txtnew file+22

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/tree.txtnew file+9

This diff is too big to show here.

tests/golden/types-record-field-nested-mold/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/tokens.txtnew file+26

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/tree.txtnew file+12

This diff is too big to show here.

tests/golden/types-record-field-outer-inner/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/source.jibbnew file+1

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/tokens.txtnew file+13

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/tree.txtnew file+7

This diff is too big to show here.

tests/golden/types-record-field-sample-duplicate/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/tokens.txtnew file+33

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/tree.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-field-separate-molds/types.txtnew file+3

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/tokens.txtnew file+15

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-record-field-unused-mold/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-request-normal/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-request-normal/mar/full.txtnew file+5

This diff is too big to show here.

tests/golden/types-request-normal/marks.txtnew file+1

This diff is too big to show here.

tests/golden/types-request-normal/module-trees.txtnew file+5

This diff is too big to show here.

tests/golden/types-request-normal/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-request-normal/modules/ui/api/demo.jibbnew file+2

This diff is too big to show here.

tests/golden/types-request-normal/source.jibbnew file+9

This diff is too big to show here.

tests/golden/types-request-normal/tokens.txtnew file+95

This diff is too big to show here.

tests/golden/types-request-normal/tree.txtnew file+50

This diff is too big to show here.

tests/golden/types-request-normal/types.txtnew file+26

This diff is too big to show here.

tests/golden/types-scope-library-poke/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-library-poke/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-library-poke/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-library-poke/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-scope-library-poke/tokens.txtnew file+8

This diff is too big to show here.

tests/golden/types-scope-library-poke/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-scope-library-poke/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-root-api/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-root-api/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-root-api/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-root-api/source.jibbnew file+2

This diff is too big to show here.

tests/golden/types-scope-root-api/tokens.txtnew file+7

This diff is too big to show here.

tests/golden/types-scope-root-api/tree.txtnew file+3

This diff is too big to show here.

tests/golden/types-scope-root-api/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-scope-store-duplicate/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-scope-store-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-scope-store-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-shadow/path.txtnew file+1

This diff is too big to show here.

tests/golden/types-scope-store-shadow/source.jibbnew file+3

This diff is too big to show here.

tests/golden/types-scope-store-shadow/tokens.txtnew file+16

This diff is too big to show here.

tests/golden/types-scope-store-shadow/tree.txtnew file+6

This diff is too big to show here.

tests/golden/types-scope-store-shadow/types.txtnew file+2

This diff is too big to show here.

tests/golden/types-single-case-pattern/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-single-case-pattern/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-single-case-pattern/source.jibbnew file+59

This diff is too big to show here.

tests/golden/types-single-case-pattern/tokens.txtnew file+364

This diff is too big to show here.

tests/golden/types-single-case-pattern/tree.txtnew file+182

This diff is too big to show here.

tests/golden/types-single-case-pattern/types.txtnew file+32

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+49

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-branch-context/types.txt+4−4

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-finite-context/types.txtnew file+27

This diff is too big to show here.

tests/golden/types-union-finite-limit/about.txt+1−1

This diff is too big to show here.

tests/golden/types-union-finite-limit/types.txt+1−1

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/source.jibbnew file+82

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/tokens.txtnew file+593

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/tree.txtnew file+257

This diff is too big to show here.

tests/golden/types-union-nonwing-subject/types.txtnew file+45

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/source.jibbnew file+25

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/tokens.txtnew file+205

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/tree.txtnew file+96

This diff is too big to show here.

tests/golden/types-union-pattern-result-context/types.txtnew file+13

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/source.jibbnew file+55

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/tokens.txtnew file+357

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/tree.txtnew file+161

This diff is too big to show here.

tests/golden/types-union-pattern-result-controls/types.txtnew file+30

This diff is too big to show here.

tests/golden/types-union-patterns/about.txt+1−1

This diff is too big to show here.

tests/golden/types-union-patterns/types.txt+3−3

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/module-trees.txtnew file+16

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules.txtnew file+2

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules/ui/one.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/modules/ui/two.jibbnew file+4

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/source.jibbnew file+33

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/tokens.txtnew file+368

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-polymorphic-identity/types.txtnew file+36

This diff is too big to show here.

tests/golden/types-union-runtime-equality/about.txtnew file+3

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-runtime-equality/tokens.txtnew file+96

This diff is too big to show here.

tests/golden/types-union-runtime-equality/tree.txtnew file+37

This diff is too big to show here.

tests/golden/types-union-runtime-equality/types.txtnew file+25

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

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

This diff is too big to show here.

tests/golden/types-union-tags/types.txt+3−3

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.txt+2−2

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.jibb+44−68

This diff is too big to show here.

tests/golden/types-unit-context/tokens.txt+458−343

This diff is too big to show here.

tests/golden/types-unit-context/tree.txt+218−180

This diff is too big to show here.

tests/golden/types-unit-context/types.txt+90−22

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/source.jibbnew file+6

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/tokens.txtnew file+68

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/tree.txtnew file+32

This diff is too big to show here.

tests/golden/types-value-cycle-shadow/types.txtnew file+7

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/source.jibbnew file+11

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/tokens.txtnew file+45

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/tree.txtnew file+17

This diff is too big to show here.

tests/golden/types-value-cycle-unsupported/types.txtnew file+8

This diff is too big to show here.

tests/golden/types-value-cycles/about.txtnew file+4

This diff is too big to show here.

tests/golden/types-value-cycles/modules.txtnew file+1

This diff is too big to show here.

tests/golden/types-value-cycles/source.jibbnew file+13

This diff is too big to show here.

tests/golden/types-value-cycles/tokens.txtnew file+87

This diff is too big to show here.

tests/golden/types-value-cycles/tree.txtnew file+39

This diff is too big to show here.

tests/golden/types-value-cycles/types.txtnew file+44

This diff is too big to show here.

tests/importer/about.txt+37−1

This diff is too big to show here.

tests/importer/shadow-static.txt+6

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+82

This diff is too big to show here.

tests/importer/tree.txt+75−3

This diff is too big to show here.

tests/lib/jibb-api-evidence.hoonnew file+258

This diff is too big to show here.

tests/lib/jibb-api-paths.hoonnew file+104

This diff is too big to show here.

tests/lib/jibb-arithmetic-guards.hoonnew file+58

This diff is too big to show here.

tests/lib/jibb-ask-guards.hoonnew file+63

This diff is too big to show here.

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

This diff is too big to show here.

tests/lib/jibb-cell-branch.hoonnew file+53

This diff is too big to show here.

tests/lib/jibb-closed-gate-guards.hoonnew file+60

This diff is too big to show here.

tests/lib/jibb-constructor-fit-guards.hoonnew file+128

This diff is too big to show here.

tests/lib/jibb-deferred-context.hoonnew file+83

This diff is too big to show here.

tests/lib/jibb-deferred-resolver.hoonnew file+113

This diff is too big to show here.

tests/lib/jibb-deferred.hoonnew file+244

This diff is too big to show here.

tests/lib/jibb-direct-gate-guards.hoonnew file+172

This diff is too big to show here.

tests/lib/jibb-direct-gate-source.hoonnew file+46

This diff is too big to show here.

tests/lib/jibb-empty.hoonnew file+174

This diff is too big to show here.

tests/lib/jibb-full-overlap-basic.hoonnew file+143

This diff is too big to show here.

tests/lib/jibb-full-overlap-graph.hoonnew file+126

This diff is too big to show here.

tests/lib/jibb-gate-free-guards.hoonnew file+79

This diff is too big to show here.

tests/lib/jibb-gate-free-source.hoonnew file+95

This diff is too big to show here.

tests/lib/jibb-generic-alias.hoonnew file+48

This diff is too big to show here.

tests/lib/jibb-generic-construction.hoonnew file+141

This diff is too big to show here.

tests/lib/jibb-generic-pattern.hoonnew file+165

This diff is too big to show here.

tests/lib/jibb-generic-recursion.hoonnew file+170

This diff is too big to show here.

tests/lib/jibb-hole-guards.hoonnew file+77

This diff is too big to show here.

tests/lib/jibb-import-default.hoonnew file+50

This diff is too big to show here.

tests/lib/jibb-import-overlap.hoonnew file+80

This diff is too big to show here.

tests/lib/jibb-import-structural.hoonnew file+82

This diff is too big to show here.

tests/lib/jibb-list-alias-guards.hoonnew file+27

This diff is too big to show here.

tests/lib/jibb-module-scope.hoon+52−3

This diff is too big to show here.

tests/lib/jibb-nested-union-guards.hoonnew file+67

This diff is too big to show here.

tests/lib/jibb-poke-bridge.hoonnew file+88

This diff is too big to show here.

tests/lib/jibb-positional-face-guards.hoonnew file+38

This diff is too big to show here.

tests/lib/jibb-proj-guards.hoonnew file+124

This diff is too big to show here.

tests/lib/jibb-qath-fuel.hoonnew file+52

This diff is too big to show here.

tests/lib/jibb-qath-source.hoonnew file+66

This diff is too big to show here.

tests/lib/jibb-request-guards.hoonnew file+149

This diff is too big to show here.

tests/lib/jibb-sub-guards.hoonnew file+37

This diff is too big to show here.

tests/lib/jibb-tlon-bridge.hoonnew file+29

This diff is too big to show here.

tests/lib/jibb-todo-api.hoonnew file+85

This diff is too big to show here.

tests/lib/jibb-todo-partial.hoonnew file+58

This diff is too big to show here.

tests/lib/jibb-union-alias-overlap.hoonnew file+107

This diff is too big to show here.

tests/lib/jibb-union-source.hoonnew file+152

This diff is too big to show here.

tests/lib/jibb.hoon+1561−741

This diff is too big to show here.

tests/type-api-evidence/about.txtnew file+3

This diff is too big to show here.

tests/type-api-evidence/expected.txtnew file+1

This diff is too big to show here.

tests/type-api-paths/about.txtnew file+3

This diff is too big to show here.

tests/type-api-paths/api.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/expected.txtnew file+18

This diff is too big to show here.

tests/type-api-paths/missing-decl.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/poke-clash.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/scry-bad.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/scry.txtnew file+13

This diff is too big to show here.

tests/type-api-paths/todo-action.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todo-item.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todo-sur.txtnew file+12

This diff is too big to show here.

tests/type-api-paths/todo-update.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/todos.txtnew file+6

This diff is too big to show here.

tests/type-api-paths/value-clash.txtnew file+15

This diff is too big to show here.

tests/type-cell-branch/about.txtnew file+2

This diff is too big to show here.

tests/type-cell-branch/bad.txtnew file+3

This diff is too big to show here.

tests/type-cell-branch/good.txtnew file+3

This diff is too big to show here.

tests/type-deferred-context/about.txtnew file+3

This diff is too big to show here.

tests/type-deferred-context/collision-early.txtnew file+27

This diff is too big to show here.

tests/type-deferred-context/collision-late.txtnew file+28

This diff is too big to show here.

tests/type-deferred-context/dangling.txtnew file+16

This diff is too big to show here.

tests/type-deferred-context/duplicate.txtnew file+14

This diff is too big to show here.

tests/type-deferred-context/missing.txtnew file+14

This diff is too big to show here.

tests/type-deferred-context/plain.txtnew file+11

This diff is too big to show here.

tests/type-deferred-context/report.txtnew file+15

This diff is too big to show here.

tests/type-deferred-context/rich.txtnew file+27

This diff is too big to show here.

tests/type-deferred-context/simple.txtnew file+10

This diff is too big to show here.

tests/type-deferred-context/wrong.txtnew file+14

This diff is too big to show here.

tests/type-deferred-resolver/about.txtnew file+5

This diff is too big to show here.

tests/type-deferred-resolver/conflict.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/duplicate.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/expected.txtnew file+42

This diff is too big to show here.

tests/type-deferred-resolver/face.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/good.txtnew file+11

This diff is too big to show here.

tests/type-deferred-resolver/hole.txtnew file+12

This diff is too big to show here.

tests/type-deferred-resolver/missing.txtnew file+10

This diff is too big to show here.

tests/type-deferred-resolver/stability-early.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-late.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-output-early.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-output-late.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-simple-early.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-simple-late.txtnew file+6

This diff is too big to show here.

tests/type-deferred-resolver/stability-slot-early.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/stability-slot-late.txtnew file+9

This diff is too big to show here.

tests/type-deferred-resolver/store.txtnew file+12

This diff is too big to show here.

tests/type-deferred/about.txtnew file+3

This diff is too big to show here.

tests/type-deferred/conflict-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/duplicate-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/expected.txtnew file+38

This diff is too big to show here.

tests/type-deferred/face-bad-src.txtnew file+6

This diff is too big to show here.

tests/type-deferred/face-good-src.txtnew file+6

This diff is too big to show here.

tests/type-deferred/hole-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/local-src.txtnew file+8

This diff is too big to show here.

tests/type-deferred/missing-src.txtnew file+10

This diff is too big to show here.

tests/type-deferred/mold-hole-src.txtnew file+12

This diff is too big to show here.

tests/type-deferred/mutual-src.txtnew file+7

This diff is too big to show here.

tests/type-deferred/nested-src.txtnew file+7

This diff is too big to show here.

tests/type-deferred/principal-src.txtnew file+11

This diff is too big to show here.

tests/type-direct-gate/about.txtnew file+4

This diff is too big to show here.

tests/type-direct-gate/expected.txtnew file+86

This diff is too big to show here.

tests/type-direct-gate/source.txtnew file+96

This diff is too big to show here.

tests/type-empty/about.txtnew file+3

This diff is too big to show here.

tests/type-empty/dead.txtnew file+7

This diff is too big to show here.

tests/type-empty/expected.txtnew file+59

This diff is too big to show here.

tests/type-empty/face-source.txtnew file+2

This diff is too big to show here.

tests/type-empty/good.txtnew file+11

This diff is too big to show here.

tests/type-empty/late-cap.txtnew file+16

This diff is too big to show here.

tests/type-empty/list-dead.txtnew file+4

This diff is too big to show here.

tests/type-empty/list-live.txtnew file+3

This diff is too big to show here.

tests/type-empty/list-open.txtnew file+3

This diff is too big to show here.

tests/type-empty/missing.txtnew file+6

This diff is too big to show here.

tests/type-empty/overlap.txtnew file+3

This diff is too big to show here.

tests/type-empty/standard-good.txtnew file+11

This diff is too big to show here.

tests/type-empty/unit-dead.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/about.txtnew file+3

This diff is too big to show here.

tests/type-full-overlap/child.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/distinct.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/duplicate-generic.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/expected-basic.txtnew file+16

This diff is too big to show here.

tests/type-full-overlap/expected-graph.txtnew file+8

This diff is too big to show here.

tests/type-full-overlap/generic.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/invalid.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/parent.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/precedence.txtnew file+5

This diff is too big to show here.

tests/type-full-overlap/same.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/unsupported.txtnew file+4

This diff is too big to show here.

tests/type-full-overlap/zero.txtnew file+4

This diff is too big to show here.

tests/type-gate-free/about.txtnew file+1

This diff is too big to show here.

tests/type-gate-free/expected.txtnew file+9

This diff is too big to show here.

tests/type-gate-free/todo-gate.txtnew file+40

This diff is too big to show here.

tests/type-gate-free/todo-noun.txtnew file+40

This diff is too big to show here.

tests/type-gate-free/todo.txtnew file+40

This diff is too big to show here.

tests/type-generic-construction/about.txtnew file+9

This diff is too big to show here.

tests/type-generic-construction/alias-client.txtnew file+12

This diff is too big to show here.

tests/type-generic-construction/alias.txtnew file+3

This diff is too big to show here.

tests/type-generic-construction/client.txtnew file+24

This diff is too big to show here.

tests/type-generic-construction/expected.txtnew file+65

This diff is too big to show here.

tests/type-generic-construction/no-event-client.txtnew file+8

This diff is too big to show here.

tests/type-generic-construction/owner-negative.txtnew file+10

This diff is too big to show here.

tests/type-generic-construction/owner-positive.txtnew file+9

This diff is too big to show here.

tests/type-generic-construction/sibling-values.txtnew file+4

This diff is too big to show here.

tests/type-generic-construction/tree-no-event.txtnew file+4

This diff is too big to show here.

tests/type-generic-construction/tree.txtnew file+6

This diff is too big to show here.

tests/type-generic-pattern/about.txtnew file+10

This diff is too big to show here.

tests/type-generic-pattern/client.txtnew file+166

This diff is too big to show here.

tests/type-generic-pattern/expected.txtnew file+91

This diff is too big to show here.

tests/type-generic-pattern/no-event.txtnew file+17

This diff is too big to show here.

tests/type-generic-pattern/owner-bad.txtnew file+22

This diff is too big to show here.

tests/type-generic-pattern/owner.txtnew file+18

This diff is too big to show here.

tests/type-generic-pattern/poly-values.txtnew file+2

This diff is too big to show here.

tests/type-generic-pattern/values.txtnew file+18

This diff is too big to show here.

tests/type-generic-recursion/about.txtnew file+14

This diff is too big to show here.

tests/type-generic-recursion/alias.txtnew file+3

This diff is too big to show here.

tests/type-generic-recursion/bad-constructor.txtnew file+8

This diff is too big to show here.

tests/type-generic-recursion/bad-match.txtnew file+10

This diff is too big to show here.

tests/type-generic-recursion/bad-mold.txtnew file+8

This diff is too big to show here.

tests/type-generic-recursion/bad-parameter.txtnew file+6

This diff is too big to show here.

tests/type-generic-recursion/chain.txtnew file+3

This diff is too big to show here.

tests/type-generic-recursion/client.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/expected.txtnew file+35

This diff is too big to show here.

tests/type-generic-recursion/list-shadow.txtnew file+4

This diff is too big to show here.

tests/type-generic-recursion/local-distinct.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/local-only.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/local-shadow.txtnew file+11

This diff is too big to show here.

tests/type-generic-recursion/tree-changed.txtnew file+6

This diff is too big to show here.

tests/type-generic-recursion/tree.txtnew file+6

This diff is too big to show here.

tests/type-import-default/about.txtnew file+1

This diff is too big to show here.

tests/type-import-default/controls.txtnew file+16

This diff is too big to show here.

tests/type-import-default/expected.txtnew file+9

This diff is too big to show here.

tests/type-import-default/parent.txtnew file+3

This diff is too big to show here.

tests/type-import-default/tlon.txtnew file+18

This diff is too big to show here.

tests/type-import-diagnostic/about.txt+1−1

This diff is too big to show here.

tests/type-import-diagnostic/expected.txt+4−1

This diff is too big to show here.

tests/type-import-diagnostic/nested.txt+1−1

This diff is too big to show here.

tests/type-import-overlap/about.txtnew file+24

This diff is too big to show here.

tests/type-import-overlap/expected.txtnew file+26

This diff is too big to show here.

tests/type-import-overlap/source.txtnew file+4

This diff is too big to show here.

tests/type-import-overlap/sur.txtnew file+17

This diff is too big to show here.

tests/type-import-structural/about.txtnew file+14

This diff is too big to show here.

tests/type-import-structural/expected.txtnew file+41

This diff is too big to show here.

tests/type-import-structural/source.txtnew file+5

This diff is too big to show here.

tests/type-import-structural/sur.txtnew file+12

This diff is too big to show here.

tests/type-import/about.txt+23−4

This diff is too big to show here.

tests/type-import/expected.txt+67−9

This diff is too big to show here.

tests/type-import/source.txt+26

This diff is too big to show here.

tests/type-import/sur.txt+6

This diff is too big to show here.

tests/type-list-alias/expected.txtnew file+36

This diff is too big to show here.

tests/type-module-scope/expected.txt+18

This diff is too big to show here.

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

This diff is too big to show here.

tests/type-poke/alias.txtnew file+2

This diff is too big to show here.

tests/type-poke/api.txtnew file+2

This diff is too big to show here.

tests/type-poke/client.txtnew file+23

This diff is too big to show here.

tests/type-poke/direct.txtnew file+2

This diff is too big to show here.

tests/type-poke/expected.txtnew file+66

This diff is too big to show here.

tests/type-poke/exported.txtnew file+9

This diff is too big to show here.

tests/type-poke/fake.txtnew file+4

This diff is too big to show here.

tests/type-poke/impostor-client.txtnew file+2

This diff is too big to show here.

tests/type-poke/impostor.txtnew file+1

This diff is too big to show here.

tests/type-poke/inner.txtnew file+2

This diff is too big to show here.

tests/type-poke/mark.txtnew file+5

This diff is too big to show here.

tests/type-poke/public.txtnew file+2

This diff is too big to show here.

tests/type-poke/transitive.txtnew file+2

This diff is too big to show here.

tests/type-tlon/about.txtnew file+6

This diff is too big to show here.

tests/type-tlon/expected.txtnew file+6

This diff is too big to show here.

tests/type-tlon/source.txtnew file+6

This diff is too big to show here.

tests/type-todo-api/about.txtnew file+1

This diff is too big to show here.

tests/type-todo-api/expected.txtnew file+17

This diff is too big to show here.

tests/type-todo-api/negative-expected.txtnew file+26

This diff is too big to show here.

tests/type-todo-api/negative.txtnew file+12

This diff is too big to show here.

tests/type-todo-api/source.txtnew file+21

This diff is too big to show here.

tests/type-todo-api/unsupported.txtnew file+13

This diff is too big to show here.

tests/type-todo-partial/about.txtnew file+4

This diff is too big to show here.

tests/type-todo-partial/expected.txtnew file+17

This diff is too big to show here.

tests/type-union-alias-overlap/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/expected.txtnew file+25

This diff is too big to show here.

tests/type-union-alias-overlap/flag-source.txtnew file+7

This diff is too big to show here.

tests/type-union-alias-overlap/multi.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/negative.txtnew file+16

This diff is too big to show here.

tests/type-union-alias-overlap/nonzero.txtnew file+4

This diff is too big to show here.

tests/type-union-alias-overlap/opaque.txtnew file+4

This diff is too big to show here.

tests/type-union-alias-overlap/positive.txtnew file+8

This diff is too big to show here.

tests/type-union-alias-overlap/qualified.txtnew file+5

This diff is too big to show here.

tests/type-union-alias-overlap/wrong.txtnew file+5

This diff is too big to show here.

tests/type-union-source/direct-source.txtnew file+3

This diff is too big to show here.

tests/type-union-source/duplicate-params.txtnew file+4

This diff is too big to show here.

tests/type-union-source/duplicate.txtnew file+5

This diff is too big to show here.

tests/type-union-source/expected.txtnew file+36

This diff is too big to show here.

tests/type-union-source/free-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/good.txtnew file+9

This diff is too big to show here.

tests/type-union-source/hidden-ref.txtnew file+5

This diff is too big to show here.

tests/type-union-source/late-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/mixed-source.txtnew file+8

This diff is too big to show here.

tests/type-union-source/nested.txtnew file+4

This diff is too big to show here.

tests/type-union-source/qualified.txtnew file+4

This diff is too big to show here.

tests/type-union-source/same.txtnew file+5

This diff is too big to show here.

tests/type-union-source/shadow-source.txtnew file+7

This diff is too big to show here.

tests/type-union-source/wide-source.txtnew file+4

This diff is too big to show here.

tests/type-union-source/wrong.txtnew file+5

This diff is too big to show here.

tests/type-union-source/zero.txtnew file+5

This diff is too big to show here.

tools/clay-fixtures+56

This diff is too big to show here.

tools/golden+12−2

This diff is too big to show here.

tools/importer-test+1−1

This diff is too big to show here.

tools/ship+46−8

This diff is too big to show here.

tools/testdata/clay-fixtures-selftestnew file+109

This diff is too big to show here.

tools/testdata/lead-late-hoon-reference.hoonnew file+24

This diff is too big to show here.

tools/testdata/selftest+10−10

This diff is too big to show here.

tools/testdata/ship-selftest+161−3

This diff is too big to show here.

tools/testdata/succ-hoon-reference.hoonnew file+9

This diff is too big to show here.

tools/testdata/zing-hoon-reference.hoonnew file+17

This diff is too big to show here.

tools/type-api-evidence-testnew file+40

This diff is too big to show here.

tools/type-api-paths-testnew file+52

This diff is too big to show here.

tools/type-arithmetic-guards-testnew file+28

This diff is too big to show here.

tools/type-ask-guards-testnew file+31

This diff is too big to show here.

tools/type-cell-branch-testnew file+43

This diff is too big to show here.

tools/type-closed-gate-guards-testnew file+29

This diff is too big to show here.

tools/type-constructor-fit-guards-testnew file+29

This diff is too big to show here.

tools/type-deferred-context-testnew file+31

This diff is too big to show here.

tools/type-deferred-resolver-testnew file+33

This diff is too big to show here.

tools/type-deferred-testnew file+32

This diff is too big to show here.

tools/type-direct-gate-testnew file+64

This diff is too big to show here.

tools/type-empty-testnew file+55

This diff is too big to show here.

tools/type-full-overlap-testnew file+49

This diff is too big to show here.

tools/type-gate-free-guards-testnew file+29

This diff is too big to show here.

tools/type-gate-free-source-testnew file+50

This diff is too big to show here.

tools/type-generic-alias-testnew file+28

This diff is too big to show here.

tools/type-generic-construction-testnew file+49

This diff is too big to show here.

tools/type-generic-pattern-testnew file+52

This diff is too big to show here.

tools/type-generic-recursion-testnew file+61

This diff is too big to show here.

tools/type-hole-guards-testnew file+32

This diff is too big to show here.

tools/type-import-default-testnew file+38

This diff is too big to show here.

tools/type-import-overlap-testnew file+33

This diff is too big to show here.

tools/type-import-structural-testnew file+36

This diff is too big to show here.

tools/type-list-alias-testnew file+33

This diff is too big to show here.

tools/type-module-scope-test+2−1

This diff is too big to show here.

tools/type-nested-union-guards-testnew file+29

This diff is too big to show here.

tools/type-poke-testnew file+50

This diff is too big to show here.

tools/type-positional-face-guards-testnew file+29

This diff is too big to show here.

tools/type-proj-guards-testnew file+32

This diff is too big to show here.

tools/type-qath-guards-testnew file+31

This diff is too big to show here.

tools/type-request-guards-testnew file+31

This diff is too big to show here.

tools/type-sub-guards-testnew file+31

This diff is too big to show here.

tools/type-tlon-testnew file+39

This diff is too big to show here.

tools/type-todo-api-testnew file+62

This diff is too big to show here.

tools/type-todo-partial-testnew file+55

This diff is too big to show here.

tools/type-union-alias-overlap-testnew file+52

This diff is too big to show here.

tools/type-union-source-testnew file+55

This diff is too big to show here.