@mark1russell7/coeval 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -508,6 +508,446 @@ function looksLikeKind(value) {
508
508
  return isRecord(value) && isRecord(field(value, "verbs"));
509
509
  }
510
510
  //#endregion
511
+ //#region src/merge.ts
512
+ /** The exception of a merge with conflicts. It lists each conflict of the merge, not only the first. */
513
+ var MergeError = class extends Error {
514
+ conflicts;
515
+ /**
516
+ * This constructor makes the exception.
517
+ *
518
+ * @param conflicts - The conflicts, in the order that the merge found them.
519
+ */
520
+ constructor(conflicts) {
521
+ const lines = conflicts.map((item) => `At ${JSON.stringify(item.path)}, the parts ${item.parts[0]} and ${item.parts[1]}: ${item.reason}`);
522
+ super(`The merge has ${conflicts.length === 1 ? "1 conflict" : `${conflicts.length} conflicts`}. ${lines.join(" ")}`);
523
+ this.name = "MergeError";
524
+ this.conflicts = conflicts;
525
+ }
526
+ };
527
+ const NONE$1 = /* @__PURE__ */ new Set();
528
+ function keyOf(path) {
529
+ return JSON.stringify(path.map(String));
530
+ }
531
+ /** This function sets an own data property. An assignment to the key `__proto__` changes the prototype. */
532
+ function setOwn$2(target, key, value) {
533
+ if (key === "__proto__") Object.defineProperty(target, key, {
534
+ value,
535
+ enumerable: true,
536
+ writable: true,
537
+ configurable: true
538
+ });
539
+ else target[key] = value;
540
+ }
541
+ function own$1(table, key) {
542
+ return table !== void 0 && Object.hasOwn(table, key) ? table[key] : void 0;
543
+ }
544
+ /** This function gives a copy of a JSON value without the fields whose value is `undefined`, as JSON writes it. */
545
+ function defined(value) {
546
+ if (Array.isArray(value)) return value.map(defined);
547
+ if (!isRecord(value)) return value;
548
+ const out = {};
549
+ for (const key of Object.keys(value)) if (value[key] !== void 0) setOwn$2(out, key, defined(value[key]));
550
+ return out;
551
+ }
552
+ /** Two values are the same when they are equal by `docEquals`. A function and a host value are equal only to themselves. */
553
+ function same(a, b) {
554
+ return Object.is(a, b) || docEquals(defined(a), defined(b));
555
+ }
556
+ /** Two lists of roots are the same when they hold the same roots, in any order. */
557
+ function sameRoots(a, b) {
558
+ if (!Array.isArray(a) || !Array.isArray(b)) return same(a, b);
559
+ return same([...new Set(a.map(String))].sort(), [...new Set(b.map(String))].sort());
560
+ }
561
+ /** The record of a merge: the conflicts, and the part that gave each entry. */
562
+ var Merger = class {
563
+ conflicts = [];
564
+ sources = /* @__PURE__ */ new Map();
565
+ /** This method gives the part that gave the entry at a path, or the entry nearest above it. */
566
+ sourceOf(path) {
567
+ for (let length = path.length; length >= 0; length -= 1) {
568
+ const found = this.sources.get(keyOf(path.slice(0, length)));
569
+ if (found !== void 0) return found;
570
+ }
571
+ return 0;
572
+ }
573
+ /** This method records the part that gives a new entry. */
574
+ give(path, part) {
575
+ this.sources.set(keyOf(path), part);
576
+ }
577
+ /** This method records the part that replaces an entry, and forgets the parts of each entry below it. */
578
+ replace(path, part) {
579
+ const below = `${keyOf(path).slice(0, -1)},`;
580
+ for (const key of [...this.sources.keys()]) if (key.startsWith(below)) this.sources.delete(key);
581
+ this.give(path, part);
582
+ }
583
+ clash(path, part, reason) {
584
+ this.conflicts.push({
585
+ path,
586
+ parts: [this.sourceOf(path), part],
587
+ reason
588
+ });
589
+ }
590
+ };
591
+ /**
592
+ * This function merges one entry of a table into the table. A new entry joins the table. A path in `replaces` gives
593
+ * the later entry. Two entries that are the same give one entry. Each other pair is a conflict.
594
+ */
595
+ function mergeLeaf(m, table, key, later, path, part, replaces, equal, reason) {
596
+ if (later === void 0) return;
597
+ const earlier = own$1(table, key);
598
+ if (earlier === void 0) {
599
+ setOwn$2(table, key, later);
600
+ m.give(path, part);
601
+ } else if (replaces.has(keyOf(path))) {
602
+ setOwn$2(table, key, later);
603
+ m.replace(path, part);
604
+ } else if (!equal(earlier, later)) m.clash(path, part, reason);
605
+ }
606
+ function what(entry) {
607
+ if (isKind(entry)) return "a kind";
608
+ if (isAlias(entry)) return "an alias";
609
+ return isNamespace(entry) ? "a namespace" : "an entry";
610
+ }
611
+ function mergeFallback(m, earlier, later, path, part, replaces) {
612
+ const table = earlier === void 0 ? {} : { fallback: earlier };
613
+ mergeLeaf(m, table, "fallback", later, path, part, replaces, same, "Two parts give two different fallback kinds.");
614
+ return table["fallback"];
615
+ }
616
+ function mergeEntries(m, into, from, path, part, replaces) {
617
+ for (const key of Object.keys(from)) {
618
+ const later = from[key];
619
+ if (later === void 0) continue;
620
+ const at = [...path, key];
621
+ const earlier = own$1(into, key);
622
+ if (earlier === void 0) {
623
+ setOwn$2(into, key, later);
624
+ m.give(at, part);
625
+ } else setOwn$2(into, key, mergeEntry(m, earlier, later, at, part, replaces));
626
+ }
627
+ }
628
+ /** This function merges two entries at one path. Two namespaces merge key by key, and their fallbacks merge too. */
629
+ function mergeEntry(m, earlier, later, path, part, replaces) {
630
+ if (replaces.has(keyOf(path))) {
631
+ m.replace(path, part);
632
+ return later;
633
+ }
634
+ if (same(earlier, later)) return earlier;
635
+ if (isNamespace(earlier) && isNamespace(later)) {
636
+ const kinds = { ...earlier.kinds };
637
+ mergeEntries(m, kinds, later.kinds, [...path, "kinds"], part, replaces);
638
+ const fallback = mergeFallback(m, earlier.fallback, later.fallback, [...path, "fallback"], part, replaces);
639
+ return fallback === void 0 ? { kinds } : {
640
+ kinds,
641
+ fallback
642
+ };
643
+ }
644
+ const a = what(earlier);
645
+ const b = what(later);
646
+ m.clash(path, part, a === b ? `Two parts give two different ${a === "an alias" ? "aliases" : "kinds"}.` : `One part gives ${a}, and the other part gives ${b}.`);
647
+ return earlier;
648
+ }
649
+ function worldOf(draft) {
650
+ const world = {
651
+ kinds: { ...draft.kinds },
652
+ defaults: { ...draft.defaults }
653
+ };
654
+ return draft.fallback === void 0 ? world : {
655
+ ...world,
656
+ fallback: draft.fallback
657
+ };
658
+ }
659
+ function mergeWorldInto(m, draft, part, index, replaces, base) {
660
+ if (part === void 0) return;
661
+ if (part.kinds !== void 0) mergeEntries(m, draft.kinds, part.kinds, [...base, "kinds"], index, replaces);
662
+ const defaults = part.defaults ?? {};
663
+ for (const verb of Object.keys(defaults)) mergeLeaf(m, draft.defaults, verb, defaults[verb], [
664
+ ...base,
665
+ "defaults",
666
+ verb
667
+ ], index, replaces, Object.is, "Two parts give two different defaults for this verb.");
668
+ const fallback = mergeFallback(m, draft.fallback, part.fallback, [...base, "fallback"], index, replaces);
669
+ if (fallback !== void 0) draft.fallback = fallback;
670
+ }
671
+ /**
672
+ * This function merges worlds into one world, in the order of the parts. It does not change a part.
673
+ *
674
+ * - Two entries that are equal by `docEquals` give one entry.
675
+ * - Two namespaces merge key by key, at each depth. Their fallbacks merge as each other entry.
676
+ * - The defaults merge verb by verb, and the world keeps one fallback.
677
+ * - Each other pair of entries at one path is a conflict, unless the later part names the path in `replaces`.
678
+ * Then the later entry wins, with no merge below it.
679
+ *
680
+ * A part can be a function of the merge of the parts before it (`prev`, as an overlay of Nix). Thus a part can read
681
+ * the entry that it replaces.
682
+ *
683
+ * @param parts - The worlds, or functions that give a world from the merge before them.
684
+ * @returns The world. It has no `replaces`.
685
+ * @throws {MergeError} The merge has a conflict. The error lists each conflict.
686
+ */
687
+ function mergeWorlds(...parts) {
688
+ const m = new Merger();
689
+ const draft = {
690
+ kinds: {},
691
+ defaults: {}
692
+ };
693
+ parts.forEach((input, index) => {
694
+ const part = typeof input === "function" ? input(worldOf(draft)) : input;
695
+ mergeWorldInto(m, draft, part, index, new Set((part.replaces ?? []).map(keyOf)), []);
696
+ });
697
+ if (m.conflicts.length > 0) throw new MergeError(m.conflicts);
698
+ return worldOf(draft);
699
+ }
700
+ /** The fields of a machine that merge by their own rules. Each other field is one value, or a conflict. */
701
+ const TABLES = /* @__PURE__ */ new Set([
702
+ "world",
703
+ "evaluators",
704
+ "runners",
705
+ "derefs",
706
+ "walkers",
707
+ "known",
708
+ "replaces"
709
+ ]);
710
+ /**
711
+ * This function composes the hooks `known` in the order of their parts. The first answer that is not `true` wins. A
712
+ * hook does not answer for an evaluator name whose code a later part replaces.
713
+ */
714
+ function composeKnown(hooks, replaced) {
715
+ const first = hooks[0];
716
+ if (first === void 0) return void 0;
717
+ if (hooks.length === 1 && replaced.size === 0) return first.known;
718
+ const list = [...hooks];
719
+ const last = new Map(replaced);
720
+ return (path, evaluator) => {
721
+ const after = last.get(evaluator);
722
+ for (const hook of list) {
723
+ if (after !== void 0 && hook.part < after) continue;
724
+ const answer = hook.known(path, evaluator);
725
+ if (answer !== true) return answer;
726
+ }
727
+ return true;
728
+ };
729
+ }
730
+ function machineOf(draft) {
731
+ const known = composeKnown(draft.hooks, draft.replaced);
732
+ return {
733
+ ...draft.rest,
734
+ world: worldOf(draft.world),
735
+ evaluators: { ...draft.evaluators },
736
+ ...draft.runners === void 0 ? {} : { runners: { ...draft.runners } },
737
+ ...draft.derefs === void 0 ? {} : { derefs: { ...draft.derefs } },
738
+ ...draft.walkers === void 0 ? {} : { walkers: { ...draft.walkers } },
739
+ ...known === void 0 ? {} : { known }
740
+ };
741
+ }
742
+ /** This function merges the evaluators and the runners of a part. The evaluator and the runner of a name are its code. */
743
+ function mergeCode(m, draft, part, index, replaces) {
744
+ if (part.runners !== void 0) draft.runners ??= {};
745
+ const names = /* @__PURE__ */ new Set([...Object.keys(part.evaluators ?? {}), ...Object.keys(part.runners ?? {})]);
746
+ for (const name of names) {
747
+ const evaluator = own$1(part.evaluators, name);
748
+ const runner = own$1(part.runners, name);
749
+ if (evaluator === void 0 && runner === void 0) continue;
750
+ const evaluatorPath = ["evaluators", name];
751
+ const runnerPath = ["runners", name];
752
+ if (replaces.has(keyOf(evaluatorPath)) || replaces.has(keyOf(runnerPath))) {
753
+ if (evaluator === void 0) delete draft.evaluators[name];
754
+ else setOwn$2(draft.evaluators, name, evaluator);
755
+ if (runner !== void 0) setOwn$2(draft.runners ??= {}, name, runner);
756
+ else if (draft.runners !== void 0) delete draft.runners[name];
757
+ m.replace(evaluatorPath, index);
758
+ m.replace(runnerPath, index);
759
+ draft.replaced.set(name, index);
760
+ continue;
761
+ }
762
+ mergeLeaf(m, draft.evaluators, name, evaluator, evaluatorPath, index, NONE$1, Object.is, "Two parts give two different evaluators for this name.");
763
+ if (runner !== void 0) mergeLeaf(m, draft.runners ??= {}, name, runner, runnerPath, index, NONE$1, Object.is, "Two parts give two different runners for this name.");
764
+ }
765
+ }
766
+ /** A runner hides the evaluator of its name. Thus a name with a runner and an evaluator needs one part that gives both. */
767
+ function checkHidden(m, draft) {
768
+ const runners = draft.runners ?? {};
769
+ for (const name of Object.keys(runners)) {
770
+ const runner = runners[name];
771
+ const evaluator = own$1(draft.evaluators, name);
772
+ if (runner === void 0 || evaluator === void 0) continue;
773
+ if (draft.parts.some((part) => own$1(part.evaluators, name) === evaluator && own$1(part.runners, name) === runner)) continue;
774
+ const a = m.sourceOf(["evaluators", name]);
775
+ const b = m.sourceOf(["runners", name]);
776
+ m.conflicts.push({
777
+ path: ["runners", name],
778
+ parts: [Math.min(a, b), Math.max(a, b)],
779
+ reason: "The runner of one part hides the evaluator of the other part, because a runner wins over an evaluator of its name."
780
+ });
781
+ }
782
+ }
783
+ /**
784
+ * This function merges machines into one machine, in the order of the parts. It does not change a part.
785
+ *
786
+ * - The worlds merge with the rules of `mergeWorlds`. The paths of their conflicts start with `"world"`.
787
+ * - The tables `evaluators`, `runners`, `derefs` and `walkers` merge name by name. A function is equal only to itself.
788
+ * - The evaluator and the runner of a name are its code. A replacement of the name replaces both.
789
+ * - A runner hides the evaluator of its name. Thus one part must give both, or the merge gives a conflict.
790
+ * - The hooks `known` compose in the order of the parts. A hook does not answer for a name that a later part replaces.
791
+ * - Each other field, for example `permits`, `adopt`, `roots`, `plain` or `maxDepth`, is one value. Two different
792
+ * values are a conflict. An absent field has no value.
793
+ *
794
+ * A conflict stops the merge, unless the later part names its path in `replaces`. A part can be a function of the
795
+ * merge of the parts before it (`prev`, as an overlay of Nix). Thus a part can wrap the code that it replaces.
796
+ *
797
+ * @param parts - The machines, or functions that give a machine from the merge before them.
798
+ * @returns The machine.
799
+ * @throws {MergeError} The merge has a conflict. The error lists each conflict.
800
+ */
801
+ function mergeMachines(...parts) {
802
+ const m = new Merger();
803
+ const draft = {
804
+ world: {
805
+ kinds: {},
806
+ defaults: {}
807
+ },
808
+ evaluators: {},
809
+ hooks: [],
810
+ replaced: /* @__PURE__ */ new Map(),
811
+ rest: {},
812
+ parts: []
813
+ };
814
+ parts.forEach((input, index) => {
815
+ const part = typeof input === "function" ? input(machineOf(draft)) : input;
816
+ draft.parts.push(part);
817
+ const replaces = new Set([...part.replaces ?? [], ...(part.world?.replaces ?? []).map((path) => ["world", ...path])].map(keyOf));
818
+ mergeWorldInto(m, draft.world, part.world, index, replaces, ["world"]);
819
+ mergeCode(m, draft, part, index, replaces);
820
+ if (part.derefs !== void 0) {
821
+ const derefs = draft.derefs ??= {};
822
+ for (const name of Object.keys(part.derefs)) mergeLeaf(m, derefs, name, part.derefs[name], ["derefs", name], index, replaces, Object.is, "Two parts give two different deref codes for this name.");
823
+ }
824
+ if (part.walkers !== void 0) {
825
+ const walkers = draft.walkers ??= {};
826
+ for (const name of Object.keys(part.walkers)) mergeLeaf(m, walkers, name, part.walkers[name], ["walkers", name], index, replaces, Object.is, "Two parts give two different walkers for this name.");
827
+ }
828
+ if (part.known !== void 0 && !draft.hooks.some((hook) => hook.known === part.known)) draft.hooks.push({
829
+ part: index,
830
+ known: part.known
831
+ });
832
+ const fields = part;
833
+ for (const key of Object.keys(fields)) {
834
+ if (TABLES.has(key)) continue;
835
+ mergeLeaf(m, draft.rest, key, fields[key], [key], index, replaces, key === "roots" ? sameRoots : same, `Two parts give two different values for ${key}.`);
836
+ }
837
+ });
838
+ checkHidden(m, draft);
839
+ if (m.conflicts.length > 0) throw new MergeError(m.conflicts);
840
+ return machineOf(draft);
841
+ }
842
+ /** This function removes the entry at a path from a table of entries. It gives the same table when no entry is there. */
843
+ function removeEntry(entries, path) {
844
+ const [first, ...rest] = path;
845
+ if (first === void 0) return entries;
846
+ const key = String(first);
847
+ const entry = own$1(entries, key);
848
+ if (entry === void 0) return entries;
849
+ let next;
850
+ if (rest.length > 0) {
851
+ if (!isNamespace(entry)) return entries;
852
+ if (rest.length === 1 && String(rest[0]) === "fallback") {
853
+ if (entry.fallback === void 0) return entries;
854
+ next = { kinds: entry.kinds };
855
+ } else {
856
+ if (String(rest[0]) !== "kinds") return entries;
857
+ const kinds = removeEntry(entry.kinds, rest.slice(1));
858
+ if (kinds === entry.kinds) return entries;
859
+ next = entry.fallback === void 0 ? { kinds } : {
860
+ kinds,
861
+ fallback: entry.fallback
862
+ };
863
+ }
864
+ }
865
+ const out = { ...entries };
866
+ if (next === void 0) delete out[key];
867
+ else setOwn$2(out, key, next);
868
+ return out;
869
+ }
870
+ /**
871
+ * This function removes entries from a world, for a language that restricts another language. A path names an entry
872
+ * as `replaces` names it, for example `["kinds", "fn"]`, `["kinds", "ops", "kinds", "mul"]`,
873
+ * `["kinds", "ops", "fallback"]`, `["defaults", "view"]` or `["fallback"]`. A path that names no entry changes
874
+ * nothing. The function does not change the world.
875
+ *
876
+ * A removed kind gives `#KIND?`, also through an alias to it. A namespace without its fallback knows only its own keys.
877
+ * A world without its fallback is closed.
878
+ *
879
+ * @param world - The world.
880
+ * @param paths - The paths of the entries to remove.
881
+ * @returns The world without the entries.
882
+ */
883
+ function restrictWorld(world, paths) {
884
+ let kinds = world.kinds;
885
+ const defaults = { ...world.defaults };
886
+ let fallback = world.fallback;
887
+ for (const path of paths) {
888
+ const [first, ...rest] = path.map(String);
889
+ if (first === "kinds") kinds = removeEntry(kinds, rest);
890
+ else if (first === "defaults" && rest.length === 1) delete defaults[rest[0]];
891
+ else if (first === "fallback" && rest.length === 0) fallback = void 0;
892
+ }
893
+ const out = {
894
+ kinds: { ...kinds },
895
+ defaults
896
+ };
897
+ return fallback === void 0 ? out : {
898
+ ...out,
899
+ fallback
900
+ };
901
+ }
902
+ /** The tables of the code of a machine, as the paths of a restriction name them. */
903
+ const CODE_TABLES = [
904
+ "evaluators",
905
+ "runners",
906
+ "derefs",
907
+ "walkers"
908
+ ];
909
+ /**
910
+ * This function removes entries from a machine, for a language that restricts another language. A path names an
911
+ * entry as `replaces` names it:
912
+ *
913
+ * - A path that starts with `"world"` removes an entry of the world, with the rules of `restrictWorld`.
914
+ * - `["evaluators", name]` or `["runners", name]` removes the code of the name: its evaluator and its runner.
915
+ * - `["derefs", name]` and `["walkers", name]` remove one entry of their tables.
916
+ *
917
+ * A path that names no entry changes nothing. The function does not change the machine. An own entry names an
918
+ * evaluator directly, thus only a machine without the code of a name refuses each document that names it.
919
+ *
920
+ * @param machine - The machine.
921
+ * @param paths - The paths of the entries to remove.
922
+ * @returns The machine without the entries.
923
+ */
924
+ function restrictMachine(machine, paths) {
925
+ const world = paths.filter((path) => String(path[0]) === "world").map((path) => path.slice(1));
926
+ const tables = {
927
+ evaluators: { ...machine.evaluators },
928
+ runners: machine.runners === void 0 ? void 0 : { ...machine.runners },
929
+ derefs: machine.derefs === void 0 ? void 0 : { ...machine.derefs },
930
+ walkers: machine.walkers === void 0 ? void 0 : { ...machine.walkers }
931
+ };
932
+ for (const path of paths) {
933
+ const [table, name, ...rest] = path.map(String);
934
+ if (name === void 0 || rest.length > 0 || !CODE_TABLES.includes(table)) continue;
935
+ const from = table === "evaluators" || table === "runners" ? ["evaluators", "runners"] : [table];
936
+ for (const key of from) {
937
+ const entries = tables[key];
938
+ if (entries !== void 0) delete entries[name];
939
+ }
940
+ }
941
+ return {
942
+ ...machine,
943
+ world: world.length === 0 ? machine.world : restrictWorld(machine.world, world),
944
+ evaluators: tables.evaluators,
945
+ ...tables.runners === void 0 ? {} : { runners: tables.runners },
946
+ ...tables.derefs === void 0 ? {} : { derefs: tables.derefs },
947
+ ...tables.walkers === void 0 ? {} : { walkers: tables.walkers }
948
+ };
949
+ }
950
+ //#endregion
511
951
  //#region src/ladder.ts
