@fable-org/fable-library-js 2.10.0 → 2.11.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.
- package/Array.js +272 -167
- package/BigInt.js +18 -6
- package/CHANGELOG.md +33 -1
- package/Date.js +1 -1
- package/Decimal.js +16 -46
- package/Double.js +25 -10
- package/FSharp.Core.js +7 -1
- package/Global.js +1 -1
- package/Int32.js +10 -1
- package/List.js +226 -156
- package/Long.js +7 -2
- package/Map.js +46 -39
- package/MutableMap.js +76 -96
- package/MutableSet.js +58 -80
- package/NumberStyles.js +56 -0
- package/Numeric.js +10 -4
- package/Random.js +3 -4
- package/Range.js +4 -3
- package/RegExp.js +3 -2
- package/Seq.js +132 -64
- package/Seq2.js +4 -8
- package/Set.js +64 -57
- package/String.js +14 -16
- package/System.Collections.Generic.js +3 -2
- package/System.Text.js +2 -2
- package/TimeOnly.js +1 -1
- package/Types.js +25 -10
- package/Util.js +91 -48
- package/package.json +1 -1
package/Set.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { record_type, bool_type, list_type, option_type, class_type } from "./Reflection.js";
|
|
2
2
|
import { some, value as value_2 } from "./Option.js";
|
|
3
|
-
import { structuralHash, toIterator, disposeSafe, getEnumerator, isArrayLike, Exception } from "./Util.js";
|
|
3
|
+
import { structuralHash, toIterator, disposeSafe, getEnumerator, isArrayLike, physicalHash, Exception } from "./Util.js";
|
|
4
|
+
import { Operators_InvalidOp, Operators_InvalidArg } from "./FSharp.Core.js";
|
|
4
5
|
import { toString, Record } from "./Types.js";
|
|
5
6
|
import { fold as fold_2, cons, singleton as singleton_1, empty as empty_1, ofArrayWithTail, tail, head, isEmpty as isEmpty_1, FSharpList } from "./List.js";
|
|
6
7
|
import { fold as fold_1, fill, setItem } from "./Array.js";
|
|
@@ -51,7 +52,7 @@ export function SetTreeModule_countAux(t_mut, acc_mut) {
|
|
|
51
52
|
SetTreeModule_countAux: while (true) {
|
|
52
53
|
const t = t_mut, acc = acc_mut;
|
|
53
54
|
if (t != null) {
|
|
54
|
-
const t2 =
|
|
55
|
+
const t2 = t;
|
|
55
56
|
if (t2 instanceof SetTreeNode$1) {
|
|
56
57
|
const tn = t2;
|
|
57
58
|
t_mut = SetTreeNode$1__get_Left(tn);
|
|
@@ -76,7 +77,7 @@ export function SetTreeModule_mk(l, k, r) {
|
|
|
76
77
|
let hl;
|
|
77
78
|
const t = l;
|
|
78
79
|
if (t != null) {
|
|
79
|
-
const t2 =
|
|
80
|
+
const t2 = t;
|
|
80
81
|
hl = ((t2 instanceof SetTreeNode$1) ? ((tn = t2, SetTreeNode$1__get_Height(tn))) : 1);
|
|
81
82
|
}
|
|
82
83
|
else {
|
|
@@ -85,7 +86,7 @@ export function SetTreeModule_mk(l, k, r) {
|
|
|
85
86
|
let hr;
|
|
86
87
|
const t_1 = r;
|
|
87
88
|
if (t_1 != null) {
|
|
88
|
-
const t2_1 =
|
|
89
|
+
const t2_1 = t_1;
|
|
89
90
|
hr = ((t2_1 instanceof SetTreeNode$1) ? ((tn_1 = t2_1, SetTreeNode$1__get_Height(tn_1))) : 1);
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
@@ -104,7 +105,7 @@ export function SetTreeModule_rebalance(t1, v, t2) {
|
|
|
104
105
|
let t1h;
|
|
105
106
|
const t = t1;
|
|
106
107
|
if (t != null) {
|
|
107
|
-
const t2_1 =
|
|
108
|
+
const t2_1 = t;
|
|
108
109
|
t1h = ((t2_1 instanceof SetTreeNode$1) ? ((tn = t2_1, SetTreeNode$1__get_Height(tn))) : 1);
|
|
109
110
|
}
|
|
110
111
|
else {
|
|
@@ -113,7 +114,7 @@ export function SetTreeModule_rebalance(t1, v, t2) {
|
|
|
113
114
|
let t2h;
|
|
114
115
|
const t_1 = t2;
|
|
115
116
|
if (t_1 != null) {
|
|
116
|
-
const t2_2 =
|
|
117
|
+
const t2_2 = t_1;
|
|
117
118
|
t2h = ((t2_2 instanceof SetTreeNode$1) ? ((tn_1 = t2_2, SetTreeNode$1__get_Height(tn_1))) : 1);
|
|
118
119
|
}
|
|
119
120
|
else {
|
|
@@ -123,7 +124,7 @@ export function SetTreeModule_rebalance(t1, v, t2) {
|
|
|
123
124
|
const matchValue = value_2(t2);
|
|
124
125
|
if (matchValue instanceof SetTreeNode$1) {
|
|
125
126
|
const t2$0027 = matchValue;
|
|
126
|
-
if (((t_2 = SetTreeNode$1__get_Left(t2$0027), (t_2 != null) ? ((t2_3 =
|
|
127
|
+
if (((t_2 = SetTreeNode$1__get_Left(t2$0027), (t_2 != null) ? ((t2_3 = t_2, (t2_3 instanceof SetTreeNode$1) ? ((tn_2 = t2_3, SetTreeNode$1__get_Height(tn_2))) : 1)) : 0)) > (t1h + 1)) {
|
|
127
128
|
const matchValue_1 = value_2(SetTreeNode$1__get_Left(t2$0027));
|
|
128
129
|
if (matchValue_1 instanceof SetTreeNode$1) {
|
|
129
130
|
const t2l = matchValue_1;
|
|
@@ -145,7 +146,7 @@ export function SetTreeModule_rebalance(t1, v, t2) {
|
|
|
145
146
|
const matchValue_2 = value_2(t1);
|
|
146
147
|
if (matchValue_2 instanceof SetTreeNode$1) {
|
|
147
148
|
const t1$0027 = matchValue_2;
|
|
148
|
-
if (((t_3 = SetTreeNode$1__get_Right(t1$0027), (t_3 != null) ? ((t2_4 =
|
|
149
|
+
if (((t_3 = SetTreeNode$1__get_Right(t1$0027), (t_3 != null) ? ((t2_4 = t_3, (t2_4 instanceof SetTreeNode$1) ? ((tn_3 = t2_4, SetTreeNode$1__get_Height(tn_3))) : 1)) : 0)) > (t2h + 1)) {
|
|
149
150
|
const matchValue_3 = value_2(SetTreeNode$1__get_Right(t1$0027));
|
|
150
151
|
if (matchValue_3 instanceof SetTreeNode$1) {
|
|
151
152
|
const t1r = matchValue_3;
|
|
@@ -169,7 +170,7 @@ export function SetTreeModule_rebalance(t1, v, t2) {
|
|
|
169
170
|
}
|
|
170
171
|
export function SetTreeModule_add(comparer, k, t) {
|
|
171
172
|
if (t != null) {
|
|
172
|
-
const t2 =
|
|
173
|
+
const t2 = t;
|
|
173
174
|
const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;
|
|
174
175
|
if (t2 instanceof SetTreeNode$1) {
|
|
175
176
|
const tn = t2;
|
|
@@ -202,9 +203,9 @@ export function SetTreeModule_add(comparer, k, t) {
|
|
|
202
203
|
}
|
|
203
204
|
export function SetTreeModule_balance(comparer, t1, k, t2) {
|
|
204
205
|
if (t1 != null) {
|
|
205
|
-
const t1$0027 =
|
|
206
|
+
const t1$0027 = t1;
|
|
206
207
|
if (t2 != null) {
|
|
207
|
-
const t2$0027 =
|
|
208
|
+
const t2$0027 = t2;
|
|
208
209
|
if (t1$0027 instanceof SetTreeNode$1) {
|
|
209
210
|
const t1n = t1$0027;
|
|
210
211
|
if (t2$0027 instanceof SetTreeNode$1) {
|
|
@@ -237,7 +238,7 @@ export function SetTreeModule_balance(comparer, t1, k, t2) {
|
|
|
237
238
|
}
|
|
238
239
|
export function SetTreeModule_split(comparer, pivot, t) {
|
|
239
240
|
if (t != null) {
|
|
240
|
-
const t2 =
|
|
241
|
+
const t2 = t;
|
|
241
242
|
if (t2 instanceof SetTreeNode$1) {
|
|
242
243
|
const tn = t2;
|
|
243
244
|
const c = comparer.Compare(pivot, SetTreeLeaf$1__get_Key(tn)) | 0;
|
|
@@ -272,7 +273,7 @@ export function SetTreeModule_split(comparer, pivot, t) {
|
|
|
272
273
|
}
|
|
273
274
|
export function SetTreeModule_spliceOutSuccessor(t) {
|
|
274
275
|
if (t != null) {
|
|
275
|
-
const t2 =
|
|
276
|
+
const t2 = t;
|
|
276
277
|
if (t2 instanceof SetTreeNode$1) {
|
|
277
278
|
const tn = t2;
|
|
278
279
|
if (SetTreeNode$1__get_Left(tn) == null) {
|
|
@@ -293,7 +294,7 @@ export function SetTreeModule_spliceOutSuccessor(t) {
|
|
|
293
294
|
}
|
|
294
295
|
export function SetTreeModule_remove(comparer, k, t) {
|
|
295
296
|
if (t != null) {
|
|
296
|
-
const t2 =
|
|
297
|
+
const t2 = t;
|
|
297
298
|
const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;
|
|
298
299
|
if (t2 instanceof SetTreeNode$1) {
|
|
299
300
|
const tn = t2;
|
|
@@ -331,7 +332,7 @@ export function SetTreeModule_mem(comparer_mut, k_mut, t_mut) {
|
|
|
331
332
|
SetTreeModule_mem: while (true) {
|
|
332
333
|
const comparer = comparer_mut, k = k_mut, t = t_mut;
|
|
333
334
|
if (t != null) {
|
|
334
|
-
const t2 =
|
|
335
|
+
const t2 = t;
|
|
335
336
|
const c = comparer.Compare(k, SetTreeLeaf$1__get_Key(t2)) | 0;
|
|
336
337
|
if (t2 instanceof SetTreeNode$1) {
|
|
337
338
|
const tn = t2;
|
|
@@ -365,7 +366,7 @@ export function SetTreeModule_iter(f_mut, t_mut) {
|
|
|
365
366
|
SetTreeModule_iter: while (true) {
|
|
366
367
|
const f = f_mut, t = t_mut;
|
|
367
368
|
if (t != null) {
|
|
368
|
-
const t2 =
|
|
369
|
+
const t2 = t;
|
|
369
370
|
if (t2 instanceof SetTreeNode$1) {
|
|
370
371
|
const tn = t2;
|
|
371
372
|
SetTreeModule_iter(f, SetTreeNode$1__get_Left(tn));
|
|
@@ -385,7 +386,7 @@ export function SetTreeModule_foldBackOpt(f_mut, t_mut, x_mut) {
|
|
|
385
386
|
SetTreeModule_foldBackOpt: while (true) {
|
|
386
387
|
const f = f_mut, t = t_mut, x = x_mut;
|
|
387
388
|
if (t != null) {
|
|
388
|
-
const t2 =
|
|
389
|
+
const t2 = t;
|
|
389
390
|
if (t2 instanceof SetTreeNode$1) {
|
|
390
391
|
const tn = t2;
|
|
391
392
|
f_mut = f;
|
|
@@ -410,7 +411,7 @@ export function SetTreeModule_foldOpt(f_mut, x_mut, t_mut) {
|
|
|
410
411
|
SetTreeModule_foldOpt: while (true) {
|
|
411
412
|
const f = f_mut, x = x_mut, t = t_mut;
|
|
412
413
|
if (t != null) {
|
|
413
|
-
const t2 =
|
|
414
|
+
const t2 = t;
|
|
414
415
|
if (t2 instanceof SetTreeNode$1) {
|
|
415
416
|
const tn = t2;
|
|
416
417
|
f_mut = f;
|
|
@@ -435,7 +436,7 @@ export function SetTreeModule_forall(f_mut, t_mut) {
|
|
|
435
436
|
SetTreeModule_forall: while (true) {
|
|
436
437
|
const f = f_mut, t = t_mut;
|
|
437
438
|
if (t != null) {
|
|
438
|
-
const t2 =
|
|
439
|
+
const t2 = t;
|
|
439
440
|
if (t2 instanceof SetTreeNode$1) {
|
|
440
441
|
const tn = t2;
|
|
441
442
|
if (f(SetTreeLeaf$1__get_Key(tn)) && SetTreeModule_forall(f, SetTreeNode$1__get_Left(tn))) {
|
|
@@ -461,7 +462,7 @@ export function SetTreeModule_exists(f_mut, t_mut) {
|
|
|
461
462
|
SetTreeModule_exists: while (true) {
|
|
462
463
|
const f = f_mut, t = t_mut;
|
|
463
464
|
if (t != null) {
|
|
464
|
-
const t2 =
|
|
465
|
+
const t2 = t;
|
|
465
466
|
if (t2 instanceof SetTreeNode$1) {
|
|
466
467
|
const tn = t2;
|
|
467
468
|
if (f(SetTreeLeaf$1__get_Key(tn)) ? true : SetTreeModule_exists(f, SetTreeNode$1__get_Left(tn))) {
|
|
@@ -498,7 +499,7 @@ export function SetTreeModule_filterAux(comparer_mut, f_mut, t_mut, acc_mut) {
|
|
|
498
499
|
SetTreeModule_filterAux: while (true) {
|
|
499
500
|
const comparer = comparer_mut, f = f_mut, t = t_mut, acc = acc_mut;
|
|
500
501
|
if (t != null) {
|
|
501
|
-
const t2 =
|
|
502
|
+
const t2 = t;
|
|
502
503
|
if (t2 instanceof SetTreeNode$1) {
|
|
503
504
|
const tn = t2;
|
|
504
505
|
const acc_1 = f(SetTreeLeaf$1__get_Key(tn)) ? SetTreeModule_add(comparer, SetTreeLeaf$1__get_Key(tn), acc) : acc;
|
|
@@ -531,7 +532,7 @@ export function SetTreeModule_diffAux(comparer_mut, t_mut, acc_mut) {
|
|
|
531
532
|
return acc;
|
|
532
533
|
}
|
|
533
534
|
else if (t != null) {
|
|
534
|
-
const t2 =
|
|
535
|
+
const t2 = t;
|
|
535
536
|
if (t2 instanceof SetTreeNode$1) {
|
|
536
537
|
const tn = t2;
|
|
537
538
|
comparer_mut = comparer;
|
|
@@ -554,9 +555,9 @@ export function SetTreeModule_diff(comparer, a, b) {
|
|
|
554
555
|
}
|
|
555
556
|
export function SetTreeModule_union(comparer, t1, t2) {
|
|
556
557
|
if (t1 != null) {
|
|
557
|
-
const t1$0027 =
|
|
558
|
+
const t1$0027 = t1;
|
|
558
559
|
if (t2 != null) {
|
|
559
|
-
const t2$0027 =
|
|
560
|
+
const t2$0027 = t2;
|
|
560
561
|
if (t1$0027 instanceof SetTreeNode$1) {
|
|
561
562
|
const t1n = t1$0027;
|
|
562
563
|
if (t2$0027 instanceof SetTreeNode$1) {
|
|
@@ -590,7 +591,7 @@ export function SetTreeModule_intersectionAux(comparer_mut, b_mut, t_mut, acc_mu
|
|
|
590
591
|
SetTreeModule_intersectionAux: while (true) {
|
|
591
592
|
const comparer = comparer_mut, b = b_mut, t = t_mut, acc = acc_mut;
|
|
592
593
|
if (t != null) {
|
|
593
|
-
const t2 =
|
|
594
|
+
const t2 = t;
|
|
594
595
|
if (t2 instanceof SetTreeNode$1) {
|
|
595
596
|
const tn = t2;
|
|
596
597
|
const acc_1 = SetTreeModule_intersectionAux(comparer, b, SetTreeNode$1__get_Right(tn), acc);
|
|
@@ -630,7 +631,7 @@ export function SetTreeModule_partitionAux(comparer_mut, f_mut, t_mut, acc__mut,
|
|
|
630
631
|
const comparer = comparer_mut, f = f_mut, t = t_mut, acc_ = acc__mut, acc__1 = acc__1_mut;
|
|
631
632
|
const acc = [acc_, acc__1];
|
|
632
633
|
if (t != null) {
|
|
633
|
-
const t2 =
|
|
634
|
+
const t2 = t;
|
|
634
635
|
if (t2 instanceof SetTreeNode$1) {
|
|
635
636
|
const tn = t2;
|
|
636
637
|
const acc_1 = SetTreeModule_partitionAux(comparer, f, SetTreeNode$1__get_Right(tn), acc[0], acc[1]);
|
|
@@ -659,7 +660,7 @@ export function SetTreeModule_minimumElementAux(t_mut, n_mut) {
|
|
|
659
660
|
SetTreeModule_minimumElementAux: while (true) {
|
|
660
661
|
const t = t_mut, n = n_mut;
|
|
661
662
|
if (t != null) {
|
|
662
|
-
const t2 =
|
|
663
|
+
const t2 = t;
|
|
663
664
|
if (t2 instanceof SetTreeNode$1) {
|
|
664
665
|
const tn = t2;
|
|
665
666
|
t_mut = SetTreeNode$1__get_Left(tn);
|
|
@@ -678,7 +679,7 @@ export function SetTreeModule_minimumElementAux(t_mut, n_mut) {
|
|
|
678
679
|
}
|
|
679
680
|
export function SetTreeModule_minimumElementOpt(t) {
|
|
680
681
|
if (t != null) {
|
|
681
|
-
const t2 =
|
|
682
|
+
const t2 = t;
|
|
682
683
|
if (t2 instanceof SetTreeNode$1) {
|
|
683
684
|
const tn = t2;
|
|
684
685
|
return some(SetTreeModule_minimumElementAux(SetTreeNode$1__get_Left(tn), SetTreeLeaf$1__get_Key(tn)));
|
|
@@ -695,7 +696,7 @@ export function SetTreeModule_maximumElementAux(t_mut, n_mut) {
|
|
|
695
696
|
SetTreeModule_maximumElementAux: while (true) {
|
|
696
697
|
const t = t_mut, n = n_mut;
|
|
697
698
|
if (t != null) {
|
|
698
|
-
const t2 =
|
|
699
|
+
const t2 = t;
|
|
699
700
|
if (t2 instanceof SetTreeNode$1) {
|
|
700
701
|
const tn = t2;
|
|
701
702
|
t_mut = SetTreeNode$1__get_Right(tn);
|
|
@@ -714,7 +715,7 @@ export function SetTreeModule_maximumElementAux(t_mut, n_mut) {
|
|
|
714
715
|
}
|
|
715
716
|
export function SetTreeModule_maximumElementOpt(t) {
|
|
716
717
|
if (t != null) {
|
|
717
|
-
const t2 =
|
|
718
|
+
const t2 = t;
|
|
718
719
|
if (t2 instanceof SetTreeNode$1) {
|
|
719
720
|
const tn = t2;
|
|
720
721
|
return some(SetTreeModule_maximumElementAux(SetTreeNode$1__get_Right(tn), SetTreeLeaf$1__get_Key(tn)));
|
|
@@ -730,7 +731,7 @@ export function SetTreeModule_maximumElementOpt(t) {
|
|
|
730
731
|
export function SetTreeModule_minimumElement(s) {
|
|
731
732
|
const matchValue = SetTreeModule_minimumElementOpt(s);
|
|
732
733
|
if (matchValue == null) {
|
|
733
|
-
throw
|
|
734
|
+
throw Operators_InvalidArg("s", "Set contains no elements.");
|
|
734
735
|
}
|
|
735
736
|
else {
|
|
736
737
|
return value_2(matchValue);
|
|
@@ -739,7 +740,7 @@ export function SetTreeModule_minimumElement(s) {
|
|
|
739
740
|
export function SetTreeModule_maximumElement(s) {
|
|
740
741
|
const matchValue = SetTreeModule_maximumElementOpt(s);
|
|
741
742
|
if (matchValue == null) {
|
|
742
|
-
throw
|
|
743
|
+
throw Operators_InvalidArg("s", "Set contains no elements.");
|
|
743
744
|
}
|
|
744
745
|
else {
|
|
745
746
|
return value_2(matchValue);
|
|
@@ -751,6 +752,12 @@ export class SetTreeModule_SetIterator$1 extends Record {
|
|
|
751
752
|
this.stack = stack;
|
|
752
753
|
this.started = started;
|
|
753
754
|
}
|
|
755
|
+
Equals(other) {
|
|
756
|
+
return this === other;
|
|
757
|
+
}
|
|
758
|
+
GetHashCode() {
|
|
759
|
+
return physicalHash(this);
|
|
760
|
+
}
|
|
754
761
|
}
|
|
755
762
|
export function SetTreeModule_SetIterator$1_$reflection(gen0) {
|
|
756
763
|
return record_type("Set.SetTreeModule.SetIterator`1", [gen0], SetTreeModule_SetIterator$1, () => [["stack", list_type(option_type(SetTreeLeaf$1_$reflection(gen0)))], ["started", bool_type]]);
|
|
@@ -762,7 +769,7 @@ export function SetTreeModule_collapseLHS(stack_mut) {
|
|
|
762
769
|
const x = head(stack);
|
|
763
770
|
const rest = tail(stack);
|
|
764
771
|
if (x != null) {
|
|
765
|
-
const x2 =
|
|
772
|
+
const x2 = x;
|
|
766
773
|
if (x2 instanceof SetTreeNode$1) {
|
|
767
774
|
const xn = x2;
|
|
768
775
|
stack_mut = ofArrayWithTail([SetTreeNode$1__get_Left(xn), SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(xn)), SetTreeNode$1__get_Right(xn)], rest);
|
|
@@ -787,10 +794,10 @@ export function SetTreeModule_mkIterator(s) {
|
|
|
787
794
|
return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton_1(s)), false);
|
|
788
795
|
}
|
|
789
796
|
export function SetTreeModule_notStarted() {
|
|
790
|
-
throw
|
|
797
|
+
throw Operators_InvalidOp("Enumeration has not started. Call MoveNext.");
|
|
791
798
|
}
|
|
792
799
|
export function SetTreeModule_alreadyFinished() {
|
|
793
|
-
throw
|
|
800
|
+
throw Operators_InvalidOp("Enumeration already finished.");
|
|
794
801
|
}
|
|
795
802
|
export function SetTreeModule_current(i) {
|
|
796
803
|
if (i.started) {
|
|
@@ -799,7 +806,7 @@ export function SetTreeModule_current(i) {
|
|
|
799
806
|
return SetTreeModule_alreadyFinished();
|
|
800
807
|
}
|
|
801
808
|
else if (head(matchValue) != null) {
|
|
802
|
-
const t =
|
|
809
|
+
const t = head(matchValue);
|
|
803
810
|
return SetTreeLeaf$1__get_Key(t);
|
|
804
811
|
}
|
|
805
812
|
else {
|
|
@@ -815,7 +822,7 @@ export function SetTreeModule_moveNext(i) {
|
|
|
815
822
|
const matchValue = i.stack;
|
|
816
823
|
if (!isEmpty_1(matchValue)) {
|
|
817
824
|
if (head(matchValue) != null) {
|
|
818
|
-
const t =
|
|
825
|
+
const t = head(matchValue);
|
|
819
826
|
if (t instanceof SetTreeNode$1) {
|
|
820
827
|
throw new Exception("Please report error: Set iterator, unexpected stack for moveNext");
|
|
821
828
|
}
|
|
@@ -866,8 +873,8 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
866
873
|
if (!isEmpty_1(l2)) {
|
|
867
874
|
if (head(l2) != null) {
|
|
868
875
|
if (head(l1) != null) {
|
|
869
|
-
const x1_3 =
|
|
870
|
-
const x2_3 =
|
|
876
|
+
const x1_3 = head(l1);
|
|
877
|
+
const x2_3 = head(l2);
|
|
871
878
|
if (x1_3 instanceof SetTreeNode$1) {
|
|
872
879
|
const x1n_2 = x1_3;
|
|
873
880
|
if (SetTreeNode$1__get_Left(x1n_2) == null) {
|
|
@@ -891,13 +898,13 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
891
898
|
if (head(l1) != null) {
|
|
892
899
|
matchResult = 0;
|
|
893
900
|
t1_6 = tail(l1);
|
|
894
|
-
x1_4 =
|
|
901
|
+
x1_4 = head(l1);
|
|
895
902
|
}
|
|
896
903
|
else if (!isEmpty_1(l2)) {
|
|
897
904
|
if (head(l2) != null) {
|
|
898
905
|
matchResult = 1;
|
|
899
906
|
t2_6 = tail(l2);
|
|
900
|
-
x2_4 =
|
|
907
|
+
x2_4 = head(l2);
|
|
901
908
|
}
|
|
902
909
|
else {
|
|
903
910
|
matchResult = 2;
|
|
@@ -911,7 +918,7 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
911
918
|
if (head(l2) != null) {
|
|
912
919
|
matchResult = 1;
|
|
913
920
|
t2_6 = tail(l2);
|
|
914
|
-
x2_4 =
|
|
921
|
+
x2_4 = head(l2);
|
|
915
922
|
}
|
|
916
923
|
else {
|
|
917
924
|
matchResult = 2;
|
|
@@ -973,13 +980,13 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
973
980
|
if (head(l1) != null) {
|
|
974
981
|
matchResult_1 = 0;
|
|
975
982
|
t1_7 = tail(l1);
|
|
976
|
-
x1_5 =
|
|
983
|
+
x1_5 = head(l1);
|
|
977
984
|
}
|
|
978
985
|
else if (!isEmpty_1(l2)) {
|
|
979
986
|
if (head(l2) != null) {
|
|
980
987
|
matchResult_1 = 1;
|
|
981
988
|
t2_7 = tail(l2);
|
|
982
|
-
x2_5 =
|
|
989
|
+
x2_5 = head(l2);
|
|
983
990
|
}
|
|
984
991
|
else {
|
|
985
992
|
matchResult_1 = 2;
|
|
@@ -993,7 +1000,7 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
993
1000
|
if (head(l2) != null) {
|
|
994
1001
|
matchResult_1 = 1;
|
|
995
1002
|
t2_7 = tail(l2);
|
|
996
|
-
x2_5 =
|
|
1003
|
+
x2_5 = head(l2);
|
|
997
1004
|
}
|
|
998
1005
|
else {
|
|
999
1006
|
matchResult_1 = 2;
|
|
@@ -1056,13 +1063,13 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1056
1063
|
if (head(l1) != null) {
|
|
1057
1064
|
matchResult_2 = 0;
|
|
1058
1065
|
t1_8 = tail(l1);
|
|
1059
|
-
x1_6 =
|
|
1066
|
+
x1_6 = head(l1);
|
|
1060
1067
|
}
|
|
1061
1068
|
else if (!isEmpty_1(l2)) {
|
|
1062
1069
|
if (head(l2) != null) {
|
|
1063
1070
|
matchResult_2 = 1;
|
|
1064
1071
|
t2_8 = tail(l2);
|
|
1065
|
-
x2_6 =
|
|
1072
|
+
x2_6 = head(l2);
|
|
1066
1073
|
}
|
|
1067
1074
|
else {
|
|
1068
1075
|
matchResult_2 = 2;
|
|
@@ -1076,7 +1083,7 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1076
1083
|
if (head(l2) != null) {
|
|
1077
1084
|
matchResult_2 = 1;
|
|
1078
1085
|
t2_8 = tail(l2);
|
|
1079
|
-
x2_6 =
|
|
1086
|
+
x2_6 = head(l2);
|
|
1080
1087
|
}
|
|
1081
1088
|
else {
|
|
1082
1089
|
matchResult_2 = 2;
|
|
@@ -1133,19 +1140,19 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1133
1140
|
}
|
|
1134
1141
|
}
|
|
1135
1142
|
else {
|
|
1136
|
-
const x2 =
|
|
1143
|
+
const x2 = head(l2);
|
|
1137
1144
|
let matchResult_3 = undefined, t1_2 = undefined, x1 = undefined, t2_2 = undefined, x2_1 = undefined;
|
|
1138
1145
|
if (!isEmpty_1(l1)) {
|
|
1139
1146
|
if (head(l1) != null) {
|
|
1140
1147
|
matchResult_3 = 0;
|
|
1141
1148
|
t1_2 = tail(l1);
|
|
1142
|
-
x1 =
|
|
1149
|
+
x1 = head(l1);
|
|
1143
1150
|
}
|
|
1144
1151
|
else if (!isEmpty_1(l2)) {
|
|
1145
1152
|
if (head(l2) != null) {
|
|
1146
1153
|
matchResult_3 = 1;
|
|
1147
1154
|
t2_2 = tail(l2);
|
|
1148
|
-
x2_1 =
|
|
1155
|
+
x2_1 = head(l2);
|
|
1149
1156
|
}
|
|
1150
1157
|
else {
|
|
1151
1158
|
matchResult_3 = 2;
|
|
@@ -1159,7 +1166,7 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1159
1166
|
if (head(l2) != null) {
|
|
1160
1167
|
matchResult_3 = 1;
|
|
1161
1168
|
t2_2 = tail(l2);
|
|
1162
|
-
x2_1 =
|
|
1169
|
+
x2_1 = head(l2);
|
|
1163
1170
|
}
|
|
1164
1171
|
else {
|
|
1165
1172
|
matchResult_3 = 2;
|
|
@@ -1203,19 +1210,19 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1203
1210
|
}
|
|
1204
1211
|
}
|
|
1205
1212
|
else if (head(l1) != null) {
|
|
1206
|
-
const x1_1 =
|
|
1213
|
+
const x1_1 = head(l1);
|
|
1207
1214
|
let matchResult_4 = undefined, t1_4 = undefined, x1_2 = undefined, t2_4 = undefined, x2_2 = undefined;
|
|
1208
1215
|
if (!isEmpty_1(l1)) {
|
|
1209
1216
|
if (head(l1) != null) {
|
|
1210
1217
|
matchResult_4 = 0;
|
|
1211
1218
|
t1_4 = tail(l1);
|
|
1212
|
-
x1_2 =
|
|
1219
|
+
x1_2 = head(l1);
|
|
1213
1220
|
}
|
|
1214
1221
|
else if (!isEmpty_1(l2)) {
|
|
1215
1222
|
if (head(l2) != null) {
|
|
1216
1223
|
matchResult_4 = 1;
|
|
1217
1224
|
t2_4 = tail(l2);
|
|
1218
|
-
x2_2 =
|
|
1225
|
+
x2_2 = head(l2);
|
|
1219
1226
|
}
|
|
1220
1227
|
else {
|
|
1221
1228
|
matchResult_4 = 2;
|
|
@@ -1229,7 +1236,7 @@ export function SetTreeModule_compareStacks(comparer_mut, l1_mut, l2_mut) {
|
|
|
1229
1236
|
if (head(l2) != null) {
|
|
1230
1237
|
matchResult_4 = 1;
|
|
1231
1238
|
t2_4 = tail(l2);
|
|
1232
|
-
x2_2 =
|
|
1239
|
+
x2_2 = head(l2);
|
|
1233
1240
|
}
|
|
1234
1241
|
else {
|
|
1235
1242
|
matchResult_4 = 2;
|
|
@@ -1315,7 +1322,7 @@ export function SetTreeModule_toList(t) {
|
|
|
1315
1322
|
loop: while (true) {
|
|
1316
1323
|
const t$0027 = t$0027_mut, acc = acc_mut;
|
|
1317
1324
|
if (t$0027 != null) {
|
|
1318
|
-
const t2 =
|
|
1325
|
+
const t2 = t$0027;
|
|
1319
1326
|
if (t2 instanceof SetTreeNode$1) {
|
|
1320
1327
|
const tn = t2;
|
|
1321
1328
|
t$0027_mut = SetTreeNode$1__get_Left(tn);
|
package/String.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toString as dateToString } from "./Date.js";
|
|
2
|
-
import { compare as numericCompare, divide, isNumeric, isIntegral, multiply, toExponential, toFixed, toHex, toPrecision } from "./Numeric.js";
|
|
2
|
+
import { compare as numericCompare, divide, isNumeric, isIntegral, multiply, toExponential, toFixed, toHex, toPrecision, toRadix } from "./Numeric.js";
|
|
3
3
|
import { escape } from "./RegExp.js";
|
|
4
4
|
import { toString } from "./Types.js";
|
|
5
5
|
import { Exception } from "./Util.js";
|
|
@@ -207,19 +207,16 @@ function formatReplacement(rep, flags, padLength, precision, format) {
|
|
|
207
207
|
flags = flags || "";
|
|
208
208
|
format = format || "";
|
|
209
209
|
if (isNumeric(rep)) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
sign = "+";
|
|
221
|
-
}
|
|
222
|
-
}
|
|
210
|
+
const radix = format === "x" || format === "X" ? 16 : format === "o" ? 8 : 10;
|
|
211
|
+
if (radix === 10 && isLessThan(rep, 0)) {
|
|
212
|
+
rep = multiply(rep, -1);
|
|
213
|
+
sign = "-";
|
|
214
|
+
}
|
|
215
|
+
else if (flags.indexOf(" ") >= 0) {
|
|
216
|
+
sign = " ";
|
|
217
|
+
}
|
|
218
|
+
else if (flags.indexOf("+") >= 0) {
|
|
219
|
+
sign = "+";
|
|
223
220
|
}
|
|
224
221
|
precision = precision == null ? null : parseInt(precision, 10);
|
|
225
222
|
switch (format) {
|
|
@@ -237,10 +234,11 @@ function formatReplacement(rep, flags, padLength, precision, format) {
|
|
|
237
234
|
rep = precision != null ? toExponential(rep, precision) : toExponential(rep);
|
|
238
235
|
break;
|
|
239
236
|
case "x":
|
|
240
|
-
|
|
237
|
+
case "o":
|
|
238
|
+
rep = toRadix(rep, radix);
|
|
241
239
|
break;
|
|
242
240
|
case "X":
|
|
243
|
-
rep =
|
|
241
|
+
rep = toRadix(rep, radix).toUpperCase();
|
|
244
242
|
break;
|
|
245
243
|
default: // AOid
|
|
246
244
|
rep = String(rep);
|
|
@@ -5,6 +5,7 @@ import { toArray, empty, singleton, append, enumerateWhile, delay } from "./Seq.
|
|
|
5
5
|
import { setItem, initialize, copyTo, fill, item as item_1 } from "./Array.js";
|
|
6
6
|
import { max } from "./Double.js";
|
|
7
7
|
import { ArgumentOutOfRangeException_$ctor_Z721C83C5 } from "./System.js";
|
|
8
|
+
import { Operators_InvalidOp } from "./FSharp.Core.js";
|
|
8
9
|
export class KeyNotFoundException extends Exception {
|
|
9
10
|
constructor(message) {
|
|
10
11
|
super(message);
|
|
@@ -231,7 +232,7 @@ export function Queue$1__Enqueue_2B595(_, value) {
|
|
|
231
232
|
}
|
|
232
233
|
export function Queue$1__Dequeue(_) {
|
|
233
234
|
if (_.count === 0) {
|
|
234
|
-
throw
|
|
235
|
+
throw Operators_InvalidOp("Queue is empty");
|
|
235
236
|
}
|
|
236
237
|
const value = item_1(_.head, _.contents);
|
|
237
238
|
_.head = (((_.head + 1) % Queue$1__size(_)) | 0);
|
|
@@ -240,7 +241,7 @@ export function Queue$1__Dequeue(_) {
|
|
|
240
241
|
}
|
|
241
242
|
export function Queue$1__Peek(_) {
|
|
242
243
|
if (_.count === 0) {
|
|
243
|
-
throw
|
|
244
|
+
throw Operators_InvalidOp("Queue is empty");
|
|
244
245
|
}
|
|
245
246
|
return item_1(_.head, _.contents);
|
|
246
247
|
}
|
package/System.Text.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { replace, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
|
|
1
|
+
import { replace, getCharAtIndex, format, replicate, substring, isNullOrEmpty, join } from "./String.js";
|
|
2
2
|
import { class_type } from "./Reflection.js";
|
|
3
3
|
import { toString } from "./Types.js";
|
|
4
4
|
import { Exception, clear, int64ToString, int32ToString, int16ToString } from "./Util.js";
|
|
@@ -160,7 +160,7 @@ export function StringBuilder__get_Chars_Z524259A4(x, index) {
|
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
162
|
const pos = (index - len) | 0;
|
|
163
|
-
return item(i, x.buf)
|
|
163
|
+
return getCharAtIndex(item(i, x.buf), pos);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
export function StringBuilder__set_Chars_413E0D0A(x, index, value) {
|
package/TimeOnly.js
CHANGED
|
@@ -28,7 +28,7 @@ export function add(t, ts, wrappedDays) {
|
|
|
28
28
|
const t2 = (t + ts) % millisecondsPerDay;
|
|
29
29
|
return t2 < 0 ? millisecondsPerDay + t2 : t2;
|
|
30
30
|
}
|
|
31
|
-
wrappedDays.contents = ts / millisecondsPerDay;
|
|
31
|
+
wrappedDays.contents = Math.trunc(ts / millisecondsPerDay);
|
|
32
32
|
let newMs = t + ts % millisecondsPerDay;
|
|
33
33
|
if (newMs < 0) {
|
|
34
34
|
wrappedDays.contents--;
|
package/Types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Exception,
|
|
1
|
+
import { Exception, combineHashCode, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from "./Util.js";
|
|
2
2
|
export function seqToString(self) {
|
|
3
3
|
let count = 0;
|
|
4
4
|
let str = "[";
|
|
@@ -69,9 +69,11 @@ export class Union {
|
|
|
69
69
|
return unionToString(this.name, this.fields);
|
|
70
70
|
}
|
|
71
71
|
GetHashCode() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
let h = combineHashCode(0, numberHash(this.tag));
|
|
73
|
+
for (let i = 0; i < this.fields.length; i++) {
|
|
74
|
+
h = combineHashCode(h, structuralHash(this.fields[i]));
|
|
75
|
+
}
|
|
76
|
+
return h;
|
|
75
77
|
}
|
|
76
78
|
Equals(other) {
|
|
77
79
|
if (this === other) {
|
|
@@ -114,8 +116,13 @@ function recordToString(self) {
|
|
|
114
116
|
return "{ " + Object.entries(self).map(([k, v]) => k + " = " + toStringQuoted(v)).join("\n ") + " }";
|
|
115
117
|
}
|
|
116
118
|
function recordGetHashCode(self) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
// Snapshot all values before calling any user-defined hash functions.
|
|
120
|
+
const values = Object.values(self);
|
|
121
|
+
let hash = 0;
|
|
122
|
+
for (let i = 0; i < values.length; i++) {
|
|
123
|
+
hash = combineHashCode(hash, structuralHash(values[i]));
|
|
124
|
+
}
|
|
125
|
+
return hash;
|
|
119
126
|
}
|
|
120
127
|
function recordEquals(self, other) {
|
|
121
128
|
if (self === other) {
|
|
@@ -161,19 +168,27 @@ export class Record {
|
|
|
161
168
|
}
|
|
162
169
|
export class FSharpRef {
|
|
163
170
|
get contents() {
|
|
164
|
-
return this.getter();
|
|
171
|
+
return this.getter === undefined ? this.value : this.getter();
|
|
165
172
|
}
|
|
166
173
|
set contents(v) {
|
|
167
|
-
this.setter
|
|
174
|
+
if (this.setter === undefined) {
|
|
175
|
+
this.value = v;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.setter(v);
|
|
179
|
+
}
|
|
168
180
|
}
|
|
181
|
+
// Same field layout on both paths so every cell shares one hidden class
|
|
169
182
|
constructor(contentsOrGetter, setter) {
|
|
170
183
|
if (typeof setter === "function") {
|
|
171
184
|
this.getter = contentsOrGetter;
|
|
172
185
|
this.setter = setter;
|
|
186
|
+
this.value = undefined;
|
|
173
187
|
}
|
|
174
188
|
else {
|
|
175
|
-
this.getter =
|
|
176
|
-
this.setter =
|
|
189
|
+
this.getter = undefined;
|
|
190
|
+
this.setter = undefined;
|
|
191
|
+
this.value = contentsOrGetter;
|
|
177
192
|
}
|
|
178
193
|
}
|
|
179
194
|
}
|