@elaraai/east 0.0.1-beta.3 → 0.0.1-beta.31

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 (191) hide show
  1. package/LICENSE.md +15 -666
  2. package/README.md +30 -8
  3. package/dist/src/analyze.d.ts +3 -0
  4. package/dist/src/analyze.d.ts.map +1 -1
  5. package/dist/src/analyze.js +76 -15
  6. package/dist/src/analyze.js.map +1 -1
  7. package/dist/src/ast.d.ts +37 -33
  8. package/dist/src/ast.d.ts.map +1 -1
  9. package/dist/src/ast_to_ir.d.ts +6 -0
  10. package/dist/src/ast_to_ir.d.ts.map +1 -1
  11. package/dist/src/ast_to_ir.js +135 -101
  12. package/dist/src/ast_to_ir.js.map +1 -1
  13. package/dist/src/builtins.d.ts +1 -1
  14. package/dist/src/builtins.d.ts.map +1 -1
  15. package/dist/src/builtins.js +32 -0
  16. package/dist/src/builtins.js.map +1 -1
  17. package/dist/src/comparison.d.ts.map +1 -1
  18. package/dist/src/comparison.js +12 -4
  19. package/dist/src/comparison.js.map +1 -1
  20. package/dist/src/compile.d.ts +26 -1
  21. package/dist/src/compile.d.ts.map +1 -1
  22. package/dist/src/compile.js +388 -257
  23. package/dist/src/compile.js.map +1 -1
  24. package/dist/src/datetime_format/types.d.ts +23 -23
  25. package/dist/src/eastir.d.ts +4 -0
  26. package/dist/src/eastir.d.ts.map +1 -1
  27. package/dist/src/eastir.js +27 -7
  28. package/dist/src/eastir.js.map +1 -1
  29. package/dist/src/error.d.ts +12 -1
  30. package/dist/src/error.d.ts.map +1 -1
  31. package/dist/src/error.js +31 -1
  32. package/dist/src/error.js.map +1 -1
  33. package/dist/src/expr/array.d.ts +109 -1
  34. package/dist/src/expr/array.d.ts.map +1 -1
  35. package/dist/src/expr/array.js +204 -44
  36. package/dist/src/expr/array.js.map +1 -1
  37. package/dist/src/expr/ast.d.ts +1 -1
  38. package/dist/src/expr/ast.d.ts.map +1 -1
  39. package/dist/src/expr/ast.js +16 -28
  40. package/dist/src/expr/ast.js.map +1 -1
  41. package/dist/src/expr/asyncfunction.js +1 -1
  42. package/dist/src/expr/asyncfunction.js.map +1 -1
  43. package/dist/src/expr/blob.d.ts +73 -1
  44. package/dist/src/expr/blob.d.ts.map +1 -1
  45. package/dist/src/expr/blob.js +97 -7
  46. package/dist/src/expr/blob.js.map +1 -1
  47. package/dist/src/expr/block.d.ts +232 -12
  48. package/dist/src/expr/block.d.ts.map +1 -1
  49. package/dist/src/expr/block.js +646 -140
  50. package/dist/src/expr/block.js.map +1 -1
  51. package/dist/src/expr/boolean.d.ts +44 -0
  52. package/dist/src/expr/boolean.d.ts.map +1 -1
  53. package/dist/src/expr/boolean.js +57 -5
  54. package/dist/src/expr/boolean.js.map +1 -1
  55. package/dist/src/expr/datetime.d.ts +135 -0
  56. package/dist/src/expr/datetime.d.ts.map +1 -1
  57. package/dist/src/expr/datetime.js +183 -33
  58. package/dist/src/expr/datetime.js.map +1 -1
  59. package/dist/src/expr/dict.d.ts +42 -0
  60. package/dist/src/expr/dict.d.ts.map +1 -1
  61. package/dist/src/expr/dict.js +105 -55
  62. package/dist/src/expr/dict.js.map +1 -1
  63. package/dist/src/expr/expr.d.ts +1 -1
  64. package/dist/src/expr/expr.d.ts.map +1 -1
  65. package/dist/src/expr/expr.js.map +1 -1
  66. package/dist/src/expr/float.d.ts +153 -0
  67. package/dist/src/expr/float.d.ts.map +1 -1
  68. package/dist/src/expr/float.js +190 -16
  69. package/dist/src/expr/float.js.map +1 -1
  70. package/dist/src/expr/function.d.ts +7 -2
  71. package/dist/src/expr/function.d.ts.map +1 -1
  72. package/dist/src/expr/function.js +1 -1
  73. package/dist/src/expr/function.js.map +1 -1
  74. package/dist/src/expr/index.d.ts +202 -2
  75. package/dist/src/expr/index.d.ts.map +1 -1
  76. package/dist/src/expr/index.js +207 -2
  77. package/dist/src/expr/index.js.map +1 -1
  78. package/dist/src/expr/integer.d.ts +180 -0
  79. package/dist/src/expr/integer.d.ts.map +1 -1
  80. package/dist/src/expr/integer.js +188 -17
  81. package/dist/src/expr/integer.js.map +1 -1
  82. package/dist/src/expr/libs/blob.js +2 -2
  83. package/dist/src/expr/libs/blob.js.map +1 -1
  84. package/dist/src/expr/libs/integer.d.ts +19 -0
  85. package/dist/src/expr/libs/integer.d.ts.map +1 -1
  86. package/dist/src/expr/libs/integer.js +47 -0
  87. package/dist/src/expr/libs/integer.js.map +1 -1
  88. package/dist/src/expr/libs/string.js +1 -1
  89. package/dist/src/expr/libs/string.js.map +1 -1
  90. package/dist/src/expr/recursive.d.ts +83 -0
  91. package/dist/src/expr/recursive.d.ts.map +1 -0
  92. package/dist/src/expr/recursive.js +99 -0
  93. package/dist/src/expr/recursive.js.map +1 -0
  94. package/dist/src/expr/ref.js +3 -3
  95. package/dist/src/expr/ref.js.map +1 -1
  96. package/dist/src/expr/set.d.ts +44 -2
  97. package/dist/src/expr/set.d.ts.map +1 -1
  98. package/dist/src/expr/set.js +97 -47
  99. package/dist/src/expr/set.js.map +1 -1
  100. package/dist/src/expr/string.d.ts +134 -0
  101. package/dist/src/expr/string.d.ts.map +1 -1
  102. package/dist/src/expr/string.js +172 -22
  103. package/dist/src/expr/string.js.map +1 -1
  104. package/dist/src/expr/struct.d.ts +1 -1
  105. package/dist/src/expr/struct.d.ts.map +1 -1
  106. package/dist/src/expr/struct.js +1 -1
  107. package/dist/src/expr/struct.js.map +1 -1
  108. package/dist/src/expr/types.d.ts +7 -6
  109. package/dist/src/expr/types.d.ts.map +1 -1
  110. package/dist/src/expr/variant.d.ts +123 -1
  111. package/dist/src/expr/variant.d.ts.map +1 -1
  112. package/dist/src/expr/variant.js +66 -2
  113. package/dist/src/expr/variant.js.map +1 -1
  114. package/dist/src/fuzz.d.ts +36 -2
  115. package/dist/src/fuzz.d.ts.map +1 -1
  116. package/dist/src/fuzz.js +344 -77
  117. package/dist/src/fuzz.js.map +1 -1
  118. package/dist/src/index.d.ts +1 -0
  119. package/dist/src/index.d.ts.map +1 -1
  120. package/dist/src/index.js +1 -0
  121. package/dist/src/index.js.map +1 -1
  122. package/dist/src/internal.d.ts +12 -0
  123. package/dist/src/internal.d.ts.map +1 -1
  124. package/dist/src/internal.js +13 -0
  125. package/dist/src/internal.js.map +1 -1
  126. package/dist/src/ir.d.ts +1551 -1505
  127. package/dist/src/ir.d.ts.map +1 -1
  128. package/dist/src/ir.js +49 -34
  129. package/dist/src/ir.js.map +1 -1
  130. package/dist/src/location.d.ts +30 -10
  131. package/dist/src/location.d.ts.map +1 -1
  132. package/dist/src/location.js +70 -28
  133. package/dist/src/location.js.map +1 -1
  134. package/dist/src/patch/apply.d.ts +15 -0
  135. package/dist/src/patch/apply.d.ts.map +1 -0
  136. package/dist/src/patch/apply.js +380 -0
  137. package/dist/src/patch/apply.js.map +1 -0
  138. package/dist/src/patch/compose.d.ts +15 -0
  139. package/dist/src/patch/compose.d.ts.map +1 -0
  140. package/dist/src/patch/compose.js +480 -0
  141. package/dist/src/patch/compose.js.map +1 -0
  142. package/dist/src/patch/diff.d.ts +15 -0
  143. package/dist/src/patch/diff.d.ts.map +1 -0
  144. package/dist/src/patch/diff.js +328 -0
  145. package/dist/src/patch/diff.js.map +1 -0
  146. package/dist/src/patch/fuzz.d.ts +73 -0
  147. package/dist/src/patch/fuzz.d.ts.map +1 -0
  148. package/dist/src/patch/fuzz.js +159 -0
  149. package/dist/src/patch/fuzz.js.map +1 -0
  150. package/dist/src/patch/index.d.ts +18 -0
  151. package/dist/src/patch/index.d.ts.map +1 -0
  152. package/dist/src/patch/index.js +20 -0
  153. package/dist/src/patch/index.js.map +1 -0
  154. package/dist/src/patch/invert.d.ts +15 -0
  155. package/dist/src/patch/invert.d.ts.map +1 -0
  156. package/dist/src/patch/invert.js +302 -0
  157. package/dist/src/patch/invert.js.map +1 -0
  158. package/dist/src/patch/type_of_patch.d.ts +17 -0
  159. package/dist/src/patch/type_of_patch.d.ts.map +1 -0
  160. package/dist/src/patch/type_of_patch.js +143 -0
  161. package/dist/src/patch/type_of_patch.js.map +1 -0
  162. package/dist/src/patch/types.d.ts +166 -0
  163. package/dist/src/patch/types.d.ts.map +1 -0
  164. package/dist/src/patch/types.js +69 -0
  165. package/dist/src/patch/types.js.map +1 -0
  166. package/dist/src/platform.d.ts +6 -0
  167. package/dist/src/platform.d.ts.map +1 -1
  168. package/dist/src/serialization/beast.d.ts.map +1 -1
  169. package/dist/src/serialization/beast.js +53 -18
  170. package/dist/src/serialization/beast.js.map +1 -1
  171. package/dist/src/serialization/beast2.d.ts +39 -3
  172. package/dist/src/serialization/beast2.d.ts.map +1 -1
  173. package/dist/src/serialization/beast2.js +241 -18
  174. package/dist/src/serialization/beast2.js.map +1 -1
  175. package/dist/src/serialization/csv.d.ts +139 -0
  176. package/dist/src/serialization/csv.d.ts.map +1 -0
  177. package/dist/src/serialization/csv.js +615 -0
  178. package/dist/src/serialization/csv.js.map +1 -0
  179. package/dist/src/serialization/index.d.ts +2 -1
  180. package/dist/src/serialization/index.d.ts.map +1 -1
  181. package/dist/src/serialization/index.js +2 -1
  182. package/dist/src/serialization/index.js.map +1 -1
  183. package/dist/src/type_of_type.d.ts +45 -34
  184. package/dist/src/type_of_type.d.ts.map +1 -1
  185. package/dist/src/type_of_type.js +62 -1
  186. package/dist/src/type_of_type.js.map +1 -1
  187. package/dist/src/types.d.ts +8 -8
  188. package/dist/src/types.d.ts.map +1 -1
  189. package/dist/src/types.js +4 -4
  190. package/dist/src/types.js.map +1 -1
  191. package/package.json +4 -5