512
952
  /** The rungs of the ladder, in the order that a question visits them. */
513
953
  const RUNGS = [
@@ -4022,37 +4462,26 @@ function formulaKnown(profile = {}) {
4022
4462
  };
4023
4463
  }
4024
4464
  /**
4025
- * This function makes a machine for a formula language. The machine has the kinds and the evaluators of the
4026
- * formula kit. It also has the kinds, the evaluators and the walkers that the language adds. Its hook `known` comes
4027
- * from the profile (`formulaKnown`). A hook `known` of the language answers each name that the kit knows.
4465
+ * This function makes a machine for a formula language. It merges the kit and the parts that the language adds with
4466
+ * `mergeMachines`. Thus a kind `ops.*` or a namespace `ops` of the language extends the namespace of the kit, and
4467
+ * the fallback of the kit stays. The hook `known` of the kit comes from the profile (`formulaKnown`). A hook `known`
4468
+ * of the language answers after it.
4469
+ *
4470
+ * A kind or an evaluator of the language that differs from the entry of the kit with its name is a conflict. The
4471
+ * language names the path in `replaces` to replace the entry, for example `["world", "kinds", "ref"]` or
4472
+ * `["evaluators", "formula.op"]`. Then the hook of the kit does not answer for a replaced evaluator.
4028
4473
  *
4029
4474
  * @param profile - The operations and the rules of the language.
4030
- * @param more - The parts of a machine that the language adds. Its kinds win over the kinds of the kit.
4475
+ * @param more - The parts of a machine that the language adds, with the paths of the entries that it replaces.
4031
4476
  * @returns The machine.
4477
+ * @throws {MergeError} The language and the kit have a conflict.
4032
4478
  */
