@elaraai/east 0.0.1-beta.26 → 0.0.1-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/analyze.d.ts +3 -0
- package/dist/src/analyze.d.ts.map +1 -1
- package/dist/src/analyze.js +30 -9
- package/dist/src/analyze.js.map +1 -1
- package/dist/src/ast.d.ts +1 -0
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/ast_to_ir.d.ts.map +1 -1
- package/dist/src/ast_to_ir.js +1 -0
- package/dist/src/ast_to_ir.js.map +1 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +19 -3
- package/dist/src/compile.js.map +1 -1
- package/dist/src/datetime_format/types.d.ts +23 -23
- package/dist/src/expr/block.d.ts +133 -1
- package/dist/src/expr/block.d.ts.map +1 -1
- package/dist/src/expr/block.js +344 -0
- package/dist/src/expr/block.js.map +1 -1
- package/dist/src/expr/index.d.ts +73 -2
- package/dist/src/expr/index.d.ts.map +1 -1
- package/dist/src/expr/index.js +72 -1
- package/dist/src/expr/index.js.map +1 -1
- package/dist/src/internal.d.ts +1 -1
- package/dist/src/internal.d.ts.map +1 -1
- package/dist/src/internal.js +1 -1
- package/dist/src/internal.js.map +1 -1
- package/dist/src/ir.d.ts +1406 -1371
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/ir.js +1 -1
- package/dist/src/ir.js.map +1 -1
- package/dist/src/platform.d.ts +6 -0
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/serialization/csv.d.ts +17 -17
- package/dist/src/type_of_type.d.ts +34 -34
- package/dist/src/type_of_type.js +1 -1
- package/dist/src/type_of_type.js.map +1 -1
- package/dist/src/types.d.ts +8 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -44,51 +44,51 @@ export declare const DateTimeFormatTokenType: VariantType<{
|
|
|
44
44
|
* Any characters in the format string that are not recognized as format
|
|
45
45
|
* codes are treated as literals.
|
|
46
46
|
*/
|
|
47
|
-
literal: StringType;
|
|
47
|
+
readonly literal: StringType;
|
|
48
48
|
/** Four-digit year (e.g., "2025") - Format: YYYY */
|
|
49
|
-
year4: NullType;
|
|
49
|
+
readonly year4: NullType;
|
|
50
50
|
/** Two-digit year (e.g., "25") - Format: YY */
|
|
51
|
-
year2: NullType;
|
|
51
|
+
readonly year2: NullType;
|
|
52
52
|
/** Month as 1-12 without zero-padding (e.g., "1", "12") - Format: M */
|
|
53
|
-
month1: NullType;
|
|
53
|
+
readonly month1: NullType;
|
|
54
54
|
/** Month as 01-12 with zero-padding (e.g., "01", "12") - Format: MM */
|
|
55
|
-
month2: NullType;
|
|
55
|
+
readonly month2: NullType;
|
|
56
56
|
/** Short month name (e.g., "Jan", "Feb") - Format: MMM */
|
|
57
|
-
monthNameShort: NullType;
|
|
57
|
+
readonly monthNameShort: NullType;
|
|
58
58
|
/** Full month name (e.g., "January", "February") - Format: MMMM */
|
|
59
|
-
monthNameFull: NullType;
|
|
59
|
+
readonly monthNameFull: NullType;
|
|
60
60
|
/** Day of month as 1-31 without zero-padding (e.g., "1", "31") - Format: D */
|
|
61
|
-
day1: NullType;
|
|
61
|
+
readonly day1: NullType;
|
|
62
62
|
/** Day of month as 01-31 with zero-padding (e.g., "01", "31") - Format: DD */
|
|
63
|
-
day2: NullType;
|
|
63
|
+
readonly day2: NullType;
|
|
64
64
|
/** Minimal weekday name (e.g., "Su", "Mo") - Format: dd */
|
|
65
|
-
weekdayNameMin: NullType;
|
|
65
|
+
readonly weekdayNameMin: NullType;
|
|
66
66
|
/** Short weekday name (e.g., "Sun", "Mon") - Format: ddd */
|
|
67
|
-
weekdayNameShort: NullType;
|
|
67
|
+
readonly weekdayNameShort: NullType;
|
|
68
68
|
/** Full weekday name (e.g., "Sunday", "Monday") - Format: dddd */
|
|
69
|
-
weekdayNameFull: NullType;
|
|
69
|
+
readonly weekdayNameFull: NullType;
|
|
70
70
|
/** Hour 0-23 without zero-padding (e.g., "0", "23") - Format: H */
|
|
71
|
-
hour24_1: NullType;
|
|
71
|
+
readonly hour24_1: NullType;
|
|
72
72
|
/** Hour 00-23 with zero-padding (e.g., "00", "23") - Format: HH */
|
|
73
|
-
hour24_2: NullType;
|
|
73
|
+
readonly hour24_2: NullType;
|
|
74
74
|
/** Hour 1-12 without zero-padding (e.g., "1", "12") - Format: h */
|
|
75
|
-
hour12_1: NullType;
|
|
75
|
+
readonly hour12_1: NullType;
|
|
76
76
|
/** Hour 01-12 with zero-padding (e.g., "01", "12") - Format: hh */
|
|
77
|
-
hour12_2: NullType;
|
|
77
|
+
readonly hour12_2: NullType;
|
|
78
78
|
/** Minute 0-59 without zero-padding (e.g., "0", "59") - Format: m */
|
|
79
|
-
minute1: NullType;
|
|
79
|
+
readonly minute1: NullType;
|
|
80
80
|
/** Minute 00-59 with zero-padding (e.g., "00", "59") - Format: mm */
|
|
81
|
-
minute2: NullType;
|
|
81
|
+
readonly minute2: NullType;
|
|
82
82
|
/** Second 0-59 without zero-padding (e.g., "0", "59") - Format: s */
|
|
83
|
-
second1: NullType;
|
|
83
|
+
readonly second1: NullType;
|
|
84
84
|
/** Second 00-59 with zero-padding (e.g., "00", "59") - Format: ss */
|
|
85
|
-
second2: NullType;
|
|
85
|
+
readonly second2: NullType;
|
|
86
86
|
/** Millisecond 000-999 with zero-padding (e.g., "000", "999") - Format: SSS */
|
|
87
|
-
millisecond3: NullType;
|
|
87
|
+
readonly millisecond3: NullType;
|
|
88
88
|
/** Uppercase AM/PM (e.g., "AM", "PM") - Format: A */
|
|
89
|
-
ampmUpper: NullType;
|
|
89
|
+
readonly ampmUpper: NullType;
|
|
90
90
|
/** Lowercase am/pm (e.g., "am", "pm") - Format: a */
|
|
91
|
-
ampmLower: NullType;
|
|
91
|
+
readonly ampmLower: NullType;
|
|
92
92
|
}>;
|
|
93
93
|
/**
|
|
94
94
|
* TypeScript type for datetime format tokens.
|
package/dist/src/expr/block.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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
9
|
import { Expr, TypeSymbol } from "./expr.js";
|
|
10
10
|
import { NeverExpr } from "./never.js";
|
|
@@ -17,6 +17,7 @@ import { SetExpr } from "./set.js";
|
|
|
17
17
|
import { DictExpr } from "./dict.js";
|
|
18
18
|
import { type CallableFunctionExpr, FunctionExpr } from "./function.js";
|
|
19
19
|
import type { PlatformFunction } from "../platform.js";
|
|
20
|
+
import { type EastTypeValue } from "../type_of_type.js";
|
|
20
21
|
import { AsyncFunctionExpr, type CallableAsyncFunctionExpr } from "./asyncfunction.js";
|
|
21
22
|
import { type PatchTypeOf } from "../patch/index.js";
|
|
22
23
|
/** A factory function to help build `Expr` from AST.
|
|
@@ -248,6 +249,137 @@ compiled(); // Logs "Hello, world!" to the console
|
|
|
248
249
|
* ```
|
|
249
250
|
*/
|
|
250
251
|
export declare function asyncPlatform<const Inputs extends EastType[], Output extends EastType>(name: string, input_types: Inputs, output_type: Output): AsyncPlatformDefinition<Inputs, Output>;
|
|
252
|
+
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;
|
|
253
|
+
type ZipToRecord<Names extends readonly string[], Types extends readonly unknown[]> = {
|
|
254
|
+
[K in Names[number]]: Types[IndexOf<Names, K>];
|
|
255
|
+
};
|
|
256
|
+
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<{
|
|
257
|
+
[K in keyof Fields]: ApplyTypeArgs<TypeArgs, Fields[K]>;
|
|
258
|
+
}> : T extends RecursiveType<infer U> ? RecursiveType<ApplyTypeArgs<TypeArgs, U>> : T extends VariantType<infer Cases> ? VariantType<{
|
|
259
|
+
[K in keyof Cases]: ApplyTypeArgs<TypeArgs, Cases[K]>;
|
|
260
|
+
}> : T extends RecursiveTypeMarker ? T : T extends FunctionType<infer Ins, infer Out> ? FunctionType<{
|
|
261
|
+
[K in keyof Ins]: ApplyTypeArgs<TypeArgs, Ins[K]>;
|
|
262
|
+
}, ApplyTypeArgs<TypeArgs, Out>> : T;
|
|
263
|
+
type GenericPlatformCallable<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = <TypeArgs extends readonly EastType[] & {
|
|
264
|
+
[K in keyof TParams]: EastType;
|
|
265
|
+
}>(type_args: TypeArgs, ...args: {
|
|
266
|
+
[K in keyof Inputs]: SubtypeExprOrValue<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Inputs[K]>>;
|
|
267
|
+
}) => ExprType<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Output>>;
|
|
268
|
+
/** Definition for a generic platform function with `.implement` method.
|
|
269
|
+
*
|
|
270
|
+
* The `implement` method receives a factory function where:
|
|
271
|
+
* - Type parameters are `EastTypeValue` (the runtime representation of types)
|
|
272
|
+
* - Value arguments are `unknown` (cast to specific types as needed based on the type parameters)
|
|
273
|
+
*
|
|
274
|
+
* Use helpers like `printFor(T)` to work with type-dependent behavior.
|
|
275
|
+
*/
|
|
276
|
+
export type GenericPlatformDefinition<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = GenericPlatformCallable<TParams, Inputs, Output> & {
|
|
277
|
+
implement: (factory: (...typeParams: {
|
|
278
|
+
[K in keyof TParams]: EastTypeValue;
|
|
279
|
+
}) => (...args: unknown[]) => unknown) => PlatformFunction;
|
|
280
|
+
};
|
|
281
|
+
/** Create a callable helper to invoke a generic (polymorphic) platform function.
|
|
282
|
+
*
|
|
283
|
+
* Generic platform functions allow you to define platform functions with type parameters,
|
|
284
|
+
* similar to how builtins work. The type parameters are passed at call time and flow
|
|
285
|
+
* through to the implementation.
|
|
286
|
+
*
|
|
287
|
+
* @param name - The name of the platform function
|
|
288
|
+
* @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
|
|
289
|
+
* @param inputs - Array of input types, can contain string placeholders like `"T"`
|
|
290
|
+
* @param output - Output type, can be a string placeholder like `"T"`
|
|
291
|
+
* @returns A callable function that creates Platform AST nodes when invoked
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```ts
|
|
295
|
+
* // Define a generic log function
|
|
296
|
+
* const log = East.genericPlatform(
|
|
297
|
+
* "log",
|
|
298
|
+
* ["T"],
|
|
299
|
+
* ["T"], // Input is type parameter T
|
|
300
|
+
* NullType
|
|
301
|
+
* );
|
|
302
|
+
*
|
|
303
|
+
* // Use it in East code - type args as array, then value args
|
|
304
|
+
* const myFunction = East.function([StringType], NullType, ($, s) => {
|
|
305
|
+
* $(log([StringType], s));
|
|
306
|
+
* });
|
|
307
|
+
*
|
|
308
|
+
* // Implementation receives type params as a factory
|
|
309
|
+
* const platform = [
|
|
310
|
+
* log.implement((T) => (value) => {
|
|
311
|
+
* console.log(printFor(T)(value));
|
|
312
|
+
* return null;
|
|
313
|
+
* }),
|
|
314
|
+
* ];
|
|
315
|
+
* ```
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```ts
|
|
319
|
+
* // Define a generic map function with 2 type parameters
|
|
320
|
+
* const map = East.genericPlatform(
|
|
321
|
+
* "map",
|
|
322
|
+
* ["T", "U"],
|
|
323
|
+
* ["T", FunctionType(["T"], "U")], // String placeholders in nested types
|
|
324
|
+
* "U"
|
|
325
|
+
* );
|
|
326
|
+
*
|
|
327
|
+
* // Call with type args array, then value arguments
|
|
328
|
+
* map([StringType, IntegerType], myString, myMapperFn)
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
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): GenericPlatformDefinition<TParams, Inputs, Output>;
|
|
332
|
+
type AsyncGenericPlatformCallable<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = <TypeArgs extends readonly EastType[] & {
|
|
333
|
+
[K in keyof TParams]: EastType;
|
|
334
|
+
}>(type_args: TypeArgs, ...args: {
|
|
335
|
+
[K in keyof Inputs]: SubtypeExprOrValue<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Inputs[K]>>;
|
|
336
|
+
}) => ExprType<ApplyTypeArgs<ZipToRecord<TParams, TypeArgs>, Output>>;
|
|
337
|
+
/** Definition for an async generic platform function with `.implement` method.
|
|
338
|
+
*
|
|
339
|
+
* The `implement` method receives a factory function where:
|
|
340
|
+
* - Type parameters are `EastTypeValue` (the runtime representation of types)
|
|
341
|
+
* - Value arguments are `unknown` (cast to specific types as needed based on the type parameters)
|
|
342
|
+
*
|
|
343
|
+
* Use helpers like `printFor(T)` to work with type-dependent behavior.
|
|
344
|
+
*/
|
|
345
|
+
export type AsyncGenericPlatformDefinition<TParams extends readonly string[], Inputs extends readonly (EastType | string)[], Output extends EastType | string> = AsyncGenericPlatformCallable<TParams, Inputs, Output> & {
|
|
346
|
+
implement: (factory: (...typeParams: {
|
|
347
|
+
[K in keyof TParams]: EastTypeValue;
|
|
348
|
+
}) => (...args: unknown[]) => Promise<unknown>) => PlatformFunction;
|
|
349
|
+
};
|
|
350
|
+
/** Create a callable helper to invoke an asynchronous generic (polymorphic) platform function.
|
|
351
|
+
*
|
|
352
|
+
* This is the async variant of `genericPlatform`. The implementation factory should return
|
|
353
|
+
* an async function.
|
|
354
|
+
*
|
|
355
|
+
* @param name - The name of the platform function
|
|
356
|
+
* @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
|
|
357
|
+
* @param inputs - Array of input types, can contain string placeholders like `"T"`
|
|
358
|
+
* @param output - Output type, can be a string placeholder like `"T"`
|
|
359
|
+
* @returns A callable function that creates Platform AST nodes when invoked
|
|
360
|
+
*
|
|
361
|
+
* @see {@link genericPlatform} for synchronous generic platform functions
|
|
362
|
+
*
|
|
363
|
+
* @example
|
|
364
|
+
* ```ts
|
|
365
|
+
* // Define an async generic fetch function
|
|
366
|
+
* const fetchAs = East.asyncGenericPlatform(
|
|
367
|
+
* "fetchAs",
|
|
368
|
+
* ["T"],
|
|
369
|
+
* [StringType], // URL input
|
|
370
|
+
* "T" // Returns parsed value of type T
|
|
371
|
+
* );
|
|
372
|
+
*
|
|
373
|
+
* // Implementation receives type params and returns async function
|
|
374
|
+
* const platform = [
|
|
375
|
+
* fetchAs.implement((T) => async (url) => {
|
|
376
|
+
* const response = await fetch(url);
|
|
377
|
+
* return parseFor(T)(await response.text());
|
|
378
|
+
* }),
|
|
379
|
+
* ];
|
|
380
|
+
* ```
|
|
381
|
+
*/
|
|
382
|
+
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): AsyncGenericPlatformDefinition<TParams, Inputs, Output>;
|
|
251
383
|
/** A helper for building blocks of code.
|
|
252
384
|
* Methods like `let`, `if`, `for` etc are available on the builder.
|
|
253
385
|
* You can also add expressions (having side effects) directly by calling the builder as a function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/expr/block.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACrG,OAAO,EAA+B,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,KAAK,QAAQ,EAA2B,QAAQ,EAA0B,UAAU,EAAE,SAAS,EAAE,WAAW,EAAe,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,WAAW,EAAqB,MAAM,aAAa,CAAC;AAE5O,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAa,IAAI,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,OAAO,EAAE,KAAK,oBAAoB,EAAsB,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAA2B,KAAK,yBAAyB,EAAE,MAAM,oBAA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AI,GAAG,IAAI;CAiC5F;AAED,wDAAwD;AACxD,cAAM,YAAY,CAAC,GAAG,CAAE,SAAQ,QAAQ;IAIR,OAAO,CAAC,gBAAgB;IAAe,OAAO,CAAC,cAAc;IAAe,OAAO,CAAC,WAAW;IAH7H,OAAO,CAAC,WAAW,CAAS;IAE5B,gBAAgB;gBACJ,GAAG,EAAE,WAAW,EAAU,gBAAgB,EAAE,WAAW,EAAU,cAAc,EAAE,WAAW,EAAU,WAAW,EAAE,GAAG;IAMlI,yGAAyG;IACzG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,UAAU,CAAC;QAAE,QAAQ,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI;IAkC7K,0KAA0K;IAC1K,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI;CAsB3D"}
|
package/dist/src/expr/block.js
CHANGED
|
@@ -23,6 +23,7 @@ import { RecursiveExpr } from "./recursive.js";
|
|
|
23
23
|
import { createFunctionExpr, FunctionExpr } from "./function.js";
|
|
24
24
|
import { valueOrExprToAst, valueOrExprToAstTyped } from "./ast.js";
|
|
25
25
|
import { toEastTypeValue } from "../type_of_type.js";
|
|
26
|
+
import { isVariant } from "../containers/variant.js";
|
|
26
27
|
import { RefExpr } from "./ref.js";
|
|
27
28
|
import { AsyncFunctionExpr, createAsyncFunctionExpr } from "./asyncfunction.js";
|
|
28
29
|
import { PatchType } from "../patch/index.js";
|
|
@@ -1024,6 +1025,7 @@ export function platform(name, input_types, output_type) {
|
|
|
1024
1025
|
type: output_type,
|
|
1025
1026
|
location: get_location(2),
|
|
1026
1027
|
name: name,
|
|
1028
|
+
type_parameters: [],
|
|
1027
1029
|
arguments: argAsts,
|
|
1028
1030
|
async: false,
|
|
1029
1031
|
});
|
|
@@ -1113,6 +1115,7 @@ export function asyncPlatform(name, input_types, output_type) {
|
|
|
1113
1115
|
type: output_type,
|
|
1114
1116
|
location: get_location(2),
|
|
1115
1117
|
name: name,
|
|
1118
|
+
type_parameters: [],
|
|
1116
1119
|
arguments: argAsts,
|
|
1117
1120
|
async: true,
|
|
1118
1121
|
});
|
|
@@ -1142,6 +1145,347 @@ export function asyncPlatform(name, input_types, output_type) {
|
|
|
1142
1145
|
};
|
|
1143
1146
|
return fn;
|
|
1144
1147
|
}
|
|
1148
|
+
// Runtime type substitution function
|
|
1149
|
+
function applyTypeArgs(typeArgs, t) {
|
|
1150
|
+
if (typeof t === 'string') {
|
|
1151
|
+
const ret = typeArgs[t];
|
|
1152
|
+
if (ret === undefined) {
|
|
1153
|
+
throw new Error(`Unexpected type argument ${t}`);
|
|
1154
|
+
}
|
|
1155
|
+
return ret;
|
|
1156
|
+
}
|
|
1157
|
+
else if (t.type === "Ref") {
|
|
1158
|
+
return { type: "Ref", value: applyTypeArgs(typeArgs, t.value) };
|
|
1159
|
+
}
|
|
1160
|
+
else if (t.type === "Array") {
|
|
1161
|
+
return { type: "Array", value: applyTypeArgs(typeArgs, t.value) };
|
|
1162
|
+
}
|
|
1163
|
+
else if (t.type === "Set") {
|
|
1164
|
+
return { type: "Set", key: applyTypeArgs(typeArgs, t.key) };
|
|
1165
|
+
}
|
|
1166
|
+
else if (t.type === "Dict") {
|
|
1167
|
+
return { type: "Dict", key: applyTypeArgs(typeArgs, t.key), value: applyTypeArgs(typeArgs, t.value) };
|
|
1168
|
+
}
|
|
1169
|
+
else if (t.type === "Struct") {
|
|
1170
|
+
const newFields = {};
|
|
1171
|
+
for (const k in t.fields) {
|
|
1172
|
+
newFields[k] = applyTypeArgs(typeArgs, t.fields[k]);
|
|
1173
|
+
}
|
|
1174
|
+
return { type: "Struct", fields: newFields };
|
|
1175
|
+
}
|
|
1176
|
+
else if (t.type === "Variant") {
|
|
1177
|
+
const newCases = {};
|
|
1178
|
+
for (const k in t.cases) {
|
|
1179
|
+
newCases[k] = applyTypeArgs(typeArgs, t.cases[k]);
|
|
1180
|
+
}
|
|
1181
|
+
return { type: "Variant", cases: newCases };
|
|
1182
|
+
}
|
|
1183
|
+
else if (t.type === "Function") {
|
|
1184
|
+
const newInputs = t.inputs.map((inputType) => applyTypeArgs(typeArgs, inputType));
|
|
1185
|
+
const newOutput = applyTypeArgs(typeArgs, t.output);
|
|
1186
|
+
return { type: "Function", inputs: newInputs, output: newOutput };
|
|
1187
|
+
}
|
|
1188
|
+
else if (t.type === "Recursive") {
|
|
1189
|
+
if (t.node === undefined) {
|
|
1190
|
+
// RecursiveTypeMarker (self-reference) - leave alone
|
|
1191
|
+
return t;
|
|
1192
|
+
}
|
|
1193
|
+
return { type: "Recursive", node: applyTypeArgs(typeArgs, t.node) };
|
|
1194
|
+
}
|
|
1195
|
+
else {
|
|
1196
|
+
return t;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
/** Create a callable helper to invoke a generic (polymorphic) platform function.
|
|
1200
|
+
*
|
|
1201
|
+
* Generic platform functions allow you to define platform functions with type parameters,
|
|
1202
|
+
* similar to how builtins work. The type parameters are passed at call time and flow
|
|
1203
|
+
* through to the implementation.
|
|
1204
|
+
*
|
|
1205
|
+
* @param name - The name of the platform function
|
|
1206
|
+
* @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
|
|
1207
|
+
* @param inputs - Array of input types, can contain string placeholders like `"T"`
|
|
1208
|
+
* @param output - Output type, can be a string placeholder like `"T"`
|
|
1209
|
+
* @returns A callable function that creates Platform AST nodes when invoked
|
|
1210
|
+
*
|
|
1211
|
+
* @example
|
|
1212
|
+
* ```ts
|
|
1213
|
+
* // Define a generic log function
|
|
1214
|
+
* const log = East.genericPlatform(
|
|
1215
|
+
* "log",
|
|
1216
|
+
* ["T"],
|
|
1217
|
+
* ["T"], // Input is type parameter T
|
|
1218
|
+
* NullType
|
|
1219
|
+
* );
|
|
1220
|
+
*
|
|
1221
|
+
* // Use it in East code - type args as array, then value args
|
|
1222
|
+
* const myFunction = East.function([StringType], NullType, ($, s) => {
|
|
1223
|
+
* $(log([StringType], s));
|
|
1224
|
+
* });
|
|
1225
|
+
*
|
|
1226
|
+
* // Implementation receives type params as a factory
|
|
1227
|
+
* const platform = [
|
|
1228
|
+
* log.implement((T) => (value) => {
|
|
1229
|
+
* console.log(printFor(T)(value));
|
|
1230
|
+
* return null;
|
|
1231
|
+
* }),
|
|
1232
|
+
* ];
|
|
1233
|
+
* ```
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* ```ts
|
|
1237
|
+
* // Define a generic map function with 2 type parameters
|
|
1238
|
+
* const map = East.genericPlatform(
|
|
1239
|
+
* "map",
|
|
1240
|
+
* ["T", "U"],
|
|
1241
|
+
* ["T", FunctionType(["T"], "U")], // String placeholders in nested types
|
|
1242
|
+
* "U"
|
|
1243
|
+
* );
|
|
1244
|
+
*
|
|
1245
|
+
* // Call with type args array, then value arguments
|
|
1246
|
+
* map([StringType, IntegerType], myString, myMapperFn)
|
|
1247
|
+
* ```
|
|
1248
|
+
*/
|
|
1249
|
+
export function genericPlatform(name, typeParams, inputs, output) {
|
|
1250
|
+
const numTypeParams = typeParams.length;
|
|
1251
|
+
const fn = (type_args, ...valueArgs) => {
|
|
1252
|
+
// Validate type args array
|
|
1253
|
+
if (!Array.isArray(type_args)) {
|
|
1254
|
+
throw new Error(`Generic platform function '${name}' expects type arguments as an array, ` +
|
|
1255
|
+
`got ${typeof type_args}`);
|
|
1256
|
+
}
|
|
1257
|
+
// Validate type args count
|
|
1258
|
+
if (type_args.length !== numTypeParams) {
|
|
1259
|
+
throw new Error(`Generic platform function '${name}' expects ${numTypeParams} type parameters, ` +
|
|
1260
|
+
`got ${type_args.length}`);
|
|
1261
|
+
}
|
|
1262
|
+
// Validate type args are EastTypes
|
|
1263
|
+
for (let i = 0; i < numTypeParams; i++) {
|
|
1264
|
+
const typeArg = type_args[i];
|
|
1265
|
+
if (!typeArg || typeof typeArg !== 'object' || !('type' in typeArg)) {
|
|
1266
|
+
throw new Error(`Generic platform function '${name}' expects type parameter ${i + 1} ` +
|
|
1267
|
+
`(${typeParams[i]}) to be an EastType`);
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
// Build type argument map
|
|
1271
|
+
const typeArgMap = {};
|
|
1272
|
+
typeParams.forEach((param, idx) => {
|
|
1273
|
+
typeArgMap[param] = type_args[idx];
|
|
1274
|
+
});
|
|
1275
|
+
// Apply type substitution to get concrete input/output types
|
|
1276
|
+
const inputTypes = inputs.map(t => applyTypeArgs(typeArgMap, t));
|
|
1277
|
+
const outputType = applyTypeArgs(typeArgMap, output);
|
|
1278
|
+
// Validate value args count
|
|
1279
|
+
if (valueArgs.length !== inputTypes.length) {
|
|
1280
|
+
throw new Error(`Generic platform function '${name}' expects ${inputTypes.length} ` +
|
|
1281
|
+
`value arguments, got ${valueArgs.length}`);
|
|
1282
|
+
}
|
|
1283
|
+
// Convert value args to AST with type validation and implicit casts
|
|
1284
|
+
const argAsts = valueArgs.map((arg, index) => {
|
|
1285
|
+
const expectedType = inputTypes[index];
|
|
1286
|
+
let ast = valueOrExprToAstTyped(arg, expectedType);
|
|
1287
|
+
if (ast.type.type === "Never") {
|
|
1288
|
+
throw new Error(`Generic platform function ${name} argument ${index + 1} expected type ${printType(expectedType)}, got Never type`);
|
|
1289
|
+
}
|
|
1290
|
+
if (!isTypeEqual(ast.type, expectedType)) {
|
|
1291
|
+
if (!isSubtype(ast.type, expectedType)) {
|
|
1292
|
+
throw new Error(`Generic platform function ${name} argument ${index + 1} expected type ${printType(expectedType)}, got ${printType(ast.type)}`);
|
|
1293
|
+
}
|
|
1294
|
+
// Insert implicit cast
|
|
1295
|
+
ast = {
|
|
1296
|
+
ast_type: "As",
|
|
1297
|
+
type: expectedType,
|
|
1298
|
+
location: get_location(2),
|
|
1299
|
+
value: ast,
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
return ast;
|
|
1303
|
+
});
|
|
1304
|
+
// Create PlatformAST with type_parameters
|
|
1305
|
+
return fromAst({
|
|
1306
|
+
ast_type: "Platform",
|
|
1307
|
+
type: outputType,
|
|
1308
|
+
location: get_location(2),
|
|
1309
|
+
name: name,
|
|
1310
|
+
type_parameters: type_args,
|
|
1311
|
+
arguments: argAsts,
|
|
1312
|
+
async: false,
|
|
1313
|
+
});
|
|
1314
|
+
};
|
|
1315
|
+
fn.implement = (factory) => {
|
|
1316
|
+
return {
|
|
1317
|
+
name,
|
|
1318
|
+
type_parameters: [...typeParams],
|
|
1319
|
+
inputs: [], // Computed at call time via inputsFn
|
|
1320
|
+
output: toEastTypeValue(NullType), // Placeholder
|
|
1321
|
+
inputsFn: (...tps) => {
|
|
1322
|
+
const typeArgMap = {};
|
|
1323
|
+
typeParams.forEach((param, idx) => {
|
|
1324
|
+
typeArgMap[param] = tps[idx];
|
|
1325
|
+
});
|
|
1326
|
+
return inputs.map(t => {
|
|
1327
|
+
if (typeof t === 'string')
|
|
1328
|
+
return typeArgMap[t];
|
|
1329
|
+
let result = applyTypeArgs(typeArgMap, t);
|
|
1330
|
+
if (!isVariant(result))
|
|
1331
|
+
result = toEastTypeValue(result);
|
|
1332
|
+
return result;
|
|
1333
|
+
});
|
|
1334
|
+
},
|
|
1335
|
+
outputsFn: (...tps) => {
|
|
1336
|
+
const typeArgMap = {};
|
|
1337
|
+
typeParams.forEach((param, idx) => {
|
|
1338
|
+
typeArgMap[param] = tps[idx];
|
|
1339
|
+
});
|
|
1340
|
+
if (typeof output === 'string')
|
|
1341
|
+
return typeArgMap[output];
|
|
1342
|
+
let result = applyTypeArgs(typeArgMap, output);
|
|
1343
|
+
if (!isVariant(result))
|
|
1344
|
+
result = toEastTypeValue(result);
|
|
1345
|
+
return result;
|
|
1346
|
+
},
|
|
1347
|
+
type: 'sync',
|
|
1348
|
+
fn: factory,
|
|
1349
|
+
};
|
|
1350
|
+
};
|
|
1351
|
+
return fn;
|
|
1352
|
+
}
|
|
1353
|
+
/** Create a callable helper to invoke an asynchronous generic (polymorphic) platform function.
|
|
1354
|
+
*
|
|
1355
|
+
* This is the async variant of `genericPlatform`. The implementation factory should return
|
|
1356
|
+
* an async function.
|
|
1357
|
+
*
|
|
1358
|
+
* @param name - The name of the platform function
|
|
1359
|
+
* @param typeParams - Array of type parameter names (e.g., `["T", "U"]`)
|
|
1360
|
+
* @param inputs - Array of input types, can contain string placeholders like `"T"`
|
|
1361
|
+
* @param output - Output type, can be a string placeholder like `"T"`
|
|
1362
|
+
* @returns A callable function that creates Platform AST nodes when invoked
|
|
1363
|
+
*
|
|
1364
|
+
* @see {@link genericPlatform} for synchronous generic platform functions
|
|
1365
|
+
*
|
|
1366
|
+
* @example
|
|
1367
|
+
* ```ts
|
|
1368
|
+
* // Define an async generic fetch function
|
|
1369
|
+
* const fetchAs = East.asyncGenericPlatform(
|
|
1370
|
+
* "fetchAs",
|
|
1371
|
+
* ["T"],
|
|
1372
|
+
* [StringType], // URL input
|
|
1373
|
+
* "T" // Returns parsed value of type T
|
|
1374
|
+
* );
|
|
1375
|
+
*
|
|
1376
|
+
* // Implementation receives type params and returns async function
|
|
1377
|
+
* const platform = [
|
|
1378
|
+
* fetchAs.implement((T) => async (url) => {
|
|
1379
|
+
* const response = await fetch(url);
|
|
1380
|
+
* return parseFor(T)(await response.text());
|
|
1381
|
+
* }),
|
|
1382
|
+
* ];
|
|
1383
|
+
* ```
|
|
1384
|
+
*/
|
|
1385
|
+
export function asyncGenericPlatform(name, typeParams, inputs, output) {
|
|
1386
|
+
const numTypeParams = typeParams.length;
|
|
1387
|
+
const fn = (type_args, ...valueArgs) => {
|
|
1388
|
+
// Validate type args array
|
|
1389
|
+
if (!Array.isArray(type_args)) {
|
|
1390
|
+
throw new Error(`Generic platform function '${name}' expects type arguments as an array, ` +
|
|
1391
|
+
`got ${typeof type_args}`);
|
|
1392
|
+
}
|
|
1393
|
+
// Validate type args count
|
|
1394
|
+
if (type_args.length !== numTypeParams) {
|
|
1395
|
+
throw new Error(`Generic platform function '${name}' expects ${numTypeParams} type parameters, ` +
|
|
1396
|
+
`got ${type_args.length}`);
|
|
1397
|
+
}
|
|
1398
|
+
// Validate type args are EastTypes
|
|
1399
|
+
for (let i = 0; i < numTypeParams; i++) {
|
|
1400
|
+
const typeArg = type_args[i];
|
|
1401
|
+
if (!typeArg || typeof typeArg !== 'object' || !('type' in typeArg)) {
|
|
1402
|
+
throw new Error(`Generic platform function '${name}' expects type parameter ${i + 1} ` +
|
|
1403
|
+
`(${typeParams[i]}) to be an EastType`);
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
// Build type argument map
|
|
1407
|
+
const typeArgMap = {};
|
|
1408
|
+
typeParams.forEach((param, idx) => {
|
|
1409
|
+
typeArgMap[param] = type_args[idx];
|
|
1410
|
+
});
|
|
1411
|
+
// Apply type substitution to get concrete input/output types
|
|
1412
|
+
const inputTypes = inputs.map(t => applyTypeArgs(typeArgMap, t));
|
|
1413
|
+
const outputType = applyTypeArgs(typeArgMap, output);
|
|
1414
|
+
// Validate value args count
|
|
1415
|
+
if (valueArgs.length !== inputTypes.length) {
|
|
1416
|
+
throw new Error(`Generic platform function '${name}' expects ${inputTypes.length} ` +
|
|
1417
|
+
`value arguments, got ${valueArgs.length}`);
|
|
1418
|
+
}
|
|
1419
|
+
// Convert value args to AST with type validation and implicit casts
|
|
1420
|
+
const argAsts = valueArgs.map((arg, index) => {
|
|
1421
|
+
const expectedType = inputTypes[index];
|
|
1422
|
+
let ast = valueOrExprToAstTyped(arg, expectedType);
|
|
1423
|
+
if (ast.type.type === "Never") {
|
|
1424
|
+
throw new Error(`Generic platform function ${name} argument ${index + 1} expected type ${printType(expectedType)}, got Never type`);
|
|
1425
|
+
}
|
|
1426
|
+
if (!isTypeEqual(ast.type, expectedType)) {
|
|
1427
|
+
if (!isSubtype(ast.type, expectedType)) {
|
|
1428
|
+
throw new Error(`Generic platform function ${name} argument ${index + 1} expected type ${printType(expectedType)}, got ${printType(ast.type)}`);
|
|
1429
|
+
}
|
|
1430
|
+
// Insert implicit cast
|
|
1431
|
+
ast = {
|
|
1432
|
+
ast_type: "As",
|
|
1433
|
+
type: expectedType,
|
|
1434
|
+
location: get_location(2),
|
|
1435
|
+
value: ast,
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
return ast;
|
|
1439
|
+
});
|
|
1440
|
+
// Create PlatformAST with type_parameters and async: true
|
|
1441
|
+
return fromAst({
|
|
1442
|
+
ast_type: "Platform",
|
|
1443
|
+
type: outputType,
|
|
1444
|
+
location: get_location(2),
|
|
1445
|
+
name: name,
|
|
1446
|
+
type_parameters: type_args,
|
|
1447
|
+
arguments: argAsts,
|
|
1448
|
+
async: true,
|
|
1449
|
+
});
|
|
1450
|
+
};
|
|
1451
|
+
fn.implement = (factory) => {
|
|
1452
|
+
return {
|
|
1453
|
+
name,
|
|
1454
|
+
type_parameters: [...typeParams],
|
|
1455
|
+
inputs: [], // Computed at call time via inputsFn
|
|
1456
|
+
output: toEastTypeValue(NullType), // Placeholder
|
|
1457
|
+
inputsFn: (...tps) => {
|
|
1458
|
+
const typeArgMap = {};
|
|
1459
|
+
typeParams.forEach((param, idx) => {
|
|
1460
|
+
typeArgMap[param] = tps[idx];
|
|
1461
|
+
});
|
|
1462
|
+
return inputs.map(t => {
|
|
1463
|
+
if (typeof t === 'string')
|
|
1464
|
+
return typeArgMap[t];
|
|
1465
|
+
let result = applyTypeArgs(typeArgMap, t);
|
|
1466
|
+
if (!isVariant(result))
|
|
1467
|
+
result = toEastTypeValue(result);
|
|
1468
|
+
return result;
|
|
1469
|
+
});
|
|
1470
|
+
},
|
|
1471
|
+
outputsFn: (...tps) => {
|
|
1472
|
+
const typeArgMap = {};
|
|
1473
|
+
typeParams.forEach((param, idx) => {
|
|
1474
|
+
typeArgMap[param] = tps[idx];
|
|
1475
|
+
});
|
|
1476
|
+
if (typeof output === 'string')
|
|
1477
|
+
return typeArgMap[output];
|
|
1478
|
+
let result = applyTypeArgs(typeArgMap, output);
|
|
1479
|
+
if (!isVariant(result))
|
|
1480
|
+
result = toEastTypeValue(result);
|
|
1481
|
+
return result;
|
|
1482
|
+
},
|
|
1483
|
+
type: 'async',
|
|
1484
|
+
fn: factory,
|
|
1485
|
+
};
|
|
1486
|
+
};
|
|
1487
|
+
return fn;
|
|
1488
|
+
}
|
|
1145
1489
|
export const BlockBuilder = (return_type) => {
|
|
1146
1490
|
const statements = [];
|
|
1147
1491
|
const $ = ((expr) => {
|