@elaraai/east 0.0.1-beta.0 → 0.0.1-beta.2

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 (101) hide show
  1. package/README.md +39 -10
  2. package/dist/src/analyze.d.ts +4 -4
  3. package/dist/src/analyze.d.ts.map +1 -1
  4. package/dist/src/analyze.js +142 -44
  5. package/dist/src/analyze.js.map +1 -1
  6. package/dist/src/ast.d.ts +18 -7
  7. package/dist/src/ast.d.ts.map +1 -1
  8. package/dist/src/ast.js +1 -146
  9. package/dist/src/ast.js.map +1 -1
  10. package/dist/src/ast_to_ir.d.ts +1 -0
  11. package/dist/src/ast_to_ir.d.ts.map +1 -1
  12. package/dist/src/ast_to_ir.js +71 -10
  13. package/dist/src/ast_to_ir.js.map +1 -1
  14. package/dist/src/builtins.d.ts.map +1 -1
  15. package/dist/src/builtins.js +79 -64
  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 +21 -0
  19. package/dist/src/comparison.js.map +1 -1
  20. package/dist/src/compile.d.ts.map +1 -1
  21. package/dist/src/compile.js +114 -220
  22. package/dist/src/compile.js.map +1 -1
  23. package/dist/src/default.d.ts.map +1 -1
  24. package/dist/src/default.js +2 -0
  25. package/dist/src/default.js.map +1 -1
  26. package/dist/src/eastir.d.ts +12 -10
  27. package/dist/src/eastir.d.ts.map +1 -1
  28. package/dist/src/eastir.js +20 -19
  29. package/dist/src/eastir.js.map +1 -1
  30. package/dist/src/expr/array.js +51 -51
  31. package/dist/src/expr/array.js.map +1 -1
  32. package/dist/src/expr/ast.d.ts.map +1 -1
  33. package/dist/src/expr/ast.js +6 -0
  34. package/dist/src/expr/ast.js.map +1 -1
  35. package/dist/src/expr/asyncfunction.d.ts +49 -0
  36. package/dist/src/expr/asyncfunction.d.ts.map +1 -0
  37. package/dist/src/expr/asyncfunction.js +60 -0
  38. package/dist/src/expr/asyncfunction.js.map +1 -0
  39. package/dist/src/expr/block.d.ts +60 -6
  40. package/dist/src/expr/block.d.ts.map +1 -1
  41. package/dist/src/expr/block.js +251 -14
  42. package/dist/src/expr/block.js.map +1 -1
  43. package/dist/src/expr/dict.js +47 -47
  44. package/dist/src/expr/dict.js.map +1 -1
  45. package/dist/src/expr/expr.d.ts +9 -0
  46. package/dist/src/expr/expr.d.ts.map +1 -1
  47. package/dist/src/expr/expr.js +5 -1
  48. package/dist/src/expr/expr.js.map +1 -1
  49. package/dist/src/expr/index.d.ts +73 -2
  50. package/dist/src/expr/index.d.ts.map +1 -1
  51. package/dist/src/expr/index.js +72 -8
  52. package/dist/src/expr/index.js.map +1 -1
  53. package/dist/src/expr/libs/array.js +1 -1
  54. package/dist/src/expr/libs/array.js.map +1 -1
  55. package/dist/src/expr/libs/dict.js +3 -3
  56. package/dist/src/expr/libs/dict.js.map +1 -1
  57. package/dist/src/expr/libs/set.js +2 -2
  58. package/dist/src/expr/libs/set.js.map +1 -1
  59. package/dist/src/expr/ref.js +1 -1
  60. package/dist/src/expr/ref.js.map +1 -1
  61. package/dist/src/expr/set.js +38 -38
  62. package/dist/src/expr/set.js.map +1 -1
  63. package/dist/src/expr/struct.d.ts +2 -0
  64. package/dist/src/expr/struct.d.ts.map +1 -1
  65. package/dist/src/expr/types.d.ts +8 -5
  66. package/dist/src/expr/types.d.ts.map +1 -1
  67. package/dist/src/fuzz.d.ts.map +1 -1
  68. package/dist/src/fuzz.js +5 -0
  69. package/dist/src/fuzz.js.map +1 -1
  70. package/dist/src/internal.d.ts +11 -9
  71. package/dist/src/internal.d.ts.map +1 -1
  72. package/dist/src/internal.js +15 -5
  73. package/dist/src/internal.js.map +1 -1
  74. package/dist/src/ir.d.ts +231 -33
  75. package/dist/src/ir.d.ts.map +1 -1
  76. package/dist/src/ir.js +3 -1
  77. package/dist/src/ir.js.map +1 -1
  78. package/dist/src/serialization/beast.d.ts.map +1 -1
  79. package/dist/src/serialization/beast.js +6 -0
  80. package/dist/src/serialization/beast.js.map +1 -1
  81. package/dist/src/serialization/beast2-stream.d.ts.map +1 -1
  82. package/dist/src/serialization/beast2-stream.js +5 -0
  83. package/dist/src/serialization/beast2-stream.js.map +1 -1
  84. package/dist/src/serialization/beast2.d.ts.map +1 -1
  85. package/dist/src/serialization/beast2.js +6 -0
  86. package/dist/src/serialization/beast2.js.map +1 -1
  87. package/dist/src/serialization/east.d.ts.map +1 -1
  88. package/dist/src/serialization/east.js +9 -1
  89. package/dist/src/serialization/east.js.map +1 -1
  90. package/dist/src/serialization/json.d.ts.map +1 -1
  91. package/dist/src/serialization/json.js +8 -2
  92. package/dist/src/serialization/json.js.map +1 -1
  93. package/dist/src/type_of_type.d.ts +19 -32
  94. package/dist/src/type_of_type.d.ts.map +1 -1
  95. package/dist/src/type_of_type.js +126 -14
  96. package/dist/src/type_of_type.js.map +1 -1
  97. package/dist/src/types.d.ts +59 -44
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/dist/src/types.js +191 -91
  100. package/dist/src/types.js.map +1 -1
  101. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../src/builtins.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAA4D,KAAK,QAAQ,EAAyG,MAAM,YAAY,CAAC;AAG5M,gBAAgB;AAChB,MAAM,MAAM,WAAW,GAAG;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,MAAM,EAAE,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC3B,CAAA;AAED,gBAAgB;AAChB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,cAAc,GACrG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,GACxD,gBAAgB,GAAG,eAAe,GAAG,YAAY,GAAG,iBAAiB,GA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Ac,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,eAAe,GAAG,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAE,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,cAAc,GAC3c,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,YAAY,GAAG,YAAY,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,kBAAkB,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,YAAY,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,eAAe,CACvjB;AAEH,gBAAgB;AAChB,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,WAAW,EAAE,WAAW,CAw+BrD,CAAA;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,QAAQ,CA4G/I"}
