@fncts/schema 0.0.23 → 0.0.25

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.
Files changed (146) hide show
  1. package/AST.d.ts +60 -29
  2. package/ASTAnnotationMap.d.ts +4 -1
  3. package/LICENSE +26 -0
  4. package/ParseError/ParseError.d.ts +28 -13
  5. package/_cjs/AST.cjs +1096 -1087
  6. package/_cjs/AST.cjs.map +1 -1
  7. package/_cjs/ASTAnnotation.cjs +114 -83
  8. package/_cjs/ASTAnnotation.cjs.map +1 -1
  9. package/_cjs/ASTAnnotationMap.cjs +43 -32
  10. package/_cjs/ASTAnnotationMap.cjs.map +1 -1
  11. package/_cjs/Eq.cjs +113 -145
  12. package/_cjs/Eq.cjs.map +1 -1
  13. package/_cjs/Gen.cjs +131 -167
  14. package/_cjs/Gen.cjs.map +1 -1
  15. package/_cjs/Guard.cjs +167 -267
  16. package/_cjs/Guard.cjs.map +1 -1
  17. package/_cjs/InvalidInterpretationError.cjs +9 -15
  18. package/_cjs/InvalidInterpretationError.cjs.map +1 -1
  19. package/_cjs/ParseError/ParseError.cjs +285 -209
  20. package/_cjs/ParseError/ParseError.cjs.map +1 -1
  21. package/_cjs/ParseError/ParseErrorFormatter.cjs +0 -2
  22. package/_cjs/ParseError/PathFormatter.cjs +55 -87
  23. package/_cjs/ParseError/PathFormatter.cjs.map +1 -1
  24. package/_cjs/ParseError/TreeFormatter.cjs +70 -102
  25. package/_cjs/ParseError/TreeFormatter.cjs.map +1 -1
  26. package/_cjs/ParseError.cjs +35 -50
  27. package/_cjs/ParseResult.cjs +15 -15
  28. package/_cjs/ParseResult.cjs.map +1 -1
  29. package/_cjs/Parser/api.cjs +54 -50
  30. package/_cjs/Parser/api.cjs.map +1 -1
  31. package/_cjs/Parser/definition.cjs +17 -16
  32. package/_cjs/Parser/definition.cjs.map +1 -1
  33. package/_cjs/Parser/interpreter.cjs +276 -358
  34. package/_cjs/Parser/interpreter.cjs.map +1 -1
  35. package/_cjs/Parser.cjs +12 -39
  36. package/_cjs/Schema/api/conc.cjs +64 -59
  37. package/_cjs/Schema/api/conc.cjs.map +1 -1
  38. package/_cjs/Schema/api/either.cjs +73 -72
  39. package/_cjs/Schema/api/either.cjs.map +1 -1
  40. package/_cjs/Schema/api/hashMap.cjs +85 -85
  41. package/_cjs/Schema/api/hashMap.cjs.map +1 -1
  42. package/_cjs/Schema/api/hashSet.cjs +75 -69
  43. package/_cjs/Schema/api/hashSet.cjs.map +1 -1
  44. package/_cjs/Schema/api/list.cjs +74 -64
  45. package/_cjs/Schema/api/list.cjs.map +1 -1
  46. package/_cjs/Schema/api/map.cjs +81 -83
  47. package/_cjs/Schema/api/map.cjs.map +1 -1
  48. package/_cjs/Schema/api/maybe.cjs +56 -49
  49. package/_cjs/Schema/api/maybe.cjs.map +1 -1
  50. package/_cjs/Schema/api/set.cjs +68 -61
  51. package/_cjs/Schema/api/set.cjs.map +1 -1
  52. package/_cjs/Schema/api.cjs +332 -350
  53. package/_cjs/Schema/api.cjs.map +1 -1
  54. package/_cjs/Schema/definition.cjs +28 -27
  55. package/_cjs/Schema/definition.cjs.map +1 -1
  56. package/_cjs/Schema/derivations.cjs +85 -100
  57. package/_cjs/Schema/derivations.cjs.map +1 -1
  58. package/_cjs/Schema.cjs +95 -127
  59. package/_cjs/Show.cjs +91 -151
  60. package/_cjs/Show.cjs.map +1 -1
  61. package/_cjs/chunk.cjs +28 -0
  62. package/_cjs/global.cjs +0 -2
  63. package/_cjs/index.cjs +0 -2
  64. package/_cjs/utils.cjs +41 -46
  65. package/_cjs/utils.cjs.map +1 -1
  66. package/_mjs/AST.mjs +1007 -1031
  67. package/_mjs/AST.mjs.map +1 -1
  68. package/_mjs/ASTAnnotation.mjs +77 -71
  69. package/_mjs/ASTAnnotation.mjs.map +1 -1
  70. package/_mjs/ASTAnnotationMap.mjs +36 -25
  71. package/_mjs/ASTAnnotationMap.mjs.map +1 -1
  72. package/_mjs/Eq.mjs +101 -134
  73. package/_mjs/Eq.mjs.map +1 -1
  74. package/_mjs/Gen.mjs +117 -157
  75. package/_mjs/Gen.mjs.map +1 -1
  76. package/_mjs/Guard.mjs +154 -257
  77. package/_mjs/Guard.mjs.map +1 -1
  78. package/_mjs/InvalidInterpretationError.mjs +8 -9
  79. package/_mjs/InvalidInterpretationError.mjs.map +1 -1
  80. package/_mjs/ParseError/ParseError.mjs +270 -190
  81. package/_mjs/ParseError/ParseError.mjs.map +1 -1
  82. package/_mjs/ParseError/ParseErrorFormatter.mjs +0 -2
  83. package/_mjs/ParseError/PathFormatter.mjs +51 -80
  84. package/_mjs/ParseError/PathFormatter.mjs.map +1 -1
  85. package/_mjs/ParseError/TreeFormatter.mjs +62 -94
  86. package/_mjs/ParseError/TreeFormatter.mjs.map +1 -1
  87. package/_mjs/ParseError.mjs +5 -6
  88. package/_mjs/ParseResult.mjs +13 -9
  89. package/_mjs/ParseResult.mjs.map +1 -1
  90. package/_mjs/Parser/api.mjs +43 -39
  91. package/_mjs/Parser/api.mjs.map +1 -1
  92. package/_mjs/Parser/definition.mjs +12 -8
  93. package/_mjs/Parser/definition.mjs.map +1 -1
  94. package/_mjs/Parser/interpreter.mjs +262 -348
  95. package/_mjs/Parser/interpreter.mjs.map +1 -1
  96. package/_mjs/Parser.mjs +4 -5
  97. package/_mjs/Schema/api/conc.mjs +41 -45
  98. package/_mjs/Schema/api/conc.mjs.map +1 -1
  99. package/_mjs/Schema/api/either.mjs +55 -61
  100. package/_mjs/Schema/api/either.mjs.map +1 -1
  101. package/_mjs/Schema/api/hashMap.mjs +61 -71
  102. package/_mjs/Schema/api/hashMap.mjs.map +1 -1
  103. package/_mjs/Schema/api/hashSet.mjs +53 -56
  104. package/_mjs/Schema/api/hashSet.mjs.map +1 -1
  105. package/_mjs/Schema/api/list.mjs +50 -51
  106. package/_mjs/Schema/api/list.mjs.map +1 -1
  107. package/_mjs/Schema/api/map.mjs +59 -69
  108. package/_mjs/Schema/api/map.mjs.map +1 -1
  109. package/_mjs/Schema/api/maybe.mjs +34 -36
  110. package/_mjs/Schema/api/maybe.mjs.map +1 -1
  111. package/_mjs/Schema/api/set.mjs +47 -48
  112. package/_mjs/Schema/api/set.mjs.map +1 -1
  113. package/_mjs/Schema/api.mjs +304 -346
  114. package/_mjs/Schema/api.mjs.map +1 -1
  115. package/_mjs/Schema/definition.mjs +21 -18
  116. package/_mjs/Schema/definition.mjs.map +1 -1
  117. package/_mjs/Schema/derivations.mjs +71 -90
  118. package/_mjs/Schema/derivations.mjs.map +1 -1
  119. package/_mjs/Schema.mjs +12 -15
  120. package/_mjs/Show.mjs +79 -139
  121. package/_mjs/Show.mjs.map +1 -1
  122. package/_mjs/global.mjs +0 -2
  123. package/_mjs/index.mjs +0 -2
  124. package/_mjs/utils.mjs +35 -37
  125. package/_mjs/utils.mjs.map +1 -1
  126. package/_src/AST.ts +226 -28
  127. package/_src/ASTAnnotationMap.ts +14 -1
  128. package/_src/ParseError/ParseError.ts +128 -13
  129. package/_src/Schema/api/hashMap.ts +1 -1
  130. package/_src/Schema/api/hashSet.ts +1 -1
  131. package/_src/Schema/api/list.ts +3 -1
  132. package/_src/Schema/api/map.ts +1 -1
  133. package/_src/Schema/api/set.ts +1 -1
  134. package/package.json +7 -3
  135. package/_cjs/ParseError/ParseErrorFormatter.cjs.map +0 -1
  136. package/_cjs/ParseError.cjs.map +0 -1
  137. package/_cjs/Parser.cjs.map +0 -1
  138. package/_cjs/Schema.cjs.map +0 -1
  139. package/_cjs/global.cjs.map +0 -1
  140. package/_cjs/index.cjs.map +0 -1
  141. package/_mjs/ParseError/ParseErrorFormatter.mjs.map +0 -1
  142. package/_mjs/ParseError.mjs.map +0 -1
  143. package/_mjs/Parser.mjs.map +0 -1
  144. package/_mjs/Schema.mjs.map +0 -1
  145. package/_mjs/global.mjs.map +0 -1
  146. package/_mjs/index.mjs.map +0 -1
package/_mjs/AST.mjs CHANGED
@@ -1,1149 +1,1125 @@
1
- var _a;
2
- const fileName_1 = "(@fncts/schema) src/AST.ts";
3
- import * as tsplus_module_1 from "@fncts/schema/Show";
4
- import * as tsplus_module_2 from "@fncts/schema/ASTAnnotation";
5
- import * as tsplus_module_3 from "@fncts/base/collection/immutable/Vector/api";
6
- import * as tsplus_module_4 from "@fncts/base/data/Maybe/constructors";
7
- import * as tsplus_module_5 from "@fncts/schema/ParseResult";
8
- import * as tsplus_module_6 from "@fncts/schema/ParseError/ParseError";
9
- import * as tsplus_module_7 from "@fncts/base/data/number/instances";
10
- import * as tsplus_module_8 from "@fncts/base/data/Ord/api/contramap";
11
- import * as tsplus_module_9 from "@fncts/base/data/Ord/api";
12
- import * as tsplus_module_10 from "@fncts/base/data/Ord/api/max";
13
- import * as tsplus_module_11 from "@fncts/base/collection/Iterable/api";
14
- import * as tsplus_module_12 from "@fncts/base/data/Maybe/destructors";
15
- import * as tsplus_module_13 from "@fncts/base/data/Maybe/definition";
16
- import * as tsplus_module_14 from "@fncts/base/collection/immutable/Vector/internal";
17
- import * as tsplus_module_15 from "@fncts/base/data/Maybe/api";
18
- export const createLiteral = createLiteral_1;
19
- export const isLiteral = isLiteral_1;
20
- export const createUniqueSymbol = createUniqueSymbol_1;
21
- export const isUniqueSymbol = isUniqueSymbol_1;
22
- export const isStringKeyword = isStringKeyword_1;
23
- export const isNumberKeyword = isNumberKeyword_1;
24
- export const isSymbolKeyword = isSymbolKeyword_1;
25
- export const createTemplateLiteral = createTemplateLiteral_1;
26
- export const createElement = createElement_1;
27
- export const createTuple = createTuple_1;
28
- export const createPropertySignature = createPropertySignature_1;
29
- export const createIndexSignature = createIndexSignature_1;
30
- export const createTypeLiteral = createTypeLiteral_1;
31
- export const createUnion = createUnion_1;
32
- export const createLazy = createLazy_1;
33
- export const createRefinement = createRefinement_1;
34
- export const getPropertySignatures = getPropertySignatures_1;
35
- export const keysOf = keysOf_1;
36
- export const partial = partial_1;
37
- export const getFrom = getFrom_1;
38
- export const getTo = getTo_1;
1
+ import { ASTAnnotationMap } from "./ASTAnnotationMap.mjs";
2
+ import * as tsplus_module_6 from "@fncts/base/collection/immutable/Vector/api";
39
3
  import { show } from "@fncts/base/data/Showable";
4
+ import * as tsplus_module_18 from "@fncts/base/data/Maybe/api";
5
+ import * as tsplus_module_7 from "@fncts/base/data/Maybe/constructors";
6
+ import * as tsplus_module_15 from "@fncts/base/data/Maybe/destructors";
40
7
  import { memoize } from "@fncts/schema/utils";