@@ -1,7 +1,9 @@
1
1
  import { get_location } from "../location.js";
2
- import { IntegerType, StringType } from "../types.js";
2
+ import { ArrayType, IntegerType, StringType } from "../types.js";
3
3
  import { valueOrExprToAstTyped } from "./ast.js";
4
4
  import { AstSymbol, Expr, FactorySymbol } from "./expr.js";
5
+ import { equal, notEqual } from "./block.js";
6
+ import { CsvParseConfigType, csvParseOptionsToValue } from "../serialization/csv.js";
5
7
  /**
6
8
  * Expression representing binary blob values and operations.
7
9
  *
@@ -50,7 +52,7 @@ export class BlobExpr extends Expr {
50
52
  return this[FactorySymbol]({
51
53
  ast_type: "Builtin",
52
54
  type: IntegerType,
53
- location: get_location(2),
55
+ location: get_location(),
54
56
  builtin: "BlobSize",
55
57
  type_parameters: [],
56
58
  arguments: [this[AstSymbol]],
@@ -81,7 +83,7 @@ export class BlobExpr extends Expr {
81
83
  return this[FactorySymbol]({
82
84
  ast_type: "Builtin",
83
85
  type: IntegerType,
84
- location: get_location(2),
86
+ location: get_location(),
85
87
  builtin: "BlobGetUint8",
86
88
  type_parameters: [],
87
89
  arguments: [this[AstSymbol], offsetAst],
@@ -113,7 +115,7 @@ export class BlobExpr extends Expr {
113
115
  return this[FactorySymbol]({
114
116
  ast_type: "Builtin",
115
117
  type: StringType,
116
- location: get_location(2),
118
+ location: get_location(),
117
119
  builtin: "BlobDecodeUtf8",
118
120
  type_parameters: [],
119
121
  arguments: [this[AstSymbol]],
@@ -143,7 +145,7 @@ export class BlobExpr extends Expr {
143
145
  return this[FactorySymbol]({
144
146
  ast_type: "Builtin",
145
147
  type: StringType,
146
- location: get_location(2),
148
+ location: get_location(),
147
149
  builtin: "BlobDecodeUtf16",
148
150
  type_parameters: [],
149
151
  arguments: [this[AstSymbol]],
@@ -174,7 +176,7 @@ export class BlobExpr extends Expr {
174
176
  return this[FactorySymbol]({
175
177
  ast_type: "Builtin",
176
178
  type,
177
- location: get_location(2),
179
+ location: get_location(),
178
180
  builtin: "BlobDecodeBeast",
179
181
  type_parameters: [type],
180
182
  arguments: [this[AstSymbol]],
@@ -184,7 +186,7 @@ export class BlobExpr extends Expr {
184
186
  return this[FactorySymbol]({
185
187
  ast_type: "Builtin",
186
188
  type,
187
- location: get_location(2),
189
+ location: get_location(),
188
190
  builtin: "BlobDecodeBeast2",
189
191
  type_parameters: [type],
190
192
  arguments: [this[AstSymbol]],
@@ -194,5 +196,93 @@ export class BlobExpr extends Expr {
194
196
  throw new Error(`Unsupported Beast version: ${version}`);
195
197
  }
196
198
  }
199
+ /**
200
+ * Decodes the blob as CSV data into an array of structs.
201
+ *
202
+ * @param structType - The struct type for each row
203
+ * @param options - CSV parsing options
204
+ * @returns An ArrayExpr containing the decoded structs
205
+ *
206
+ * @throws East runtime error if the CSV is malformed or doesn't match the struct type
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const PersonType = StructType({ name: StringType, age: IntegerType });
211
+ *
212
+ * const parseCsv = East.function([BlobType], ArrayType(PersonType), ($, blob) => {
213
+ * $.return(blob.decodeCsv(PersonType, { delimiter: ',' }));
214
+ * });
215
+ * const compiled = East.compile(parseCsv.toIR(), []);
216
+ * const csv = new TextEncoder().encode("name,age\nAlice,30\nBob,25");
217
+ * compiled(csv); // [{ name: "Alice", age: 30n }, { name: "Bob", age: 25n }]
218
+ * ```
219
+ */
220
+ decodeCsv(structType, options) {
221
+ // Convert options to East config value
222
+ const configValue = csvParseOptionsToValue(options);
223
+ const configAst = valueOrExprToAstTyped(configValue, CsvParseConfigType);
224
+ return this[FactorySymbol]({
225
+ ast_type: "Builtin",
226
+ type: ArrayType(structType),
227
+ location: get_location(),
228
+ builtin: "BlobDecodeCsv",
229
+ type_parameters: [structType, CsvParseConfigType],
230
+ arguments: [this[AstSymbol], configAst],
231
+ });
232
+ }
233
+ /**
234
+ * Checks if this blob equals another blob (byte-by-byte comparison).
235
+ *
236
+ * @param other - The blob to compare against
237
+ * @returns A BooleanExpr that is true if the blobs are identical
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * const isEqual = East.function([BlobType, BlobType], BooleanType, ($, a, b) => {
242
+ * $.return(a.equals(b));
243
+ * });
244
+ * const compiled = East.compile(isEqual.toIR(), []);
245
+ * const blob1 = new Uint8Array([1, 2, 3]);
246
+ * const blob2 = new Uint8Array([1, 2, 3]);
247
+ * const blob3 = new Uint8Array([1, 2, 4]);
248
+ * compiled(blob1, blob2); // true
249
+ * compiled(blob1, blob3); // false
250
+ * ```
251
+ */
252
+ equals(other) {
253
+ return equal(this, other);
254
+ }
255
+ /**
256
+ * Checks if this blob does not equal another blob.
257
+ *
258
+ * @param other - The blob to compare against
259
+ * @returns A BooleanExpr that is true if the blobs are different
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const isNotEqual = East.function([BlobType, BlobType], BooleanType, ($, a, b) => {
264
+ * $.return(a.notEquals(b));
265
+ * });
266
+ * const compiled = East.compile(isNotEqual.toIR(), []);
267
+ * const blob1 = new Uint8Array([1, 2, 3]);
268
+ * const blob2 = new Uint8Array([1, 2, 4]);
269
+ * compiled(blob1, blob2); // true
270
+ * compiled(blob1, blob1); // false
271
+ * ```
272
+ */
273
+ notEquals(other) {
274
+ return notEqual(this, other);
275
+ }
276
+ // ============================================================================
277
+ // Aliases for comparison operations
278
+ // ============================================================================
279
+ /** Alias for {@link equals} */
280
+ eq = this.equals;
281
+ /** Alias for {@link equals} */
282
+ equal = this.equals;
283
+ /** Alias for {@link notEquals} */
284
+ ne = this.notEquals;
285
+ /** Alias for {@link notEquals} */
286
+ notEqual = this.notEquals;
197
287
  }