@@ -443,12 +443,12 @@ export const Builtins = {
443
443
  },
444
444
  RefMerge: {
445
445
  type_parameters: ["T", "T2"],
446
- inputs: [RefType("T"), "T2", FunctionType(["T", "T2"], "T", null)],
446
+ inputs: [RefType("T"), "T2", FunctionType(["T", "T2"], "T")],
447
447
  output: NullType,
448
448
  },
449
449
  ArrayGenerate: {
450
450
  type_parameters: ["T"],
451
- inputs: [IntegerType, FunctionType([IntegerType], "T", null)],
451
+ inputs: [IntegerType, FunctionType([IntegerType], "T")],
452
452
  output: ArrayType("T"),
453
453
  },
454
454
  ArrayRange: {
@@ -478,7 +478,7 @@ export const Builtins = {
478
478
  },
479
479
  ArrayGetOrDefault: {
480
480
  type_parameters: ["T"],
481
- inputs: [ArrayType("T"), IntegerType, FunctionType([IntegerType], "T", null)],
481
+ inputs: [ArrayType("T"), IntegerType, FunctionType([IntegerType], "T")],
482
482
  output: "T",
483
483
  },
484
484
  ArrayTryGet: {
@@ -493,7 +493,7 @@ export const Builtins = {
493
493
  },
494
494
  ArrayMerge: {
495
495
  type_parameters: ["T", "T2"],
496
- inputs: [ArrayType("T"), IntegerType, "T2", FunctionType(["T", "T2", IntegerType], "T", null)],
496
+ inputs: [ArrayType("T"), IntegerType, "T2", FunctionType(["T", "T2", IntegerType], "T")],
497
497
  output: NullType,
498
498
  },
499
499
  ArrayPushLast: {
@@ -528,7 +528,7 @@ export const Builtins = {
528
528
  },
529
529
  ArrayMergeAll: {
530
530
  type_parameters: ["T", "T2"],
531
- inputs: [ArrayType("T"), ArrayType("T2"), FunctionType(["T", "T2", IntegerType], "T", null)],
531
+ inputs: [ArrayType("T"), ArrayType("T2"), FunctionType(["T", "T2", IntegerType], "T")],
532
532
  output: NullType,
533
533
  },
534
534
  ArrayClear: {
@@ -538,7 +538,7 @@ export const Builtins = {
538
538
  },
539
539
  ArraySortInPlace: {
540
540
  type_parameters: ["T", "T2"],
541
- inputs: [ArrayType("T"), FunctionType(["T"], "T2", null)],
541
+ inputs: [ArrayType("T"), FunctionType(["T"], "T2")],
542
542
  output: NullType,
543
543
  },
544
544
  ArrayReverseInPlace: {
@@ -548,7 +548,7 @@ export const Builtins = {
548
548
  },
549
549
  ArraySort: {
550
550
  type_parameters: ["T", "T2"],
551
- inputs: [ArrayType("T"), FunctionType(["T"], "T2", null)],
551
+ inputs: [ArrayType("T"), FunctionType(["T"], "T2")],
552
552
  output: ArrayType("T"),
553
553
  },
554
554
  ArrayReverse: {
@@ -558,27 +558,27 @@ export const Builtins = {
558
558
  },
559
559
  ArrayIsSorted: {
560
560
  type_parameters: ["T", "T2"],
561
- inputs: [ArrayType("T"), FunctionType(["T"], "T2", null)],
561
+ inputs: [ArrayType("T"), FunctionType(["T"], "T2")],
562
562
  output: BooleanType,
563
563
  },
564
564
  ArrayFindSortedFirst: {
565
565
  type_parameters: ["T", "T2"],
566
- inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2", null)],
566
+ inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2")],
567
567
  output: IntegerType,
568
568
  },
569
569
  ArrayFindSortedLast: {
570
570
  type_parameters: ["T", "T2"],
571
- inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2", null)],
571
+ inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2")],
572
572
  output: IntegerType,
573
573
  },
574
574
  ArrayFindSortedRange: {
575
575
  type_parameters: ["T", "T2"],
576
- inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2", null)],
576
+ inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2")],
577
577
  output: StructType({ start: IntegerType, end: IntegerType }),
578
578
  },
579
579
  ArrayFindFirst: {
580
580
  type_parameters: ["T", "T2"],
581
- inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2", null)],
581
+ inputs: [ArrayType("T"), "T2", FunctionType(["T"], "T2")],
582
582
  output: VariantType({ none: NullType, some: IntegerType }),
583
583
  },
584
584
  ArrayConcat: {
@@ -593,12 +593,12 @@ export const Builtins = {
593
593
  },
594
594
  ArrayGetKeys: {
595
595
  type_parameters: ["T"],
596
- inputs: [ArrayType("T"), ArrayType(IntegerType), FunctionType([IntegerType], "T", null)],
596
+ inputs: [ArrayType("T"), ArrayType(IntegerType), FunctionType([IntegerType], "T")],
597
597
  output: ArrayType("T"),
598
598
  },
599
599
  ArrayForEach: {
600
600
  type_parameters: ["T", "T2"],
601
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2", null)],
601
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2")],
602
602
  output: NullType,
603
603
  },
604
604
  ArrayCopy: {
@@ -608,32 +608,32 @@ export const Builtins = {
608
608
  },
609
609
  ArrayMap: {
610
610
  type_parameters: ["T", "T2"],
611
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2", null)],
611
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2")],
612
612
  output: ArrayType("T2"),
613
613
  },
614
614
  ArrayFilter: {
615
615
  type_parameters: ["T"],
616
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], BooleanType, null)],
616
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], BooleanType)],
617
617
  output: ArrayType("T"),
618
618
  },
619
619
  ArrayFilterMap: {
620
620
  type_parameters: ["T", "T2"],
621
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], VariantType({ none: NullType, some: "T2" }), null)],
621
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], VariantType({ none: NullType, some: "T2" }))],
622
622
  output: ArrayType("T2"),
