@magnusopera/fscript 0.86.2 → 0.87.0

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.
@@ -1,9 +1,9 @@
1
1
 
2
2
  import { Span, Position } from "./Span.js";
3
3
  import { EvalException, EvalError$ } from "./Error.js";
4
- import { FSharpMap__Remove, toList, add, FSharpMap__Add, FSharpMap__ContainsKey, FSharpMap__TryFind, empty as empty_1, FSharpMap__get_Item, forAll, FSharpMap__get_Keys, FSharpMap__get_Count, tryFind } from "../fable_modules/fable-library-js.5.24.0/Map.js";
4
+ import { FSharpMap__Remove, toList, add, FSharpMap__Add, FSharpMap__ContainsKey, FSharpMap__TryFind, empty as empty_1, forAll, FSharpMap__get_Count, tryFind } from "../fable_modules/fable-library-js.5.24.0/Map.js";
5
5
  import { builtinSchemes } from "./BuiltinSignatures.js";
6
- import { equals as equals_1, compare, comparePrimitives, curry2, defaultOf, Exception } from "../fable_modules/fable-library-js.5.24.0/Util.js";
6
+ import { compare as compare_1, equals as equals_1, curry2, defaultOf, Exception } from "../fable_modules/fable-library-js.5.24.0/Util.js";
7
7
  import { endsWith, split, join, substring, indexOf, replace, format, concat } from "../fable_modules/fable-library-js.5.24.0/String.js";
8
8
  import { FSharpRef, Record } from "../fable_modules/fable-library-js.5.24.0/Types.js";
9
9
  import { Value, MapKey, ExternalFunction, Value_$reflection } from "./Value.js";
@@ -14,12 +14,12 @@ import { HashIdentity_Reference } from "../fable_modules/fable-library-js.5.24.0
14
14
  import { tryGetValue, addToDict } from "../fable_modules/fable-library-js.5.24.0/MapUtil.js";
15
15
  import { tryParse } from "../fable_modules/fable-library-js.5.24.0/Long.js";
16
16
  import { tryParse as tryParse_1 } from "../fable_modules/fable-library-js.5.24.0/Double.js";