198
288
  //# sourceMappingURL=blob.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"blob.js","sourceRoot":"","sources":["../../../src/expr/blob.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAgC,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAe,MAAM,WAAW,CAAC;AAKxE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,QAAS,SAAQ,IAAc;IAC1C,YAAY,GAAQ,EAAE,UAAkB;QACtC,KAAK,CAAC,GAAG,CAAC,IAAgB,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,aAA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tE,uCAAuC;QACvC,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;QAEzE,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;YACzB,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC;YAC3B,QAAQ,EAAE,YAAY,EAAE;YACxB,OAAO,EAAE,eAAe;YACxB,eAAe,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC;YACjD,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;SACxC,CAAiB,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,KAA4B;QACjC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,KAA4B;QACpC,OAAO,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,+EAA+E;IAC/E,oCAAoC;IACpC,+EAA+E;IAE/E,+BAA+B;IAC/B,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;IACjB,+BAA+B;IAC/B,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;IAEpB,kCAAkC;IAClC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;IACpB,kCAAkC;IAClC,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;CAC3B"}
@@ -4,9 +4,9 @@
4
4
  */
5
5
  import { type AST, type IfElseAST, type Label, type TryCatchAST, type VariableAST } from "../ast.js";
6
6
  import { type Location } from "../location.js";