623
623
  },
624
624
  ArrayFirstMap: {
625
625
  type_parameters: ["T", "T2"],
626
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], VariantType({ none: NullType, some: "T2" }), null)],
626
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], VariantType({ none: NullType, some: "T2" }))],
627
627
  output: VariantType({ none: NullType, some: "T2" }),
628
628
  },
629
629
  ArrayFold: {
630
630
  type_parameters: ["T", "T2"],
631
- inputs: [ArrayType("T"), "T2", FunctionType(["T2", "T", IntegerType], "T2", null)],
631
+ inputs: [ArrayType("T"), "T2", FunctionType(["T2", "T", IntegerType], "T2")],
632
632
  output: "T2",
633
633
  },
634
634
  ArrayMapReduce: {
635
635
  type_parameters: ["T", "T2"],
636
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2", null), FunctionType(["T2", "T2"], "T2", null)],
636
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "T2"), FunctionType(["T2", "T2"], "T2")],
637
637
  output: "T2",
638
638
  },
639
639
  ArrayStringJoin: {
@@ -643,37 +643,37 @@ export const Builtins = {
643
643
  },
644
644
  ArrayToSet: {
645
645
  type_parameters: ["T", "K2"],
646
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2", null)],
646
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2")],
647
647
  output: SetType("K2"),
648
648
  },
649
649
  ArrayToDict: {
650
650
  type_parameters: ["T", "K2", "T2"],
651
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2", null), FunctionType(["T", IntegerType], "T2", null), FunctionType(["T2", "T2", "K2"], "T2", null)],
651
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2"), FunctionType(["T", IntegerType], "T2"), FunctionType(["T2", "T2", "K2"], "T2")],
652
652
  output: DictType("K2", "T2"),
653
653
  },
654
654
  ArrayFlattenToArray: {
655
655
  type_parameters: ["T", "T2"],
656
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], ArrayType("T2"), null)],
656
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], ArrayType("T2"))],
657
657
  output: ArrayType("T2"),
