firefly-compiler 0.4.20 → 0.4.21
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/compiler/Builder.ff +23 -13
- package/compiler/JsEmitter.ff +120 -76
- package/compiler/LspHook.ff +4 -2
- package/compiler/Main.ff +13 -7
- package/compiler/Resolver.ff +15 -15
- package/compiler/Syntax.ff +1 -0
- package/core/Array.ff +6 -4
- package/core/Int.ff +12 -12
- package/core/List.ff +6 -4
- package/experimental/benchmarks/ListGrab.ff +23 -0
- package/experimental/benchmarks/ListGrab.java +55 -0
- package/experimental/benchmarks/Pyrotek45.ff +30 -0
- package/experimental/benchmarks/Pyrotek45.java +64 -0
- package/experimental/tests/TestJson.ff +26 -0
- package/lsp/Handler.ff +55 -59
- package/lsp/SignatureHelpHandler.ff +5 -4
- package/lsp/TestReferences.ff +15 -0
- package/lsp/TestReferencesCase.ff +8 -0
- package/output/js/ff/compiler/Builder.mjs +50 -44
- package/output/js/ff/compiler/Dependencies.mjs +0 -2
- package/output/js/ff/compiler/Deriver.mjs +16 -140
- package/output/js/ff/compiler/Dictionaries.mjs +8 -222
- package/output/js/ff/compiler/Environment.mjs +12 -154
- package/output/js/ff/compiler/Inference.mjs +127 -1013
- package/output/js/ff/compiler/JsEmitter.mjs +434 -2344
- package/output/js/ff/compiler/JsImporter.mjs +0 -12
- package/output/js/ff/compiler/LspHook.mjs +20 -446
- package/output/js/ff/compiler/Main.mjs +96 -550
- package/output/js/ff/compiler/Parser.mjs +36 -356
- package/output/js/ff/compiler/Patterns.mjs +20 -200
- package/output/js/ff/compiler/Resolver.mjs +26 -340
- package/output/js/ff/compiler/Substitution.mjs +2 -160
- package/output/js/ff/compiler/Syntax.mjs +449 -3293
- package/output/js/ff/compiler/Token.mjs +9 -1095
- package/output/js/ff/compiler/Tokenizer.mjs +4 -2
- package/output/js/ff/compiler/Unification.mjs +26 -360
- package/output/js/ff/compiler/Wildcards.mjs +0 -86
- package/output/js/ff/compiler/Workspace.mjs +8 -96
- package/output/js/ff/core/Array.mjs +15 -8
- package/output/js/ff/core/AssetSystem.mjs +4 -14
- package/output/js/ff/core/Bool.mjs +0 -12
- package/output/js/ff/core/Core.mjs +0 -30
- package/output/js/ff/core/Int.mjs +24 -24
- package/output/js/ff/core/IntMap.mjs +0 -8
- package/output/js/ff/core/Json.mjs +0 -40
- package/output/js/ff/core/List.mjs +23 -32
- package/output/js/ff/core/Lock.mjs +0 -10
- package/output/js/ff/core/Map.mjs +0 -24
- package/output/js/ff/core/Option.mjs +10 -286
- package/output/js/ff/core/Ordering.mjs +16 -158
- package/output/js/ff/core/Pair.mjs +2 -34
- package/output/js/ff/core/Path.mjs +2 -28
- package/output/js/ff/core/Random.mjs +4 -4
- package/output/js/ff/core/RbMap.mjs +56 -644
- package/output/js/ff/core/Show.mjs +0 -16
- package/output/js/ff/core/Stream.mjs +14 -144
- package/output/js/ff/core/StringMap.mjs +0 -8
- package/output/js/ff/core/Try.mjs +4 -108
- package/output/js/ff/core/Unit.mjs +2 -16
- package/package.json +1 -1
- package/postgresql/Pg.ff +23 -23
- package/vscode/package.json +1 -1
|
@@ -278,13 +278,10 @@ return ff_core_IntMap.IntMap_grab(self_, key_)
|
|
|
278
278
|
export function IntMap_push(self_, key_, value_) {
|
|
279
279
|
{
|
|
280
280
|
const _1 = ff_core_IntMap.IntMap_get(self_, key_);
|
|
281
|
-
{
|
|
282
281
|
if(_1.None) {
|
|
283
282
|
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.List_toArray([value_]))
|
|
284
283
|
return
|
|
285
284
|
}
|
|
286
|
-
}
|
|
287
|
-
{
|
|
288
285
|
if(_1.Some) {
|
|
289
286
|
const array_ = _1.value_;
|
|
290
287
|
ff_core_Array.Array_push(array_, value_)
|
|
@@ -292,18 +289,14 @@ return
|
|
|
292
289
|
}
|
|
293
290
|
}
|
|
294
291
|
}
|
|
295
|
-
}
|
|
296
292
|
|
|
297
293
|
export async function IntMap_push$(self_, key_, value_, $task) {
|
|
298
294
|
{
|
|
299
295
|
const _1 = ff_core_IntMap.IntMap_get(self_, key_);
|
|
300
|
-
{
|
|
301
296
|
if(_1.None) {
|
|
302
297
|
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.List_toArray([value_]))
|
|
303
298
|
return
|
|
304
299
|
}
|
|
305
|
-
}
|
|
306
|
-
{
|
|
307
300
|
if(_1.Some) {
|
|
308
301
|
const array_ = _1.value_;
|
|
309
302
|
ff_core_Array.Array_push(array_, value_)
|
|
@@ -311,7 +304,6 @@ return
|
|
|
311
304
|
}
|
|
312
305
|
}
|
|
313
306
|
}
|
|
314
|
-
}
|
|
315
307
|
|
|
316
308
|
|
|
317
309
|
|
|
@@ -726,26 +726,20 @@ toJson_(value_) {
|
|
|
726
726
|
return ff_core_Json.string_(value_)
|
|
727
727
|
},
|
|
728
728
|
fromJson_(json_) {
|
|
729
|
-
{
|
|
730
729
|
const json_a = json_;
|
|
731
730
|
{
|
|
732
731
|
const _w1 = json_a;
|
|
733
732
|
return ff_core_Json.Json_getString(_w1)
|
|
734
|
-
return
|
|
735
|
-
}
|
|
736
733
|
}
|
|
737
734
|
},
|
|
738
735
|
async toJson_$(value_, $task) {
|
|
739
736
|
return ff_core_Json.string_(value_)
|
|
740
737
|
},
|
|
741
738
|
async fromJson_$(json_, $task) {
|
|
742
|
-
{
|
|
743
739
|
const json_a = json_;
|
|
744
740
|
{
|
|
745
741
|
const _w1 = json_a;
|
|
746
742
|
return ff_core_Json.Json_getString(_w1)
|
|
747
|
-
return
|
|
748
|
-
}
|
|
749
743
|
}
|
|
750
744
|
}
|
|
751
745
|
};
|
|
@@ -755,26 +749,20 @@ toJson_(value_) {
|
|
|
755
749
|
return ff_core_Json.int_(value_)
|
|
756
750
|
},
|
|
757
751
|
fromJson_(json_) {
|
|
758
|
-
{
|
|
759
752
|
const json_a = json_;
|
|
760
753
|
{
|
|
761
754
|
const _w1 = json_a;
|
|
762
755
|
return ff_core_Json.Json_getInt(_w1)
|
|
763
|
-
return
|
|
764
|
-
}
|
|
765
756
|
}
|
|
766
757
|
},
|
|
767
758
|
async toJson_$(value_, $task) {
|
|
768
759
|
return ff_core_Json.int_(value_)
|
|
769
760
|
},
|
|
770
761
|
async fromJson_$(json_, $task) {
|
|
771
|
-
{
|
|
772
762
|
const json_a = json_;
|
|
773
763
|
{
|
|
774
764
|
const _w1 = json_a;
|
|
775
765
|
return ff_core_Json.Json_getInt(_w1)
|
|
776
|
-
return
|
|
777
|
-
}
|
|
778
766
|
}
|
|
779
767
|
}
|
|
780
768
|
};
|
|
@@ -784,26 +772,20 @@ toJson_(value_) {
|
|
|
784
772
|
return ff_core_Json.float_(value_)
|
|
785
773
|
},
|
|
786
774
|
fromJson_(json_) {
|
|
787
|
-
{
|
|
788
775
|
const json_a = json_;
|
|
789
776
|
{
|
|
790
777
|
const _w1 = json_a;
|
|
791
778
|
return ff_core_Json.Json_getFloat(_w1)
|
|
792
|
-
return
|
|
793
|
-
}
|
|
794
779
|
}
|
|
795
780
|
},
|
|
796
781
|
async toJson_$(value_, $task) {
|
|
797
782
|
return ff_core_Json.float_(value_)
|
|
798
783
|
},
|
|
799
784
|
async fromJson_$(json_, $task) {
|
|
800
|
-
{
|
|
801
785
|
const json_a = json_;
|
|
802
786
|
{
|
|
803
787
|
const _w1 = json_a;
|
|
804
788
|
return ff_core_Json.Json_getFloat(_w1)
|
|
805
|
-
return
|
|
806
|
-
}
|
|
807
789
|
}
|
|
808
790
|
}
|
|
809
791
|
};
|
|
@@ -813,26 +795,20 @@ toJson_(value_) {
|
|
|
813
795
|
return ff_core_Json.bool_(value_)
|
|
814
796
|
},
|
|
815
797
|
fromJson_(json_) {
|
|
816
|
-
{
|
|
817
798
|
const json_a = json_;
|
|
818
799
|
{
|
|
819
800
|
const _w1 = json_a;
|
|
820
801
|
return ff_core_Json.Json_getBool(_w1)
|
|
821
|
-
return
|
|
822
|
-
}
|
|
823
802
|
}
|
|
824
803
|
},
|
|
825
804
|
async toJson_$(value_, $task) {
|
|
826
805
|
return ff_core_Json.bool_(value_)
|
|
827
806
|
},
|
|
828
807
|
async fromJson_$(json_, $task) {
|
|
829
|
-
{
|
|
830
808
|
const json_a = json_;
|
|
831
809
|
{
|
|
832
810
|
const _w1 = json_a;
|
|
833
811
|
return ff_core_Json.Json_getBool(_w1)
|
|
834
|
-
return
|
|
835
|
-
}
|
|
836
812
|
}
|
|
837
813
|
}
|
|
838
814
|
};
|
|
@@ -850,19 +826,15 @@ const result_ = ff_core_Array.make_();
|
|
|
850
826
|
ff_core_List.List_eachWhile(array_, ((item_) => {
|
|
851
827
|
do {
|
|
852
828
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(item_);
|
|
853
|
-
{
|
|
854
829
|
if(_1.None) {
|
|
855
830
|
convertible_ = false
|
|
856
831
|
break
|
|
857
832
|
}
|
|
858
|
-
}
|
|
859
|
-
{
|
|
860
833
|
if(_1.Some) {
|
|
861
834
|
const value_ = _1.value_;
|
|
862
835
|
ff_core_Array.Array_push(result_, value_)
|
|
863
836
|
break
|
|
864
837
|
}
|
|
865
|
-
}
|
|
866
838
|
} while(false);
|
|
867
839
|
return convertible_
|
|
868
840
|
}));
|
|
@@ -883,19 +855,15 @@ const result_ = ff_core_Array.make_();
|
|
|
883
855
|
ff_core_List.List_eachWhile(array_, ((item_) => {
|
|
884
856
|
do {
|
|
885
857
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(item_);
|
|
886
|
-
{
|
|
887
858
|
if(_1.None) {
|
|
888
859
|
convertible_ = false
|
|
889
860
|
break
|
|
890
861
|
}
|
|
891
|
-
}
|
|
892
|
-
{
|
|
893
862
|
if(_1.Some) {
|
|
894
863
|
const value_ = _1.value_;
|
|
895
864
|
ff_core_Array.Array_push(result_, value_)
|
|
896
865
|
break
|
|
897
866
|
}
|
|
898
|
-
}
|
|
899
867
|
} while(false);
|
|
900
868
|
return convertible_
|
|
901
869
|
}));
|
|
@@ -922,19 +890,15 @@ let convertible_ = true;
|
|
|
922
890
|
ff_core_Json.Json_eachWhile(json_, ((key_, value_) => {
|
|
923
891
|
do {
|
|
924
892
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(value_);
|
|
925
|
-
{
|
|
926
893
|
if(_1.None) {
|
|
927
894
|
convertible_ = false
|
|
928
895
|
break
|
|
929
896
|
}
|
|
930
|
-
}
|
|
931
|
-
{
|
|
932
897
|
if(_1.Some) {
|
|
933
898
|
const v_ = _1.value_;
|
|
934
899
|
ff_core_StringMap.StringMap_set(map_, key_, v_)
|
|
935
900
|
break
|
|
936
901
|
}
|
|
937
|
-
}
|
|
938
902
|
} while(false);
|
|
939
903
|
return convertible_
|
|
940
904
|
}));
|
|
@@ -959,19 +923,15 @@ let convertible_ = true;
|
|
|
959
923
|
ff_core_Json.Json_eachWhile(json_, ((key_, value_) => {
|
|
960
924
|
do {
|
|
961
925
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(value_);
|
|
962
|
-
{
|
|
963
926
|
if(_1.None) {
|
|
964
927
|
convertible_ = false
|
|
965
928
|
break
|
|
966
929
|
}
|
|
967
|
-
}
|
|
968
|
-
{
|
|
969
930
|
if(_1.Some) {
|
|
970
931
|
const v_ = _1.value_;
|
|
971
932
|
ff_core_StringMap.StringMap_set(map_, key_, v_)
|
|
972
933
|
break
|
|
973
934
|
}
|
|
974
|
-
}
|
|
975
935
|
} while(false);
|
|
976
936
|
return convertible_
|
|
977
937
|
}));
|
|
@@ -123,6 +123,12 @@ export function internalSame_(left_, right_) {
|
|
|
123
123
|
return left_ === right_
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
export function internalGrab_(self_, index_) {
|
|
127
|
+
|
|
128
|
+
return index_ < 0 || index_ >= self_.length ? ff_core_Try.internalThrowGrabException_() : self_[index_];
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
126
132
|
export async function empty_$($task) {
|
|
127
133
|
throw new Error('Function empty is missing on this target in async context.');
|
|
128
134
|
}
|
|
@@ -149,6 +155,10 @@ export async function internalSame_$(left_, right_, $task) {
|
|
|
149
155
|
throw new Error('Function internalSame is missing on this target in async context.');
|
|
150
156
|
}
|
|
151
157
|
|
|
158
|
+
export async function internalGrab_$(self_, index_, $task) {
|
|
159
|
+
throw new Error('Function internalGrab is missing on this target in async context.');
|
|
160
|
+
}
|
|
161
|
+
|
|
152
162
|
export function List_addAll(self_, that_) {
|
|
153
163
|
return self_.concat(that_)
|
|
154
164
|
}
|
|
@@ -171,10 +181,7 @@ export function List_get(self_, index_) {
|
|
|
171
181
|
|
|
172
182
|
export function List_grab(self_, index_) {
|
|
173
183
|
|
|
174
|
-
|
|
175
|
-
ff_core_Try.internalThrowGrabException_()
|
|
176
|
-
}
|
|
177
|
-
return self_[index_]
|
|
184
|
+
return self_[index_] ?? internalGrab_(self_, index_);
|
|
178
185
|
|
|
179
186
|
}
|
|
180
187
|
|
|
@@ -253,13 +260,13 @@ if((ff_core_List.List_size(self_) <= ff_core_List.List_size(that_))) {
|
|
|
253
260
|
let i_ = (-1);
|
|
254
261
|
return ff_core_List.List_map(self_, ((x_) => {
|
|
255
262
|
i_ += 1;
|
|
256
|
-
return ff_core_Pair.Pair(x_, ff_core_List.
|
|
263
|
+
return ff_core_Pair.Pair(x_, (that_[i_] ?? ff_core_List.internalGrab_(that_, i_)))
|
|
257
264
|
}))
|
|
258
265
|
} else {
|
|
259
266
|
let i_ = (-1);
|
|
260
267
|
return ff_core_List.List_map(that_, ((y_) => {
|
|
261
268
|
i_ += 1;
|
|
262
|
-
return ff_core_Pair.Pair(ff_core_List.
|
|
269
|
+
return ff_core_Pair.Pair((self_[i_] ?? ff_core_List.internalGrab_(self_, i_)), y_)
|
|
263
270
|
}))
|
|
264
271
|
}
|
|
265
272
|
}
|
|
@@ -288,7 +295,7 @@ let index_ = 0;
|
|
|
288
295
|
return ff_core_Stream.make_((() => {
|
|
289
296
|
if((index_ < ff_core_List.List_size(self_))) {
|
|
290
297
|
return ff_core_Option.Some((function() {
|
|
291
|
-
const result_ = ff_core_List.
|
|
298
|
+
const result_ = (self_[index_] ?? ff_core_List.internalGrab_(self_, index_));
|
|
292
299
|
index_ += 1;
|
|
293
300
|
return result_
|
|
294
301
|
})())
|
|
@@ -394,17 +401,13 @@ let result_ = ff_core_Option.None();
|
|
|
394
401
|
ff_core_List.List_eachWhile(self_, ((x_) => {
|
|
395
402
|
{
|
|
396
403
|
const _1 = body_(x_);
|
|
397
|
-
{
|
|
398
404
|
if(_1.None) {
|
|
399
405
|
return true
|
|
400
|
-
return
|
|
401
|
-
}
|
|
402
406
|
}
|
|
403
407
|
{
|
|
404
408
|
const o_ = _1;
|
|
405
409
|
result_ = o_;
|
|
406
410
|
return false
|
|
407
|
-
return
|
|
408
411
|
}
|
|
409
412
|
}
|
|
410
413
|
}));
|
|
@@ -540,13 +543,13 @@ if((ff_core_List.List_size(self_) <= ff_core_List.List_size(that_))) {
|
|
|
540
543
|
let i_ = (-1);
|
|
541
544
|
return ff_core_List.List_map(self_, ((x_) => {
|
|
542
545
|
i_ += 1;
|
|
543
|
-
return ff_core_Pair.Pair(x_, ff_core_List.
|
|
546
|
+
return ff_core_Pair.Pair(x_, (that_[i_] ?? ff_core_List.internalGrab_(that_, i_)))
|
|
544
547
|
}))
|
|
545
548
|
} else {
|
|
546
549
|
let i_ = (-1);
|
|
547
550
|
return ff_core_List.List_map(that_, ((y_) => {
|
|
548
551
|
i_ += 1;
|
|
549
|
-
return ff_core_Pair.Pair(ff_core_List.
|
|
552
|
+
return ff_core_Pair.Pair((self_[i_] ?? ff_core_List.internalGrab_(self_, i_)), y_)
|
|
550
553
|
}))
|
|
551
554
|
}
|
|
552
555
|
}
|
|
@@ -575,7 +578,7 @@ let index_ = 0;
|
|
|
575
578
|
return (await ff_core_Stream.make_$((async ($task) => {
|
|
576
579
|
if((index_ < ff_core_List.List_size(self_))) {
|
|
577
580
|
return ff_core_Option.Some((await (async function() {
|
|
578
|
-
const result_ = ff_core_List.
|
|
581
|
+
const result_ = (self_[index_] ?? ff_core_List.internalGrab_(self_, index_));
|
|
579
582
|
index_ += 1;
|
|
580
583
|
return result_
|
|
581
584
|
})()))
|
|
@@ -687,17 +690,13 @@ let result_ = ff_core_Option.None();
|
|
|
687
690
|
(await ff_core_List.List_eachWhile$(self_, (async (x_, $task) => {
|
|
688
691
|
{
|
|
689
692
|
const _1 = (await body_(x_, $task));
|
|
690
|
-
{
|
|
691
693
|
if(_1.None) {
|
|
692
694
|
return true
|
|
693
|
-
return
|
|
694
|
-
}
|
|
695
695
|
}
|
|
696
696
|
{
|
|
697
697
|
const o_ = _1;
|
|
698
698
|
result_ = o_;
|
|
699
699
|
return false
|
|
700
|
-
return
|
|
701
700
|
}
|
|
702
701
|
}
|
|
703
702
|
}), $task));
|
|
@@ -755,16 +754,13 @@ let seen_ = ff_core_List.List_toSet([], ff_core_Ordering_Order$T);
|
|
|
755
754
|
return ff_core_List.List_filter(self_, ((_1) => {
|
|
756
755
|
{
|
|
757
756
|
const item_ = _1;
|
|
758
|
-
|
|
759
|
-
if(_guard1) {
|
|
757
|
+
if((!ff_core_Set.Set_contains(seen_, item_, ff_core_Ordering_Order$T))) {
|
|
760
758
|
seen_ = ff_core_Set.Set_add(seen_, item_, ff_core_Ordering_Order$T);
|
|
761
759
|
return true
|
|
762
|
-
return
|
|
763
760
|
}
|
|
764
761
|
}
|
|
765
762
|
{
|
|
766
763
|
return false
|
|
767
|
-
return
|
|
768
764
|
}
|
|
769
765
|
}))
|
|
770
766
|
}
|
|
@@ -786,16 +782,13 @@ let seen_ = ff_core_List.List_toSet([], ff_core_Ordering_Order$T);
|
|
|
786
782
|
return ff_core_List.List_filter(self_, ((_1) => {
|
|
787
783
|
{
|
|
788
784
|
const item_ = _1;
|
|
789
|
-
|
|
790
|
-
if(_guard1) {
|
|
785
|
+
if((!ff_core_Set.Set_contains(seen_, item_, ff_core_Ordering_Order$T))) {
|
|
791
786
|
seen_ = ff_core_Set.Set_add(seen_, item_, ff_core_Ordering_Order$T);
|
|
792
787
|
return true
|
|
793
|
-
return
|
|
794
788
|
}
|
|
795
789
|
}
|
|
796
790
|
{
|
|
797
791
|
return false
|
|
798
|
-
return
|
|
799
792
|
}
|
|
800
793
|
}))
|
|
801
794
|
}
|
|
@@ -823,7 +816,6 @@ const map_ = _1;
|
|
|
823
816
|
const key_ = _2.first_;
|
|
824
817
|
const value_ = _2.second_;
|
|
825
818
|
return ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering_Order$K)
|
|
826
|
-
return
|
|
827
819
|
}
|
|
828
820
|
}))
|
|
829
821
|
}
|
|
@@ -850,7 +842,6 @@ const map_ = _1;
|
|
|
850
842
|
const key_ = _2.first_;
|
|
851
843
|
const value_ = _2.second_;
|
|
852
844
|
return ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering_Order$K)
|
|
853
|
-
return
|
|
854
845
|
}
|
|
855
846
|
}))
|
|
856
847
|
}
|
|
@@ -946,7 +937,7 @@ return false
|
|
|
946
937
|
let i_ = (-1);
|
|
947
938
|
return ff_core_List.List_all(x_, ((l_) => {
|
|
948
939
|
i_ += 1;
|
|
949
|
-
return ff_core_Equal_Equal$T.equals_(l_, ff_core_List.
|
|
940
|
+
return ff_core_Equal_Equal$T.equals_(l_, (y_[i_] ?? ff_core_List.internalGrab_(y_, i_)))
|
|
950
941
|
}))
|
|
951
942
|
}
|
|
952
943
|
}
|
|
@@ -961,7 +952,7 @@ return false
|
|
|
961
952
|
let i_ = (-1);
|
|
962
953
|
return ff_core_List.List_all(x_, ((l_) => {
|
|
963
954
|
i_ += 1;
|
|
964
|
-
return ff_core_Equal_Equal$T.equals_(l_, ff_core_List.
|
|
955
|
+
return ff_core_Equal_Equal$T.equals_(l_, (y_[i_] ?? ff_core_List.internalGrab_(y_, i_)))
|
|
965
956
|
}))
|
|
966
957
|
}
|
|
967
958
|
}
|
|
@@ -977,7 +968,7 @@ const size_ = ff_core_Int.Int_min(ff_core_List.List_size(x_), ff_core_List.List_
|
|
|
977
968
|
let i_ = 0;
|
|
978
969
|
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
979
970
|
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
980
|
-
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_List.
|
|
971
|
+
ordering_ = ff_core_Ordering_Order$T.compare_((x_[i_] ?? ff_core_List.internalGrab_(x_, i_)), (y_[i_] ?? ff_core_List.internalGrab_(y_, i_)));
|
|
981
972
|
i_ += 1
|
|
982
973
|
};
|
|
983
974
|
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
@@ -995,7 +986,7 @@ const size_ = ff_core_Int.Int_min(ff_core_List.List_size(x_), ff_core_List.List_
|
|
|
995
986
|
let i_ = 0;
|
|
996
987
|
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
997
988
|
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
998
|
-
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_List.
|
|
989
|
+
ordering_ = ff_core_Ordering_Order$T.compare_((x_[i_] ?? ff_core_List.internalGrab_(x_, i_)), (y_[i_] ?? ff_core_List.internalGrab_(y_, i_)));
|
|
999
990
|
i_ += 1
|
|
1000
991
|
};
|
|
1001
992
|
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
@@ -196,14 +196,10 @@ export function LockCondition_sleepUntil(self_, body_) {
|
|
|
196
196
|
_tailcall: for(;;) {
|
|
197
197
|
{
|
|
198
198
|
const _1 = body_();
|
|
199
|
-
{
|
|
200
199
|
if(_1.Some) {
|
|
201
200
|
const value_ = _1.value_;
|
|
202
201
|
return value_
|
|
203
|
-
return
|
|
204
|
-
}
|
|
205
202
|
}
|
|
206
|
-
{
|
|
207
203
|
if(_1.None) {
|
|
208
204
|
ff_core_Lock.LockCondition_sleep(self_);
|
|
209
205
|
{
|
|
@@ -216,7 +212,6 @@ continue _tailcall
|
|
|
216
212
|
return
|
|
217
213
|
}
|
|
218
214
|
}
|
|
219
|
-
}
|
|
220
215
|
return
|
|
221
216
|
}
|
|
222
217
|
}
|
|
@@ -268,14 +263,10 @@ export async function LockCondition_sleepUntil$(self_, body_, $task) {
|
|
|
268
263
|
_tailcall: for(;;) {
|
|
269
264
|
{
|
|
270
265
|
const _1 = (await body_($task));
|
|
271
|
-
{
|
|
272
266
|
if(_1.Some) {
|
|
273
267
|
const value_ = _1.value_;
|
|
274
268
|
return value_
|
|
275
|
-
return
|
|
276
|
-
}
|
|
277
269
|
}
|
|
278
|
-
{
|
|
279
270
|
if(_1.None) {
|
|
280
271
|
(await ff_core_Lock.LockCondition_sleep$(self_, $task));
|
|
281
272
|
{
|
|
@@ -288,7 +279,6 @@ continue _tailcall
|
|
|
288
279
|
return
|
|
289
280
|
}
|
|
290
281
|
}
|
|
291
|
-
}
|
|
292
282
|
return
|
|
293
283
|
}
|
|
294
284
|
}
|
|
@@ -179,18 +179,12 @@ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Order
|
|
|
179
179
|
export function Map_updateOrInsert(self_, key_, update_, default_, ff_core_Ordering_Order$K) {
|
|
180
180
|
{
|
|
181
181
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
182
|
-
{
|
|
183
182
|
if(_1.None) {
|
|
184
183
|
return ff_core_Map.Map_add(self_, key_, default_(), ff_core_Ordering_Order$K)
|
|
185
|
-
return
|
|
186
|
-
}
|
|
187
184
|
}
|
|
188
|
-
{
|
|
189
185
|
if(_1.Some) {
|
|
190
186
|
const v_ = _1.value_;
|
|
191
187
|
return ff_core_Map.Map_add(self_, key_, update_(v_), ff_core_Ordering_Order$K)
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
188
|
}
|
|
195
189
|
}
|
|
196
190
|
}
|
|
@@ -282,18 +276,12 @@ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Order
|
|
|
282
276
|
export async function Map_updateOrInsert$(self_, key_, update_, default_, ff_core_Ordering_Order$K, $task) {
|
|
283
277
|
{
|
|
284
278
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
285
|
-
{
|
|
286
279
|
if(_1.None) {
|
|
287
280
|
return ff_core_Map.Map_add(self_, key_, (await default_($task)), ff_core_Ordering_Order$K)
|
|
288
|
-
return
|
|
289
|
-
}
|
|
290
281
|
}
|
|
291
|
-
{
|
|
292
282
|
if(_1.Some) {
|
|
293
283
|
const v_ = _1.value_;
|
|
294
284
|
return ff_core_Map.Map_add(self_, key_, (await update_(v_, $task)), ff_core_Ordering_Order$K)
|
|
295
|
-
return
|
|
296
|
-
}
|
|
297
285
|
}
|
|
298
286
|
}
|
|
299
287
|
}
|
|
@@ -329,19 +317,13 @@ return [value_]
|
|
|
329
317
|
export function Map_push(self_, key_, value_, ff_core_Ordering_Order$K) {
|
|
330
318
|
{
|
|
331
319
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
332
|
-
{
|
|
333
320
|
if(_1.None) {
|
|
334
321
|
return ff_core_Map.Map_add(self_, key_, ff_core_List.List_toArray([value_]), ff_core_Ordering_Order$K)
|
|
335
|
-
return
|
|
336
|
-
}
|
|
337
322
|
}
|
|
338
|
-
{
|
|
339
323
|
if(_1.Some) {
|
|
340
324
|
const array_ = _1.value_;
|
|
341
325
|
ff_core_Array.Array_push(array_, value_);
|
|
342
326
|
return self_
|
|
343
|
-
return
|
|
344
|
-
}
|
|
345
327
|
}
|
|
346
328
|
}
|
|
347
329
|
}
|
|
@@ -349,19 +331,13 @@ return
|
|
|
349
331
|
export async function Map_push$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
|
|
350
332
|
{
|
|
351
333
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
352
|
-
{
|
|
353
334
|
if(_1.None) {
|
|
354
335
|
return ff_core_Map.Map_add(self_, key_, ff_core_List.List_toArray([value_]), ff_core_Ordering_Order$K)
|
|
355
|
-
return
|
|
356
|
-
}
|
|
357
336
|
}
|
|
358
|
-
{
|
|
359
337
|
if(_1.Some) {
|
|
360
338
|
const array_ = _1.value_;
|
|
361
339
|
ff_core_Array.Array_push(array_, value_);
|
|
362
340
|
return self_
|
|
363
|
-
return
|
|
364
|
-
}
|
|
365
341
|
}
|
|
366
342
|
}
|
|
367
343
|
}
|