7
- import { type EastType, NullType, StringType, NeverType, VariantType, TypeUnion, IntegerType, StructType, ArrayType, type ValueTypeOf } from "../types.js";
7
+ import { type EastType, FunctionType, NullType, StringType, NeverType, VariantType, TypeUnion, IntegerType, StructType, ArrayType, type ValueTypeOf, type RefType, type SetType, type DictType, type RecursiveType, type RecursiveTypeMarker } from "../types.js";
8
8
  import type { ExprType, SubtypeExprOrValue, TypeOf } from "./types.js";
9
- import { Expr } from "./expr.js";
9
+ import { Expr, TypeSymbol } from "./expr.js";
10
10
  import { NeverExpr } from "./never.js";
11
11
  import { NullExpr } from "./null.js";
12
12
  import { BooleanExpr } from "./boolean.js";
@@ -15,13 +15,35 @@ import { StringExpr } from "./string.js";
15
15
  import { ArrayExpr } from "./array.js";
16
16
  import { SetExpr } from "./set.js";
17
17
  import { DictExpr } from "./dict.js";
18
- import { type CallableFunctionExpr } from "./function.js";
18
+ import { type CallableFunctionExpr, FunctionExpr } from "./function.js";
19
19
  import type { PlatformFunction } from "../platform.js";
