firefly-compiler 0.4.31 → 0.4.33
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/bin/Release.ff +6 -0
- package/compiler/Builder.ff +15 -7
- package/compiler/Compiler.ff +13 -8
- package/compiler/Dependencies.ff +24 -17
- package/compiler/DependencyLock.ff +17 -0
- package/compiler/Deriver.ff +2 -1
- package/compiler/Dictionaries.ff +4 -4
- package/compiler/Environment.ff +3 -3
- package/compiler/Inference.ff +7 -7
- package/compiler/JsEmitter.ff +2 -2
- package/compiler/JsImporter.ff +2 -2
- package/compiler/LspHook.ff +2 -2
- package/compiler/Main.ff +22 -8
- package/compiler/ModuleCache.ff +6 -6
- package/compiler/Parser.ff +36 -36
- package/compiler/Resolver.ff +7 -7
- package/compiler/Syntax.ff +1 -1
- package/compiler/Tokenizer.ff +2 -2
- package/compiler/Unification.ff +3 -3
- package/compiler/Wildcards.ff +1 -1
- package/core/.firefly/include/package-lock.json +96 -96
- package/core/.firefly/include/package.json +1 -1
- package/core/Array.ff +2 -2
- package/core/Atomic.ff +1 -1
- package/core/Buffer.ff +1 -1
- package/core/Int.ff +2 -2
- package/core/IntMap.ff +4 -4
- package/core/Json.ff +5 -5
- package/core/List.ff +15 -15
- package/core/Map.ff +1 -1
- package/core/NodeSystem.ff +89 -0
- package/core/Option.ff +10 -3
- package/core/Random.ff +1 -1
- package/core/RbMap.ff +1 -1
- package/core/Serializable.ff +2 -2
- package/core/Set.ff +2 -2
- package/core/Stream.ff +4 -4
- package/core/StringMap.ff +4 -4
- package/experimental/random/Index.ff +53 -0
- package/experimental/random/MapTest.ff +2 -2
- package/experimental/random/Process.ff +120 -0
- package/experimental/random/RunLength.ff +2 -2
- package/experimental/random/Symbols.ff +2 -2
- package/lsp/CompletionHandler.ff +3 -6
- package/lsp/Handler.ff +45 -24
- package/lsp/LanguageServer.ff +13 -3
- package/lsp/SymbolHandler.ff +2 -2
- package/lsp/TestReferences.ff +2 -2
- package/lux/Lux.ff +6 -6
- package/output/js/ff/compiler/Builder.mjs +40 -28
- package/output/js/ff/compiler/Compiler.mjs +38 -14
- package/output/js/ff/compiler/Dependencies.mjs +30 -16
- package/output/js/ff/compiler/DependencyLock.mjs +128 -0
- package/output/js/ff/compiler/Deriver.mjs +4 -4
- package/output/js/ff/compiler/Dictionaries.mjs +8 -8
- package/output/js/ff/compiler/Environment.mjs +6 -6
- package/output/js/ff/compiler/Inference.mjs +12 -12
- package/output/js/ff/compiler/JsEmitter.mjs +4 -4
- package/output/js/ff/compiler/JsImporter.mjs +4 -4
- package/output/js/ff/compiler/LspHook.mjs +4 -4
- package/output/js/ff/compiler/Main.mjs +14 -12
- package/output/js/ff/compiler/ModuleCache.mjs +4 -4
- package/output/js/ff/compiler/Parser.mjs +72 -72
- package/output/js/ff/compiler/Resolver.mjs +14 -14
- package/output/js/ff/compiler/Syntax.mjs +2 -2
- package/output/js/ff/compiler/Tokenizer.mjs +4 -4
- package/output/js/ff/compiler/Unification.mjs +4 -4
- package/output/js/ff/compiler/Wildcards.mjs +2 -2
- package/output/js/ff/core/Array.mjs +5 -5
- package/output/js/ff/core/Atomic.mjs +3 -3
- package/output/js/ff/core/Buffer.mjs +3 -3
- package/output/js/ff/core/Int.mjs +4 -4
- package/output/js/ff/core/IntMap.mjs +9 -9
- package/output/js/ff/core/Json.mjs +10 -10
- package/output/js/ff/core/List.mjs +31 -31
- package/output/js/ff/core/Map.mjs +2 -2
- package/output/js/ff/core/NodeSystem.mjs +115 -0
- package/output/js/ff/core/Option.mjs +28 -2
- package/output/js/ff/core/Random.mjs +2 -2
- package/output/js/ff/core/RbMap.mjs +2 -2
- package/output/js/ff/core/Serializable.mjs +4 -4
- package/output/js/ff/core/Set.mjs +4 -4
- package/output/js/ff/core/Stream.mjs +8 -8
- package/output/js/ff/core/StringMap.mjs +9 -9
- package/package.json +1 -1
- package/postgresql/Pg.ff +2 -2
- package/rpc/Rpc.ff +3 -3
- package/vscode/package.json +1 -1
- package/webserver/WebServer.ff +2 -2
- package/httpserver/.firefly/package.ff +0 -1
- package/httpserver/HttpServer.ff +0 -184
|
@@ -115,13 +115,13 @@ return _w1.column_
|
|
|
115
115
|
})), (() => {
|
|
116
116
|
return (-1)
|
|
117
117
|
}));
|
|
118
|
-
const tokens_ = ff_core_Array.
|
|
118
|
+
const tokens_ = ff_core_Array.new_();
|
|
119
119
|
let line_ = 1;
|
|
120
120
|
let lineOffset_ = 0;
|
|
121
121
|
let startLine_ = line_;
|
|
122
122
|
let startLineOffset_ = lineOffset_;
|
|
123
123
|
const operatorCharactersString_ = "!@#$%&/=?+|^~*<>.:-;";
|
|
124
|
-
let operatorCharacters_ = ff_core_Set.
|
|
124
|
+
let operatorCharacters_ = ff_core_Set.new_();
|
|
125
125
|
ff_core_List.List_map(ff_core_List.range_(ff_core_String.String_size(operatorCharactersString_)), ((j_) => {
|
|
126
126
|
operatorCharacters_ = ff_core_Set.Set_add(operatorCharacters_, ff_core_String.String_grab(operatorCharactersString_, j_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)
|
|
127
127
|
}));
|
|
@@ -359,13 +359,13 @@ return _w1.column_
|
|
|
359
359
|
})), (() => {
|
|
360
360
|
return (-1)
|
|
361
361
|
}));
|
|
362
|
-
const tokens_ = ff_core_Array.
|
|
362
|
+
const tokens_ = ff_core_Array.new_();
|
|
363
363
|
let line_ = 1;
|
|
364
364
|
let lineOffset_ = 0;
|
|
365
365
|
let startLine_ = line_;
|
|
366
366
|
let startLineOffset_ = lineOffset_;
|
|
367
367
|
const operatorCharactersString_ = "!@#$%&/=?+|^~*<>.:-;";
|
|
368
|
-
let operatorCharacters_ = ff_core_Set.
|
|
368
|
+
let operatorCharacters_ = ff_core_Set.new_();
|
|
369
369
|
ff_core_List.List_map(ff_core_List.range_(ff_core_String.String_size(operatorCharactersString_)), ((j_) => {
|
|
370
370
|
operatorCharacters_ = ff_core_Set.Set_add(operatorCharacters_, ff_core_String.String_grab(operatorCharactersString_, j_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)
|
|
371
371
|
}));
|
|
@@ -120,8 +120,8 @@ export function fail_(at_, message_) {
|
|
|
120
120
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, message_), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
export function
|
|
124
|
-
return ff_compiler_Unification.Unification(ff_core_Map.
|
|
123
|
+
export function new_(modules_, attemptFixes_) {
|
|
124
|
+
return ff_compiler_Unification.Unification(ff_core_Map.new_(), ff_core_Map.new_(), 3, ff_core_List.List_toMap(ff_core_List.List_flatMap(modules_, ((module_) => {
|
|
125
125
|
const moduleName_ = ff_core_String.String_dropLast(module_.file_, ff_core_String.String_size(".ff"));
|
|
126
126
|
return ff_core_List.List_map(module_.instances_, ((definition_) => {
|
|
127
127
|
const typeName_ = (((_1) => {
|
|
@@ -143,8 +143,8 @@ export async function fail_$(at_, message_, $task) {
|
|
|
143
143
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, message_), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export async function
|
|
147
|
-
return ff_compiler_Unification.Unification(ff_core_Map.
|
|
146
|
+
export async function new_$(modules_, attemptFixes_, $task) {
|
|
147
|
+
return ff_compiler_Unification.Unification(ff_core_Map.new_(), ff_core_Map.new_(), 3, ff_core_List.List_toMap(ff_core_List.List_flatMap(modules_, ((module_) => {
|
|
148
148
|
const moduleName_ = ff_core_String.String_dropLast(module_.file_, ff_core_String.String_size(".ff"));
|
|
149
149
|
return ff_core_List.List_map(module_.instances_, ((definition_) => {
|
|
150
150
|
const typeName_ = (((_1) => {
|
|
@@ -99,7 +99,7 @@ return {seenWildcards_};
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
export function
|
|
102
|
+
export function new_() {
|
|
103
103
|
return ff_compiler_Wildcards.Wildcards(0)
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -107,7 +107,7 @@ export function fail_(at_, message_) {
|
|
|
107
107
|
return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
export async function
|
|
110
|
+
export async function new_$($task) {
|
|
111
111
|
return ff_compiler_Wildcards.Wildcards(0)
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -93,7 +93,7 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function new_() {
|
|
97
97
|
return {array: []}
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -149,8 +149,8 @@ export function internalGrab_(self_, index_) {
|
|
|
149
149
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export async function
|
|
153
|
-
throw new Error('Function
|
|
152
|
+
export async function new_$($task) {
|
|
153
|
+
throw new Error('Function new is missing on this target in async context.');
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export async function fill_$(size_, value_, $task) {
|
|
@@ -586,7 +586,7 @@ throw new Error('Function Array_join is missing on this target in async context.
|
|
|
586
586
|
|
|
587
587
|
export function ff_core_Show_Show$ff_core_Array_Array(ff_core_Show_Show$T) { return {
|
|
588
588
|
show_(value_) {
|
|
589
|
-
const array_ = ff_core_Array.
|
|
589
|
+
const array_ = ff_core_Array.new_();
|
|
590
590
|
ff_core_Array.Array_push(array_, "[");
|
|
591
591
|
ff_core_Array.Array_each(value_, ((x_) => {
|
|
592
592
|
if((ff_core_Array.Array_size(array_) > 1)) {
|
|
@@ -598,7 +598,7 @@ ff_core_Array.Array_push(array_, "].toArray()");
|
|
|
598
598
|
return ff_core_Array.Array_join(array_, "")
|
|
599
599
|
},
|
|
600
600
|
async show_$(value_, $task) {
|
|
601
|
-
const array_ = ff_core_Array.
|
|
601
|
+
const array_ = ff_core_Array.new_();
|
|
602
602
|
ff_core_Array.Array_push(array_, "[");
|
|
603
603
|
ff_core_Array.Array_each(value_, ((x_) => {
|
|
604
604
|
if((ff_core_Array.Array_size(array_) > 1)) {
|
|
@@ -93,14 +93,14 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function new_(value_) {
|
|
97
97
|
|
|
98
98
|
return {value: value_}
|
|
99
99
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export async function
|
|
103
|
-
throw new Error('Function
|
|
102
|
+
export async function new_$(value_, $task) {
|
|
103
|
+
throw new Error('Function new is missing on this target in async context.');
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export function Atomic_modify(self_, body_) {
|
|
@@ -93,7 +93,7 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function new_(size_, shared_ = false) {
|
|
97
97
|
return new DataView(shared_ ? new SharedArrayBuffer(size_) : new ArrayBuffer(size_))
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -133,8 +133,8 @@ export function fromBase64_(base64_) {
|
|
|
133
133
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export async function
|
|
137
|
-
throw new Error('Function
|
|
136
|
+
export async function new_$(size_, shared_ = false, $task) {
|
|
137
|
+
throw new Error('Function new is missing on this target in async context.');
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export async function fromByteArray_$(array_, $task) {
|
|
@@ -130,7 +130,7 @@ return signed_ ? self_ >> bits_ : self_ >>> bits_;
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export function Int_to(self_, inclusiveEnd_) {
|
|
133
|
-
const result_ = ff_core_Array.
|
|
133
|
+
const result_ = ff_core_Array.new_();
|
|
134
134
|
let n_ = self_;
|
|
135
135
|
while((n_ <= inclusiveEnd_)) {
|
|
136
136
|
ff_core_Array.Array_push(result_, n_);
|
|
@@ -140,7 +140,7 @@ return ff_core_Array.Array_drain(result_)
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
export function Int_until(self_, exclusiveEnd_) {
|
|
143
|
-
const result_ = ff_core_Array.
|
|
143
|
+
const result_ = ff_core_Array.new_();
|
|
144
144
|
let n_ = self_;
|
|
145
145
|
while((n_ < exclusiveEnd_)) {
|
|
146
146
|
ff_core_Array.Array_push(result_, n_);
|
|
@@ -212,7 +212,7 @@ throw new Error('Function Int_bitRight is missing on this target in async contex
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
export async function Int_to$(self_, inclusiveEnd_, $task) {
|
|
215
|
-
const result_ = ff_core_Array.
|
|
215
|
+
const result_ = ff_core_Array.new_();
|
|
216
216
|
let n_ = self_;
|
|
217
217
|
while((n_ <= inclusiveEnd_)) {
|
|
218
218
|
ff_core_Array.Array_push(result_, n_);
|
|
@@ -222,7 +222,7 @@ return ff_core_Array.Array_drain(result_)
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export async function Int_until$(self_, exclusiveEnd_, $task) {
|
|
225
|
-
const result_ = ff_core_Array.
|
|
225
|
+
const result_ = ff_core_Array.new_();
|
|
226
226
|
let n_ = self_;
|
|
227
227
|
while((n_ < exclusiveEnd_)) {
|
|
228
228
|
ff_core_Array.Array_push(result_, n_);
|
|
@@ -93,12 +93,12 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function new_() {
|
|
97
97
|
return new Map()
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export async function
|
|
101
|
-
throw new Error('Function
|
|
100
|
+
export async function new_$($task) {
|
|
101
|
+
throw new Error('Function new is missing on this target in async context.');
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
export function IntMap_get(self_, key_) {
|
|
@@ -144,7 +144,7 @@ for(const [k, v] of self_) if(!body_(k, v)) break
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
export function IntMap_toArray(self_) {
|
|
147
|
-
const array_ = ff_core_Array.
|
|
147
|
+
const array_ = ff_core_Array.new_();
|
|
148
148
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
149
149
|
ff_core_Array.Array_push(array_, ff_core_Pair.Pair(k_, v_))
|
|
150
150
|
}));
|
|
@@ -164,7 +164,7 @@ return ff_core_List.List_toMap(ff_core_IntMap.IntMap_toList(self_), ff_core_Orde
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
export function IntMap_keys(self_) {
|
|
167
|
-
const array_ = ff_core_Array.
|
|
167
|
+
const array_ = ff_core_Array.new_();
|
|
168
168
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
169
169
|
ff_core_Array.Array_push(array_, k_)
|
|
170
170
|
}));
|
|
@@ -172,7 +172,7 @@ return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
export function IntMap_values(self_) {
|
|
175
|
-
const array_ = ff_core_Array.
|
|
175
|
+
const array_ = ff_core_Array.new_();
|
|
176
176
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
177
177
|
ff_core_Array.Array_push(array_, v_)
|
|
178
178
|
}));
|
|
@@ -227,7 +227,7 @@ for(const [k, v] of self_) if(!await body_(k, v)) break
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
export async function IntMap_toArray$(self_, $task) {
|
|
230
|
-
const array_ = ff_core_Array.
|
|
230
|
+
const array_ = ff_core_Array.new_();
|
|
231
231
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
232
232
|
ff_core_Array.Array_push(array_, ff_core_Pair.Pair(k_, v_))
|
|
233
233
|
}));
|
|
@@ -247,7 +247,7 @@ return ff_core_List.List_toMap(ff_core_IntMap.IntMap_toList(self_), ff_core_Orde
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
export async function IntMap_keys$(self_, $task) {
|
|
250
|
-
const array_ = ff_core_Array.
|
|
250
|
+
const array_ = ff_core_Array.new_();
|
|
251
251
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
252
252
|
ff_core_Array.Array_push(array_, k_)
|
|
253
253
|
}));
|
|
@@ -255,7 +255,7 @@ return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
export async function IntMap_values$(self_, $task) {
|
|
258
|
-
const array_ = ff_core_Array.
|
|
258
|
+
const array_ = ff_core_Array.new_();
|
|
259
259
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
260
260
|
ff_core_Array.Array_push(array_, v_)
|
|
261
261
|
}));
|
|
@@ -356,7 +356,7 @@ export function Json_grabArray(self_) {
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
export function Json_grabMap(self_) {
|
|
359
|
-
let map_ = ff_core_Map.
|
|
359
|
+
let map_ = ff_core_Map.new_();
|
|
360
360
|
ff_core_Json.Json_each(self_, ((key_, value_) => {
|
|
361
361
|
map_ = ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
362
362
|
}));
|
|
@@ -499,7 +499,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.G
|
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
export function Json_map(self_, body_) {
|
|
502
|
-
const array_ = ff_core_Array.
|
|
502
|
+
const array_ = ff_core_Array.new_();
|
|
503
503
|
ff_core_Json.Json_each(self_, ((field_, value_) => {
|
|
504
504
|
ff_core_Array.Array_push(array_, body_(field_, value_))
|
|
505
505
|
}));
|
|
@@ -507,7 +507,7 @@ return ff_core_Array.Array_drain(array_)
|
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
export function Json_flatMap(self_, body_) {
|
|
510
|
-
const array_ = ff_core_Array.
|
|
510
|
+
const array_ = ff_core_Array.new_();
|
|
511
511
|
ff_core_Json.Json_each(self_, ((field_, value_) => {
|
|
512
512
|
ff_core_Array.Array_pushList(array_, body_(field_, value_))
|
|
513
513
|
}));
|
|
@@ -561,7 +561,7 @@ throw new Error('Function Json_grabArray is missing on this target in async cont
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
export async function Json_grabMap$(self_, $task) {
|
|
564
|
-
let map_ = ff_core_Map.
|
|
564
|
+
let map_ = ff_core_Map.new_();
|
|
565
565
|
ff_core_Json.Json_each(self_, ((key_, value_) => {
|
|
566
566
|
map_ = ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
|
|
567
567
|
}));
|
|
@@ -675,7 +675,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Core.G
|
|
|
675
675
|
}
|
|
676
676
|
|
|
677
677
|
export async function Json_map$(self_, body_, $task) {
|
|
678
|
-
const array_ = ff_core_Array.
|
|
678
|
+
const array_ = ff_core_Array.new_();
|
|
679
679
|
(await ff_core_Json.Json_each$(self_, (async (field_, value_, $task) => {
|
|
680
680
|
ff_core_Array.Array_push(array_, (await body_(field_, value_, $task)))
|
|
681
681
|
}), $task));
|
|
@@ -683,7 +683,7 @@ return ff_core_Array.Array_drain(array_)
|
|
|
683
683
|
}
|
|
684
684
|
|
|
685
685
|
export async function Json_flatMap$(self_, body_, $task) {
|
|
686
|
-
const array_ = ff_core_Array.
|
|
686
|
+
const array_ = ff_core_Array.new_();
|
|
687
687
|
(await ff_core_Json.Json_each$(self_, (async (field_, value_, $task) => {
|
|
688
688
|
ff_core_Array.Array_pushList(array_, (await body_(field_, value_, $task)))
|
|
689
689
|
}), $task));
|
|
@@ -820,7 +820,7 @@ return ff_core_Json_JsonLike$T.toJson_(value_)
|
|
|
820
820
|
fromJson_(json_) {
|
|
821
821
|
return ff_core_Option.Option_flatMap(ff_core_Json.Json_getArray(json_), ((array_) => {
|
|
822
822
|
let convertible_ = true;
|
|
823
|
-
const result_ = ff_core_Array.
|
|
823
|
+
const result_ = ff_core_Array.new_();
|
|
824
824
|
ff_core_List.List_eachWhile(array_, ((item_) => {
|
|
825
825
|
do {
|
|
826
826
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(item_);
|
|
@@ -849,7 +849,7 @@ return ff_core_Json_JsonLike$T.toJson_(value_)
|
|
|
849
849
|
async fromJson_$(json_, $task) {
|
|
850
850
|
return ff_core_Option.Option_flatMap(ff_core_Json.Json_getArray(json_), ((array_) => {
|
|
851
851
|
let convertible_ = true;
|
|
852
|
-
const result_ = ff_core_Array.
|
|
852
|
+
const result_ = ff_core_Array.new_();
|
|
853
853
|
ff_core_List.List_eachWhile(array_, ((item_) => {
|
|
854
854
|
do {
|
|
855
855
|
const _1 = ff_core_Json_JsonLike$T.fromJson_(item_);
|
|
@@ -883,7 +883,7 @@ setField_(key_, ff_core_Json_JsonLike$T.toJson_(value_))
|
|
|
883
883
|
fromJson_(json_) {
|
|
884
884
|
return ff_core_Option.Option_flatten((ff_core_Json.Json_isObject(json_)
|
|
885
885
|
? ff_core_Option.Some((function() {
|
|
886
|
-
const map_ = ff_core_StringMap.
|
|
886
|
+
const map_ = ff_core_StringMap.new_();
|
|
887
887
|
let convertible_ = true;
|
|
888
888
|
ff_core_Json.Json_eachWhile(json_, ((key_, value_) => {
|
|
889
889
|
do {
|
|
@@ -916,7 +916,7 @@ setField_(key_, ff_core_Json_JsonLike$T.toJson_(value_))
|
|
|
916
916
|
async fromJson_$(json_, $task) {
|
|
917
917
|
return ff_core_Option.Option_flatten((ff_core_Json.Json_isObject(json_)
|
|
918
918
|
? ff_core_Option.Some((await (async function() {
|
|
919
|
-
const map_ = ff_core_StringMap.
|
|
919
|
+
const map_ = ff_core_StringMap.new_();
|
|
920
920
|
let convertible_ = true;
|
|
921
921
|
ff_core_Json.Json_eachWhile(json_, ((key_, value_) => {
|
|
922
922
|
do {
|
|
@@ -93,7 +93,7 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function new_() {
|
|
97
97
|
|
|
98
98
|
return [];
|
|
99
99
|
|
|
@@ -127,8 +127,8 @@ export function internalGrab_(self_, index_) {
|
|
|
127
127
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
export async function
|
|
131
|
-
throw new Error('Function
|
|
130
|
+
export async function new_$($task) {
|
|
131
|
+
throw new Error('Function new is missing on this target in async context.');
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export async function fill_$(size_, value_, $task) {
|
|
@@ -270,8 +270,8 @@ return ff_core_Pair.Pair((self_[i_] ?? ff_core_List.internalGrab_(self_, i_)), y
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
export function List_chunk(self_, chunkSize_) {
|
|
273
|
-
const results_ = ff_core_Array.
|
|
274
|
-
const result_ = ff_core_Array.
|
|
273
|
+
const results_ = ff_core_Array.new_();
|
|
274
|
+
const result_ = ff_core_Array.new_();
|
|
275
275
|
let added_ = 0;
|
|
276
276
|
ff_core_List.List_each(self_, ((item_) => {
|
|
277
277
|
if((added_ < chunkSize_)) {
|
|
@@ -290,7 +290,7 @@ return ff_core_Array.Array_drain(results_)
|
|
|
290
290
|
|
|
291
291
|
export function List_toStream(self_, cycle_ = false) {
|
|
292
292
|
let index_ = 0;
|
|
293
|
-
return ff_core_Stream.
|
|
293
|
+
return ff_core_Stream.new_((() => {
|
|
294
294
|
if((index_ < ff_core_List.List_size(self_))) {
|
|
295
295
|
return ff_core_Option.Some((function() {
|
|
296
296
|
const result_ = (self_[index_] ?? ff_core_List.internalGrab_(self_, index_));
|
|
@@ -355,7 +355,7 @@ return result_
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
export function List_filter(self_, body_) {
|
|
358
|
-
const result_ = ff_core_Array.
|
|
358
|
+
const result_ = ff_core_Array.new_();
|
|
359
359
|
ff_core_List.List_each(self_, ((x_) => {
|
|
360
360
|
if(body_(x_)) {
|
|
361
361
|
ff_core_Array.Array_push(result_, x_)
|
|
@@ -377,7 +377,7 @@ export function List_map(self_, body_) {
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
export function List_flatMap(self_, body_) {
|
|
380
|
-
const results_ = ff_core_Array.
|
|
380
|
+
const results_ = ff_core_Array.new_();
|
|
381
381
|
ff_core_List.List_each(self_, ((x_) => {
|
|
382
382
|
ff_core_Array.Array_pushList(results_, body_(x_))
|
|
383
383
|
}));
|
|
@@ -385,7 +385,7 @@ return ff_core_Array.Array_drain(results_)
|
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
export function List_collect(self_, body_) {
|
|
388
|
-
let result_ = ff_core_Array.
|
|
388
|
+
let result_ = ff_core_Array.new_();
|
|
389
389
|
ff_core_List.List_each(self_, ((x_) => {
|
|
390
390
|
ff_core_Option.Option_each(body_(x_), ((_w1) => {
|
|
391
391
|
ff_core_Array.Array_push(result_, _w1)
|
|
@@ -431,7 +431,7 @@ return ff_core_List.List_grab(self_, (ff_core_List.List_size(self_) - i_))
|
|
|
431
431
|
}
|
|
432
432
|
|
|
433
433
|
export function List_separate(self_, separator_) {
|
|
434
|
-
const array_ = ff_core_Array.
|
|
434
|
+
const array_ = ff_core_Array.new_();
|
|
435
435
|
ff_core_List.List_each(ff_core_List.List_pairs(self_), ((_1) => {
|
|
436
436
|
{
|
|
437
437
|
const i_ = _1.first_;
|
|
@@ -553,8 +553,8 @@ return ff_core_Pair.Pair((self_[i_] ?? ff_core_List.internalGrab_(self_, i_)), y
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
export async function List_chunk$(self_, chunkSize_, $task) {
|
|
556
|
-
const results_ = ff_core_Array.
|
|
557
|
-
const result_ = ff_core_Array.
|
|
556
|
+
const results_ = ff_core_Array.new_();
|
|
557
|
+
const result_ = ff_core_Array.new_();
|
|
558
558
|
let added_ = 0;
|
|
559
559
|
ff_core_List.List_each(self_, ((item_) => {
|
|
560
560
|
if((added_ < chunkSize_)) {
|
|
@@ -573,7 +573,7 @@ return ff_core_Array.Array_drain(results_)
|
|
|
573
573
|
|
|
574
574
|
export async function List_toStream$(self_, cycle_ = false, $task) {
|
|
575
575
|
let index_ = 0;
|
|
576
|
-
return (await ff_core_Stream.
|
|
576
|
+
return (await ff_core_Stream.new_$((async ($task) => {
|
|
577
577
|
if((index_ < ff_core_List.List_size(self_))) {
|
|
578
578
|
return ff_core_Option.Some((await (async function() {
|
|
579
579
|
const result_ = (self_[index_] ?? ff_core_List.internalGrab_(self_, index_));
|
|
@@ -640,7 +640,7 @@ return result_
|
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
export async function List_filter$(self_, body_, $task) {
|
|
643
|
-
const result_ = ff_core_Array.
|
|
643
|
+
const result_ = ff_core_Array.new_();
|
|
644
644
|
(await ff_core_List.List_each$(self_, (async (x_, $task) => {
|
|
645
645
|
if((await body_(x_, $task))) {
|
|
646
646
|
ff_core_Array.Array_push(result_, x_)
|
|
@@ -666,7 +666,7 @@ export async function List_map$(self_, body_, $task) {
|
|
|
666
666
|
}
|
|
667
667
|
|
|
668
668
|
export async function List_flatMap$(self_, body_, $task) {
|
|
669
|
-
const results_ = ff_core_Array.
|
|
669
|
+
const results_ = ff_core_Array.new_();
|
|
670
670
|
(await ff_core_List.List_each$(self_, (async (x_, $task) => {
|
|
671
671
|
ff_core_Array.Array_pushList(results_, (await body_(x_, $task)))
|
|
672
672
|
}), $task));
|
|
@@ -674,7 +674,7 @@ return ff_core_Array.Array_drain(results_)
|
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
export async function List_collect$(self_, body_, $task) {
|
|
677
|
-
let result_ = ff_core_Array.
|
|
677
|
+
let result_ = ff_core_Array.new_();
|
|
678
678
|
(await ff_core_List.List_each$(self_, (async (x_, $task) => {
|
|
679
679
|
ff_core_Option.Option_each((await body_(x_, $task)), ((_w1) => {
|
|
680
680
|
ff_core_Array.Array_push(result_, _w1)
|
|
@@ -720,7 +720,7 @@ return ff_core_List.List_grab(self_, (ff_core_List.List_size(self_) - i_))
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
export async function List_separate$(self_, separator_, $task) {
|
|
723
|
-
const array_ = ff_core_Array.
|
|
723
|
+
const array_ = ff_core_Array.new_();
|
|
724
724
|
ff_core_List.List_each(ff_core_List.List_pairs(self_), ((_1) => {
|
|
725
725
|
{
|
|
726
726
|
const i_ = _1.first_;
|
|
@@ -742,7 +742,7 @@ return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
|
742
742
|
}
|
|
743
743
|
|
|
744
744
|
export function List_toSet(self_, ff_core_Ordering_Order$T) {
|
|
745
|
-
return ff_core_List.List_foldLeft(self_, ff_core_Set.
|
|
745
|
+
return ff_core_List.List_foldLeft(self_, ff_core_Set.new_(), ((_w1, _w2) => {
|
|
746
746
|
return ff_core_Set.Set_add(_w1, _w2, ff_core_Ordering_Order$T)
|
|
747
747
|
}))
|
|
748
748
|
}
|
|
@@ -770,7 +770,7 @@ return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
export async function List_toSet$(self_, ff_core_Ordering_Order$T, $task) {
|
|
773
|
-
return ff_core_List.List_foldLeft(self_, ff_core_Set.
|
|
773
|
+
return ff_core_List.List_foldLeft(self_, ff_core_Set.new_(), ((_w1, _w2) => {
|
|
774
774
|
return ff_core_Set.Set_add(_w1, _w2, ff_core_Ordering_Order$T)
|
|
775
775
|
}))
|
|
776
776
|
}
|
|
@@ -792,7 +792,7 @@ return false
|
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
export function List_flatten(self_) {
|
|
795
|
-
const result_ = ff_core_Array.
|
|
795
|
+
const result_ = ff_core_Array.new_();
|
|
796
796
|
ff_core_List.List_each(self_, ((xs_) => {
|
|
797
797
|
ff_core_Array.Array_pushList(result_, xs_)
|
|
798
798
|
}));
|
|
@@ -800,7 +800,7 @@ return ff_core_Array.Array_drain(result_)
|
|
|
800
800
|
}
|
|
801
801
|
|
|
802
802
|
export async function List_flatten$(self_, $task) {
|
|
803
|
-
const result_ = ff_core_Array.
|
|
803
|
+
const result_ = ff_core_Array.new_();
|
|
804
804
|
ff_core_List.List_each(self_, ((xs_) => {
|
|
805
805
|
ff_core_Array.Array_pushList(result_, xs_)
|
|
806
806
|
}));
|
|
@@ -808,7 +808,7 @@ return ff_core_Array.Array_drain(result_)
|
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
export function List_toMap(self_, ff_core_Ordering_Order$K) {
|
|
811
|
-
return ff_core_List.List_foldLeft(self_, ff_core_Map.
|
|
811
|
+
return ff_core_List.List_foldLeft(self_, ff_core_Map.new_(), ((_1, _2) => {
|
|
812
812
|
{
|
|
813
813
|
const map_ = _1;
|
|
814
814
|
const key_ = _2.first_;
|
|
@@ -819,7 +819,7 @@ return ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering_Order$K)
|
|
|
819
819
|
}
|
|
820
820
|
|
|
821
821
|
export function List_group(self_, ff_core_Ordering_Order$K) {
|
|
822
|
-
let map_ = ff_core_Map.
|
|
822
|
+
let map_ = ff_core_Map.new_();
|
|
823
823
|
ff_core_List.List_each(self_, ((_1) => {
|
|
824
824
|
{
|
|
825
825
|
const k_ = _1.first_;
|
|
@@ -834,7 +834,7 @@ return ff_core_Array.Array_drain(v_)
|
|
|
834
834
|
}
|
|
835
835
|
|
|
836
836
|
export async function List_toMap$(self_, ff_core_Ordering_Order$K, $task) {
|
|
837
|
-
return ff_core_List.List_foldLeft(self_, ff_core_Map.
|
|
837
|
+
return ff_core_List.List_foldLeft(self_, ff_core_Map.new_(), ((_1, _2) => {
|
|
838
838
|
{
|
|
839
839
|
const map_ = _1;
|
|
840
840
|
const key_ = _2.first_;
|
|
@@ -845,7 +845,7 @@ return ff_core_Map.Map_add(map_, key_, value_, ff_core_Ordering_Order$K)
|
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
export async function List_group$(self_, ff_core_Ordering_Order$K, $task) {
|
|
848
|
-
let map_ = ff_core_Map.
|
|
848
|
+
let map_ = ff_core_Map.new_();
|
|
849
849
|
ff_core_List.List_each(self_, ((_1) => {
|
|
850
850
|
{
|
|
851
851
|
const k_ = _1.first_;
|
|
@@ -860,8 +860,8 @@ return ff_core_Array.Array_drain(v_)
|
|
|
860
860
|
}
|
|
861
861
|
|
|
862
862
|
export function List_unzip(self_) {
|
|
863
|
-
const first_ = ff_core_Array.
|
|
864
|
-
const second_ = ff_core_Array.
|
|
863
|
+
const first_ = ff_core_Array.new_();
|
|
864
|
+
const second_ = ff_core_Array.new_();
|
|
865
865
|
ff_core_List.List_each(self_, ((_1) => {
|
|
866
866
|
{
|
|
867
867
|
const x_ = _1.first_;
|
|
@@ -875,8 +875,8 @@ return ff_core_Pair.Pair(ff_core_Array.Array_drain(first_), ff_core_Array.Array_
|
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
export async function List_unzip$(self_, $task) {
|
|
878
|
-
const first_ = ff_core_Array.
|
|
879
|
-
const second_ = ff_core_Array.
|
|
878
|
+
const first_ = ff_core_Array.new_();
|
|
879
|
+
const second_ = ff_core_Array.new_();
|
|
880
880
|
ff_core_List.List_each(self_, ((_1) => {
|
|
881
881
|
{
|
|
882
882
|
const x_ = _1.first_;
|
|
@@ -899,7 +899,7 @@ throw new Error('Function List_join is missing on this target in async context.'
|
|
|
899
899
|
|
|
900
900
|
export function ff_core_Show_Show$ff_core_List_List(ff_core_Show_Show$T) { return {
|
|
901
901
|
show_(value_) {
|
|
902
|
-
const array_ = ff_core_Array.
|
|
902
|
+
const array_ = ff_core_Array.new_();
|
|
903
903
|
ff_core_Array.Array_push(array_, "[");
|
|
904
904
|
ff_core_List.List_each(value_, ((x_) => {
|
|
905
905
|
if((ff_core_Array.Array_size(array_) > 1)) {
|
|
@@ -911,7 +911,7 @@ ff_core_Array.Array_push(array_, "]");
|
|
|
911
911
|
return ff_core_Array.Array_join(array_, "")
|
|
912
912
|
},
|
|
913
913
|
async show_$(value_, $task) {
|
|
914
|
-
const array_ = ff_core_Array.
|
|
914
|
+
const array_ = ff_core_Array.new_();
|
|
915
915
|
ff_core_Array.Array_push(array_, "[");
|
|
916
916
|
ff_core_List.List_each(value_, ((x_) => {
|
|
917
917
|
if((ff_core_Array.Array_size(array_) > 1)) {
|
|
@@ -94,11 +94,11 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
export function
|
|
97
|
+
export function new_() {
|
|
98
98
|
return ff_core_RbMap.E()
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export async function
|
|
101
|
+
export async function new_$($task) {
|
|
102
102
|
return ff_core_RbMap.E()
|
|
103
103
|
}
|
|
104
104
|
|