17
- import { append, tryHead, concat as concat_1, choose, ofArray, map, exists, fold, forAll2, length as length_1, empty, reverse, cons, tail as tail_1, head as head_1, isEmpty } from "../fable_modules/fable-library-js.5.24.0/List.js";
18
- import { compare as compare_1, op_Addition, toInt32_unchecked, fromInt32, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.24.0/BigInt.js";
19
- import { ofSeq } from "../fable_modules/fable-library-js.5.24.0/Set.js";
17
+ import { append, tryHead, choose, concat as concat_1, ofArray, map, exists as exists_1, fold, forAll2, length as length_1, empty, reverse, cons, tail as tail_1, head as head_1, isEmpty } from "../fable_modules/fable-library-js.5.24.0/List.js";
18
+ import { compare, op_Addition, toInt32_unchecked, fromInt32, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.24.0/BigInt.js";
19
+ import { exists } from "../fable_modules/fable-library-js.5.24.0/Seq.js";
20
+ import { some, toArray } from "../fable_modules/fable-library-js.5.24.0/Option.js";
20
21
  import { $007CRecordFields$007C_$007C } from "./HostInterop.js";
21
22
  import { tryParse as tryParse_2 } from "../fable_modules/fable-library-js.5.24.0/Boolean.js";
22
- import { some } from "../fable_modules/fable-library-js.5.24.0/Option.js";
23
23
 
24
24
  const unknownSpan = new Span(new Position(undefined, 0, 0), new Position(undefined, 0, 0));
25
25
 
@@ -548,18 +548,14 @@ function valueEquals(a_mut, b_mut) {
548
548
  return false;
549
549
  }
550
550
  case 7:
551
- if ((FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) && ofSeq(FSharpMap__get_Keys(xf), {
552
- Compare: (x_4, y_4) => (comparePrimitives(x_4, y_4) | 0),
553
- }).Equals(ofSeq(FSharpMap__get_Keys(yf), {
554
- Compare: (x_5, y_5) => (comparePrimitives(x_5, y_5) | 0),
555
- }))) {
556
- return forAll((k, xv) => valueEquals(xv, FSharpMap__get_Item(yf, k)), xf);
551
+ if (FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) {
552
+ return forAll((key, value) => exists((b_3) => valueEquals(value, b_3), toArray(tryFind(key, yf))), xf);
557
553
  }
558
554
  else {
559
555
  return false;
560
556
  }
561
557
  default: {
562
- let matchResult_1, xf_1, yf_1, x_8, y_8, cx, cy, px, py, tx, ty, tx_1, ty_1;
558
+ let matchResult_1, xf_1, yf_1, x_4, y_4, cx, cy, px, py, tx, ty, tx_1, ty_1;
563
559
  switch (a.tag) {
564
560
  case 8: {
565
561
  if (b.tag === 8) {
@@ -577,8 +573,8 @@ function valueEquals(a_mut, b_mut) {
577
573
  if (b.tag === 9) {
578
574
  if (b.fields[0] != null) {
579
575
  matchResult_1 = 2;
580
- x_8 = a.fields[0];
581
- y_8 = b.fields[0];
576
+ x_4 = a.fields[0];
577
+ y_4 = b.fields[0];
582
578
  }
583
579
  else {
584
580
  matchResult_1 = 5;
@@ -632,12 +628,8 @@ function valueEquals(a_mut, b_mut) {
632
628
  }
633
629
  switch (matchResult_1) {
634
630
  case 0:
635
- if ((FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) && ofSeq(FSharpMap__get_Keys(xf_1), {
636
- Compare: (x_6, y_6) => (compare(x_6, y_6) | 0),
637
- }).Equals(ofSeq(FSharpMap__get_Keys(yf_1), {
638
- Compare: (x_7, y_7) => (compare(x_7, y_7) | 0),
639
- }))) {
640
- return forAll((k_1, xv_1) => valueEquals(xv_1, FSharpMap__get_Item(yf_1, k_1)), xf_1);
631
+ if (FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) {
632
+ return forAll((key_1, value_1) => exists((b_4) => valueEquals(value_1, b_4), toArray(tryFind(key_1, yf_1))), xf_1);
641
633
  }
642
634
  else {
643
635
  return false;
@@ -645,17 +637,17 @@ function valueEquals(a_mut, b_mut) {
645
637
  case 1:
646
638
  return true;
647
639
  case 2: {
648
- a_mut = x_8;
649
- b_mut = y_8;
640
+ a_mut = x_4;
641
+ b_mut = y_4;
650
642
  continue valueEquals;
651
643
  }
652
644
  case 3:
653
645
  if ((tx === ty) && (cx === cy)) {
654
- let matchResult_2, xv_2, yv;
646
+ let matchResult_2, xv, yv;
655
647
  if (px != null) {
656
648
  if (py != null) {
657
649
  matchResult_2 = 1;
658
- xv_2 = px;
650
+ xv = px;
659
651
  yv = py;
660
652
  }
661
653
  else {
@@ -672,7 +664,7 @@ function valueEquals(a_mut, b_mut) {
672
664
  case 0:
673
665
  return true;
674
666
  case 1: {
675
- a_mut = xv_2;
667
+ a_mut = xv;
676
668
  b_mut = yv;
677
669
  continue valueEquals;
678
670
  }
@@ -696,7 +688,7 @@ function valueEquals(a_mut, b_mut) {
696
688
 
697
689
  function distinctValues(values) {
698
690
  return reverse(fold((acc, value) => {
699
- if (exists((existing) => valueEquals(existing, value), acc)) {
691
+ if (exists_1((existing) => valueEquals(existing, value), acc)) {
700
692
  return acc;
701
693
  }
702
694
  else {
@@ -1189,11 +1181,26 @@ const builtinListChoose = resumable("List.choose", 2, (apply, args) => {
1189
1181
  }
1190
1182
  switch (matchResult) {
1191
1183
  case 0: {
1192
- const body_3 = Execution_map((value) => {
1193
- const body_1 = apply(callback)(value);
1184
+ let results = empty();
1185
+ const second = () => (new Execution$1(new Value(/* VList */ 5, [reverse(results)]), defaultOf()));
1186
+ const body_2 = Execution_Builder__For_Z3A5BE4A(Execution_execution, values, (_arg) => {
1187
+ const body_1 = apply(callback)(_arg);
1194
1188
  if (Execution$1__get_IsImmediate(body_1)) {
1195
1189
  const result = body_1.Value;
1196
- return (result.tag === 9) ? (new Execution$1(result.fields[0], defaultOf())) : (new Execution$1(fail("List.choose chooser must return option"), defaultOf()));
1190
+ if (result.tag === 9) {
1191
+ if (result.fields[0] == null) {
1192
+ return new Execution$1(undefined, defaultOf());
1193
+ }
1194
+ else {
1195
+ const item = result.fields[0];
1196
+ results = cons(item, results);
1197
+ return new Execution$1(undefined, defaultOf());
1198
+ }
1199
+ }
1200
+ else {
1201
+ fail("List.choose chooser must return option");
1202
+ return new Execution$1(undefined, defaultOf());
1203
+ }
1197
1204
  }
1198
1205
  else {
1199
1206
  return new Execution$1(defaultOf(), (continuation) => {
@@ -1201,7 +1208,20 @@ const builtinListChoose = resumable("List.choose", 2, (apply, args) => {
1201
1208
  if (Execution$1__get_IsImmediate(execution_1)) {
1202
1209
  let execution;
1203
1210
  const result = execution_1.Value;
1204
- execution = ((result.tag === 9) ? (new Execution$1(result.fields[0], defaultOf())) : (new Execution$1(fail("List.choose chooser must return option"), defaultOf())));
1211
+ if (result.tag === 9) {
1212
+ if (result.fields[0] == null) {
1213
+ execution = (new Execution$1(undefined, defaultOf()));
1214
+ }
1215
+ else {
1216
+ const item = result.fields[0];
1217
+ results = cons(item, results);
1218
+ execution = (new Execution$1(undefined, defaultOf()));
1219
+ }
1220
+ }
1221
+ else {
1222
+ fail("List.choose chooser must return option");
1223
+ execution = (new Execution$1(undefined, defaultOf()));
1224
+ }
1205
1225
  const continuation_1 = continuation;
1206
1226
  if (Execution$1__get_IsImmediate(execution)) {
1207
1227
  return continuation_1(execution.Value);
@@ -1211,21 +1231,34 @@ const builtinListChoose = resumable("List.choose", 2, (apply, args) => {
1211
1231
  }
1212
1232
  }
1213
1233
  else {
1214
- return execution_1.Resume((value_5) => {
1234
+ return execution_1.Resume((value_4) => {
1215
1235
  let execution;
1216
- const result = value_5;
1217
- execution = ((result.tag === 9) ? (new Execution$1(result.fields[0], defaultOf())) : (new Execution$1(fail("List.choose chooser must return option"), defaultOf())));
1236
+ const result = value_4;
1237
+ if (result.tag === 9) {
1238
+ if (result.fields[0] == null) {
1239
+ execution = (new Execution$1(undefined, defaultOf()));
1240
+ }
1241
+ else {
1242
+ const item = result.fields[0];
1243
+ results = cons(item, results);
1244
+ execution = (new Execution$1(undefined, defaultOf()));
1245
+ }
1246
+ }
1247
+ else {
1248
+ fail("List.choose chooser must return option");
1249
+ execution = (new Execution$1(undefined, defaultOf()));
1250
+ }
1218
1251
  const continuation_1 = continuation;
1219
1252
  return Execution$1__get_IsImmediate(execution) ? continuation_1(execution.Value) : execution.Resume(continuation_1);
1220
1253
  });
1221
1254
  }
1222
1255
  });
1223
1256
  }
1224
- }, values);
1225
- return Execution$1__get_IsImmediate(body_3) ? (new Execution$1(new Value(/* VList */ 5, [choose((x) => x, body_3.Value)]), defaultOf())) : (new Execution$1(defaultOf(), (continuation_3) => {
1226
- const execution_3 = body_3;
1257
+ });
1258
+ return Execution$1__get_IsImmediate(body_2) ? second() : (new Execution$1(defaultOf(), (continuation_3) => {
1259
+ const execution_3 = body_2;
1227
1260
  if (Execution$1__get_IsImmediate(execution_3)) {
1228
- const execution_2 = new Execution$1(new Value(/* VList */ 5, [choose((x) => x, execution_3.Value)]), defaultOf());
1261
+ const execution_2 = second();
1229
1262
  const continuation_4 = continuation_3;
1230
1263
  if (Execution$1__get_IsImmediate(execution_2)) {
1231
1264
  return continuation_4(execution_2.Value);
@@ -1235,8 +1268,8 @@ const builtinListChoose = resumable("List.choose", 2, (apply, args) => {
1235
1268
  }
1236
1269
  }
1237
1270
  else {
1238
- return execution_3.Resume((value_8) => {
1239
- const execution_2 = new Execution$1(new Value(/* VList */ 5, [choose((x) => x, value_8)]), defaultOf());
1271
+ return execution_3.Resume((value_7) => {
1272
+ const execution_2 = second();
1240
1273
  const continuation_4 = continuation_3;
1241
1274
  return Execution$1__get_IsImmediate(execution_2) ? continuation_4(execution_2.Value) : execution_2.Resume(continuation_4);
1242
1275
  });
@@ -1451,7 +1484,7 @@ const builtinListContains = new ExternalFunction("List.contains", scheme("List.c
1451
1484
  }
1452
1485
  switch (matchResult) {
1453
1486
  case 0:
1454
- return new Value(/* VBool */ 3, [exists((value) => {
1487
+ return new Value(/* VBool */ 3, [exists_1((value) => {
1455
1488
  let matchResult_1, x, y, x_1, y_1, x_2, y_2, x_3, y_3;
1456
1489
  switch (value.tag) {
1457
1490
  case 0: {
@@ -1926,7 +1959,7 @@ const builtinListTryItem = new ExternalFunction("List.tryItem", scheme("List.try
1926
1959
  break;
1927
1960
  }
1928
1961
  };
1929
- return (compare_1(index, 0n) < 0) ? (new Value(/* VOption */ 9, [undefined])) : (new Value(/* VOption */ 9, [loop(values, 0n)]));
1962
+ return (compare(index, 0n) < 0) ? (new Value(/* VOption */ 9, [undefined])) : (new Value(/* VOption */ 9, [loop(values, 0n)]));
1930
1963
  }
1931
1964
  default:
1932
1965
  return fail("List.tryItem expects (index, values)");
@@ -2202,7 +2235,7 @@ const builtinOptionMap = resumable("Option.map", 2, (apply, args) => {
2202
2235
  });
2203
2236
 
2204
2237
  const builtinMapEmpty = new ExternalFunction("Map.empty", scheme("Map.empty"), (_arg, _arg_1) => (new Value(/* VMap */ 8, [empty_1({
2205
- Compare: (x, y) => (compare(x, y) | 0),
2238
+ Compare: (x, y) => (compare_1(x, y) | 0),
2206
2239
  })])), 0);
2207
2240
 
2208
2241
  const builtinMapTryGet = new ExternalFunction("Map.tryGet", scheme("Map.tryGet"), (_arg, args) => {
@@ -2363,7 +2396,7 @@ const builtinMapOfList = new ExternalFunction("Map.ofList", scheme("Map.ofList")
2363
2396
  return fail("Map.ofList expects [(key * value)]");
2364
2397
  }
2365
2398
  }, empty_1({
2366
- Compare: (x, y) => (compare(x, y) | 0),
2399
+ Compare: (x, y) => (compare_1(x, y) | 0),
2367
2400
  }), pairs)]);
2368
2401
  default:
2369
2402
  return fail("Map.ofList expects (pairs)");
@@ -2668,7 +2701,7 @@ const builtinMapFilter = resumable("Map.filter", 2, (apply, args) => {
2668
2701
  });
2669
2702
  }
2670
2703
  }, empty_1({
2671
- Compare: (x, y) => (compare(x, y) | 0),
2704
+ Compare: (x, y) => (compare_1(x, y) | 0),
2672
2705
  }), items);
2673
2706
  return Execution$1__get_IsImmediate(body_5) ? (new Execution$1(new Value(/* VMap */ 8, [body_5.Value]), defaultOf())) : (new Execution$1(defaultOf(), (continuation_6) => {
2674
2707
  const execution_5 = body_5;
@@ -2866,7 +2899,7 @@ const builtinMapChoose = resumable("Map.choose", 2, (apply, args) => {
2866
2899
  });
2867
2900
  }
2868
2901
  }, empty_1({
2869
- Compare: (x, y) => (compare(x, y) | 0),
2902
+ Compare: (x, y) => (compare_1(x, y) | 0),
2870
2903
  }), items);
2871
2904
  return Execution$1__get_IsImmediate(body_5) ? (new Execution$1(new Value(/* VMap */ 8, [body_5.Value]), defaultOf())) : (new Execution$1(defaultOf(), (continuation_6) => {
2872
2905
  const execution_5 = body_5;
@@ -2952,7 +2985,7 @@ const builtinMapMap = resumable("Map.map", 2, (apply, args) => {
2952
2985
  });
2953
2986
  }
2954
2987
  }, empty_1({
2955
- Compare: (x, y) => (compare(x, y) | 0),
2988
+ Compare: (x, y) => (compare_1(x, y) | 0),
2956
2989
  }), items);
2957
2990
  return Execution$1__get_IsImmediate(body_3) ? (new Execution$1(new Value(/* VMap */ 8, [body_3.Value]), defaultOf())) : (new Execution$1(defaultOf(), (continuation_3) => {
2958
2991
  const execution_3 = body_3;
@@ -3105,7 +3138,7 @@ const builtinMapIter = resumable("Map.iter", 2, (apply, args) => {
3105
3138
  });
3106
3139
  }
3107
3140
  }, empty_1({
3108
- Compare: (x, y) => (compare(x, y) | 0),
3141
+ Compare: (x, y) => (compare_1(x, y) | 0),
3109
3142
  }), items);
3110
3143
  return Execution$1__get_IsImmediate(body_5) ? (new Execution$1(Value.VUnit, defaultOf())) : (new Execution$1(defaultOf(), (continuation_6) => {
3111
3144
  const execution_5 = body_5;
@@ -6,19 +6,19 @@ import { ExternalFunction, ExternalCallContext, MapKey, Value, TaskHandle_$refle
6
6
  import { EvalException, EvalError$, EvalError$_$reflection } from "./Error.js";
7
7
  import { Span, Position } from "./Span.js";
8
8
  import { printf, toText, join, concat } from "../fable_modules/fable-library-js.5.24.0/String.js";
9
- import { curry2, Exception, defaultOf, disposeSafe, getEnumerator, equals as equals_1, compare, comparePrimitives, int64ToString } from "../fable_modules/fable-library-js.5.24.0/Util.js";
9
+ import { curry2, Exception, compare as compare_1, defaultOf, disposeSafe, getEnumerator, comparePrimitives, equals as equals_1, int64ToString } from "../fable_modules/fable-library-js.5.24.0/Util.js";
10
10
  import { ofArray, collect, tryFindIndex, choose, tryFind as tryFind_1, tryPick as tryPick_1, reverse, append, zip, fold as fold_1, singleton, forAll as forAll_1, empty, cons, tail as tail_2, head as head_1, isEmpty, forAll2, length, map } from "../fable_modules/fable-library-js.5.24.0/List.js";
11
- import { keys, map as map_1, containsKey, FSharpMap__Add, fold, empty as empty_1, FSharpMap__Remove, FSharpMap__get_IsEmpty, FSharpMap__ContainsKey, add, FSharpMap__TryFind, tryFind, toSeq, ofList, FSharpMap__get_Item, forAll, FSharpMap__get_Keys, FSharpMap__get_Count, toList } from "../fable_modules/fable-library-js.5.24.0/Map.js";
12
- import { compare as compare_1, op_Modulus, op_Division, op_Multiply, op_Subtraction, op_Addition, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.24.0/BigInt.js";
13
- import { contains, ofSeq } from "../fable_modules/fable-library-js.5.24.0/Set.js";
11
+ import { keys, map as map_1, containsKey, FSharpMap__Add, fold, empty as empty_1, FSharpMap__get_Item, FSharpMap__Remove, FSharpMap__get_IsEmpty, FSharpMap__ContainsKey, add, FSharpMap__TryFind, toSeq, ofList, tryFind, forAll, FSharpMap__get_Count, toList } from "../fable_modules/fable-library-js.5.24.0/Map.js";
12
+ import { compare, op_Modulus, op_Division, op_Multiply, op_Subtraction, op_Addition, toInt64_unchecked, equals } from "../fable_modules/fable-library-js.5.24.0/BigInt.js";
13
+ import { toList as toList_1, filter, length as length_1, foldBack, head as head_2, tryPick, exists } from "../fable_modules/fable-library-js.5.24.0/Seq.js";
14
+ import { some, toArray } from "../fable_modules/fable-library-js.5.24.0/Option.js";
14
15
  import { ofExterns, typeDefinitions, invoke, prepareCall, matches, $007CRecordFields$007C_$007C } from "./HostInterop.js";
15
16
  import { Ast_spanOfExpr, Expr, Ast_spanOfPattern, TypeRef } from "./Ast.js";
16
- import { toList as toList_1, filter, length as length_1, foldBack, head as head_2, exists, tryPick } from "../fable_modules/fable-library-js.5.24.0/Seq.js";
17
- import { some, toArray } from "../fable_modules/fable-library-js.5.24.0/Option.js";
18
17
  import { Execution_fold, Execution_map, Execution_execution, Execution_Builder__For_Z3A5BE4A, Execution$1__get_IsImmediate, Execution$1, Execution_run } from "./Execution.js";
19
18
  import { awaitTask, spawn } from "./TaskFunctions.js";
20
19
  import { builtinExterns, tryExecution } from "./BuiltinFunctions.js";
21
20
  import { StringBuilder__Append_Z721C83C5, StringBuilder_$ctor } from "../fable_modules/fable-library-js.5.24.0/System.Text.js";
21
+ import { contains } from "../fable_modules/fable-library-js.5.24.0/Set.js";
22
22
  import { builtinReservedNames } from "./BuiltinSignatures.js";
23
23
  import { typeDefs as typeDefs_2 } from "./BuiltinTypes.js";
24
24
 
@@ -481,18 +481,14 @@ function valueEquals(a_mut, b_mut) {
481
481
  return false;
482
482
  }
483
483
  case 7:
484
- if ((FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) && ofSeq(FSharpMap__get_Keys(xf), {
485
- Compare: (x_4, y_4) => (comparePrimitives(x_4, y_4) | 0),
486
- }).Equals(ofSeq(FSharpMap__get_Keys(yf), {
487
- Compare: (x_5, y_5) => (comparePrimitives(x_5, y_5) | 0),
488
- }))) {
489
- return forAll((k, xv) => valueEquals(xv, FSharpMap__get_Item(yf, k)), xf);
484
+ if (FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) {
485
+ return forAll((key, value) => exists((b_3) => valueEquals(value, b_3), toArray(tryFind(key, yf))), xf);
490
486
  }
491
487
  else {
492
488
  return false;
493
489
  }
494
490
  default: {
495
- let matchResult_1, xf_1, yf_1, x_8, y_8, cx, cy, px, py, tx, ty, tx_1, ty_1, tx_2, ty_2;
491
+ let matchResult_1, xf_1, yf_1, x_4, y_4, cx, cy, px, py, tx, ty, tx_1, ty_1, tx_2, ty_2;
496
492
  switch (a.tag) {
497
493
  case 8: {
498
494
  if (b.tag === 8) {
@@ -510,8 +506,8 @@ function valueEquals(a_mut, b_mut) {
510
506
  if (b.tag === 9) {
511
507
  if (b.fields[0] != null) {
512
508
  matchResult_1 = 2;
513
- x_8 = a.fields[0];
514
- y_8 = b.fields[0];
509
+ x_4 = a.fields[0];
510
+ y_4 = b.fields[0];
515
511
  }
516
512
  else {
517
513
  matchResult_1 = 6;
@@ -576,12 +572,8 @@ function valueEquals(a_mut, b_mut) {
576
572
  }
577
573
  switch (matchResult_1) {
578
574
  case 0:
579
- if ((FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) && ofSeq(FSharpMap__get_Keys(xf_1), {
580
- Compare: (x_6, y_6) => (compare(x_6, y_6) | 0),
581
- }).Equals(ofSeq(FSharpMap__get_Keys(yf_1), {
582
- Compare: (x_7, y_7) => (compare(x_7, y_7) | 0),
583
- }))) {
584
- return forAll((k_1, xv_1) => valueEquals(xv_1, FSharpMap__get_Item(yf_1, k_1)), xf_1);
575
+ if (FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) {
576
+ return forAll((key_1, value_1) => exists((b_4) => valueEquals(value_1, b_4), toArray(tryFind(key_1, yf_1))), xf_1);
585
577
  }
586
578
  else {
587
579
  return false;
@@ -589,17 +581,17 @@ function valueEquals(a_mut, b_mut) {
589
581
  case 1:
590
582
  return true;
591
583
  case 2: {
592
- a_mut = x_8;
593
- b_mut = y_8;
584
+ a_mut = x_4;
585
+ b_mut = y_4;
594
586
  continue valueEquals;
595
587
  }
596
588
  case 3:
597
589
  if ((tx === ty) && (cx === cy)) {
598
- let matchResult_2, xv_2, yv;
590
+ let matchResult_2, xv, yv;
599
591
  if (px != null) {
600
592
  if (py != null) {
601
593
  matchResult_2 = 1;
602
- xv_2 = px;
594
+ xv = px;
603
595
  yv = py;
604
596
  }
605
597
  else {
@@ -616,7 +608,7 @@ function valueEquals(a_mut, b_mut) {
616
608
  case 0:
617
609
  return true;
618
610
  case 1: {
619
- a_mut = xv_2;
611
+ a_mut = xv;
620
612
  b_mut = yv;
621
613
  continue valueEquals;
622
614
  }
@@ -1781,7 +1773,7 @@ function binaryOperator(span, op, av, bv) {
1781
1773
  }
1782
1774
  switch (matchResult_3) {
1783
1775
  case 0:
1784
- return new Value(/* VBool */ 3, [(op === "<") ? (compare_1(x_11, y_11) < 0) : ((op === ">") ? (compare_1(x_11, y_11) > 0) : ((op === "<=") ? (compare_1(x_11, y_11) <= 0) : ((op === ">=") && (compare_1(x_11, y_11) >= 0))))]);
1776
+ return new Value(/* VBool */ 3, [(op === "<") ? (compare(x_11, y_11) < 0) : ((op === ">") ? (compare(x_11, y_11) > 0) : ((op === "<=") ? (compare(x_11, y_11) <= 0) : ((op === ">=") && (compare(x_11, y_11) >= 0))))]);
1785
1777
  case 1:
1786
1778
  return new Value(/* VBool */ 3, [(op === "<") ? (x_12 < y_12) : ((op === ">") ? (x_12 > y_12) : ((op === "<=") ? (x_12 <= y_12) : ((op === ">=") && (x_12 >= y_12))))]);
1787
1779
  default:
@@ -3335,12 +3327,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3335
3327
  }
3336
3328
  switch (matchResult_1) {
3337
3329
  case 0: {
3338
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3330
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3339
3331
  const build = (acc_1_mut, current_mut) => {
3340
3332
  build:
3341
3333
  while (true) {
3342
3334
  const acc_1 = acc_1_mut, current = current_mut;
3343
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3335
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3344
3336
  return reverse(acc_1);
3345
3337
  }
3346
3338
  else {
@@ -3381,12 +3373,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3381
3373
  }
3382
3374
  switch (matchResult_2) {
3383
3375
  case 0: {
3384
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3376
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3385
3377
  const build = (acc_1_mut_1, current_mut_1) => {
3386
3378
  build:
3387
3379
  while (true) {
3388
3380
  const acc_1 = acc_1_mut_1, current = current_mut_1;
3389
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3381
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3390
3382
  return reverse(acc_1);
3391
3383
  }
3392
3384
  else {
@@ -3433,12 +3425,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3433
3425
  }
3434
3426
  switch (matchResult_3) {
3435
3427
  case 0: {
3436
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3428
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3437
3429
  const build = (acc_1_mut_2, current_mut_2) => {
3438
3430
  build:
3439
3431
  while (true) {
3440
3432
  const acc_1 = acc_1_mut_2, current = current_mut_2;
3441
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3433
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3442
3434
  return reverse(acc_1);
3443
3435
  }
3444
3436
  else {
@@ -3489,12 +3481,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3489
3481
  }
3490
3482
  switch (matchResult_4) {
3491
3483
  case 0: {
3492
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3484
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3493
3485
  const build = (acc_1_mut_3, current_mut_3) => {
3494
3486
  build:
3495
3487
  while (true) {
3496
3488
  const acc_1 = acc_1_mut_3, current = current_mut_3;
3497
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3489
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3498
3490
  return reverse(acc_1);
3499
3491
  }
3500
3492
  else {
@@ -3536,12 +3528,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3536
3528
  }
3537
3529
  switch (matchResult_5) {
3538
3530
  case 0: {
3539
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3531
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3540
3532
  const build = (acc_1_mut_4, current_mut_4) => {
3541
3533
  build:
3542
3534
  while (true) {
3543
3535
  const acc_1 = acc_1_mut_4, current = current_mut_4;
3544
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3536
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3545
3537
  return reverse(acc_1);
3546
3538
  }
3547
3539
  else {
@@ -3588,12 +3580,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3588
3580
  }
3589
3581
  switch (matchResult_6) {
3590
3582
  case 0: {
3591
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3583
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3592
3584
  const build = (acc_1_mut_5, current_mut_5) => {
3593
3585
  build:
3594
3586
  while (true) {
3595
3587
  const acc_1 = acc_1_mut_5, current = current_mut_5;
3596
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3588
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3597
3589
  return reverse(acc_1);
3598
3590
  }
3599
3591
  else {
@@ -3649,12 +3641,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3649
3641
  }
3650
3642
  switch (matchResult_7) {
3651
3643
  case 0: {
3652
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3644
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3653
3645
  const build = (acc_1_mut_6, current_mut_6) => {
3654
3646
  build:
3655
3647
  while (true) {
3656
3648
  const acc_1 = acc_1_mut_6, current = current_mut_6;
3657
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3649
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3658
3650
  return reverse(acc_1);
3659
3651
  }
3660
3652
  else {
@@ -3696,12 +3688,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3696
3688
  }
3697
3689
  switch (matchResult_8) {
3698
3690
  case 0: {
3699
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3691
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3700
3692
  const build = (acc_1_mut_7, current_mut_7) => {
3701
3693
  build:
3702
3694
  while (true) {
3703
3695
  const acc_1 = acc_1_mut_7, current = current_mut_7;
3704
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3696
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3705
3697
  return reverse(acc_1);
3706
3698
  }
3707
3699
  else {
@@ -3748,12 +3740,12 @@ function evalCompound(runtime, typeDefs, env, expr) {
3748
3740
  }
3749
3741
  switch (matchResult_9) {
3750
3742
  case 0: {
3751
- const step = (compare_1(s, e) <= 0) ? (1n) : (-1n);
3743
+ const step = (compare(s, e) <= 0) ? (1n) : (-1n);
3752
3744
  const build = (acc_1_mut_8, current_mut_8) => {
3753
3745
  build:
3754
3746
  while (true) {
3755
3747
  const acc_1 = acc_1_mut_8, current = current_mut_8;
3756
- if (((compare_1(step, 0n) > 0) && (compare_1(current, e) > 0)) ? true : ((compare_1(step, 0n) < 0) && (compare_1(current, e) < 0))) {
3748
+ if (((compare(step, 0n) > 0) && (compare(current, e) > 0)) ? true : ((compare(step, 0n) < 0) && (compare(current, e) < 0))) {
3757
3749
  return reverse(acc_1);
3758
3750
  }
3759
3751
  else {
@@ -4084,7 +4076,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4084
4076
  }
4085
4077
  }
4086
4078
  }, empty_1({
4087
- Compare: (x_1, y_1) => (compare(x_1, y_1) | 0),
4079
+ Compare: (x_1, y_1) => (compare_1(x_1, y_1) | 0),
4088
4080
  }), entries_1);
4089
4081
  if (Execution$1__get_IsImmediate(body_57)) {
4090
4082
  return new Execution$1(new Value(/* VMap */ 8, [body_57.Value]), defaultOf());
@@ -4371,7 +4363,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4371
4363
  break;
4372
4364
  }
4373
4365
  };
4374
- return new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf());
4366
+ return new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf());
4375
4367
  }
4376
4368
  case 1:
4377
4369
  return new Execution$1(new Value(/* VOption */ 9, [FSharpMap__TryFind(values_4, valueToMapKey(span_12, key_1))]), defaultOf());
@@ -4465,7 +4457,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4465
4457
  break;
4466
4458
  }
4467
4459
  };
4468
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4460
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4469
4461
  break;
4470
4462
  }
4471
4463
  case 1: {
@@ -4571,7 +4563,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4571
4563
  break;
4572
4564
  }
4573
4565
  };
4574
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4566
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4575
4567
  break;
4576
4568
  }
4577
4569
  case 1: {
@@ -4681,7 +4673,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4681
4673
  break;
4682
4674
  }
4683
4675
  };
4684
- execution_46 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4676
+ execution_46 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4685
4677
  break;
4686
4678
  }
4687
4679
  case 1: {
@@ -4782,7 +4774,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4782
4774
  break;
4783
4775
  }
4784
4776
  };
4785
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4777
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4786
4778
  break;
4787
4779
  }
4788
4780
  case 1: {
@@ -4888,7 +4880,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
4888
4880
  break;
4889
4881
  }
4890
4882
  };
4891
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4883
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4892
4884
  break;
4893
4885
  }
4894
4886
  case 1: {
@@ -5003,7 +4995,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
5003
4995
  break;
5004
4996
  }
5005
4997
  };
5006
- execution_46 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
4998
+ execution_46 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
5007
4999
  break;
5008
5000
  }
5009
5001
  case 1: {
@@ -5104,7 +5096,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
5104
5096
  break;
5105
5097
  }
5106
5098
  };
5107
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
5099
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
5108
5100
  break;
5109
5101
  }
5110
5102
  case 1: {
@@ -5210,7 +5202,7 @@ function evalCompound(runtime, typeDefs, env, expr) {
5210
5202
  break;
5211
5203
  }
5212
5204
  };
5213
- execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare_1(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
5205
+ execution_44 = (new Execution$1(new Value(/* VOption */ 9, [(compare(index, 0n) < 0) ? undefined : find(values_3, 0n)]), defaultOf()));
5214
5206
  break;
5215
5207
  }
5216
5208
  case 1: {