20
- import { type CallableAsyncFunctionExpr } from "./asyncfunction.js";
20
+ import { type EastTypeValue } from "../type_of_type.js";
21
+ import { AsyncFunctionExpr, type CallableAsyncFunctionExpr } from "./asyncfunction.js";
22
+ import { type PatchTypeOf } from "../patch/index.js";
21
23
  /** A factory function to help build `Expr` from AST.
22
24
  * We inject this into each concrete `Expr` type so they can create new expressions recursively, without having circular dependencies between JavaScript modules.
23
25
  */
24
26
  export declare function fromAst<T extends AST>(ast: T): Expr<T["type"]>;
27
+ /**
28
+ * Compile a function expression into a JavaScript function.
29
+ *
30
+ * @param f the function expression to compile
31
+ * @param platform the platform functions available during compilation
32
+ * @returns the compiled function
33
+ */
34
+ export declare function compile<I extends any[], O>(f: FunctionExpr<I, O>, platform: PlatformFunction[]): (...inputs: {
35
+ [K in keyof I]: ValueTypeOf<I[K]>;
36
+ }) => ValueTypeOf<O>;
37
+ /**
38
+ * Compile an async function expression into a JavaScript function.
39
+ *
40
+ * @param f the async function expression to compile
41
+ * @param platform the platform functions available during compilation
42
+ * @returns the compiled async function
43
+ */
44
+ export declare function compileAsync<I extends any[], O>(f: AsyncFunctionExpr<I, O>, platform: PlatformFunction[]): (...inputs: {
45
+ [K in keyof I]: ValueTypeOf<I[K]>;
46
+ }) => Promise<ValueTypeOf<O>>;
25
47
  /**
26
48
  * Create an East expression from a JavaScript value
27
49
  */