658
658
  },
659
659
  ArrayFlattenToSet: {
660
660
  type_parameters: ["T", "K2"],
661
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], SetType("K2"), null)],
661
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], SetType("K2"))],
662
662
  output: SetType("K2"),
663
663
  },
664
664
  ArrayFlattenToDict: {
665
665
  type_parameters: ["T", "K2", "T2"],
666
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], DictType("K2", "T2"), null), FunctionType(["T2", "T2", "K2"], "T2", null)],
666
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], DictType("K2", "T2")), FunctionType(["T2", "T2", "K2"], "T2")],
667
667
  output: DictType("K2", "T2"),
668
668
  },
669
669
  ArrayGroupFold: {
670
670
  type_parameters: ["T", "K2", "T2"],
671
- inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2", null), FunctionType(["K2"], "T2", null), FunctionType(["T2", "T", IntegerType], "T2", null)],
671
+ inputs: [ArrayType("T"), FunctionType(["T", IntegerType], "K2"), FunctionType(["K2"], "T2"), FunctionType(["T2", "T", IntegerType], "T2")],
672
672
  output: DictType("K2", "T2"),
673
673
  },
674
674
  SetGenerate: {
675
675
  type_parameters: ["K"],
676
- inputs: [IntegerType, FunctionType([IntegerType], "K", null), FunctionType(["K"], NullType, null)],
676
+ inputs: [IntegerType, FunctionType([IntegerType], "K"), FunctionType(["K"], NullType)],
677
677
  output: SetType("K"),
678
678
  },