4033
4479
  function formulaMachine(profile = {}, more = {}) {
4034
- const kit = formulaKnown(profile);
4035
- const replaced = (name) => more.evaluators !== void 0 && Object.hasOwn(more.evaluators, name) || more.runners !== void 0 && Object.hasOwn(more.runners, name);
4036
- const theirs = more.known;
4037
- const known = (path, evaluator) => {
4038
- const answer = replaced(evaluator) ? true : kit(path, evaluator);
4039
- return answer === true && theirs !== void 0 ? theirs(path, evaluator) : answer;
4040
- };
4041
- return {
4042
- ...more,
4043
- world: {
4044
- kinds: {
4045
- ...formulaKinds(),
4046
- ...more.world?.kinds
4047
- },
4048
- defaults: { ...more.world?.defaults }
4049
- },
4050
- evaluators: {
4051
- ...formulaEvaluators(profile),
4052
- ...more.evaluators
4053
- },
4054
- known
4055
- };
4480
+ return mergeMachines({
4481
+ world: { kinds: formulaKinds() },
4482
+ evaluators: formulaEvaluators(profile),
4483
+ known: formulaKnown(profile)
4484
+ }, more);
4056
4485
  }
4057
4486
  //#endregion
4058
4487
  //#region src/reference.ts
@@ -5243,6 +5672,6 @@ function generate(world, options) {
5243
5672
  });