@@ -69,7 +91,7 @@ export declare function block<F extends ($: BlockBuilder<NeverType>) => any>(bod
69
91
  /**
70
92
  * Create an East error expression
71
93
  */
72
- export declare function error(message: SubtypeExprOrValue<StringType>, location?: Location): NeverExpr;
94
+ export declare function error(message: SubtypeExprOrValue<StringType>, location?: Location[]): NeverExpr;
73
95
  /** Create a match expression */
74
96
  export declare function matchExpr<Cases extends Record<string, any>, Handlers extends {
75
97
  [K in keyof Cases]: ($: BlockBuilder<NeverType>, data: ExprType<Cases[K]>) => any;
@@ -96,6 +118,34 @@ export declare function lessEqual<T>(left: Expr<T>, right: SubtypeExprOrValue<No
96
118
  export declare function greater<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
97
119
  /** Test if the first value is greater than or equal to the second. */
98
120
  export declare function greaterEqual<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
121
+ /** Alias for {@link equal} */
122
+ export declare const equals: typeof equal;
123
+ /** Alias for {@link equal} */
124
+ export declare const eq: typeof equal;
125
+ /** Alias for {@link notEqual} */
126
+ export declare const notEquals: typeof notEqual;
127
+ /** Alias for {@link notEqual} */
128
+ export declare const ne: typeof notEqual;
129
+ /** Alias for {@link less} */
130
+ export declare const lessThan: typeof less;
131
+ /** Alias for {@link less} */
132
+ export declare const lt: typeof less;
133
+ /** Alias for {@link lessEqual} */
134
+ export declare const lessThanOrEqual: typeof lessEqual;
135
+ /** Alias for {@link lessEqual} */
136
+ export declare const lte: typeof lessEqual;
137
+ /** Alias for {@link lessEqual} */
138
+ export declare const le: typeof lessEqual;
139
+ /** Alias for {@link greater} */
140
+ export declare const greaterThan: typeof greater;
141
+ /** Alias for {@link greater} */
142
+ export declare const gt: typeof greater;
143
+ /** Alias for {@link greaterEqual} */
144
+ export declare const greaterThanOrEqual: typeof greaterEqual;
145
+ /** Alias for {@link greaterEqual} */
146
+ export declare const gte: typeof greaterEqual;
147
+ /** Alias for {@link greaterEqual} */
148
+ export declare const ge: typeof greaterEqual;
99
149
  /** Test if the first value is the same object the second.
100
150
  * For mutable collections, such as arrays, this means that they are the same object in memory.
101
151
  * For immutable data types, such as integers and strings, this is equivalent to equality.
@@ -103,6 +153,23 @@ export declare function greaterEqual<T>(left: Expr<T>, right: SubtypeExprOrValue
103
153
  export declare function is<T>(left: Expr<T>, right: SubtypeExprOrValue<NoInfer<T>>): BooleanExpr;
104
154
  /** Print a value as a string. */
105
155
  export declare function print(value: Expr): StringExpr;
156
+ /** Compute the difference between two values of the same type.
157
+ * Returns a patch that, when applied to `before`, produces `after`.
158
+ */
159
+ export declare function diff<T extends EastType>(before: Expr<T>, after: Expr<T>): ExprType<PatchTypeOf<T>>;
160
+ /** Apply a patch to a value, producing the modified value.
161
+ * @throws East runtime error if the patch conflicts with the value (e.g., deleting a non-existent key)
162
+ */
163
+ export declare function applyPatch<T extends EastType>(value: Expr<T>, patch: Expr<PatchTypeOf<T>>): ExprType<T>;
164
+ /** Compose two patches into a single patch.
165
+ * The result is a patch that has the same effect as applying `first` then `second`.
166
+ * @throws East runtime error if the patches are incompatible (second expects different intermediate state)
167
+ */
168
+ export declare function composePatch<T extends EastType>(first: Expr<PatchTypeOf<T>>, second: Expr<PatchTypeOf<T>>, type: T): ExprType<PatchTypeOf<T>>;
169
+ /** Invert a patch, producing a patch that undoes the original.
170
+ * Applying the inverted patch to the "after" value produces the "before" value.
171
+ */
172
+ export declare function invertPatch<T extends EastType>(patch: Expr<PatchTypeOf<T>>, type: T): ExprType<PatchTypeOf<T>>;
106
173
  /** Callable helper type for synchronous platform functions. */
107
174
  export type PlatformDefinition<Inputs extends EastType[], Output extends EastType> = ((...args: {
108
175
  [K in keyof Inputs]: SubtypeExprOrValue<Inputs[K]>;
@@ -111,6 +178,17 @@ export type PlatformDefinition<Inputs extends EastType[], Output extends EastTyp
111
178
  [K in keyof Inputs]: ValueTypeOf<Inputs[K]>;
112
179
  }) => Output extends NullType ? null | undefined | void : ValueTypeOf<Output>) => PlatformFunction;
113
180
  };
181
+ /** Options for defining platform functions. */
182
+ export interface PlatformOptions {
183
+ /**
184
+ * When true, compilation succeeds even if the platform function is not provided.
185
+ * A runtime error will be thrown if the function is called without an implementation.
186
+ * This is useful for platform functions that may not be available in all environments.
187
+ *
188
+ * @default false
189
+ */
190
+ optional?: boolean;
191
+ }
114
192
  /** Create a callable helper to invoke a synchronous platform function.
115
193
  *
116
194
  * Platform functions provide access to external capabilities (logging, I/O, database access, etc.)
@@ -119,6 +197,7 @@ export type PlatformDefinition<Inputs extends EastType[], Output extends EastTyp
119
197
  * @param name - The name of the platform function
120
198
  * @param input_types - Array of input parameter types for the platform function
121
199
  * @param output_type - The return type of the platform function
200
+ * @param options - Optional configuration for the platform function
122
201
  * @returns A callable function that creates Platform AST nodes when invoked
123
202
  *
124
203
  * @see {@link asyncPlatform} for defining asynchronous platform functions (that return `Promise`s)
@@ -136,13 +215,22 @@ const myFunction = East.function([], NullType, ($) => {
136
215
 
137
216
  // Provide the implementation when compiling
138
217
  const platform = [
139
- log.implement(false, (message: string) => console.log(message)),
218
+ log.implement((message: string) => console.log(message)),
140
219
  ];
141
220
  const compiled = myFunction.toIR().compile(platform);
142
221
  compiled(); // Logs "Hello, world!" to the console
222
+ * ```
223
+ *
224
+ * @example
225
+ * ```ts
226
+ // Define an optional platform function that may not be available
227
+ const analytics = East.platform("analytics", [StringType], NullType, { optional: true });
228
+
229
+ // This compiles even without providing an analytics implementation
230
+ // If called at runtime without implementation, it throws an error
143
231
  * ```
144
232
  */
145
- export declare function platform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output): PlatformDefinition<Inputs, Output>;
233
+ export declare function platform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output, options?: PlatformOptions): PlatformDefinition<Inputs, Output>;
146
234
  /** Callable helper type for asynchronous platform functions. */