679
679
  SetSize: {
@@ -753,77 +753,77 @@ export const Builtins = {
753
753
  },
754
754
  SetForEach: {
755
755
  type_parameters: ["K", "T2"],
756
- inputs: [SetType("K"), FunctionType(["K"], "T2", null)],
756
+ inputs: [SetType("K"), FunctionType(["K"], "T2")],
757
757
  output: NullType,
758
758
  },
759
759
  SetMap: {
760
760
  type_parameters: ["K", "T2"],
761
- inputs: [SetType("K"), FunctionType(["K"], "T2", null)],
761
+ inputs: [SetType("K"), FunctionType(["K"], "T2")],
762
762
  output: DictType("K", "T2"),
763
763
  },
764
764
  SetFilter: {
765
765
  type_parameters: ["K"],
766
- inputs: [SetType("K"), FunctionType(["K"], BooleanType, null)],
766
+ inputs: [SetType("K"), FunctionType(["K"], BooleanType)],
767
767
  output: SetType("K"),
768
768
  },
769
769
  SetFilterMap: {
770
770
  type_parameters: ["K", "V2"],
771
- inputs: [SetType("K"), FunctionType(["K"], VariantType({ none: NullType, some: "V2" }), null)],
771
+ inputs: [SetType("K"), FunctionType(["K"], VariantType({ none: NullType, some: "V2" }))],
772
772
  output: DictType("K", "V2"),
773
773
  },
774
774
  SetFirstMap: {
775
775
  type_parameters: ["K", "T2"],
776
- inputs: [SetType("K"), FunctionType(["K"], VariantType({ none: NullType, some: "T2" }), null)],
776
+ inputs: [SetType("K"), FunctionType(["K"], VariantType({ none: NullType, some: "T2" }))],
777
777
  output: VariantType({ none: NullType, some: "T2" }),
778
778
  },
779
779
  SetMapReduce: {
780
780
  type_parameters: ["K", "T2"],
781
- inputs: [SetType("K"), FunctionType(["K"], "T2", null), FunctionType(["T2", "T2"], "T2", null)],
781
+ inputs: [SetType("K"), FunctionType(["K"], "T2"), FunctionType(["T2", "T2"], "T2")],
782
782
  output: "T2",
783
783
  },
784
784
  SetReduce: {
785
785
  type_parameters: ["K", "T2"],
786
- inputs: [SetType("K"), FunctionType(["T2", "K"], "T2", null), "T2"],
786
+ inputs: [SetType("K"), FunctionType(["T2", "K"], "T2"), "T2"],
787
787
  output: "T2",
788
788
  },
789
789
  SetToArray: {
790
790
  type_parameters: ["K", "T2"],
791
- inputs: [SetType("K"), FunctionType(["K"], "T2", null)],
791
+ inputs: [SetType("K"), FunctionType(["K"], "T2")],
792
792
  output: ArrayType("T2"),
793
793
  },
794
794
  SetToSet: {
795
795
  type_parameters: ["K", "K2"],
796
- inputs: [SetType("K"), FunctionType(["K"], "K2", null)],
796
+ inputs: [SetType("K"), FunctionType(["K"], "K2")],
797
797
  output: SetType("K2"),
798
798
  },
799
799
  SetToDict: {
800
800
  type_parameters: ["K", "K2", "T2"],
801
- inputs: [SetType("K"), FunctionType(["K"], "K2", null), FunctionType(["K"], "T2", null), FunctionType(["T2", "T2", "K2"], "T2", null)],
801
+ inputs: [SetType("K"), FunctionType(["K"], "K2"), FunctionType(["K"], "T2"), FunctionType(["T2", "T2", "K2"], "T2")],
802
802
  output: DictType("K2", "T2"),
803
803
  },
804
804
  SetFlattenToArray: {
805
805
  type_parameters: ["K", "T2"],
806
- inputs: [SetType("K"), FunctionType(["K"], ArrayType("T2"), null)],
806
+ inputs: [SetType("K"), FunctionType(["K"], ArrayType("T2"))],
807
807
  output: ArrayType("T2"),
808
808
  },
809
809
  SetFlattenToSet: {
810
810
  type_parameters: ["K", "K2"],
811
- inputs: [SetType("K"), FunctionType(["K"], SetType("K2"), null)],
811
+ inputs: [SetType("K"), FunctionType(["K"], SetType("K2"))],
812
812
  output: SetType("K2"),
813
813
  },
814
814
  SetFlattenToDict: {
815
815
  type_parameters: ["K", "K2", "T2"],
816
- inputs: [SetType("K"), FunctionType(["K"], DictType("K2", "T2"), null), FunctionType(["T2", "T2", "K2"], "T2", null)],
816
+ inputs: [SetType("K"), FunctionType(["K"], DictType("K2", "T2")), FunctionType(["T2", "T2", "K2"], "T2")],
817
817
  output: DictType("K2", "T2"),
818
818
  },
819
819
  SetGroupFold: {
820
820
  type_parameters: ["K", "K2", "T2"],
821
- inputs: [SetType("K"), FunctionType(["K"], "K2", null), FunctionType(["K2"], "T2", null), FunctionType(["T2", "K"], "T2", null)],
821
+ inputs: [SetType("K"), FunctionType(["K"], "K2"), FunctionType(["K2"], "T2"), FunctionType(["T2", "K"], "T2")],
822
822
  output: DictType("K2", "T2"),
823
823
  },
824
824
  DictGenerate: {
825
825
  type_parameters: ["K", "V"],
826
- inputs: [IntegerType, FunctionType([IntegerType], "K", null), FunctionType([IntegerType], "V", null), FunctionType(["V", "V", "K"], "V", null)],
826
+ inputs: [IntegerType, FunctionType([IntegerType], "K"), FunctionType([IntegerType], "V"), FunctionType(["V", "V", "K"], "V")],
827
827
  output: DictType("K", "V"),
828
828
  },
829
829
  DictSize: {
@@ -843,7 +843,7 @@ export const Builtins = {
843
843
  },
844
844
  DictGetOrDefault: {
845
845
  type_parameters: ["K", "V"],
846
- inputs: [DictType("K", "V"), "K", FunctionType(["K"], "V", null)],
846
+ inputs: [DictType("K", "V"), "K", FunctionType(["K"], "V")],
847
847
  output: "V",
848
848
  },
849
849
  DictTryGet: {
@@ -858,12 +858,12 @@ export const Builtins = {
858
858
  },
859
859
  DictInsertOrUpdate: {
860
860
  type_parameters: ["K", "V"],
861
- inputs: [DictType("K", "V"), "K", "V", FunctionType(["V", "V", "K"], "V", null)],
861
+ inputs: [DictType("K", "V"), "K", "V", FunctionType(["V", "V", "K"], "V")],
862
862
  output: NullType,
863
863
  },
864
864
  DictGetOrInsert: {
865
865
  type_parameters: ["K", "V"],
866
- inputs: [DictType("K", "V"), "K", FunctionType(["K"], "V", null)],
866
+ inputs: [DictType("K", "V"), "K", FunctionType(["K"], "V")],
867
867
  output: "V",
868
868
  },
869
869
  DictUpdate: {
@@ -878,7 +878,7 @@ export const Builtins = {
878
878
  },
879
879
  DictMerge: {
880
880
  type_parameters: ["K", "V", "V2"],
881
- inputs: [DictType("K", "V"), "K", "V2", FunctionType(["V", "V2", "K"], "V", null), FunctionType(["K"], "V", null)],
881
+ inputs: [DictType("K", "V"), "K", "V2", FunctionType(["V", "V2", "K"], "V"), FunctionType(["K"], "V")],
882
882
  output: NullType,
883
883
  },
884
884
  DictDelete: {
@@ -903,12 +903,12 @@ export const Builtins = {
903
903
  },
904
904
  DictUnionInPlace: {
905
905
  type_parameters: ["K", "V"],
906
- inputs: [DictType("K", "V"), DictType("K", "V"), FunctionType(["V", "V", "K"], "V", null)],
906
+ inputs: [DictType("K", "V"), DictType("K", "V"), FunctionType(["V", "V", "K"], "V")],
907
907
  output: NullType,
908
908
  },
909
909
  DictMergeAll: {
910
910
  type_parameters: ["K", "V", "V2"],
911
- inputs: [DictType("K", "V"), DictType("K", "V2"), FunctionType(["V", "V2", "K"], "V", null), FunctionType(["K"], "V", null)],
911
+ inputs: [DictType("K", "V"), DictType("K", "V2"), FunctionType(["V", "V2", "K"], "V"), FunctionType(["K"], "V")],
912
912
  output: NullType,
913
913
  },
914
914
  DictKeys: {
@@ -918,12 +918,12 @@ export const Builtins = {
918
918
  },
919
919
  DictGetKeys: {
920
920
  type_parameters: ["K", "V"],
921
- inputs: [DictType("K", "V"), SetType("K"), FunctionType(["K"], "V", null)],
921
+ inputs: [DictType("K", "V"), SetType("K"), FunctionType(["K"], "V")],
922
922
  output: DictType("K", "V"),
923
923
  },
924
924
  DictForEach: {
925
925
  type_parameters: ["K", "V", "T2"],
926
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2", null)],
926
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2")],
927
927
  output: NullType,
928
928
  },
929
929
  DictCopy: {
@@ -933,67 +933,67 @@ export const Builtins = {
933
933
  },
934
934
  DictMap: {
935
935
  type_parameters: ["K", "V", "V2"],
936
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "V2", null)],
936
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "V2")],
937
937
  output: DictType("K", "V2"),
938
938
  },
939
939
  DictFilter: {
940
940
  type_parameters: ["K", "V"],
941
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], BooleanType, null)],
941
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], BooleanType)],
942
942
  output: DictType("K", "V"),