41
- import { ASTAnnotationMap } from "./ASTAnnotationMap.mjs";
42
- export const ASTTypeId = /*#__PURE__*/Symbol.for("fncts.schema.AST");
43
- export class Annotated {
44
- constructor() {
45
- this.annotations = ASTAnnotationMap.empty;
46
- }
47
- }
8
+ import * as tsplus_module_4 from "@fncts/schema/ASTAnnotation";
9
+ import * as tsplus_module_8 from "@fncts/schema/ParseResult";
10
+ import * as tsplus_module_16 from "@fncts/base/data/Maybe/definition";
11
+ import * as tsplus_module_1 from "@fncts/base/data/Equatable/definition";
12
+ import * as tsplus_module_2 from "@fncts/schema/Show";
13
+ import * as tsplus_module_3 from "@fncts/base/util/predicates";
14
+ import * as tsplus_module_5 from "@fncts/base/collection/immutable/Vector/definition";
15
+ import * as tsplus_module_9 from "@fncts/schema/ParseError/ParseError";
16
+ import * as tsplus_module_10 from "@fncts/base/data/number/instances";
17
+ import * as tsplus_module_11 from "@fncts/base/data/Ord/api/contramap";
18
+ import * as tsplus_module_12 from "@fncts/base/data/Ord/api";
19
+ import * as tsplus_module_13 from "@fncts/base/data/Ord/api/max";
20
+ import * as tsplus_module_14 from "@fncts/base/collection/Iterable/api";
21
+ import * as tsplus_module_17 from "@fncts/base/collection/immutable/Vector/internal";
22
+ //#region build/esm/AST.js
23
+ const fileName_1 = "(@fncts/schema) src/AST.ts";
24
+ const createLiteral = createLiteral_1;
25
+ const isLiteral = isLiteral_1;
26
+ const createUniqueSymbol = createUniqueSymbol_1;
27
+ const isUniqueSymbol = isUniqueSymbol_1;
28
+ const isStringKeyword = isStringKeyword_1;
29
+ const isNumberKeyword = isNumberKeyword_1;
30
+ const isSymbolKeyword = isSymbolKeyword_1;
31
+ const createTemplateLiteral = createTemplateLiteral_1;
32
+ const createElement = createElement_1;
33
+ const createTuple = createTuple_1;
34
+ const createPropertySignature = createPropertySignature_1;
35
+ const createIndexSignature = createIndexSignature_1;
36
+ const createTypeLiteral = createTypeLiteral_1;
37
+ const createUnion = createUnion_1;
38
+ const createLazy = createLazy_1;
39
+ const createRefinement = createRefinement_1;
40
+ const getPropertySignatures = getPropertySignatures_1;
41
+ const keysOf = keysOf_1;
42
+ const partial = partial_1;
43
+ const getFrom = getFrom_1;
44
+ const getTo = getTo_1;
45
+ const ASTTypeId = Symbol.for("fncts.schema.AST");
46
+ var Annotated = class {
47
+ annotations = ASTAnnotationMap.empty;
48
+ };
48
49
  /**
49
- * @tsplus type fncts.schema.AST
50
- * @tsplus companion fncts.schema.ASTOps
51
- */
52
- export class AST extends Annotated {
53
- constructor() {
54
- super(...arguments);
55
- this[_a] = ASTTypeId;
56
- }
57
- toString(verbose = false) {
58
- return tsplus_module_1.showAST(verbose)(this);
59
- }
60
- }
61
- _a = ASTTypeId;
50
+ * @tsplus type fncts.schema.AST
51
+ * @tsplus companion fncts.schema.ASTOps
52
+ */
53
+ var AST = class extends Annotated {
54
+ [ASTTypeId] = ASTTypeId;
55
+ toString(verbose = false) {
56
+ return tsplus_module_2.showAST(verbose)(this);
57
+ }
58
+ };
62
59
  /**
63
- * @tsplus static fncts.schema.ASTOps concrete
64
- * @tsplus macro remove
65
- */
66
- export function concrete(_) {
67
- //
60
+ * @tsplus static fncts.schema.ASTOps concrete
61
+ * @tsplus macro remove
62
+ */
63
+ function concrete(_) {}
64
+ function isAST(u) {
65
+ return tsplus_module_3.isObject(u) && ASTTypeId in u;
68
66
  }
69
- export function getAnnotations(key) {
70
- return self => {
71
- return self.annotations.get(key);
72
- };
67
+ function hasTag(u, tag) {
68
+ return isAST(u) && u._tag === tag;
73
69
  }
74
- /*
75
- * Declaration
76
- */
77
- /**
78
- * @tsplus type fncts.schema.AST.Declaration
79
- */
80
- export class Declaration extends AST {
81
- constructor(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
82
- super();
83
- this.typeParameters = typeParameters;
84
- this.decode = decode;
85
- this.encode = encode;
86
- this.annotations = annotations;
87
- this._tag = 0 /* ASTTag.Declaration */;
88
- }
89
- clone(newProperties) {
90
- return new Declaration(newProperties.typeParameters ?? this.typeParameters, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
91
- }
70
+ function getAnnotations(key) {
71
+ return (self) => {
72
+ return self.annotations.get(key);
73
+ };
92
74
  }
93
75
  /**
94
- * @tsplus static fncts.schema.ASTOps createDeclaration
95
- */
96
- export function createDeclaration(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
97
- return new Declaration(typeParameters, decode, encode, annotations);
98
- }
76
+ * @tsplus type fncts.schema.AST.Declaration
77
+ */
78
+ var Declaration = class Declaration extends AST {
79
+ typeParameters;
80
+ decode;
81
+ encode;
82
+ annotations;
83
+ _tag = 0;
84
+ constructor(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
85
+ super();
86
+ this.typeParameters = typeParameters;
87
+ this.decode = decode;
88
+ this.encode = encode;
89
+ this.annotations = annotations;
90
+ }
91
+ clone(newProperties) {
92
+ return new Declaration(newProperties.typeParameters ?? this.typeParameters, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
93
+ }
94
+ [tsplus_module_1.equalsSymbol](that, context) {
95
+ return hasTag(that, 0) && context.comparator(this.typeParameters, that.typeParameters) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
96
+ }
97
+ };
99
98
  /**
100
- * @tsplus fluent fncts.schema.AST isDeclaration
101
- */
102
- export function isDeclaration(self) {
103
- void 0;
104
- return self._tag === 0 /* ASTTag.Declaration */;
105
- }
106
- export class Literal extends AST {
107
- constructor(literal, annotations = ASTAnnotationMap.empty) {
108
- super();
109
- this.literal = literal;
110
- this.annotations = annotations;
111
- this._tag = 1 /* ASTTag.Literal */;
112
- }
113
- clone(newProperties) {
114
- return new Literal(newProperties.literal ?? this.literal, newProperties.annotations ?? this.annotations);
115
- }
99
+ * @tsplus static fncts.schema.ASTOps createDeclaration
100
+ */
101
+ function createDeclaration(typeParameters, decode, encode, annotations = ASTAnnotationMap.empty) {
102
+ return new Declaration(typeParameters, decode, encode, annotations);
116
103
  }
117
104
  /**
118
- * @tsplus static fncts.schema.ASTOps createLiteral
119
- */
105
+ * @tsplus fluent fncts.schema.AST isDeclaration
106
+ */
107
+ function isDeclaration(self) {
108
+ return self._tag === 0;
109
+ }
110
+ var Literal = class Literal extends AST {
111
+ literal;
112
+ annotations;
113
+ _tag = 1;
114
+ constructor(literal, annotations = ASTAnnotationMap.empty) {
115
+ super();
116
+ this.literal = literal;
117
+ this.annotations = annotations;
118
+ }
119
+ clone(newProperties) {
120
+ return new Literal(newProperties.literal ?? this.literal, newProperties.annotations ?? this.annotations);
121
+ }
122
+ [tsplus_module_1.equalsSymbol](that, context) {
123
+ return hasTag(that, 1) && context.comparator(this.literal, that.literal) && context.comparator(this.annotations, that.annotations);
124
+ }
125
+ };
126
+ /**
127
+ * @tsplus static fncts.schema.ASTOps createLiteral
128
+ */
120
129
  function createLiteral_1(literal, annotations = ASTAnnotationMap.empty) {
121
- return new Literal(literal, annotations);
130
+ return new Literal(literal, annotations);
122
131
  }
123
132
  /**
124
- * @tsplus fluent fncts.schema.AST isLiteral
125
- */
133
+ * @tsplus fluent fncts.schema.AST isLiteral
134
+ */
126
135
  function isLiteral_1(self) {
127
- void 0;
128
- return self._tag === 1 /* ASTTag.Literal */;
129
- }
130
- /*
131
- * UniqueSymbol
132
- */
133
- export class UniqueSymbol extends AST {
134
- constructor(symbol, annotations = ASTAnnotationMap.empty) {
135
- super();
136
- this.symbol = symbol;
137
- this.annotations = annotations;
138
- this._tag = 2 /* ASTTag.UniqueSymbol */;
139
- }
140
- clone(newProperties) {
141
- return new UniqueSymbol(newProperties.symbol ?? this.symbol, newProperties.annotations ?? this.annotations);
142
- }
143
- }
136
+ return self._tag === 1;
137
+ }
138
+ var UniqueSymbol = class UniqueSymbol extends AST {
139
+ symbol;
140
+ annotations;
141
+ _tag = 2;
142
+ constructor(symbol, annotations = ASTAnnotationMap.empty) {
143
+ super();
144
+ this.symbol = symbol;
145
+ this.annotations = annotations;
146
+ }
147
+ clone(newProperties) {
148
+ return new UniqueSymbol(newProperties.symbol ?? this.symbol, newProperties.annotations ?? this.annotations);
149
+ }
150
+ [tsplus_module_1.equalsSymbol](that, context) {
151
+ return hasTag(that, 2) && context.comparator(this.symbol, that.symbol) && context.comparator(this.annotations, that.annotations);
152
+ }
153
+ };
144
154
  /**
145
- * @tsplus static fncts.schema.ASTOps createUniqueSymbol
146
- */
155
+ * @tsplus static fncts.schema.ASTOps createUniqueSymbol
156
+ */
147
157
  function createUniqueSymbol_1(symbol, annotations = ASTAnnotationMap.empty) {
148
- return new UniqueSymbol(symbol, annotations);
158
+ return new UniqueSymbol(symbol, annotations);
149
159
  }
150
160
  /**
151
- * @tsplus fluent fncts.schema.AST isUniqueSymbol
152
- */
161
+ * @tsplus fluent fncts.schema.AST isUniqueSymbol
162
+ */
153
163
  function isUniqueSymbol_1(self) {
154
- void 0;
155
- return self._tag === 2 /* ASTTag.UniqueSymbol */;
156
- }
157
- /*
158
- * UndefinedKeyword
159
- */
160
- export class UndefinedKeyword extends AST {
161
- constructor(annotations = ASTAnnotationMap.empty) {
162
- super();
163
- this.annotations = annotations;
164
- this._tag = 3 /* ASTTag.UndefinedKeyword */;
165
- }
166
- clone(newProperties) {
167
- return new UndefinedKeyword(newProperties.annotations ?? this.annotations);
168
- }
169
- }
164
+ return self._tag === 2;
165
+ }
166
+ var UndefinedKeyword = class UndefinedKeyword extends AST {
167
+ annotations;
168
+ _tag = 3;
169
+ constructor(annotations = ASTAnnotationMap.empty) {
170
+ super();
171
+ this.annotations = annotations;
172
+ }
173
+ clone(newProperties) {
174
+ return new UndefinedKeyword(newProperties.annotations ?? this.annotations);
175
+ }
176
+ [tsplus_module_1.equalsSymbol](that, context) {
177
+ return hasTag(that, 3) && context.comparator(this.annotations, that.annotations);
178
+ }
179
+ };
170
180
  /**
171
- * @tsplus static fncts.schema.ASTOps undefinedKeyword
172
- */
173
- const undefinedKeyword_1 = /*#__PURE__*/new UndefinedKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "undefined"));
174
- export const undefinedKeyword = undefinedKeyword_1;
175
- /*
176
- * VoidKeyword
177
- */
178
- export class VoidKeyword extends AST {
179
- constructor(annotations = ASTAnnotationMap.empty) {
180
- super();
181
- this.annotations = annotations;
182
- this._tag = 4 /* ASTTag.VoidKeyword */;
183
- }
184
- clone(newProperties) {
185
- return new VoidKeyword(newProperties.annotations ?? this.annotations);
186
- }
187
- }
181
+ * @tsplus static fncts.schema.ASTOps undefinedKeyword
182
+ */
183
+ const undefinedKeyword_1 = new UndefinedKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "undefined"));
184
+ const undefinedKeyword = undefinedKeyword_1;
185
+ var VoidKeyword = class VoidKeyword extends AST {
186
+ annotations;
187
+ _tag = 4;
188
+ constructor(annotations = ASTAnnotationMap.empty) {
189
+ super();
190
+ this.annotations = annotations;
191
+ }
192
+ clone(newProperties) {
193
+ return new VoidKeyword(newProperties.annotations ?? this.annotations);
194
+ }
195
+ [tsplus_module_1.equalsSymbol](that, context) {
196
+ return hasTag(that, 4) && context.comparator(this.annotations, that.annotations);
197
+ }
198
+ };
188
199
  /**
189
- * @tsplus static fncts.schema.ASTOps voidKeyword
190
- */
191
- export const voidKeyword = /*#__PURE__*/new VoidKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "void"));
192
- /*
193
- * NeverKeyword
194
- */
195
- export class NeverKeyword extends AST {
196
- constructor(annotations = ASTAnnotationMap.empty) {
197
- super();
198
- this.annotations = annotations;
199
- this._tag = 5 /* ASTTag.NeverKeyword */;
200
- }
201
- clone(newProperties) {
202
- return new NeverKeyword(newProperties.annotations ?? this.annotations);
203
- }
204
- }
200
+ * @tsplus static fncts.schema.ASTOps voidKeyword
201
+ */
202
+ const voidKeyword = new VoidKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "void"));
203
+ var NeverKeyword = class NeverKeyword extends AST {
204
+ annotations;
205
+ _tag = 5;
206
+ constructor(annotations = ASTAnnotationMap.empty) {
207
+ super();
208
+ this.annotations = annotations;
209
+ }
210
+ clone(newProperties) {
211
+ return new NeverKeyword(newProperties.annotations ?? this.annotations);
212
+ }
213
+ [tsplus_module_1.equalsSymbol](that, context) {
214
+ return hasTag(that, 5) && context.comparator(this.annotations, that.annotations);
215
+ }
216
+ };
205
217
  /**
206
- * @tsplus static fncts.schema.ASTOps neverKeyword
207
- */
208
- const neverKeyword_1 = /*#__PURE__*/new NeverKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "never"));
209
- export const neverKeyword = neverKeyword_1;
210
- /*
211
- * UnknownKeyword
212
- */
213
- export class UnknownKeyword extends AST {
214
- constructor(annotations = ASTAnnotationMap.empty) {
215
- super();
216
- this.annotations = annotations;
217
- this._tag = 6 /* ASTTag.UnknownKeyword */;
218
- }
219
- clone(newProperties) {
220
- return new UnknownKeyword(newProperties.annotations ?? this.annotations);
221
- }
222
- }
218
+ * @tsplus static fncts.schema.ASTOps neverKeyword
219
+ */
220
+ const neverKeyword_1 = new NeverKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "never"));
221
+ const neverKeyword = neverKeyword_1;
222
+ var UnknownKeyword = class UnknownKeyword extends AST {
223
+ annotations;
224
+ _tag = 6;
225
+ constructor(annotations = ASTAnnotationMap.empty) {
226
+ super();
227
+ this.annotations = annotations;
228
+ }
229
+ clone(newProperties) {
230
+ return new UnknownKeyword(newProperties.annotations ?? this.annotations);
231
+ }
232
+ [tsplus_module_1.equalsSymbol](that, context) {
233
+ return hasTag(that, 6) && context.comparator(this.annotations, that.annotations);
234
+ }
235
+ };
223
236
  /**
224
- * @tsplus static fncts.schema.ASTOps unknownKeyword
225
- */
226
- const unknownKeyword_1 = /*#__PURE__*/new UnknownKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "unknown"));
227
- export const unknownKeyword = unknownKeyword_1;
228
- /*
229
- * AnyKeyword
230
- */
231
- export class AnyKeyword extends AST {
232
- constructor(annotations = ASTAnnotationMap.empty) {
233
- super();
234
- this.annotations = annotations;
235
- this._tag = 7 /* ASTTag.AnyKeyword */;
236
- }
237
- clone(newProperties) {
238
- return new AnyKeyword(newProperties.annotations ?? this.annotations);
239
- }
240
- }
237
+ * @tsplus static fncts.schema.ASTOps unknownKeyword
238
+ */
239
+ const unknownKeyword_1 = new UnknownKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "unknown"));
240
+ const unknownKeyword = unknownKeyword_1;
241
+ var AnyKeyword = class AnyKeyword extends AST {
242
+ annotations;
243
+ _tag = 7;
244
+ constructor(annotations = ASTAnnotationMap.empty) {
245
+ super();
246
+ this.annotations = annotations;
247
+ }
248
+ clone(newProperties) {
249
+ return new AnyKeyword(newProperties.annotations ?? this.annotations);
250
+ }
251
+ [tsplus_module_1.equalsSymbol](that, context) {
252
+ return hasTag(that, 7) && context.comparator(this.annotations, that.annotations);
253
+ }
254
+ };
241
255
  /**
242
- * @tsplus static fncts.schema.ASTOps anyKeyword
243
- */
244
- export const anyKeyword = /*#__PURE__*/new AnyKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "any"));
245
- /*
246
- * StringKeyword
247
- */
248
- export class StringKeyword extends AST {
249
- constructor(annotations = ASTAnnotationMap.empty) {
250
- super();
251
- this.annotations = annotations;
252
- this._tag = 8 /* ASTTag.StringKeyword */;
253
- }
254
- clone(newProperties) {
255
- return new StringKeyword(newProperties.annotations ?? this.annotations);
256
- }
257
- }
256
+ * @tsplus static fncts.schema.ASTOps anyKeyword
257
+ */
258
+ const anyKeyword = new AnyKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "any"));
259
+ var StringKeyword = class StringKeyword extends AST {
260
+ annotations;
261
+ _tag = 8;
262
+ constructor(annotations = ASTAnnotationMap.empty) {
263
+ super();
264
+ this.annotations = annotations;
265
+ }
266
+ clone(newProperties) {
267
+ return new StringKeyword(newProperties.annotations ?? this.annotations);
268
+ }
269
+ [tsplus_module_1.equalsSymbol](that, context) {
270
+ return hasTag(that, 8) && context.comparator(this.annotations, that.annotations);
271
+ }
272
+ };
258
273
  /**
259
- * @tsplus static fncts.schema.ASTOps stringKeyword
260
- */
261
- const stringKeyword_1 = /*#__PURE__*/new StringKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "string"));
262
- export const stringKeyword = stringKeyword_1;
274
+ * @tsplus static fncts.schema.ASTOps stringKeyword
275
+ */
276
+ const stringKeyword_1 = new StringKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "string"));
277
+ const stringKeyword = stringKeyword_1;
263
278
  /**
264
- * @tsplus fluent fncts.schema.AST isStringKeyword
265
- */
279
+ * @tsplus fluent fncts.schema.AST isStringKeyword
280
+ */
266
281
  function isStringKeyword_1(self) {
267
- void 0;
268
- return self._tag === 8 /* ASTTag.StringKeyword */;
269
- }
270
- /*
271
- * NumberKeyword
272
- */
273
- export class NumberKeyword extends AST {
274
- constructor(annotations = ASTAnnotationMap.empty) {
275
- super();
276
- this.annotations = annotations;
277
- this._tag = 9 /* ASTTag.NumberKeyword */;
278
- }
279
- clone(newProperties) {
280
- return new NumberKeyword(newProperties.annotations ?? this.annotations);
281
- }
282
- }
282
+ return self._tag === 8;
283
+ }
284
+ var NumberKeyword = class NumberKeyword extends AST {
285
+ annotations;
286
+ _tag = 9;
287
+ constructor(annotations = ASTAnnotationMap.empty) {
288
+ super();
289
+ this.annotations = annotations;
290
+ }
291
+ clone(newProperties) {
292
+ return new NumberKeyword(newProperties.annotations ?? this.annotations);
293
+ }
294
+ [tsplus_module_1.equalsSymbol](that, context) {
295
+ return hasTag(that, 9) && context.comparator(this.annotations, that.annotations);
296
+ }
297
+ };
283
298
  /**
284
- * @tsplus static fncts.schema.ASTOps numberKeyword
285
- */
286
- const numberKeyword_1 = /*#__PURE__*/new NumberKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "number"));
287
- export const numberKeyword = numberKeyword_1;
299
+ * @tsplus static fncts.schema.ASTOps numberKeyword
300
+ */
301
+ const numberKeyword_1 = new NumberKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "number"));
302
+ const numberKeyword = numberKeyword_1;
288
303
  /**
289
- * @tsplus fluent fncts.schema.AST isNumberKeyword
290
- */
304
+ * @tsplus fluent fncts.schema.AST isNumberKeyword
305
+ */
291
306
  function isNumberKeyword_1(self) {
292
- void 0;
293
- return self._tag === 9 /* ASTTag.NumberKeyword */;
294
- }
295
- /*
296
- * BooleanKeyword
297
- */
298
- export class BooleanKeyword extends AST {
299
- constructor(annotations = ASTAnnotationMap.empty) {
300
- super();
301
- this.annotations = annotations;
302
- this._tag = 10 /* ASTTag.BooleanKeyword */;
303
- }
304
- clone(newProperties) {
305
- return new BooleanKeyword(newProperties.annotations ?? this.annotations);
306
- }
307
- }
307
+ return self._tag === 9;
308
+ }
309
+ var BooleanKeyword = class BooleanKeyword extends AST {
310
+ annotations;
311
+ _tag = 10;
312
+ constructor(annotations = ASTAnnotationMap.empty) {
313
+ super();
314
+ this.annotations = annotations;
315
+ }
316
+ clone(newProperties) {
317
+ return new BooleanKeyword(newProperties.annotations ?? this.annotations);
318
+ }
319
+ [tsplus_module_1.equalsSymbol](that, context) {
320
+ return hasTag(that, 10) && context.comparator(this.annotations, that.annotations);
321
+ }
322
+ };
308
323
  /**
309
- * @tsplus static fncts.schema.ASTOps booleanKeyword
310
- */
311
- export const booleanKeyword = /*#__PURE__*/new BooleanKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "boolean"));
324
+ * @tsplus static fncts.schema.ASTOps booleanKeyword
325
+ */
326
+ const booleanKeyword = new BooleanKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "boolean"));
312
327
  /**
313
- * @tsplus fluent fncts.schema.AST isBooleanKeyword
314
- */
315
- export function isBooleanKeyword(self) {
316
- void 0;
317
- return self._tag === 10 /* ASTTag.BooleanKeyword */;
318
- }
319
- /*
320
- * BigIntKeyword
321
- */
322
- export class BigIntKeyword extends AST {
323
- constructor(annotations = ASTAnnotationMap.empty) {
324
- super();
325
- this.annotations = annotations;
326
- this._tag = 11 /* ASTTag.BigIntKeyword */;
327
- }
328
- clone(newProperties) {
329
- return new BigIntKeyword(newProperties.annotations ?? this.annotations);
330
- }
331
- }
328
+ * @tsplus fluent fncts.schema.AST isBooleanKeyword
329
+ */
330
+ function isBooleanKeyword(self) {
331
+ return self._tag === 10;
332
+ }
333
+ var BigIntKeyword = class BigIntKeyword extends AST {
334
+ annotations;
335
+ _tag = 11;
336
+ constructor(annotations = ASTAnnotationMap.empty) {
337
+ super();
338
+ this.annotations = annotations;
339
+ }
340
+ clone(newProperties) {
341
+ return new BigIntKeyword(newProperties.annotations ?? this.annotations);
342
+ }
343
+ [tsplus_module_1.equalsSymbol](that, context) {
344
+ return hasTag(that, 11) && context.comparator(this.annotations, that.annotations);
345
+ }
346
+ };
332
347
  /**
333
- * @tsplus static fncts.schema.ASTOps bigIntKeyword
334
- */
335
- export const bigIntKeyword = /*#__PURE__*/new BigIntKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "bigint"));
348
+ * @tsplus static fncts.schema.ASTOps bigIntKeyword
349
+ */
350
+ const bigIntKeyword = new BigIntKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "bigint"));
336
351
  /**
337
- * @tsplus fluent fncts.schema.AST isBigIntKeyword
338
- */
339
- export function isBigIntKeyword(self) {
340
- void 0;
341
- return self._tag === 11 /* ASTTag.BigIntKeyword */;
342
- }
343
- /*
344
- * SymbolKeyword
345
- */
346
- export class SymbolKeyword extends AST {
347
- constructor(annotations = ASTAnnotationMap.empty) {
348
- super();
349
- this.annotations = annotations;
350
- this._tag = 12 /* ASTTag.SymbolKeyword */;
351
- }
352
- clone(newProperties) {
353
- return new SymbolKeyword(newProperties.annotations ?? this.annotations);
354
- }
355
- }
352
+ * @tsplus fluent fncts.schema.AST isBigIntKeyword
353
+ */
354
+ function isBigIntKeyword(self) {
355
+ return self._tag === 11;
356
+ }
357
+ var SymbolKeyword = class SymbolKeyword extends AST {
358
+ annotations;
359
+ _tag = 12;
360
+ constructor(annotations = ASTAnnotationMap.empty) {
361
+ super();
362
+ this.annotations = annotations;
363
+ }
364
+ clone(newProperties) {
365
+ return new SymbolKeyword(newProperties.annotations ?? this.annotations);
366
+ }
367
+ [tsplus_module_1.equalsSymbol](that, context) {
368
+ return hasTag(that, 12) && context.comparator(this.annotations, that.annotations);
369
+ }
370
+ };
356
371
  /**
357
- * @tsplus static fncts.schema.ASTOps symbolKeyword
358
- */
359
- const symbolKeyword_1 = /*#__PURE__*/new SymbolKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "symbol"));
360
- export const symbolKeyword = symbolKeyword_1;
372
+ * @tsplus static fncts.schema.ASTOps symbolKeyword
373
+ */
374
+ const symbolKeyword_1 = new SymbolKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "symbol"));
375
+ const symbolKeyword = symbolKeyword_1;
361
376
  /**
362
- * @tsplus fluent fncts.schema.AST isSymbolKeyword
363
- */
377
+ * @tsplus fluent fncts.schema.AST isSymbolKeyword
378
+ */
364
379
  function isSymbolKeyword_1(self) {
365
- void 0;
366
- return self._tag === 12 /* ASTTag.SymbolKeyword */;
367
- }
368
- /*
369
- * ObjectKeyword
370
- */
371
- export class ObjectKeyword extends AST {
372
- constructor(annotations = ASTAnnotationMap.empty) {
373
- super();
374
- this.annotations = annotations;
375
- this._tag = 13 /* ASTTag.ObjectKeyword */;
376
- }
377
- clone(newProperties) {
378
- return new ObjectKeyword(newProperties.annotations ?? this.annotations);
379
- }
380
- }
380
+ return self._tag === 12;
381
+ }
382
+ var ObjectKeyword = class ObjectKeyword extends AST {
383
+ annotations;
384
+ _tag = 13;
385
+ constructor(annotations = ASTAnnotationMap.empty) {
386
+ super();
387
+ this.annotations = annotations;
388
+ }
389
+ clone(newProperties) {
390
+ return new ObjectKeyword(newProperties.annotations ?? this.annotations);
391
+ }
392
+ [tsplus_module_1.equalsSymbol](that, context) {
393
+ return hasTag(that, 13) && context.comparator(this.annotations, that.annotations);
394
+ }
395
+ };
381
396
  /**
382
- * @tsplus static fncts.schema.ASTOps objectKeyword
383
- */
384
- export const objectKeyword = /*#__PURE__*/new ObjectKeyword(/*#__PURE__*/ASTAnnotationMap.empty.annotate(tsplus_module_2.Title, "object"));
385
- /*
386
- * Enum
387
- */
388
- export class Enum extends AST {
389
- constructor(enums, annotations = ASTAnnotationMap.empty) {
390
- super();
391
- this.enums = enums;
392
- this.annotations = annotations;
393
- this._tag = 14 /* ASTTag.Enum */;
394
- }
395
- clone(newProperties) {
396
- return new Enum(newProperties.enums ?? this.enums, newProperties.annotations ?? this.annotations);
397
- }
398
- }
397
+ * @tsplus static fncts.schema.ASTOps objectKeyword
398
+ */
399
+ const objectKeyword = new ObjectKeyword(ASTAnnotationMap.empty.annotate(tsplus_module_4.Title, "object"));
400
+ var Enum = class Enum extends AST {
401
+ enums;
402
+ annotations;
403
+ _tag = 14;
404
+ constructor(enums, annotations = ASTAnnotationMap.empty) {
405
+ super();
406
+ this.enums = enums;
407
+ this.annotations = annotations;
408
+ }
409
+ clone(newProperties) {
410
+ return new Enum(newProperties.enums ?? this.enums, newProperties.annotations ?? this.annotations);
411
+ }
412
+ [tsplus_module_1.equalsSymbol](that, context) {
413
+ return hasTag(that, 14) && tsplus_module_5.corresponds(that.enums, ([leftName, leftValue], [rightName, rightValue]) => context.comparator(leftName, rightName) && context.comparator(leftValue, rightValue))(this.enums) && context.comparator(this.annotations, that.annotations);
414
+ }
415
+ };
399
416
  /**
400
- * @tsplus static fncts.schema.ASTOps createEnum
401
- */
402
- export function createEnum(enums, annotations = ASTAnnotationMap.empty) {
403
- return new Enum(enums, annotations);
404
- }
405
- export class TemplateLiteralSpan {
406
- constructor(type, literal) {
407
- this.type = type;
408
- this.literal = literal;
409
- }
410
- toString() {
411
- switch (this.type._tag) {
412
- case 8 /* ASTTag.StringKeyword */:
413
- return "${string}";
414
- case 9 /* ASTTag.NumberKeyword */:
415
- return "${number}";
416
- }
417
- }
418
- }
419
- /*
420
- * TemplateLiteral
421
- */
422
- export class TemplateLiteral extends AST {
423
- constructor(head, spans, annotations = ASTAnnotationMap.empty) {
424
- super();
425
- this.head = head;
426
- this.spans = spans;
427
- this.annotations = annotations;
428
- this._tag = 15 /* ASTTag.TemplateLiteral */;
429
- }
430
- clone(newProperties) {
431
- return createTemplateLiteral_1(newProperties.head ?? this.head, newProperties.spans ?? this.spans, newProperties.annotations ?? this.annotations);
432
- }
433
- }
417
+ * @tsplus static fncts.schema.ASTOps createEnum
418
+ */
419
+ function createEnum(enums, annotations = ASTAnnotationMap.empty) {
420
+ return new Enum(enums, annotations);
421
+ }
422
+ var TemplateLiteralSpan = class TemplateLiteralSpan {
423
+ type;
424
+ literal;
425
+ constructor(type, literal) {
426
+ this.type = type;
427
+ this.literal = literal;
428
+ }
429
+ [tsplus_module_1.equalsSymbol](that, context) {
430
+ return that instanceof TemplateLiteralSpan && context.comparator(this.type, that.type) && context.comparator(this.literal, that.literal);
431
+ }
432
+ toString() {
433
+ switch (this.type._tag) {
434
+ case 8: return "${string}";
435
+ case 9: return "${number}";
436
+ }
437
+ }
438
+ };
439
+ var TemplateLiteral = class extends AST {
440
+ head;
441
+ spans;
442
+ annotations;
443
+ _tag = 15;
444
+ constructor(head, spans, annotations = ASTAnnotationMap.empty) {
445
+ super();
446
+ this.head = head;
447
+ this.spans = spans;
448
+ this.annotations = annotations;
449
+ }
450
+ clone(newProperties) {
451
+ return createTemplateLiteral_1(newProperties.head ?? this.head, newProperties.spans ?? this.spans, newProperties.annotations ?? this.annotations);
452
+ }
453
+ [tsplus_module_1.equalsSymbol](that, context) {
454
+ return hasTag(that, 15) && context.comparator(this.head, that.head) && context.comparator(this.spans, that.spans) && context.comparator(this.annotations, that.annotations);
455
+ }
456
+ };
434
457
  /**
435
- * @tsplus static fncts.schema.ASTOps createTemplateLiteral
436
- */
458
+ * @tsplus static fncts.schema.ASTOps createTemplateLiteral
459
+ */
437
460
  function createTemplateLiteral_1(head, spans, annotations = ASTAnnotationMap.empty) {
438
- if (tsplus_module_3.isNonEmpty(spans)) {
439
- return new TemplateLiteral(head, spans, annotations);
440
- } else {
441
- return createLiteral_1(head, annotations);
442
- }
443
- }
444
- /*
445
- * Element
446
- */
447
- export class Element {
448
- constructor(type, isOptional) {
449
- this.type = type;
450
- this.isOptional = isOptional;
451
- }
452
- toString() {
453
- return String(this.type) + (this.isOptional ? "?" : "");
454
- }
455
- }
461
+ if (tsplus_module_6.isNonEmpty(spans)) return new TemplateLiteral(head, spans, annotations);
462
+ else return createLiteral_1(head, annotations);
463
+ }
464
+ var Element = class Element {
465
+ type;
466
+ isOptional;
467
+ constructor(type, isOptional) {
468
+ this.type = type;
469
+ this.isOptional = isOptional;
470
+ }
471
+ [tsplus_module_1.equalsSymbol](that, context) {
472
+ return that instanceof Element && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional);
473
+ }
474
+ toString() {
475
+ return String(this.type) + (this.isOptional ? "?" : "");
476
+ }
477
+ };
456
478
  /**
457
- * @tsplus static fncts.schema.ASTOps createElement
458
- */
479
+ * @tsplus static fncts.schema.ASTOps createElement
480
+ */
459
481
  function createElement_1(type, isOptional) {
460
- return new Element(type, isOptional);
461
- }
462
- /*
463
- * Tuple
464
- */
465
- export class Tuple extends AST {
466
- constructor(elements, rest, isReadonly, annotations = ASTAnnotationMap.empty) {
467
- super();
468
- this.elements = elements;
469
- this.rest = rest;
470
- this.isReadonly = isReadonly;
471
- this.annotations = annotations;
472
- this._tag = 16 /* ASTTag.Tuple */;
473
- }
474
- clone(newProperties) {
475
- return new Tuple(newProperties.elements ?? this.elements, newProperties.rest ?? this.rest, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
476
- }
477
- }
482
+ return new Element(type, isOptional);
483
+ }
484
+ var Tuple = class Tuple extends AST {
485
+ elements;
486
+ rest;
487
+ isReadonly;
488
+ annotations;
489
+ _tag = 16;
490
+ constructor(elements, rest, isReadonly, annotations = ASTAnnotationMap.empty) {
491
+ super();
492
+ this.elements = elements;
493
+ this.rest = rest;
494
+ this.isReadonly = isReadonly;
495
+ this.annotations = annotations;
496
+ }
497
+ clone(newProperties) {
498
+ return new Tuple(newProperties.elements ?? this.elements, newProperties.rest ?? this.rest, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
499
+ }
500
+ [tsplus_module_1.equalsSymbol](that, context) {
501
+ return hasTag(that, 16) && context.comparator(this.elements, that.elements) && context.comparator(this.rest, that.rest) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
502
+ }
503
+ };
478
504
  /**
479
- * @tsplus static fncts.schema.ASTOps createTuple
480
- */
505
+ * @tsplus static fncts.schema.ASTOps createTuple
506
+ */
481
507
  function createTuple_1(elements, rest, isReadonly, annotations = ASTAnnotationMap.empty) {
482
- return new Tuple(elements, rest, isReadonly, annotations);
508
+ return new Tuple(elements, rest, isReadonly, annotations);
483
509
  }
484
510
  /**
485
- * @tsplus static fncts.schema.ASTOps unknownArray
486
- */
487
- export const unknownArray = /*#__PURE__*/createTuple_1(/*#__PURE__*/tsplus_module_3.empty(), /*#__PURE__*/tsplus_module_4.just(/*#__PURE__*/tsplus_module_3.vector(unknownKeyword_1), fileName_1 + ":651:65"), true);
488
- /*
489
- * PropertySignature
490
- */
491
- export class PropertySignature {
492
- constructor(name, type, isOptional, isReadonly, annotations = ASTAnnotationMap.empty) {
493
- this.name = name;
494
- this.type = type;
495
- this.isOptional = isOptional;
496
- this.isReadonly = isReadonly;
497
- this.annotations = annotations;
498
- }
499
- clone(newProperties) {
500
- return new PropertySignature(newProperties.name ?? this.name, newProperties.type ?? this.type, newProperties.isOptional ?? this.isOptional, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
501
- }
502
- }
511
+ * @tsplus static fncts.schema.ASTOps unknownArray
512
+ */
513
+ const unknownArray = createTuple_1(tsplus_module_6.empty(), tsplus_module_7.just(tsplus_module_6.vector(unknownKeyword_1), fileName_1 + ":779:65"), true);
514
+ var PropertySignature = class PropertySignature {
515
+ name;
516
+ type;
517
+ isOptional;
518
+ isReadonly;
519
+ annotations;
520
+ constructor(name, type, isOptional, isReadonly, annotations = ASTAnnotationMap.empty) {
521
+ this.name = name;
522
+ this.type = type;
523
+ this.isOptional = isOptional;
524
+ this.isReadonly = isReadonly;
525
+ this.annotations = annotations;
526
+ }
527
+ clone(newProperties) {
528
+ return new PropertySignature(newProperties.name ?? this.name, newProperties.type ?? this.type, newProperties.isOptional ?? this.isOptional, newProperties.isReadonly ?? this.isReadonly, newProperties.annotations ?? this.annotations);
529
+ }
530
+ [tsplus_module_1.equalsSymbol](that, context) {
531
+ return that instanceof PropertySignature && context.comparator(this.name, that.name) && context.comparator(this.type, that.type) && context.comparator(this.isOptional, that.isOptional) && context.comparator(this.isReadonly, that.isReadonly) && context.comparator(this.annotations, that.annotations);
532
+ }
533
+ };
503
534
  /**
504
- * @tsplus static fncts.schema.ASTOps createPropertySignature
505
- */
535
+ * @tsplus static fncts.schema.ASTOps createPropertySignature
536
+ */
506
537
  function createPropertySignature_1(name, type, isOptional, isReadonly, annotations = ASTAnnotationMap.empty) {
507
- return new PropertySignature(name, type, isOptional, isReadonly, annotations);
508
- }
509
- /*
510
- * IndexSignature
511
- */
512
- export class IndexSignature {
513
- constructor(parameter, type, isReadonly) {
514
- this.parameter = parameter;
515
- this.type = type;
516
- this.isReadonly = isReadonly;
517
- }
518
- }
538
+ return new PropertySignature(name, type, isOptional, isReadonly, annotations);
539
+ }
540
+ var IndexSignature = class IndexSignature {
541
+ parameter;
542
+ type;
543
+ isReadonly;
544
+ constructor(parameter, type, isReadonly) {
545
+ this.parameter = parameter;
546
+ this.type = type;
547
+ this.isReadonly = isReadonly;
548
+ }
549
+ [tsplus_module_1.equalsSymbol](that, context) {
550
+ return that instanceof IndexSignature && context.comparator(this.parameter, that.parameter) && context.comparator(this.type, that.type) && context.comparator(this.isReadonly, that.isReadonly);
551
+ }
552
+ };
519
553
  /**
520
- * @tsplus static fncts.schema.ASTOps createIndexSignature
521
- */
554
+ * @tsplus static fncts.schema.ASTOps createIndexSignature
555
+ */
522
556
  function createIndexSignature_1(parameter, type, isReadonly) {
523
- return new IndexSignature(parameter, type, isReadonly);
524
- }
525
- /*
526
- * TypeLiteral
527
- */
528
- export class TypeLiteral extends AST {
529
- constructor(propertySignatures, indexSignatures, annotations = ASTAnnotationMap.empty) {
530
- super();
531
- this.annotations = annotations;
532
- this._tag = 17 /* ASTTag.TypeLiteral */;
533
- this.propertySignatures = sortByAscendingCardinality(propertySignatures);
534
- this.indexSignatures = sortByAscendingCardinality(indexSignatures);
535
- }
536
- clone(newProperties) {
537
- return new TypeLiteral(newProperties.propertySignatures ?? this.propertySignatures, newProperties.indexSignatures ?? this.indexSignatures, newProperties.annotations ?? this.annotations);
538
- }
539
- }
557
+ return new IndexSignature(parameter, type, isReadonly);
558
+ }
559
+ var TypeLiteral = class TypeLiteral extends AST {
560
+ annotations;
561
+ _tag = 17;
562
+ propertySignatures;
563
+ indexSignatures;
564
+ constructor(propertySignatures, indexSignatures, annotations = ASTAnnotationMap.empty) {
565
+ super();
566
+ this.annotations = annotations;
567
+ this.propertySignatures = sortByAscendingCardinality(propertySignatures);
568
+ this.indexSignatures = sortByAscendingCardinality(indexSignatures);
569
+ }
570
+ clone(newProperties) {
571
+ return new TypeLiteral(newProperties.propertySignatures ?? this.propertySignatures, newProperties.indexSignatures ?? this.indexSignatures, newProperties.annotations ?? this.annotations);
572
+ }
573
+ [tsplus_module_1.equalsSymbol](that, context) {
574
+ return hasTag(that, 17) && context.comparator(this.propertySignatures, that.propertySignatures) && context.comparator(this.indexSignatures, that.indexSignatures) && context.comparator(this.annotations, that.annotations);
575
+ }
576
+ };
540
577
  /**
541
- * @tsplus static fncts.schema.ASTOps isTypeLiteral
542
- * @tsplus fluent fncts.schema.AST isTypeLiteral
543
- */
544
- export function isTypeLiteral(self) {
545
- void 0;
546
- return self._tag === 17 /* ASTTag.TypeLiteral */;
578
+ * @tsplus static fncts.schema.ASTOps isTypeLiteral
579
+ * @tsplus fluent fncts.schema.AST isTypeLiteral
580
+ */
581
+ function isTypeLiteral(self) {
582
+ return self._tag === 17;
547
583
  }
548
584
  /**
549
- * @tsplus static fncts.schema.ASTOps createTypeLiteral
550
- */
585
+ * @tsplus static fncts.schema.ASTOps createTypeLiteral
586
+ */
551
587
  function createTypeLiteral_1(propertySignatures, indexSignatures, annotations) {
552
- return new TypeLiteral(propertySignatures, indexSignatures, annotations);
588
+ return new TypeLiteral(propertySignatures, indexSignatures, annotations);
553
589
  }
554
590
  /**
555
- * @tsplus static fncts.schema.ASTOps unknownRecord
556
- */
557
- export const unknownRecord = /*#__PURE__*/createTypeLiteral_1(/*#__PURE__*/tsplus_module_3.empty(), /*#__PURE__*/tsplus_module_3.vector(/*#__PURE__*/createIndexSignature_1(stringKeyword_1, unknownKeyword_1, true), /*#__PURE__*/createIndexSignature_1(symbolKeyword_1, unknownKeyword_1, true)));
558
- /*
559
- * Union
560
- */
561
- export class Union extends AST {
562
- constructor(types, annotations = ASTAnnotationMap.empty) {
563
- super();
564
- this.types = types;
565
- this.annotations = annotations;
566
- this._tag = 18 /* ASTTag.Union */;
567
- }
568
- clone(newProperties) {
569
- return createUnion_1(newProperties.types ?? this.types, newProperties.annotations ?? this.annotations);
570
- }
571
- }
591
+ * @tsplus static fncts.schema.ASTOps unknownRecord
592
+ */
593
+ const unknownRecord = createTypeLiteral_1(tsplus_module_6.empty(), tsplus_module_6.vector(createIndexSignature_1(stringKeyword_1, unknownKeyword_1, true), createIndexSignature_1(symbolKeyword_1, unknownKeyword_1, true)));
594
+ var Union = class extends AST {
595
+ types;
596
+ annotations;
597
+ _tag = 18;
598
+ constructor(types, annotations = ASTAnnotationMap.empty) {
599
+ super();
600
+ this.types = types;
601
+ this.annotations = annotations;
602
+ }
603
+ clone(newProperties) {
604
+ return createUnion_1(newProperties.types ?? this.types, newProperties.annotations ?? this.annotations);
605
+ }
606
+ [tsplus_module_1.equalsSymbol](that, context) {
607
+ return hasTag(that, 18) && context.comparator(this.types, that.types) && context.comparator(this.annotations, that.annotations);
608
+ }
609
+ };
572
610
  /**
573
- * @tsplus fluent fncts.schema.AST isUnion
574
- */
575
- export function isUnion(self) {
576
- void 0;
577
- return self._tag === 18 /* ASTTag.Union */;
611
+ * @tsplus fluent fncts.schema.AST isUnion
612
+ */
613
+ function isUnion(self) {
614
+ return self._tag === 18;
578
615
  }
579
616
  /**
580
- * @tsplus static fncts.schema.ASTOps createUnion
581
- */
617
+ * @tsplus static fncts.schema.ASTOps createUnion
618
+ */
582
619
  function createUnion_1(candidates, annotations = ASTAnnotationMap.empty) {
583
- const types = unify(candidates);
584
- switch (types.length) {
585
- case 0:
586
- return neverKeyword_1;
587
- case 1:
588
- return tsplus_module_3.unsafeGet(0)(types);
589
- default:
590
- return new Union(sortByDescendingWeight(types), annotations);
591
- }
592
- }
593
- /*
594
- * Lazy
595
- */
596
- export class Lazy extends AST {
597
- constructor(getAST, annotations = ASTAnnotationMap.empty) {
598
- super();
599
- this.getAST = getAST;
600
- this.annotations = annotations;
601
- this._tag = 19 /* ASTTag.Lazy */;
602
- }
603
- clone(newProperties) {
604
- return new Lazy(newProperties.getAST ?? this.getAST, newProperties.annotations ?? this.annotations);
605
- }
606
- }
620
+ const types = unify(candidates);
621
+ switch (types.length) {
622
+ case 0: return neverKeyword_1;
623
+ case 1: return tsplus_module_6.unsafeGet(0)(types);
624
+ default: return new Union(sortByDescendingWeight(types), annotations);
625
+ }
626
+ }
627
+ var Lazy = class Lazy extends AST {
628
+ getAST;
629
+ annotations;
630
+ _tag = 19;
631
+ constructor(getAST, annotations = ASTAnnotationMap.empty) {
632
+ super();
633
+ this.getAST = getAST;
634
+ this.annotations = annotations;
635
+ }
636
+ clone(newProperties) {
637
+ return new Lazy(newProperties.getAST ?? this.getAST, newProperties.annotations ?? this.annotations);
638
+ }
639
+ [tsplus_module_1.equalsSymbol](that) {
640
+ return this === that;
641
+ }
642
+ };
607
643
  /**
608
- * @tsplus static fncts.schema.ASTOps createLazy
609
- */
644
+ * @tsplus static fncts.schema.ASTOps createLazy
645
+ */
610
646
  function createLazy_1(getAST, annotations) {
611
- return new Lazy(getAST, annotations);
647
+ return new Lazy(getAST, annotations);
612
648
  }
613
649
  /**
614
- * @tsplus fluent fncts.schema.AST isLazy
615
- */
616
- export function isLazy(self) {
617
- void 0;
618
- return self._tag === 19 /* ASTTag.Lazy */;
619
- }
620
- /*
621
- * Refinement
622
- */
623
- export class Refinement extends AST {
624
- constructor(from, predicate, annotations = ASTAnnotationMap.empty) {
625
- super();
626
- this.from = from;
627
- this.predicate = predicate;
628
- this.annotations = annotations;
629
- this._tag = 20 /* ASTTag.Refinement */;
630
- }
631
- decode(input, options) {
632
- return this.predicate(input) ? tsplus_module_5.succeed(input) : tsplus_module_5.fail(tsplus_module_6.typeError(this, input));
633
- }
634
- clone(newProperties) {
635
- return new Refinement(newProperties.from ?? this.from, newProperties.predicate ?? this.predicate, newProperties.annotations ?? this.annotations);
636
- }
637
- }
650
+ * @tsplus fluent fncts.schema.AST isLazy
651
+ */
652
+ function isLazy(self) {
653
+ return self._tag === 19;
654
+ }
655
+ var Refinement = class Refinement extends AST {
656
+ from;
657
+ predicate;
658
+ annotations;
659
+ _tag = 20;
660
+ constructor(from, predicate, annotations = ASTAnnotationMap.empty) {
661
+ super();
662
+ this.from = from;
663
+ this.predicate = predicate;
664
+ this.annotations = annotations;
665
+ }
666
+ decode(input, options) {
667
+ return this.predicate(input) ? tsplus_module_8.succeed(input) : tsplus_module_8.fail(tsplus_module_9.typeError(this, input));
668
+ }
669
+ clone(newProperties) {
670
+ return new Refinement(newProperties.from ?? this.from, newProperties.predicate ?? this.predicate, newProperties.annotations ?? this.annotations);
671
+ }
672
+ [tsplus_module_1.equalsSymbol](that, context) {
673
+ return hasTag(that, 20) && context.comparator(this.from, that.from) && context.comparator(this.predicate, that.predicate) && context.comparator(this.annotations, that.annotations);
674
+ }
675
+ };
638
676
  /**
639
- * @tsplus static fncts.schema.ASTOps createRefinement
640
- */
677
+ * @tsplus static fncts.schema.ASTOps createRefinement
678
+ */
641
679
  function createRefinement_1(from, predicate, annotations) {
642
- return new Refinement(from, predicate, annotations);
643
- }
644
- export function isRefinement(self) {
645
- void 0;
646
- return self._tag === 20 /* ASTTag.Refinement */;
647
- }
648
- /*
649
- * Transform
650
- */
651
- export class Transform extends AST {
652
- constructor(from, to, decode, encode, annotations = ASTAnnotationMap.empty) {
653
- super();
654
- this.from = from;
655
- this.to = to;
656
- this.decode = decode;
657
- this.encode = encode;
658
- this.annotations = annotations;
659
- this._tag = 21 /* ASTTag.Transform */;
660
- }
661
- clone(newProperties) {
662
- return new Transform(newProperties.from ?? this.from, newProperties.to ?? this.to, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
663
- }
664
- }
680
+ return new Refinement(from, predicate, annotations);
681
+ }
682
+ function isRefinement(self) {
683
+ return self._tag === 20;
684
+ }
685
+ var Transform = class Transform extends AST {
686
+ from;
687
+ to;
688
+ decode;
689
+ encode;
690
+ annotations;
691
+ _tag = 21;
692
+ constructor(from, to, decode, encode, annotations = ASTAnnotationMap.empty) {
693
+ super();
694
+ this.from = from;
695
+ this.to = to;
696
+ this.decode = decode;
697
+ this.encode = encode;
698
+ this.annotations = annotations;
699
+ }
700
+ clone(newProperties) {
701
+ return new Transform(newProperties.from ?? this.from, newProperties.to ?? this.to, newProperties.decode ?? this.decode, newProperties.encode ?? this.encode, newProperties.annotations ?? this.annotations);
702
+ }
703
+ [tsplus_module_1.equalsSymbol](that, context) {
704
+ return hasTag(that, 21) && context.comparator(this.from, that.from) && context.comparator(this.to, that.to) && context.comparator(this.decode, that.decode) && context.comparator(this.encode, that.encode) && context.comparator(this.annotations, that.annotations);
705
+ }
706
+ };
665
707
  /**
666
- * @tsplus static fncts.schema.ASTOps createTransform
667
- */
668
- export function createTransform(from, to, decode, encode, annotations) {
669
- return new Transform(from, getTo_1(to), decode, encode, annotations);
670
- }
671
- /*
672
- * Validation
673
- */
674
- export class Validation extends AST {
675
- constructor(from, validation, annotations = ASTAnnotationMap.empty) {
676
- super();
677
- this.from = from;
678
- this.validation = validation;
679
- this.annotations = annotations;
680
- this._tag = 22 /* ASTTag.Validation */;
681
- }
682
- clone(newProperties) {
683
- return new Validation(newProperties.from ?? this.from, newProperties.validation ?? this.validation, newProperties.annotations ?? this.annotations);
684
- }
685
- }
708
+ * @tsplus static fncts.schema.ASTOps createTransform
709
+ */
710
+ function createTransform(from, to, decode, encode, annotations) {
711
+ return new Transform(from, getTo_1(to), decode, encode, annotations);
712
+ }
713
+ var Validation = class Validation extends AST {
714
+ from;
715
+ validation;
716
+ annotations;
717
+ _tag = 22;
718
+ constructor(from, validation, annotations = ASTAnnotationMap.empty) {
719
+ super();
720
+ this.from = from;
721
+ this.validation = validation;
722
+ this.annotations = annotations;
723
+ }
724
+ clone(newProperties) {
725
+ return new Validation(newProperties.from ?? this.from, newProperties.validation ?? this.validation, newProperties.annotations ?? this.annotations);
726
+ }
727
+ [tsplus_module_1.equalsSymbol](that, context) {
728
+ return hasTag(that, 22) && context.comparator(this.from, that.from) && context.comparator(this.validation, that.validation) && context.comparator(this.annotations, that.annotations);
729
+ }
730
+ };
686
731
  /**
687
- * @tsplus static fncts.schema.ASTOps createValidation
688
- */
689
- export function createValidation(from, validation, annotations) {
690
- return new Validation(from, validation, annotations);
732
+ * @tsplus static fncts.schema.ASTOps createValidation
733
+ */
734
+ function createValidation(from, validation, annotations) {
735
+ return new Validation(from, validation, annotations);
691
736
  }
692
737
  /**
693
- * @tsplus tailRec
694
- */
695
- export function getCardinality(ast) {
696
- var ast_1 = ast;
697
- var ast_2 = ast;
698
- while (1) {
699
- void 0;
700
- switch (ast_1._tag) {
701
- case 5 /* ASTTag.NeverKeyword */:
702
- return 0;
703
- case 1 /* ASTTag.Literal */:
704
- case 3 /* ASTTag.UndefinedKeyword */:
705
- case 4 /* ASTTag.VoidKeyword */:
706
- case 2 /* ASTTag.UniqueSymbol */:
707
- return 1;
708
- case 10 /* ASTTag.BooleanKeyword */:
709
- return 2;
710
- case 8 /* ASTTag.StringKeyword */:
711
- case 9 /* ASTTag.NumberKeyword */:
712
- case 11 /* ASTTag.BigIntKeyword */:
713
- case 12 /* ASTTag.SymbolKeyword */:
714
- return 3;
715
- case 13 /* ASTTag.ObjectKeyword */:
716
- return 5;
717
- case 6 /* ASTTag.UnknownKeyword */:
718
- case 7 /* ASTTag.AnyKeyword */:
719
- return 6;
720
- case 20 /* ASTTag.Refinement */:
721
- ast_2 = ast_1.from;
722
- ast_1 = ast_2;
723
- continue;
724
- case 21 /* ASTTag.Transform */:
725
- ast_2 = ast_1.to;
726
- ast_1 = ast_2;
727
- continue;
728
- default:
729
- return 4;
730
- }
731
- }
738
+ * @tsplus tailRec
739
+ */
740
+ function getCardinality(ast) {
741
+ var ast_1 = ast;
742
+ var ast_2 = ast;
743
+ while (1) switch (ast_1._tag) {
744
+ case 5: return 0;
745
+ case 1:
746
+ case 3:
747
+ case 4:
748
+ case 2: return 1;
749
+ case 10: return 2;
750
+ case 8:
751
+ case 9:
752
+ case 11:
753
+ case 12: return 3;
754
+ case 13: return 5;
755
+ case 6:
756
+ case 7: return 6;
757
+ case 20:
758
+ ast_2 = ast_1.from;
759
+ ast_1 = ast_2;
760
+ continue;
761
+ case 21:
762
+ ast_2 = ast_1.to;
763
+ ast_1 = ast_2;
764
+ continue;
765
+ default: return 4;
766
+ }
732
767
  }
733
768
  function sortByAscendingCardinality(types) {
734
- return tsplus_module_3.sort(tsplus_module_8.contramap(({
735
- type
736
- }) => getCardinality(type))(tsplus_module_7.Ord))(types);
769
+ return tsplus_module_6.sort(tsplus_module_11.contramap(({ type }) => getCardinality(type))(tsplus_module_10.Ord))(types);
737
770
  }
738
- const OrdWeight = /*#__PURE__*/tsplus_module_9.tuple(tsplus_module_7.Ord, tsplus_module_7.Ord, tsplus_module_7.Ord);
739
- const maxWeight = /*#__PURE__*/tsplus_module_10.max(OrdWeight);
771
+ const OrdWeight = tsplus_module_12.tuple(tsplus_module_10.Ord, tsplus_module_10.Ord, tsplus_module_10.Ord);
772
+ const maxWeight = tsplus_module_13.max(OrdWeight);
740
773
  function maxWeightAll(weights) {
741
- return tsplus_module_11.foldLeft(emptyWeight, (b, a) => maxWeight(b)(a))(weights);
742
- }
743
- const emptyWeight = [0, 0, 0];
744
- export function getWeight(ast) {
745
- void 0;
746
- switch (ast._tag) {
747
- case 0 /* ASTTag.Declaration */:
748
- return tsplus_module_12.match(() => [6, 0, 0], ast => {
749
- const [_, y, z] = getWeight(ast);
750
- return [6, y, z];
751
- })(ast.annotations.get(tsplus_module_2.Surrogate));
752
- case 16 /* ASTTag.Tuple */:
753
- return [2, ast.elements.length, tsplus_module_12.match(() => 0, rest => rest.length)(ast.rest)];
754
- case 17 /* ASTTag.TypeLiteral */:
755
- {
756
- const y = ast.propertySignatures.length;
757
- const z = ast.indexSignatures.length;
758
- return y + z === 0 ? [-4, 0, 0] : [4, y, z];
759
- }
760
- case 18 /* ASTTag.Union */:
761
- return maxWeightAll(tsplus_module_3.map(getWeight)(ast.types));
762
- case 19 /* ASTTag.Lazy */:
763
- return [8, 0, 0];
764
- case 20 /* ASTTag.Refinement */:
765
- const [x, y, z] = getWeight(ast.from);
766
- return [x + 1, y, z];
767
- case 21 /* ASTTag.Transform */:
768
- return getWeight(ast.from);
769
- case 13 /* ASTTag.ObjectKeyword */:
770
- return [-2, 0, 0];
771
- case 6 /* ASTTag.UnknownKeyword */:
772
- case 7 /* ASTTag.AnyKeyword */:
773
- return [-4, 0, 0];
774
- default:
775
- return emptyWeight;
776
- }
774
+ return tsplus_module_14.foldLeft(emptyWeight, (b, a) => maxWeight(b)(a))(weights);
775
+ }
776
+ const emptyWeight = [
777
+ 0,
778
+ 0,
779
+ 0
780
+ ];
781
+ function getWeight(ast) {
782
+ switch (ast._tag) {
783
+ case 0: return tsplus_module_15.match(() => [
784
+ 6,
785
+ 0,
786
+ 0
787
+ ], (ast) => {
788
+ const [_, y, z] = getWeight(ast);
789
+ return [
790
+ 6,
791
+ y,
792
+ z
793
+ ];
794
+ })(ast.annotations.get(tsplus_module_4.Surrogate));
795
+ case 16: return [
796
+ 2,
797
+ ast.elements.length,
798
+ tsplus_module_15.match(() => 0, (rest) => rest.length)(ast.rest)
799
+ ];
800
+ case 17: {
801
+ const y = ast.propertySignatures.length;
802
+ const z = ast.indexSignatures.length;
803
+ return y + z === 0 ? [
804
+ -4,
805
+ 0,
806
+ 0
807
+ ] : [
808
+ 4,
809
+ y,
810
+ z
811
+ ];
812
+ }
813
+ case 18: return maxWeightAll(tsplus_module_6.map(getWeight)(ast.types));
814
+ case 19: return [
815
+ 8,
816
+ 0,
817
+ 0
818
+ ];
819
+ case 20:
820
+ const [x, y, z] = getWeight(ast.from);
821
+ return [
822
+ x + 1,
823
+ y,
824
+ z
825
+ ];
826
+ case 21: return getWeight(ast.from);
827
+ case 13: return [
828
+ -2,
829
+ 0,
830
+ 0
831
+ ];
832
+ case 6:
833
+ case 7: return [
834
+ -4,
835
+ 0,
836
+ 0
837
+ ];
838
+ default: return emptyWeight;
839
+ }
777
840
  }
778
841
  function sortByDescendingWeight(types) {
779
- return tsplus_module_3.sort(tsplus_module_8.contramap(getWeight)(OrdWeight))(types);
842
+ return tsplus_module_6.sort(tsplus_module_11.contramap(getWeight)(OrdWeight))(types);
780
843
  }
781
844
  function unify(candidates) {
782
- let out = tsplus_module_3.flatMap(ast => {
783
- void 0;
784
- switch (ast._tag) {
785
- case 5 /* ASTTag.NeverKeyword */:
786
- return tsplus_module_3.empty();
787
- case 18 /* ASTTag.Union */:
788
- return ast.types;
789
- default:
790
- return tsplus_module_3.vector(ast);
791
- }
792
- })(candidates);
793
- if (tsplus_module_3.some(isStringKeyword_1)(out)) {
794
- out = tsplus_module_3.filter(m => !(isLiteral_1(m) && typeof m.literal === "string"))(out);
795
- }
796
- if (tsplus_module_3.some(isNumberKeyword_1)(out)) {
797
- out = tsplus_module_3.filter(m => !(isLiteral_1(m) && typeof m.literal === "number"))(out);
798
- }
799
- if (tsplus_module_3.some(isSymbolKeyword_1)(out)) {
800
- out = tsplus_module_3.filter(m => !isUniqueSymbol_1(m))(out);
801
- }
802
- return out;
845
+ let out = tsplus_module_6.flatMap((ast) => {
846
+ switch (ast._tag) {
847
+ case 5: return tsplus_module_6.empty();
848
+ case 18: return ast.types;
849
+ default: return tsplus_module_6.vector(ast);
850
+ }
851
+ })(candidates);
852
+ if (tsplus_module_6.some(isStringKeyword_1)(out)) out = tsplus_module_6.filter((m) => !(isLiteral_1(m) && typeof m.literal === "string"))(out);
853
+ if (tsplus_module_6.some(isNumberKeyword_1)(out)) out = tsplus_module_6.filter((m) => !(isLiteral_1(m) && typeof m.literal === "number"))(out);
854
+ if (tsplus_module_6.some(isSymbolKeyword_1)(out)) out = tsplus_module_6.filter((m) => !isUniqueSymbol_1(m))(out);
855
+ return out;
803
856
  }
804
857
  /**
805
- * @tsplus pipeable fncts.schema.AST combineAnnotations
806
- */
807
- export function combineAnnotations(annotations) {
808
- return self => {
809
- return self.clone({
810
- annotations: self.annotations.combine(annotations)
811
- });
812
- };
858
+ * @tsplus pipeable fncts.schema.AST combineAnnotations
859
+ */
860
+ function combineAnnotations(annotations) {
861
+ return (self) => {
862
+ return self.clone({ annotations: self.annotations.combine(annotations) });
863
+ };
813
864
  }
814
865
  /**
815
- * @tsplus pipeable fncts.schema.AST setAnnotation
816
- */
817
- export function setAnnotation(annotation, value) {
818
- return self => {
819
- return self.clone({
820
- annotations: self.annotations.annotate(annotation, value)
821
- });
822
- };
866
+ * @tsplus pipeable fncts.schema.AST setAnnotation
867
+ */
868
+ function setAnnotation(annotation, value) {
869
+ return (self) => {
870
+ return self.clone({ annotations: self.annotations.annotate(annotation, value) });
871
+ };
823
872
  }
824
873
  /**
825
- * @tsplus pipeable fncts.schema.AST appendRestElement
826
- */
827
- export function appendRestElement(restElement) {
828
- return self => {
829
- if (tsplus_module_13.isJust(self.rest)) {
830
- throw new Error("A rest element cannot follow another rest element. ts(1265)");
831
- }
832
- return createTuple_1(self.elements, tsplus_module_4.just(tsplus_module_3.vector(restElement), fileName_1 + ":1115:43"), self.isReadonly, self.annotations);
833
- };
874
+ * @tsplus pipeable fncts.schema.AST appendRestElement
875
+ */
876
+ function appendRestElement(restElement) {
877
+ return (self) => {
878
+ if (tsplus_module_16.isJust(self.rest)) throw new Error("A rest element cannot follow another rest element. ts(1265)");
879
+ return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.vector(restElement), fileName_1 + ":1313:43"), self.isReadonly, self.annotations);
880
+ };
834
881
  }
835
882
  /**
836
- * @tsplus pipeable fncts.schema.AST appendElement
837
- */
838
- export function appendElement(element) {
839
- return self => {
840
- if (tsplus_module_3.some(e => e.isOptional)(self.elements) && !element.isOptional) {
841
- throw new Error("A required element cannot follow an optional element. ts(1257)");
842
- }
843
- return tsplus_module_12.match(() => createTuple_1(tsplus_module_3.append(element)(self.elements), tsplus_module_4.nothing(fileName_1 + ":1128:63"), self.isReadonly, self.annotations), rest => {
844
- if (element.isOptional) {
845
- throw new Error("A required element cannot follow an optional element. ts(1257)");
846
- }
847
- return createTuple_1(self.elements, tsplus_module_4.just(tsplus_module_3.append(element.type)(rest), fileName_1 + ":1133:47"), self.isReadonly, self.annotations);
848
- })(self.rest);
849
- };
850
- }
851
- export function getParameter(x) {
852
- return isRefinement(x) ? getParameter(x.from) : x;
883
+ * @tsplus pipeable fncts.schema.AST appendElement
884
+ */
885
+ function appendElement(element) {
886
+ return (self) => {
887
+ if (tsplus_module_6.some((e) => e.isOptional)(self.elements) && !element.isOptional) throw new Error("A required element cannot follow an optional element. ts(1257)");
888
+ return tsplus_module_15.match(() => createTuple_1(tsplus_module_6.append(element)(self.elements), tsplus_module_7.nothing(fileName_1 + ":1326:63"), self.isReadonly, self.annotations), (rest) => {
889
+ if (element.isOptional) throw new Error("A required element cannot follow an optional element. ts(1257)");
890
+ return createTuple_1(self.elements, tsplus_module_7.just(tsplus_module_6.append(element.type)(rest), fileName_1 + ":1331:47"), self.isReadonly, self.annotations);
891
+ })(self.rest);
892
+ };
893
+ }
894
+ function getParameter(x) {
895
+ return isRefinement(x) ? getParameter(x.from) : x;
853
896
  }
854
897
  /**
855
- * @tsplus getter fncts.schema.AST getPropertySignatures
856
- */
898
+ * @tsplus getter fncts.schema.AST getPropertySignatures
899
+ */
857
900
  function getPropertySignatures_1(self) {
858
- void 0;
859
- switch (self._tag) {
860
- case 0 /* ASTTag.Declaration */:
861
- return tsplus_module_12.match(() => tsplus_module_3.empty(), surrogate => getPropertySignatures_1(surrogate))(self.annotations.get(tsplus_module_2.Surrogate));
862
- case 16 /* ASTTag.Tuple */:
863
- return tsplus_module_3.mapWithIndex((i, element) => createPropertySignature_1(i, element.type, element.isOptional, self.isReadonly))(self.elements);
864
- case 18 /* ASTTag.Union */:
865
- {
866
- const propertySignatures = tsplus_module_3.map(getPropertySignatures_1)(self.types);
867
- return tsplus_module_3.filterMap(({
868
- name
869
- }) => {
870
- if (tsplus_module_3.every(ps => tsplus_module_3.some(p => p.name === name)(ps))(propertySignatures)) {
871
- const members = tsplus_module_3.flatMap(ps => tsplus_module_3.filter(p => p.name === name)(ps))(propertySignatures);
872
- return tsplus_module_4.just(createPropertySignature_1(name, createUnion_1(tsplus_module_3.map(p => p.type)(members)), tsplus_module_3.some(p => p.isOptional)(members), tsplus_module_3.some(p => p.isReadonly)(members)), fileName_1 + ":1165:22");
873
- }
874
- return tsplus_module_4.nothing(fileName_1 + ":1174:23");
875
- })(tsplus_module_3.unsafeGet(0)(propertySignatures));
876
- }
877
- case 17 /* ASTTag.TypeLiteral */:
878
- return self.propertySignatures;
879
- case 19 /* ASTTag.Lazy */:
880
- return getPropertySignatures_1(self.getAST());
881
- case 20 /* ASTTag.Refinement */:
882
- return getPropertySignatures_1(self.from);
883
- case 21 /* ASTTag.Transform */:
884
- return getPropertySignatures_1(self.to);
885
- default:
886
- return tsplus_module_3.empty();
887
- }
901
+ switch (self._tag) {
902
+ case 0: return tsplus_module_15.match(() => tsplus_module_6.empty(), (surrogate) => getPropertySignatures_1(surrogate))(self.annotations.get(tsplus_module_4.Surrogate));
903
+ case 16: return tsplus_module_6.mapWithIndex((i, element) => createPropertySignature_1(i, element.type, element.isOptional, self.isReadonly))(self.elements);
904
+ case 18: {
905
+ const propertySignatures = tsplus_module_6.map(getPropertySignatures_1)(self.types);
906
+ return tsplus_module_6.filterMap(({ name }) => {
907
+ if (tsplus_module_6.every((ps) => tsplus_module_6.some((p) => p.name === name)(ps))(propertySignatures)) {
908
+ const members = tsplus_module_6.flatMap((ps) => tsplus_module_6.filter((p) => p.name === name)(ps))(propertySignatures);
909
+ return tsplus_module_7.just(createPropertySignature_1(name, createUnion_1(tsplus_module_6.map((p) => p.type)(members)), tsplus_module_6.some((p) => p.isOptional)(members), tsplus_module_6.some((p) => p.isReadonly)(members)), fileName_1 + ":1363:22");
910
+ }
911
+ return tsplus_module_7.nothing(fileName_1 + ":1372:23");
912
+ })(tsplus_module_6.unsafeGet(0)(propertySignatures));
913
+ }
914
+ case 17: return self.propertySignatures;
915
+ case 19: return getPropertySignatures_1(self.getAST());
916
+ case 20: return getPropertySignatures_1(self.from);
917
+ case 21: return getPropertySignatures_1(self.to);
918
+ default: return tsplus_module_6.empty();
919
+ }
888
920
  }
889
921
  /**
890
- * @tsplus getter fncts.schema.AST keysof
891
- */
922
+ * @tsplus getter fncts.schema.AST keysof
923
+ */
892
924
  function keysOf_1(ast) {
893
- void 0;
894
- switch (ast._tag) {
895
- case 0 /* ASTTag.Declaration */:
896
- return tsplus_module_12.match(() => tsplus_module_3.empty(), surrogate => keysOf_1(surrogate))(ast.annotations.get(tsplus_module_2.Surrogate));
897
- case 5 /* ASTTag.NeverKeyword */:
898
- case 7 /* ASTTag.AnyKeyword */:
899
- return tsplus_module_3.vector(stringKeyword_1, numberKeyword_1, symbolKeyword_1);
900
- case 8 /* ASTTag.StringKeyword */:
901
- return tsplus_module_3.vector(createLiteral_1("length"));
902
- case 17 /* ASTTag.TypeLiteral */:
903
- return tsplus_module_3.concat(tsplus_module_3.map(is => getParameter(is.parameter))(ast.indexSignatures))(tsplus_module_3.map(p => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(ast.propertySignatures));
904
- case 18 /* ASTTag.Union */:
905
- return tsplus_module_3.map(p => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(getPropertySignatures_1(ast));
906
- case 19 /* ASTTag.Lazy */:
907
- return keysOf_1(ast.getAST());
908
- case 20 /* ASTTag.Refinement */:
909
- return keysOf_1(ast.from);
910
- case 21 /* ASTTag.Transform */:
911
- return keysOf_1(ast.to);
912
- default:
913
- return tsplus_module_3.empty();
914
- }
925
+ switch (ast._tag) {
926
+ case 0: return tsplus_module_15.match(() => tsplus_module_6.empty(), (surrogate) => keysOf_1(surrogate))(ast.annotations.get(tsplus_module_4.Surrogate));
927
+ case 5:
928
+ case 7: return tsplus_module_6.vector(stringKeyword_1, numberKeyword_1, symbolKeyword_1);
929
+ case 8: return tsplus_module_6.vector(createLiteral_1("length"));
930
+ case 17: return tsplus_module_6.concat(tsplus_module_6.map((is) => getParameter(is.parameter))(ast.indexSignatures))(tsplus_module_6.map((p) => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(ast.propertySignatures));
931
+ case 18: return tsplus_module_6.map((p) => typeof p.name === "symbol" ? createUniqueSymbol_1(p.name) : createLiteral_1(p.name))(getPropertySignatures_1(ast));
932
+ case 19: return keysOf_1(ast.getAST());
933
+ case 20: return keysOf_1(ast.from);
934
+ case 21: return keysOf_1(ast.to);
935
+ default: return tsplus_module_6.empty();
936
+ }
915
937
  }
916
938
  /**
917
- * @tsplus getter fncts.schema.AST keyof
918
- */
919
- export function keyof(self) {
920
- return createUnion_1(keysOf_1(self));
939
+ * @tsplus getter fncts.schema.AST keyof
940
+ */
941
+ function keyof(self) {
942
+ return createUnion_1(keysOf_1(self));
921
943
  }
922
944
  /**
923
- * @tsplus static fncts.schema.ASTOps createRecord
924
- */
925
- export function createRecord(key, value, isReadonly) {
926
- const propertySignatures = tsplus_module_3.emptyPushable();
927
- const indexSignatures = tsplus_module_3.emptyPushable();
928
- function go(key) {
929
- void 0;
930
- switch (key._tag) {
931
- case 5 /* ASTTag.NeverKeyword */:
932
- break;
933
- case 8 /* ASTTag.StringKeyword */:
934
- case 12 /* ASTTag.SymbolKeyword */:
935
- case 15 /* ASTTag.TemplateLiteral */:
936
- case 20 /* ASTTag.Refinement */:
937
- tsplus_module_14.push(createIndexSignature_1(key, value, isReadonly))(indexSignatures);
938
- break;
939
- case 1 /* ASTTag.Literal */:
940
- if (typeof key.literal === "string" || typeof key.literal === "number") {
941
- tsplus_module_14.push(createPropertySignature_1(key.literal, value, false, isReadonly))(propertySignatures);
942
- }
943
- break;
944
- case 2 /* ASTTag.UniqueSymbol */:
945
- tsplus_module_14.push(createPropertySignature_1(key.symbol, value, false, isReadonly))(propertySignatures);
946
- break;
947
- case 18 /* ASTTag.Union */:
948
- tsplus_module_3.forEach(go)(key.types);
949
- break;
950
- default:
951
- throw new Error(`createRecord: Unsupported key\n${show(key)}`);
952
- }
953
- }
954
- go(key);
955
- return createTypeLiteral_1(propertySignatures, indexSignatures);
945
+ * @tsplus static fncts.schema.ASTOps createRecord
946
+ */
947
+ function createRecord(key, value, isReadonly) {
948
+ const propertySignatures = tsplus_module_6.emptyPushable();
949
+ const indexSignatures = tsplus_module_6.emptyPushable();
950
+ function go(key) {
951
+ switch (key._tag) {
952
+ case 5: break;
953
+ case 8:
954
+ case 12:
955
+ case 15:
956
+ case 20:
957
+ tsplus_module_17.push(createIndexSignature_1(key, value, isReadonly))(indexSignatures);
958
+ break;
959
+ case 1:
960
+ if (typeof key.literal === "string" || typeof key.literal === "number") tsplus_module_17.push(createPropertySignature_1(key.literal, value, false, isReadonly))(propertySignatures);
961
+ break;
962
+ case 2:
963
+ tsplus_module_17.push(createPropertySignature_1(key.symbol, value, false, isReadonly))(propertySignatures);
964
+ break;
965
+ case 18:
966
+ tsplus_module_6.forEach(go)(key.types);
967
+ break;
968
+ default: throw new Error(`createRecord: Unsupported key\n${show(key)}`);
969
+ }
970
+ }
971
+ go(key);
972
+ return createTypeLiteral_1(propertySignatures, indexSignatures);
956
973
  }
957
974
  /**
958
- * @tsplus pipeable fncts.schema.AST pick
959
- */
960
- export function pick(keys) {
961
- return self => {
962
- return createTypeLiteral_1(tsplus_module_3.filter(ps => tsplus_module_3.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_3.empty());
963
- };
975
+ * @tsplus pipeable fncts.schema.AST pick
976
+ */
977
+ function pick(keys) {
978
+ return (self) => {
979
+ return createTypeLiteral_1(tsplus_module_6.filter((ps) => tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
980
+ };
964
981
  }
965
982
  /**
966
- * @tsplus pipeable fncts.schema.AST omit
967
- */
968
- export function omit(keys) {
969
- return self => {
970
- return createTypeLiteral_1(tsplus_module_3.filter(ps => !tsplus_module_3.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_3.empty());
971
- };
983
+ * @tsplus pipeable fncts.schema.AST omit
984
+ */
985
+ function omit(keys) {
986
+ return (self) => {
987
+ return createTypeLiteral_1(tsplus_module_6.filter((ps) => !tsplus_module_6.includes(ps.name)(keys))(getPropertySignatures_1(self)), tsplus_module_6.empty());
988
+ };
972
989
  }
973
990
  /**
974
- * @tsplus getter fncts.schema.AST partial
975
- */
991
+ * @tsplus getter fncts.schema.AST partial
992
+ */
976
993
  function partial_1(self) {
977
- void 0;
978
- switch (self._tag) {
979
- case 16 /* ASTTag.Tuple */:
980
- return createTuple_1(tsplus_module_3.map(e => createElement_1(e.type, true))(self.elements), tsplus_module_15.map(rest => tsplus_module_3.vector(createUnion_1(tsplus_module_3.append(undefinedKeyword_1)(rest))))(self.rest), self.isReadonly);
981
- case 17 /* ASTTag.TypeLiteral */:
982
- return createTypeLiteral_1(tsplus_module_3.map(f => createPropertySignature_1(f.name, f.type, true, f.isReadonly, f.annotations))(self.propertySignatures), self.indexSignatures);
983
- case 18 /* ASTTag.Union */:
984
- return createUnion_1(tsplus_module_3.map(partial_1)(self.types));
985
- case 19 /* ASTTag.Lazy */:
986
- return createLazy_1(() => partial_1(self.getAST()));
987
- case 20 /* ASTTag.Refinement */:
988
- return partial_1(self.from);
989
- case 21 /* ASTTag.Transform */:
990
- return partial_1(self.to);
991
- default:
992
- return self;
993
- }
994
+ switch (self._tag) {
995
+ case 16: return createTuple_1(tsplus_module_6.map((e) => createElement_1(e.type, true))(self.elements), tsplus_module_18.map((rest) => tsplus_module_6.vector(createUnion_1(tsplus_module_6.append(undefinedKeyword_1)(rest))))(self.rest), self.isReadonly);
996
+ case 17: return createTypeLiteral_1(tsplus_module_6.map((f) => createPropertySignature_1(f.name, f.type, true, f.isReadonly, f.annotations))(self.propertySignatures), self.indexSignatures);
997
+ case 18: return createUnion_1(tsplus_module_6.map(partial_1)(self.types));
998
+ case 19: return createLazy_1(() => partial_1(self.getAST()));
999
+ case 20: return partial_1(self.from);
1000
+ case 21: return partial_1(self.to);
1001
+ default: return self;
1002
+ }
994
1003
  }
995
1004
  /**
996
- * @tsplus static fncts.schema.AST createKey
997
- */
998
- export function createKey(key) {
999
- return typeof key === "symbol" ? createUniqueSymbol_1(key) : createLiteral_1(key);
1005
+ * @tsplus static fncts.schema.AST createKey
1006
+ */
1007
+ function createKey(key) {
1008
+ return typeof key === "symbol" ? createUniqueSymbol_1(key) : createLiteral_1(key);
1000
1009
  }
1001
1010
  /**
1002
- * @tsplus getter fncts.schema.AST getFrom
1003
- */
1011
+ * @tsplus getter fncts.schema.AST getFrom
1012
+ */
1004
1013
  function getFrom_1(ast) {
1005
- void 0;
1006
- switch (ast._tag) {
1007
- case 0 /* ASTTag.Declaration */:
1008
- {
1009
- const surrogate = ast.annotations.get(tsplus_module_2.Surrogate);
1010
- if (tsplus_module_13.isJust(surrogate)) {
1011
- return getFrom_1(surrogate.value);
1012
- }
1013
- break;
1014
- }
1015
- case 16 /* ASTTag.Tuple */:
1016
- return createTuple_1(tsplus_module_3.map(element => createElement_1(getFrom_1(element.type), element.isOptional))(ast.elements), tsplus_module_15.map(restElement => tsplus_module_3.map(getFrom_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
1017
- case 17 /* ASTTag.TypeLiteral */:
1018
- return createTypeLiteral_1(tsplus_module_3.map(ps => createPropertySignature_1(ps.name, getFrom_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_3.map(is => createIndexSignature_1(is.parameter, getFrom_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
1019
- case 18 /* ASTTag.Union */:
1020
- return createUnion_1(tsplus_module_3.map(getFrom_1)(ast.types), ast.annotations);
1021
- case 19 /* ASTTag.Lazy */:
1022
- return createLazy_1(() => getFrom_1(ast.getAST()), ast.annotations);
1023
- case 20 /* ASTTag.Refinement */:
1024
- case 21 /* ASTTag.Transform */:
1025
- return getFrom_1(ast.from);
1026
- }
1027
- return ast;
1014
+ switch (ast._tag) {
1015
+ case 0: {
1016
+ const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
1017
+ if (tsplus_module_16.isJust(surrogate)) return getFrom_1(surrogate.value);
1018
+ break;
1019
+ }
1020
+ case 16: return createTuple_1(tsplus_module_6.map((element) => createElement_1(getFrom_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map((restElement) => tsplus_module_6.map(getFrom_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
1021
+ case 17: return createTypeLiteral_1(tsplus_module_6.map((ps) => createPropertySignature_1(ps.name, getFrom_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map((is) => createIndexSignature_1(is.parameter, getFrom_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
1022
+ case 18: return createUnion_1(tsplus_module_6.map(getFrom_1)(ast.types), ast.annotations);
1023
+ case 19: return createLazy_1(() => getFrom_1(ast.getAST()), ast.annotations);
1024
+ case 20:
1025
+ case 21: return getFrom_1(ast.from);
1026
+ }
1027
+ return ast;
1028
1028
  }
1029
1029
  /**
1030
- * @tsplus getter fncts.schema.AST getTo
1031
- */
1030
+ * @tsplus getter fncts.schema.AST getTo
1031
+ */
1032
1032
  function getTo_1(ast) {
1033
- void 0;
1034
- switch (ast._tag) {
1035
- case 0 /* ASTTag.Declaration */:
1036
- {
1037
- const surrogate = ast.annotations.get(tsplus_module_2.Surrogate);
1038
- if (tsplus_module_13.isJust(surrogate)) {
1039
- return getTo_1(surrogate.value);
1040
- }
1041
- break;
1042
- }
1043
- case 16 /* ASTTag.Tuple */:
1044
- return createTuple_1(tsplus_module_3.map(element => createElement_1(getTo_1(element.type), element.isOptional))(ast.elements), tsplus_module_15.map(restElement => tsplus_module_3.map(getTo_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
1045
- case 17 /* ASTTag.TypeLiteral */:
1046
- return createTypeLiteral_1(tsplus_module_3.map(ps => createPropertySignature_1(ps.name, getTo_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_3.map(is => createIndexSignature_1(is.parameter, getTo_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
1047
- case 18 /* ASTTag.Union */:
1048
- return createUnion_1(tsplus_module_3.map(getTo_1)(ast.types), ast.annotations);
1049
- case 19 /* ASTTag.Lazy */:
1050
- return createLazy_1(() => getTo_1(ast.getAST()), ast.annotations);
1051
- case 20 /* ASTTag.Refinement */:
1052
- return createRefinement_1(getTo_1(ast.from), ast.predicate, ast.annotations);
1053
- case 21 /* ASTTag.Transform */:
1054
- return getTo_1(ast.to);
1055
- }
1056
- return ast;
1033
+ switch (ast._tag) {
1034
+ case 0: {
1035
+ const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
1036
+ if (tsplus_module_16.isJust(surrogate)) return getTo_1(surrogate.value);
1037
+ break;
1038
+ }
1039
+ case 16: return createTuple_1(tsplus_module_6.map((element) => createElement_1(getTo_1(element.type), element.isOptional))(ast.elements), tsplus_module_18.map((restElement) => tsplus_module_6.map(getTo_1)(restElement))(ast.rest), ast.isReadonly, ast.annotations);
1040
+ case 17: return createTypeLiteral_1(tsplus_module_6.map((ps) => createPropertySignature_1(ps.name, getTo_1(ps.type), ps.isOptional, ps.isReadonly, ps.annotations))(ast.propertySignatures), tsplus_module_6.map((is) => createIndexSignature_1(is.parameter, getTo_1(is.type), is.isReadonly))(ast.indexSignatures), ast.annotations);
1041
+ case 18: return createUnion_1(tsplus_module_6.map(getTo_1)(ast.types), ast.annotations);
1042
+ case 19: return createLazy_1(() => getTo_1(ast.getAST()), ast.annotations);
1043
+ case 20: return createRefinement_1(getTo_1(ast.from), ast.predicate, ast.annotations);
1044
+ case 21: return getTo_1(ast.to);
1045
+ }
1046
+ return ast;
1057
1047
  }
1058
1048
  /**
1059
- * @tsplus static fncts.schema.AST getCompiler
1060
- */
1061
- export function getCompiler(match) {
1062
- const compile = memoize(ast => {
1063
- void 0;
1064
- return match[ast._tag](ast, compile);
1065
- });
1066
- return compile;
1067
- }
1068
- export function getLiterals(ast, isDecoding) {
1069
- void 0;
1070
- switch (ast._tag) {
1071
- case 0 /* ASTTag.Declaration */:
1072
- {
1073
- const surrogate = ast.annotations.get(tsplus_module_2.Surrogate);
1074
- if (tsplus_module_13.isJust(surrogate)) {
1075
- return getLiterals(surrogate.value, isDecoding);
1076
- }
1077
- break;
1078
- }
1079
- case 17 /* ASTTag.TypeLiteral */:
1080
- {
1081
- const out = [];
1082
- for (let i = 0; i < ast.propertySignatures.length; i++) {
1083
- const propertySignature = tsplus_module_3.unsafeGet(i)(ast.propertySignatures);
1084
- if (isLiteral_1(propertySignature.type) && !propertySignature.isOptional) {
1085
- out.push([propertySignature.name, propertySignature.type]);
1086
- }
1087
- }
1088
- return out;
1089
- }
1090
- case 20 /* ASTTag.Refinement */:
1091
- return getLiterals(ast.from, isDecoding);
1092
- case 21 /* ASTTag.Transform */:
1093
- return getLiterals(isDecoding ? ast.from : ast.to, isDecoding);
1094
- }
1095
- return [];
1096
- }
1097
- export function getSearchTree(members, isDecoding) {
1098
- const keys = {};
1099
- const otherwise = [];
1100
- for (let i = 0; i < members.length; i++) {
1101
- const member = tsplus_module_3.unsafeGet(i)(members);
1102
- const tags = getLiterals(member, isDecoding);
1103
- if (tags.length > 0) {
1104
- for (let j = 0; j < tags.length; j++) {
1105
- const [key, literal] = tags[j];
1106
- const hash = String(literal.literal);
1107
- keys[key] || (keys[key] = {
1108
- buckets: {},
1109
- ast: neverKeyword_1,
1110
- literals: []
1111
- });
1112
- const buckets = keys[key].buckets;
1113
- if (Object.prototype.hasOwnProperty.call(buckets, hash)) {
1114
- if (j < tags.length - 1) {
1115
- continue;
1116
- }
1117
- buckets[hash].push(member);
1118
- keys[key].ast = createUnion_1(tsplus_module_3.vector(keys[key].ast, literal));
1119
- keys[key].literals.push(literal);
1120
- } else {
1121
- buckets[hash] = [member];
1122
- keys[key].ast = createUnion_1(tsplus_module_3.vector(keys[key].ast, literal));
1123
- keys[key].literals.push(literal);
1124
- break;
1125
- }
1126
- }
1127
- } else {
1128
- otherwise.push(member);
1129
- }
1130
- }
1131
- return {
1132
- keys,
1133
- otherwise
1134
- };
1049
+ * @tsplus static fncts.schema.AST getCompiler
1050
+ */
1051
+ function getCompiler(match) {
1052
+ const compile = memoize((ast) => {
1053
+ return match[ast._tag](ast, compile);
1054
+ });
1055
+ return compile;
1056
+ }
1057
+ function getLiterals(ast, isDecoding) {
1058
+ switch (ast._tag) {
1059
+ case 0: {
1060
+ const surrogate = ast.annotations.get(tsplus_module_4.Surrogate);
1061
+ if (tsplus_module_16.isJust(surrogate)) return getLiterals(surrogate.value, isDecoding);
1062
+ break;
1063
+ }
1064
+ case 17: {
1065
+ const out = [];
1066
+ for (let i = 0; i < ast.propertySignatures.length; i++) {
1067
+ const propertySignature = tsplus_module_6.unsafeGet(i)(ast.propertySignatures);
1068
+ if (isLiteral_1(propertySignature.type) && !propertySignature.isOptional) out.push([propertySignature.name, propertySignature.type]);
1069
+ }
1070
+ return out;
1071
+ }
1072
+ case 20: return getLiterals(ast.from, isDecoding);
1073
+ case 21: return getLiterals(isDecoding ? ast.from : ast.to, isDecoding);
1074
+ }
1075
+ return [];
1076
+ }
1077
+ function getSearchTree(members, isDecoding) {
1078
+ const keys = {};
1079
+ const otherwise = [];
1080
+ for (let i = 0; i < members.length; i++) {
1081
+ const member = tsplus_module_6.unsafeGet(i)(members);
1082
+ const tags = getLiterals(member, isDecoding);
1083
+ if (tags.length > 0) for (let j = 0; j < tags.length; j++) {
1084
+ const [key, literal] = tags[j];
1085
+ const hash = String(literal.literal);
1086
+ keys[key] ||= {
1087
+ buckets: {},
1088
+ ast: neverKeyword_1,
1089
+ literals: []
1090
+ };
1091
+ const buckets = keys[key].buckets;
1092
+ if (Object.prototype.hasOwnProperty.call(buckets, hash)) {
1093
+ if (j < tags.length - 1) continue;
1094
+ buckets[hash].push(member);
1095
+ keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
1096
+ keys[key].literals.push(literal);
1097
+ } else {
1098
+ buckets[hash] = [member];
1099
+ keys[key].ast = createUnion_1(tsplus_module_6.vector(keys[key].ast, literal));
1100
+ keys[key].literals.push(literal);
1101
+ break;
1102
+ }
1103
+ }
1104
+ else otherwise.push(member);
1105
+ }
1106
+ return {
1107
+ keys,
1108
+ otherwise
1109
+ };
1135
1110
  }
1136
1111
  /**
1137
- * @tsplus pipeable fncts.schema.AST getFormattedExpected
1138
- */
1139
- export function getFormattedExpected(verbose = false) {
1140
- return self => {
1141
- if (verbose) {
1142
- const description = tsplus_module_15.orElse(() => self.annotations.get(tsplus_module_2.Title))(self.annotations.get(tsplus_module_2.Description));
1143
- return tsplus_module_12.match(() => description, identifier => tsplus_module_12.match(() => tsplus_module_4.just(identifier, fileName_1 + ":1512:23"), description => tsplus_module_4.just(`${identifier} (${description})`, fileName_1 + ":1513:34"))(description))(self.annotations.get(tsplus_module_2.Identifier));
1144
- } else {
1145
- return tsplus_module_15.orElse(() => self.annotations.get(tsplus_module_2.Description))(tsplus_module_15.orElse(() => self.annotations.get(tsplus_module_2.Title))(self.annotations.get(tsplus_module_2.Identifier)));
1146
- }
1147
- };
1148
- }
1112
+ * @tsplus pipeable fncts.schema.AST getFormattedExpected
1113
+ */
1114
+ function getFormattedExpected(verbose = false) {
1115
+ return (self) => {
1116
+ if (verbose) {
1117
+ const description = tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Description));
1118
+ return tsplus_module_15.match(() => description, (identifier) => tsplus_module_15.match(() => tsplus_module_7.just(identifier, fileName_1 + ":1710:23"), (description) => tsplus_module_7.just(`${identifier} (${description})`, fileName_1 + ":1711:34"))(description))(self.annotations.get(tsplus_module_4.Identifier));
1119
+ } else return tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Description))(tsplus_module_18.orElse(() => self.annotations.get(tsplus_module_4.Title))(self.annotations.get(tsplus_module_4.Identifier)));
1120
+ };
1121
+ }
1122
+ //#endregion
1123
+ export { AST, ASTTypeId, Annotated, AnyKeyword, BigIntKeyword, BooleanKeyword, Declaration, Element, Enum, IndexSignature, Lazy, Literal, NeverKeyword, NumberKeyword, ObjectKeyword, PropertySignature, Refinement, StringKeyword, SymbolKeyword, TemplateLiteral, TemplateLiteralSpan, Transform, Tuple, TypeLiteral, UndefinedKeyword, Union, UniqueSymbol, UnknownKeyword, Validation, VoidKeyword, anyKeyword, appendElement, appendRestElement, bigIntKeyword, booleanKeyword, combineAnnotations, concrete, createDeclaration, createElement, createEnum, createIndexSignature, createKey, createLazy, createLiteral, createPropertySignature, createRecord, createRefinement, createTemplateLiteral, createTransform, createTuple, createTypeLiteral, createUnion, createUniqueSymbol, createValidation, getAnnotations, getCardinality, getCompiler, getFormattedExpected, getFrom, getLiterals, getParameter, getPropertySignatures, getSearchTree, getTo, getWeight, isAST, isBigIntKeyword, isBooleanKeyword, isDeclaration, isLazy, isLiteral, isNumberKeyword, isRefinement, isStringKeyword, isSymbolKeyword, isTypeLiteral, isUnion, isUniqueSymbol, keyof, keysOf, neverKeyword, numberKeyword, objectKeyword, omit, partial, pick, setAnnotation, stringKeyword, symbolKeyword, undefinedKeyword, unknownArray, unknownKeyword, unknownRecord, voidKeyword };
1124
+
1149
1125
  //# sourceMappingURL=AST.mjs.map