147
235
  export type AsyncPlatformDefinition<Inputs extends EastType[], Output extends EastType> = ((...args: {
148
236
  [K in keyof Inputs]: SubtypeExprOrValue<Inputs[K]>;
@@ -159,6 +247,7 @@ export type AsyncPlatformDefinition<Inputs extends EastType[], Output extends Ea
159
247
  * @param name - The name of the asynchronous platform function
160
248
  * @param input_types - Array of input parameter types for the platform function
161
249
  * @param output_type - The return type of the platform function
250
+ * @param options - Optional configuration for the platform function
162
251
  * @returns A callable function that creates Platform AST nodes when invoked
163
252
  *
164
253
  * @see {@link platform} for defining synchronous platform functions
@@ -178,15 +267,146 @@ const platform = [
178
267
  readFile.implement((filename: string) => fs.promises.readFile(filename, 'utf-8')),
179
268
  ];
180
269
  const compiled = myFunction.toIR().compile(platform);
181
- compiled(); // Logs "Hello, world!" to the console
270
+ compiled(); // Returns file contents
271
+ * ```
272
+ */
273
+ export declare function asyncPlatform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output, options?: PlatformOptions): AsyncPlatformDefinition<Inputs, Output>;
274
+ type IndexOf<T extends readonly string[], S extends string, Acc extends unknown[] = []> = T extends readonly [infer First, ...infer Rest extends readonly string[]] ? First extends S ? Acc['length'] : IndexOf<Rest, S, [...Acc, unknown]> : never;
275
+ type ZipToRecord<Names extends readonly string[], Types extends readonly unknown[]> = {
276
+ [K in Names[number]]: Types[IndexOf<Names, K>];
277
+ };
278
+ type ApplyTypeArgs<TypeArgs extends Record<string, EastType>, T> = T extends keyof TypeArgs ? TypeArgs[T] : T extends RefType<infer U> ? RefType<ApplyTypeArgs<TypeArgs, U>> : T extends ArrayType<infer U> ? ArrayType<ApplyTypeArgs<TypeArgs, U>> : T extends SetType<infer K> ? SetType<ApplyTypeArgs<TypeArgs, K>> : T extends DictType<infer K, infer V> ? DictType<ApplyTypeArgs<TypeArgs, K>, ApplyTypeArgs<TypeArgs, V>> : T extends StructType<infer Fields> ? StructType<{
279
+ [K in keyof Fields]: ApplyTypeArgs<TypeArgs, Fields[K]>;
280
+ }> : T extends RecursiveType<infer U> ? RecursiveType<ApplyTypeArgs<TypeArgs, U>> : T extends VariantType<infer Cases> ? VariantType<{
281
+ [K in keyof Cases]: ApplyTypeArgs<TypeArgs, Cases[K]>;
282
+ }> : T extends RecursiveTypeMarker ? T : T extends FunctionType<infer Ins, infer Out> ? FunctionType<{
283
+ [K in keyof Ins]: ApplyTypeArgs<TypeArgs, Ins[K]>;
284
+ }, ApplyTypeArgs<TypeArgs, Out>> : T;
285
+ type GenericPlatformCallable<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = <TypeArgs extends readonly EastType[] & {
286
+ [K in keyof TParams]: EastType;
287
+ }>(type_args: TypeArgs, ...args: {
288
+ [K in keyof Inputs]: SubtypeExprOrValue<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Inputs[K]>>;
289
+ }) => ExprType<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Output>>;
290
+ /** Definition for a generic platform function with `.implement` method.
291
+ *
292
+ * The `implement` method receives a factory function where:
293
+ * - Type parameters are `EastTypeValue` (the runtime representation of types)
294
+ * - Value arguments are `unknown` (cast to specific types as needed based on the type parameters)
295
+ *
296
+ * Use helpers like `printFor(T)` to work with type-dependent behavior.
297
+ */
298
+ export type GenericPlatformDefinition<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = GenericPlatformCallable<TParams, Inputs, Output> & {
299
+ implement: (factory: (...typeParams: {
300
+ [K in keyof TParams]: EastTypeValue;
301
+ }) => (...args: unknown[]) => unknown) => PlatformFunction;
302
+ };
303
+ /** Create a callable helper to invoke a generic (polymorphic) platform function.
304
+ *
305
+ * Generic platform functions allow you to define platform functions with type parameters,
306
+ * similar to how builtins work. The type parameters are passed at call time and flow
307
+ * through to the implementation.
308
+ *
309
+ * @param name - The name of the platform function
310
+ * @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
311
+ * @param inputs - Array of input types, can contain string placeholders like `"T"`
312
+ * @param output - Output type, can be a string placeholder like `"T"`
313
+ * @returns A callable function that creates Platform AST nodes when invoked
314
+ *
315
+ * @example
316
+ * ```ts
317
+ * // Define a generic log function
318
+ * const log = East.genericPlatform(
319
+ * "log",
320
+ * ["T"],
321
+ * ["T"], // Input is type parameter T
322
+ * NullType
323
+ * );
324
+ *
325
+ * // Use it in East code - type args as array, then value args
326
+ * const myFunction = East.function([StringType], NullType, ($, s) => {
327
+ * $(log([StringType], s));
328
+ * });
329
+ *
330
+ * // Implementation receives type params as a factory
331
+ * const platform = [
332
+ * log.implement((T) => (value) => {
333
+ * console.log(printFor(T)(value));
334
+ * return null;
335
+ * }),
336
+ * ];
337
+ * ```
338
+ *
339
+ * @example
340
+ * ```ts
341
+ * // Define a generic map function with 2 type parameters
342
+ * const map = East.genericPlatform(
343
+ * "map",
344
+ * ["T", "U"],
345
+ * ["T", FunctionType(["T"], "U")], // String placeholders in nested types
346
+ * "U"
347
+ * );
348
+ *
349
+ * // Call with type args array, then value arguments
350
+ * map([StringType, IntegerType], myString, myMapperFn)
351
+ * ```
352
+ */
353
+ export declare function genericPlatform<const TParams extends readonly string[], const Inputs extends readonly (EastType | string)[], Output extends EastType | string>(name: string, typeParams: TParams, inputs: Inputs, output: Output, options?: PlatformOptions): GenericPlatformDefinition<TParams, Inputs, Output>;
354
+ type AsyncGenericPlatformCallable<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = <TypeArgs extends readonly EastType[] & {
355
+ [K in keyof TParams]: EastType;
356
+ }>(type_args: TypeArgs, ...args: {
357
+ [K in keyof Inputs]: SubtypeExprOrValue<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Inputs[K]>>;
358
+ }) => ExprType<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Output>>;
359
+ /** Definition for an async generic platform function with `.implement` method.
360
+ *
361
+ * The `implement` method receives a factory function where:
362
+ * - Type parameters are `EastTypeValue` (the runtime representation of types)
363
+ * - Value arguments are `unknown` (cast to specific types as needed based on the type parameters)
364
+ *
365
+ * Use helpers like `printFor(T)` to work with type-dependent behavior.
366
+ */
367
+ export type AsyncGenericPlatformDefinition<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = AsyncGenericPlatformCallable<TParams, Inputs, Output> & {
368
+ implement: (factory: (...typeParams: {
369
+ [K in keyof TParams]: EastTypeValue;
370
+ }) => (...args: unknown[]) => Promise<unknown>) => PlatformFunction;
371
+ };
372
+ /** Create a callable helper to invoke an asynchronous generic (polymorphic) platform function.
373
+ *
374
+ * This is the async variant of `genericPlatform`. The implementation factory should return
375
+ * an async function.
376
+ *
377
+ * @param name - The name of the platform function
378
+ * @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
379
+ * @param inputs - Array of input types, can contain string placeholders like `"T"`
380
+ * @param output - Output type, can be a string placeholder like `"T"`
381
+ * @returns A callable function that creates Platform AST nodes when invoked
382
+ *
383
+ * @see {@link genericPlatform} for synchronous generic platform functions
384
+ *
385
+ * @example
386
+ * ```ts
387
+ * // Define an async generic fetch function
388
+ * const fetchAs = East.asyncGenericPlatform(
389
+ * "fetchAs",
390
+ * ["T"],
391
+ * [StringType], // URL input
392
+ * "T" // Returns parsed value of type T
393
+ * );
394
+ *
395
+ * // Implementation receives type params and returns async function
396
+ * const platform = [
397
+ * fetchAs.implement((T) => async (url) => {
398
+ * const response = await fetch(url);
399
+ * return parseFor(T)(await response.text());
400
+ * }),
401
+ * ];
182
402
  * ```
183
403
  */
184
- export declare function asyncPlatform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output): AsyncPlatformDefinition<Inputs, Output>;
404
+ export declare function asyncGenericPlatform<const TParams extends readonly string[], const Inputs extends readonly (EastType | string)[], Output extends EastType | string>(name: string, typeParams: TParams, inputs: Inputs, output: Output, options?: PlatformOptions): AsyncGenericPlatformDefinition<TParams, Inputs, Output>;
185
405
  /** A helper for building blocks of code.
186
406
  * Methods like `let`, `if`, `for` etc are available on the builder.
187
407
  * You can also add expressions (having side effects) directly by calling the builder as a function.
188
408
  */
189
- export type BlockBuilder<Ret> = (<T extends Expr>(expr: T) => T) & {
409
+ export type BlockBuilder<Ret> = ((expr: Expr) => void) & {
190
410
  /** @internal */
191
411
  statements: AST[];
192
412
  /** @internal */
@@ -201,7 +421,7 @@ export type BlockBuilder<Ret> = (<T extends Expr>(expr: T) => T) & {
201
421
  */
202
422
  let: (<T>(expr: SubtypeExprOrValue<NoInfer<T>>, type: T) => ExprType<T>) & (<V>(expr: V) => ExprType<TypeOf<V>>);
203
423
  /** Reassign a variable defined with `let` to a new value. */
204
- assign: (<T>(variable: ExprType<T>, value: SubtypeExprOrValue<NoInfer<T>>) => ExprType<NullType>);
424
+ assign: (<E extends Expr<any>>(variable: E, value: SubtypeExprOrValue<E[TypeSymbol]>) => ExprType<NullType>);
205
425
  /** Return a value immediately from the current function */
206
426
  return: (value: SubtypeExprOrValue<Ret>) => void;
207
427
  /** Break immediately from the indicated loop */
@@ -219,7 +439,7 @@ export type BlockBuilder<Ret> = (<T extends Expr>(expr: T) => T) & {
219
439
  /** Loop over the values in a collection (array, set or dictionary) */
220
440
  for: (<T>(array: ArrayExpr<T>, body: ($: BlockBuilder<Ret>, value: ExprType<T>, key: IntegerExpr, label: Label) => void) => void) & (<K>(array: SetExpr<K>, body: ($: BlockBuilder<Ret>, key: ExprType<K>, label: Label) => void) => void) & (<K, T>(array: DictExpr<K, T>, body: ($: BlockBuilder<Ret>, value: ExprType<T>, key: ExprType<K>, label: Label) => void) => void);
221
441
  /** Throw an error immediately with a given error message. */
222
- error: (message: StringExpr | string, location?: Location) => NeverExpr;
442
+ error: (message: StringExpr | string, location?: Location[]) => NeverExpr;
223
443
  /** Run some code and catch any errors that occur. */
224
444
  try: (try_block: ($: BlockBuilder<Ret>) => (void | Expr)) => TryCatchExpr<Ret>;
225
445
  };
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/expr/block.ts"],"names":[],"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