943
943
  },
944
944
  DictFilterMap: {
945
945
  type_parameters: ["K", "V", "V2"],
946
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], VariantType({ none: NullType, some: "V2" }), null)],
946
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], VariantType({ none: NullType, some: "V2" }))],
947
947
  output: DictType("K", "V2"),
948
948
  },
949
949
  DictFirstMap: {
950
950
  type_parameters: ["K", "V", "T2"],
951
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], VariantType({ none: NullType, some: "T2" }), null)],
951
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], VariantType({ none: NullType, some: "T2" }))],
952
952
  output: VariantType({ none: NullType, some: "T2" }),
953
953
  },
954
954
  DictMapReduce: {
955
955
  type_parameters: ["K", "V", "T2"],
956
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2", null), FunctionType(["T2", "T2"], "T2", null)],
956
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2"), FunctionType(["T2", "T2"], "T2")],
957
957
  output: "T2",
958
958
  },
959
959
  DictReduce: {
960
960
  type_parameters: ["K", "V", "T2"],
961
- inputs: [DictType("K", "V"), FunctionType(["T2", "V", "K"], "T2", null), "T2"],
961
+ inputs: [DictType("K", "V"), FunctionType(["T2", "V", "K"], "T2"), "T2"],
962
962
  output: "T2",
963
963
  },