5244
5673
  }
5245
5674
  //#endregion
5246
- export { CONSTRUCTS, ENVELOPE_KEYS, Failure, Held, PARTS, PART_INFO, ROOTS, RUNGS, STD_CAPS, STD_DEFINITIONS, STD_EVALUATORS, STD_EXT, STD_MACHINE, STD_RUNNERS, STD_WALKERS, STD_WORLD, THING, agree, ask, capKeys, check, checkSteps, classify, context, dataEdges, derefStep, describe, docEquals, effectEdges, entriesAsJson, evaluate, fail, failures, field, flatten, formulaDefinitions, formulaEvaluators, formulaKinds, formulaKnown, formulaMachine, fromJson, generate, intersectCaps, isAlias, isAllowedOrder, isClosure, isEnvelope, isHostThing, isKey, isKind, isNamespace, isRecord, isRef, isStackOverflow, isTypeRef, jsTruthy, kindDocument, kindNamed, kindOf, layers, looksLikeKind, lookupKind, makeContext, mapRefs, narrow, nearestWalker, nodeAt, ok, partCaps, partsOf, pathMatches, permits, placed, planner, prepare, random, ref, reference, refsOf, resolve, run, sameValue, splitParts, stored, tag, thrown, toJson, typeName, typePath, typed, typesOf, valueOfThing, walk, worldThing };
5675
+ export { CONSTRUCTS, ENVELOPE_KEYS, Failure, Held, MergeError, PARTS, PART_INFO, ROOTS, RUNGS, STD_CAPS, STD_DEFINITIONS, STD_EVALUATORS, STD_EXT, STD_MACHINE, STD_RUNNERS, STD_WALKERS, STD_WORLD, THING, agree, ask, capKeys, check, checkSteps, classify, context, dataEdges, derefStep, describe, docEquals, effectEdges, entriesAsJson, evaluate, fail, failures, field, flatten, formulaDefinitions, formulaEvaluators, formulaKinds, formulaKnown, formulaMachine, fromJson, generate, intersectCaps, isAlias, isAllowedOrder, isClosure, isEnvelope, isHostThing, isKey, isKind, isNamespace, isRecord, isRef, isStackOverflow, isTypeRef, jsTruthy, kindDocument, kindNamed, kindOf, layers, looksLikeKind, lookupKind, makeContext, mapRefs, mergeMachines, mergeWorlds, narrow, nearestWalker, nodeAt, ok, partCaps, partsOf, pathMatches, permits, placed, planner, prepare, random, ref, reference, refsOf, resolve, restrictMachine, restrictWorld, run, sameValue, splitParts, stored, tag, thrown, toJson, typeName, typePath, typed, typesOf, valueOfThing, walk, worldThing };
5247
5676
 
5248
5677
  //# sourceMappingURL=index.js.map