964
964
  DictToArray: {
965
965
  type_parameters: ["K", "V", "T2"],
966
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2", null)],
966
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "T2")],
967
967
  output: ArrayType("T2"),
968
968
  },
969
969
  DictToSet: {
970
970
  type_parameters: ["K", "V", "K2"],
971
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2", null)],
971
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2")],
972
972
  output: SetType("K2"),
973
973
  },
974
974
  DictToDict: {
975
975
  type_parameters: ["K", "V", "K2", "V2"],
976
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2", null), FunctionType(["V", "K"], "V2", null), FunctionType(["V2", "V2", "K2"], "V2", null)],
976
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2"), FunctionType(["V", "K"], "V2"), FunctionType(["V2", "V2", "K2"], "V2")],
977
977
  output: DictType("K2", "V2"),
978
978
  },
979
979
  DictFlattenToArray: {
980
980
  type_parameters: ["K", "V", "T2"],
981
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], ArrayType("T2"), null)],
981
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], ArrayType("T2"))],
982
982
  output: ArrayType("T2"),
983
983
  },
984
984
  DictFlattenToSet: {
985
985
  type_parameters: ["K", "V", "K2"],
986
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], SetType("K2"), null)],
986
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], SetType("K2"))],
987
987
  output: SetType("K2"),
988
988
  },
989
989
  DictFlattenToDict: {
990
990
  type_parameters: ["K", "V", "K2", "V2"],
991
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], DictType("K2", "V2"), null), FunctionType(["V2", "V2", "K2"], "V2", null)],
991
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], DictType("K2", "V2")), FunctionType(["V2", "V2", "K2"], "V2")],
992
992
  output: DictType("K2", "V2"),
993
993
  },
994
994
  DictGroupFold: {
995
995
  type_parameters: ["K", "V", "K2", "T2"],
996
- inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2", null), FunctionType(["K2"], "T2", null), FunctionType(["T2", "V", "K"], "T2", null)],
996
+ inputs: [DictType("K", "V"), FunctionType(["V", "K"], "K2"), FunctionType(["K2"], "T2"), FunctionType(["T2", "V", "K"], "T2")],
997
997
  output: DictType("K2", "T2"),
998
998
  },
999
999
  };
@@ -1086,7 +1086,22 @@ export function applyTypeParameters(type, params, inStack, outStack) {
1086
1086
  type: "Function",
1087
1087
  inputs: [],
1088
1088
  output: undefined,
1089
- platforms: type.platforms,
1089
+ };
1090
+ inStack.push(type);
1091
+ outStack.push(self);
1092
+ for (const inputType of type.inputs) {
1093
+ self.inputs.push(applyTypeParameters(inputType, params, inStack, outStack));
1094
+ }
1095
+ self.output = applyTypeParameters(type.output, params, inStack, outStack);
1096
+ inStack.pop();
1097
+ outStack.pop();
1098
+ return self;
1099
+ }
1100
+ else if (type.type === "AsyncFunction") {
1101
+ const self = {
1102
+ type: "AsyncFunction",
1103
+ inputs: [],
1104
+ output: undefined,
1090
1105
  };
1091
1106
  inStack.push(type);
1092
1107
  outStack.push(self);