firefly-compiler 0.4.18 → 0.4.19
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 +1 -1
- package/compiler/Compiler.ff +6 -5
- package/compiler/Inference.ff +31 -19
- package/compiler/JsEmitter.ff +98 -71
- package/compiler/JsImporter.ff +1 -1
- package/compiler/LspHook.ff +4 -4
- package/compiler/Main.ff +6 -6
- package/compiler/Parser.ff +39 -39
- package/compiler/Patterns.ff +2 -0
- package/compiler/Syntax.ff +1 -1
- package/compiler/Tokenizer.ff +2 -2
- package/compiler/Workspace.ff +2 -2
- package/core/Array.ff +135 -294
- package/core/Buffer.ff +3 -3
- package/core/BuildSystem.ff +1 -1
- package/core/Equal.ff +36 -52
- package/core/HttpClient.ff +1 -1
- package/core/IntMap.ff +14 -18
- package/core/JsSystem.ff +1 -1
- package/core/JsValue.ff +6 -12
- package/core/Json.ff +19 -28
- package/core/List.ff +281 -312
- package/core/Map.ff +4 -8
- package/core/NodeSystem.ff +2 -2
- package/core/Option.ff +0 -4
- package/core/Ordering.ff +10 -6
- package/core/Pair.ff +0 -4
- package/core/Random.ff +12 -26
- package/core/RbMap.ff +216 -216
- package/core/Serializable.ff +9 -18
- package/core/Set.ff +0 -1
- package/core/SourceLocation.ff +1 -1
- package/core/Stack.ff +32 -45
- package/core/Stream.ff +10 -14
- package/core/String.ff +24 -6
- package/core/StringMap.ff +15 -19
- package/guide/Main.ff +20 -2
- package/lsp/CompletionHandler.ff +4 -4
- package/lsp/Handler.ff +44 -33
- package/lsp/HoverHandler.ff +2 -2
- package/lsp/LanguageServer.ff +2 -2
- package/lsp/SignatureHelpHandler.ff +1 -1
- package/lsp/SymbolHandler.ff +1 -1
- package/lux/Lux.ff +3 -3
- package/output/js/ff/compiler/Builder.mjs +19 -21
- package/output/js/ff/compiler/Compiler.mjs +18 -20
- package/output/js/ff/compiler/Dependencies.mjs +8 -10
- package/output/js/ff/compiler/Deriver.mjs +234 -236
- package/output/js/ff/compiler/Dictionaries.mjs +6 -8
- package/output/js/ff/compiler/Environment.mjs +42 -44
- package/output/js/ff/compiler/Inference.mjs +346 -304
- package/output/js/ff/compiler/JsEmitter.mjs +907 -833
- package/output/js/ff/compiler/JsImporter.mjs +0 -2
- package/output/js/ff/compiler/LspHook.mjs +10 -12
- package/output/js/ff/compiler/Main.mjs +109 -111
- package/output/js/ff/compiler/Parser.mjs +405 -407
- package/output/js/ff/compiler/Patterns.mjs +64 -50
- package/output/js/ff/compiler/Resolver.mjs +36 -38
- package/output/js/ff/compiler/Substitution.mjs +4 -6
- package/output/js/ff/compiler/Syntax.mjs +160 -162
- package/output/js/ff/compiler/Token.mjs +52 -54
- package/output/js/ff/compiler/Tokenizer.mjs +16 -18
- package/output/js/ff/compiler/Unification.mjs +24 -26
- package/output/js/ff/compiler/Wildcards.mjs +0 -2
- package/output/js/ff/compiler/Workspace.mjs +18 -20
- package/output/js/ff/core/Any.mjs +0 -2
- package/output/js/ff/core/Array.mjs +216 -613
- package/output/js/ff/core/AssetSystem.mjs +2 -4
- package/output/js/ff/core/Atomic.mjs +0 -2
- package/output/js/ff/core/Bool.mjs +0 -2
- package/output/js/ff/core/Box.mjs +0 -2
- package/output/js/ff/core/BrowserSystem.mjs +0 -2
- package/output/js/ff/core/Buffer.mjs +0 -2
- package/output/js/ff/core/BuildSystem.mjs +12 -14
- package/output/js/ff/core/Channel.mjs +0 -2
- package/output/js/ff/core/Char.mjs +0 -2
- package/output/js/ff/core/Core.mjs +0 -2
- package/output/js/ff/core/Duration.mjs +0 -2
- package/output/js/ff/core/Equal.mjs +0 -22
- package/output/js/ff/core/Error.mjs +0 -2
- package/output/js/ff/core/FileHandle.mjs +0 -2
- package/output/js/ff/core/Float.mjs +0 -2
- package/output/js/ff/core/HttpClient.mjs +2 -4
- package/output/js/ff/core/Instant.mjs +0 -2
- package/output/js/ff/core/Int.mjs +8 -10
- package/output/js/ff/core/IntMap.mjs +32 -42
- package/output/js/ff/core/JsSystem.mjs +1 -3
- package/output/js/ff/core/JsValue.mjs +5 -12
- package/output/js/ff/core/Json.mjs +23 -56
- package/output/js/ff/core/List.mjs +648 -1989
- package/output/js/ff/core/Lock.mjs +0 -2
- package/output/js/ff/core/Log.mjs +0 -2
- package/output/js/ff/core/Map.mjs +10 -20
- package/output/js/ff/core/NodeSystem.mjs +6 -8
- package/output/js/ff/core/Nothing.mjs +0 -2
- package/output/js/ff/core/Option.mjs +8 -18
- package/output/js/ff/core/Ordering.mjs +20 -98
- package/output/js/ff/core/Pair.mjs +6 -16
- package/output/js/ff/core/Path.mjs +12 -14
- package/output/js/ff/core/Random.mjs +24 -54
- package/output/js/ff/core/RbMap.mjs +54 -56
- package/output/js/ff/core/Serializable.mjs +19 -36
- package/output/js/ff/core/Set.mjs +0 -14
- package/output/js/ff/core/Show.mjs +0 -2
- package/output/js/ff/core/SourceLocation.mjs +0 -2
- package/output/js/ff/core/Stream.mjs +34 -44
- package/output/js/ff/core/String.mjs +31 -5
- package/output/js/ff/core/StringMap.mjs +32 -42
- package/output/js/ff/core/Task.mjs +0 -2
- package/output/js/ff/core/Try.mjs +0 -2
- package/output/js/ff/core/Unit.mjs +0 -2
- package/package.json +1 -1
- package/vscode/package.json +1 -1
- package/webserver/WebServer.ff +8 -8
- package/output/js/ff/core/Stack.mjs +0 -603
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -80,8 +80,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
80
80
|
|
|
81
81
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
82
82
|
|
|
83
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
84
|
-
|
|
85
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
86
84
|
|
|
87
85
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -142,10 +140,6 @@ export function Map_toList(self_, ff_core_Ordering_Order$K) {
|
|
|
142
140
|
return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
|
|
143
141
|
}
|
|
144
142
|
|
|
145
|
-
export function Map_toArray(self_, ff_core_Ordering_Order$K) {
|
|
146
|
-
return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
|
|
147
|
-
}
|
|
148
|
-
|
|
149
143
|
export function Map_toStream(self_, cycle_ = false, ff_core_Ordering_Order$K) {
|
|
150
144
|
return ff_core_RbMap.RB_toStream(self_, cycle_, ff_core_Ordering_Order$K)
|
|
151
145
|
}
|
|
@@ -249,10 +243,6 @@ export async function Map_toList$(self_, ff_core_Ordering_Order$K, $task) {
|
|
|
249
243
|
return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
|
|
250
244
|
}
|
|
251
245
|
|
|
252
|
-
export async function Map_toArray$(self_, ff_core_Ordering_Order$K, $task) {
|
|
253
|
-
return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
|
|
254
|
-
}
|
|
255
|
-
|
|
256
246
|
export async function Map_toStream$(self_, cycle_ = false, ff_core_Ordering_Order$K, $task) {
|
|
257
247
|
return (await ff_core_RbMap.RB_toStream$(self_, cycle_, ff_core_Ordering_Order$K, $task))
|
|
258
248
|
}
|
|
@@ -322,17 +312,17 @@ return (await ff_core_RbMap.RB_find$(self_, body_, ff_core_Ordering_Order$K, $ta
|
|
|
322
312
|
|
|
323
313
|
export function Map_addToList(self_, key_, value_, ff_core_Ordering_Order$K) {
|
|
324
314
|
return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
|
|
325
|
-
return
|
|
315
|
+
return [value_, ..._w1]
|
|
326
316
|
}), (() => {
|
|
327
|
-
return
|
|
317
|
+
return [value_]
|
|
328
318
|
}), ff_core_Ordering_Order$K)
|
|
329
319
|
}
|
|
330
320
|
|
|
331
321
|
export async function Map_addToList$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
|
|
332
322
|
return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
|
|
333
|
-
return
|
|
323
|
+
return [value_, ..._w1]
|
|
334
324
|
}), (() => {
|
|
335
|
-
return
|
|
325
|
+
return [value_]
|
|
336
326
|
}), ff_core_Ordering_Order$K)
|
|
337
327
|
}
|
|
338
328
|
|
|
@@ -341,14 +331,14 @@ export function Map_push(self_, key_, value_, ff_core_Ordering_Order$K) {
|
|
|
341
331
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
342
332
|
{
|
|
343
333
|
if(_1.None) {
|
|
344
|
-
return ff_core_Map.Map_add(self_, key_, ff_core_List.
|
|
334
|
+
return ff_core_Map.Map_add(self_, key_, ff_core_List.List_toArray([value_]), ff_core_Ordering_Order$K)
|
|
345
335
|
return
|
|
346
336
|
}
|
|
347
337
|
}
|
|
348
338
|
{
|
|
349
339
|
if(_1.Some) {
|
|
350
|
-
const
|
|
351
|
-
|
|
340
|
+
const array_ = _1.value_;
|
|
341
|
+
ff_core_Array.Array_push(array_, value_);
|
|
352
342
|
return self_
|
|
353
343
|
return
|
|
354
344
|
}
|
|
@@ -361,14 +351,14 @@ export async function Map_push$(self_, key_, value_, ff_core_Ordering_Order$K, $
|
|
|
361
351
|
const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
|
|
362
352
|
{
|
|
363
353
|
if(_1.None) {
|
|
364
|
-
return ff_core_Map.Map_add(self_, key_, ff_core_List.
|
|
354
|
+
return ff_core_Map.Map_add(self_, key_, ff_core_List.List_toArray([value_]), ff_core_Ordering_Order$K)
|
|
365
355
|
return
|
|
366
356
|
}
|
|
367
357
|
}
|
|
368
358
|
{
|
|
369
359
|
if(_1.Some) {
|
|
370
|
-
const
|
|
371
|
-
|
|
360
|
+
const array_ = _1.value_;
|
|
361
|
+
ff_core_Array.Array_push(array_, value_);
|
|
372
362
|
return self_
|
|
373
363
|
return
|
|
374
364
|
}
|
|
@@ -82,8 +82,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
82
82
|
|
|
83
83
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
84
|
|
|
85
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
|
-
|
|
87
85
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
88
86
|
|
|
89
87
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -130,13 +128,13 @@ export function NodeSystem_assets(self_) {
|
|
|
130
128
|
const assetPkgSnapshotPath_ = ff_core_NodeSystem.NodeSystem_path(self_, "/snapshot/output/assets");
|
|
131
129
|
if(ff_core_Path.Path_isDirectory(assetPkgSnapshotPath_)) {
|
|
132
130
|
function streams_(path_) {
|
|
133
|
-
return ff_core_Stream.Stream_flatMap(
|
|
131
|
+
return ff_core_Stream.Stream_flatMap(ff_core_List.List_toStream(ff_core_NodeSystem.internalListDirectoryWithoutOpendir_(self_, path_), false), ((file_) => {
|
|
134
132
|
if(ff_core_Path.Path_isDirectory(file_)) {
|
|
135
133
|
return streams_(file_)
|
|
136
134
|
} else {
|
|
137
|
-
return ff_core_List.List_toStream(
|
|
135
|
+
return ff_core_List.List_toStream([ff_core_Pair.Pair(("/" + ff_core_Path.Path_relativeTo(file_, assetPkgSnapshotPath_)), (() => {
|
|
138
136
|
return ff_core_Path.Path_readStream(file_)
|
|
139
|
-
})),
|
|
137
|
+
}))], false)
|
|
140
138
|
}
|
|
141
139
|
}))
|
|
142
140
|
}
|
|
@@ -218,13 +216,13 @@ export async function NodeSystem_assets$(self_, $task) {
|
|
|
218
216
|
const assetPkgSnapshotPath_ = (await ff_core_NodeSystem.NodeSystem_path$(self_, "/snapshot/output/assets", $task));
|
|
219
217
|
if((await ff_core_Path.Path_isDirectory$(assetPkgSnapshotPath_, $task))) {
|
|
220
218
|
async function streams_$(path_, $task) {
|
|
221
|
-
return (await ff_core_Stream.Stream_flatMap$((await
|
|
219
|
+
return (await ff_core_Stream.Stream_flatMap$((await ff_core_List.List_toStream$((await ff_core_NodeSystem.internalListDirectoryWithoutOpendir_$(self_, path_, $task)), false, $task)), (async (file_, $task) => {
|
|
222
220
|
if((await ff_core_Path.Path_isDirectory$(file_, $task))) {
|
|
223
221
|
return (await streams_$(file_, $task))
|
|
224
222
|
} else {
|
|
225
|
-
return (await ff_core_List.List_toStream$(
|
|
223
|
+
return (await ff_core_List.List_toStream$([ff_core_Pair.Pair(("/" + (await ff_core_Path.Path_relativeTo$(file_, assetPkgSnapshotPath_, $task))), (async ($task) => {
|
|
226
224
|
return (await ff_core_Path.Path_readStream$(file_, $task))
|
|
227
|
-
})),
|
|
225
|
+
}))], false, $task))
|
|
228
226
|
}
|
|
229
227
|
}), $task))
|
|
230
228
|
}
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -199,24 +197,20 @@ export function Option_toList(self_) {
|
|
|
199
197
|
const _1 = self_;
|
|
200
198
|
{
|
|
201
199
|
if(_1.None) {
|
|
202
|
-
return
|
|
200
|
+
return []
|
|
203
201
|
return
|
|
204
202
|
}
|
|
205
203
|
}
|
|
206
204
|
{
|
|
207
205
|
if(_1.Some) {
|
|
208
206
|
const v_ = _1.value_;
|
|
209
|
-
return
|
|
207
|
+
return [v_]
|
|
210
208
|
return
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
|
|
216
|
-
export function Option_toStack(self_) {
|
|
217
|
-
return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
|
|
218
|
-
}
|
|
219
|
-
|
|
220
214
|
export function Option_toArray(self_) {
|
|
221
215
|
return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
|
|
222
216
|
}
|
|
@@ -460,24 +454,20 @@ export async function Option_toList$(self_, $task) {
|
|
|
460
454
|
const _1 = self_;
|
|
461
455
|
{
|
|
462
456
|
if(_1.None) {
|
|
463
|
-
return
|
|
457
|
+
return []
|
|
464
458
|
return
|
|
465
459
|
}
|
|
466
460
|
}
|
|
467
461
|
{
|
|
468
462
|
if(_1.Some) {
|
|
469
463
|
const v_ = _1.value_;
|
|
470
|
-
return
|
|
464
|
+
return [v_]
|
|
471
465
|
return
|
|
472
466
|
}
|
|
473
467
|
}
|
|
474
468
|
}
|
|
475
469
|
}
|
|
476
470
|
|
|
477
|
-
export async function Option_toStack$(self_, $task) {
|
|
478
|
-
return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
|
|
479
|
-
}
|
|
480
|
-
|
|
481
471
|
export async function Option_toArray$(self_, $task) {
|
|
482
472
|
return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
|
|
483
473
|
}
|
|
@@ -947,14 +937,14 @@ serialization_.offset_ += 1;
|
|
|
947
937
|
{
|
|
948
938
|
const _1 = variantIndex_;
|
|
949
939
|
{
|
|
950
|
-
if(_1
|
|
940
|
+
if(_1 === 0) {
|
|
951
941
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
|
|
952
942
|
return ff_core_Option.None()
|
|
953
943
|
return
|
|
954
944
|
}
|
|
955
945
|
}
|
|
956
946
|
{
|
|
957
|
-
if(_1
|
|
947
|
+
if(_1 === 1) {
|
|
958
948
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
|
|
959
949
|
return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
|
|
960
950
|
return
|
|
@@ -999,14 +989,14 @@ serialization_.offset_ += 1;
|
|
|
999
989
|
{
|
|
1000
990
|
const _1 = variantIndex_;
|
|
1001
991
|
{
|
|
1002
|
-
if(_1
|
|
992
|
+
if(_1 === 0) {
|
|
1003
993
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
|
|
1004
994
|
return ff_core_Option.None()
|
|
1005
995
|
return
|
|
1006
996
|
}
|
|
1007
997
|
}
|
|
1008
998
|
{
|
|
1009
|
-
if(_1
|
|
999
|
+
if(_1 === 1) {
|
|
1010
1000
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
|
|
1011
1001
|
return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
|
|
1012
1002
|
return
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -565,105 +563,29 @@ return
|
|
|
565
563
|
|
|
566
564
|
export function ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T) { return {
|
|
567
565
|
compare_(x_, y_) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
{
|
|
580
|
-
if(x_a.Empty) {
|
|
581
|
-
return ff_core_Ordering.OrderingBefore()
|
|
582
|
-
return
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
{
|
|
586
|
-
if(y_a.Empty) {
|
|
587
|
-
return ff_core_Ordering.OrderingAfter()
|
|
588
|
-
return
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
{
|
|
592
|
-
if(x_a.Link) {
|
|
593
|
-
const a_ = x_a.head_;
|
|
594
|
-
const as_ = x_a.tail_;
|
|
595
|
-
if(y_a.Link) {
|
|
596
|
-
const b_ = y_a.head_;
|
|
597
|
-
const bs_ = y_a.tail_;
|
|
598
|
-
{
|
|
599
|
-
const _1 = ff_core_Ordering_Order$T.compare_(a_, b_);
|
|
600
|
-
{
|
|
601
|
-
if(_1.OrderingSame) {
|
|
602
|
-
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T).compare_(as_, bs_)
|
|
603
|
-
return
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
{
|
|
607
|
-
const o_ = _1;
|
|
608
|
-
return o_
|
|
609
|
-
return
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
return
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
566
|
+
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
567
|
+
let i_ = 0;
|
|
568
|
+
while((((i_ < ff_core_List.List_size(x_)) && (i_ < ff_core_List.List_size(y_))) && (ordering_ === ff_core_Ordering.OrderingSame()))) {
|
|
569
|
+
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_List.List_grab(x_, i_), ff_core_List.List_grab(y_, i_));
|
|
570
|
+
i_ += 1
|
|
571
|
+
};
|
|
572
|
+
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
573
|
+
return ff_core_Ordering.fromInt_((ff_core_List.List_size(x_) - ff_core_List.List_size(y_)))
|
|
574
|
+
} else {
|
|
575
|
+
return ordering_
|
|
616
576
|
}
|
|
617
577
|
},
|
|
618
578
|
async compare_$(x_, y_, $task) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
return
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
{
|
|
631
|
-
if(x_a.Empty) {
|
|
632
|
-
return ff_core_Ordering.OrderingBefore()
|
|
633
|
-
return
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
{
|
|
637
|
-
if(y_a.Empty) {
|
|
638
|
-
return ff_core_Ordering.OrderingAfter()
|
|
639
|
-
return
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
{
|
|
643
|
-
if(x_a.Link) {
|
|
644
|
-
const a_ = x_a.head_;
|
|
645
|
-
const as_ = x_a.tail_;
|
|
646
|
-
if(y_a.Link) {
|
|
647
|
-
const b_ = y_a.head_;
|
|
648
|
-
const bs_ = y_a.tail_;
|
|
649
|
-
{
|
|
650
|
-
const _1 = ff_core_Ordering_Order$T.compare_(a_, b_);
|
|
651
|
-
{
|
|
652
|
-
if(_1.OrderingSame) {
|
|
653
|
-
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T).compare_(as_, bs_)
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
{
|
|
658
|
-
const o_ = _1;
|
|
659
|
-
return o_
|
|
660
|
-
return
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
return
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
}
|
|
579
|
+
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
580
|
+
let i_ = 0;
|
|
581
|
+
while((((i_ < ff_core_List.List_size(x_)) && (i_ < ff_core_List.List_size(y_))) && (ordering_ === ff_core_Ordering.OrderingSame()))) {
|
|
582
|
+
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_List.List_grab(x_, i_), ff_core_List.List_grab(y_, i_));
|
|
583
|
+
i_ += 1
|
|
584
|
+
};
|
|
585
|
+
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
586
|
+
return ff_core_Ordering.fromInt_((ff_core_List.List_size(x_) - ff_core_List.List_size(y_)))
|
|
587
|
+
} else {
|
|
588
|
+
return ordering_
|
|
667
589
|
}
|
|
668
590
|
}
|
|
669
591
|
}}
|
|
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
78
78
|
|
|
79
79
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
80
|
|
|
81
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
|
-
|
|
83
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
84
82
|
|
|
85
83
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -167,17 +165,13 @@ return
|
|
|
167
165
|
}
|
|
168
166
|
|
|
169
167
|
export function Pair_toList(self_) {
|
|
170
|
-
return
|
|
168
|
+
return [self_.first_, self_.second_]
|
|
171
169
|
}
|
|
172
170
|
|
|
173
171
|
export function Pair_toArray(self_) {
|
|
174
172
|
return ff_core_List.List_toArray(ff_core_Pair.Pair_toList(self_))
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
export function Pair_toStack(self_) {
|
|
178
|
-
return ff_core_List.List_toStack(ff_core_Pair.Pair_toList(self_))
|
|
179
|
-
}
|
|
180
|
-
|
|
181
175
|
export async function Pair_mapBoth$(self_, body_, $task) {
|
|
182
176
|
{
|
|
183
177
|
const _1 = self_;
|
|
@@ -190,17 +184,13 @@ return
|
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
export async function Pair_toList$(self_, $task) {
|
|
193
|
-
return
|
|
187
|
+
return [self_.first_, self_.second_]
|
|
194
188
|
}
|
|
195
189
|
|
|
196
190
|
export async function Pair_toArray$(self_, $task) {
|
|
197
191
|
return ff_core_List.List_toArray(ff_core_Pair.Pair_toList(self_))
|
|
198
192
|
}
|
|
199
193
|
|
|
200
|
-
export async function Pair_toStack$(self_, $task) {
|
|
201
|
-
return ff_core_List.List_toStack(ff_core_Pair.Pair_toList(self_))
|
|
202
|
-
}
|
|
203
|
-
|
|
204
194
|
export function Pair_toSet(self_, ff_core_Ordering_Order$A) {
|
|
205
195
|
return ff_core_List.List_toSet(ff_core_Pair.Pair_toList(self_), ff_core_Ordering_Order$A)
|
|
206
196
|
}
|
|
@@ -210,11 +200,11 @@ return ff_core_List.List_toSet(ff_core_Pair.Pair_toList(self_), ff_core_Ordering
|
|
|
210
200
|
}
|
|
211
201
|
|
|
212
202
|
export function Pair_toMap(self_, ff_core_Ordering_Order$A) {
|
|
213
|
-
return ff_core_List.List_toMap(
|
|
203
|
+
return ff_core_List.List_toMap([self_], ff_core_Ordering_Order$A)
|
|
214
204
|
}
|
|
215
205
|
|
|
216
206
|
export async function Pair_toMap$(self_, ff_core_Ordering_Order$A, $task) {
|
|
217
|
-
return ff_core_List.List_toMap(
|
|
207
|
+
return ff_core_List.List_toMap([self_], ff_core_Ordering_Order$A)
|
|
218
208
|
}
|
|
219
209
|
|
|
220
210
|
export function ff_core_Any_HasAnyTag$ff_core_Pair_Pair(ff_core_Any_HasAnyTag$A, ff_core_Any_HasAnyTag$B) { return {
|
|
@@ -286,7 +276,7 @@ serialization_.offset_ += 1;
|
|
|
286
276
|
{
|
|
287
277
|
const _1 = variantIndex_;
|
|
288
278
|
{
|
|
289
|
-
if(_1
|
|
279
|
+
if(_1 === 0) {
|
|
290
280
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 17), 0);
|
|
291
281
|
return ff_core_Pair.Pair(ff_core_Serializable_Serializable$A.deserializeUsing_(serialization_), ff_core_Serializable_Serializable$B.deserializeUsing_(serialization_))
|
|
292
282
|
return
|
|
@@ -320,7 +310,7 @@ serialization_.offset_ += 1;
|
|
|
320
310
|
{
|
|
321
311
|
const _1 = variantIndex_;
|
|
322
312
|
{
|
|
323
|
-
if(_1
|
|
313
|
+
if(_1 === 0) {
|
|
324
314
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 17), 0);
|
|
325
315
|
return ff_core_Pair.Pair(ff_core_Serializable_Serializable$A.deserializeUsing_(serialization_), ff_core_Serializable_Serializable$B.deserializeUsing_(serialization_))
|
|
326
316
|
return
|
|
@@ -84,8 +84,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
|
84
84
|
|
|
85
85
|
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
86
86
|
|
|
87
|
-
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
88
|
-
|
|
89
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
90
88
|
|
|
91
89
|
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
@@ -214,7 +212,7 @@ function go_(pathOption_, reversed_) {
|
|
|
214
212
|
const pathOption_a = pathOption_;
|
|
215
213
|
const reversed_a = reversed_;
|
|
216
214
|
{
|
|
217
|
-
if(reversed_a.
|
|
215
|
+
if(reversed_a.length === 0) {
|
|
218
216
|
return true
|
|
219
217
|
return
|
|
220
218
|
}
|
|
@@ -222,9 +220,9 @@ return
|
|
|
222
220
|
{
|
|
223
221
|
if(pathOption_a.Some) {
|
|
224
222
|
const path_ = pathOption_a.value_;
|
|
225
|
-
if(reversed_a.
|
|
226
|
-
const p_ = reversed_a
|
|
227
|
-
const ps_ = reversed_a.
|
|
223
|
+
if(reversed_a.length > 0) {
|
|
224
|
+
const p_ = reversed_a[0];
|
|
225
|
+
const ps_ = reversed_a.slice(1);
|
|
228
226
|
return ((ff_core_Path.Path_base(path_) === p_) && go_(ff_core_Path.Path_parent(path_), ps_))
|
|
229
227
|
return
|
|
230
228
|
}
|
|
@@ -324,11 +322,11 @@ return ff_core_Stream.Stream_toBuffer(ff_core_Path.Path_readStream(self_))
|
|
|
324
322
|
}
|
|
325
323
|
|
|
326
324
|
export function Path_writeBuffer(self_, buffer_) {
|
|
327
|
-
ff_core_Path.Path_writeStream(self_, ff_core_List.List_toStream(
|
|
325
|
+
ff_core_Path.Path_writeStream(self_, ff_core_List.List_toStream([buffer_], false), false)
|
|
328
326
|
}
|
|
329
327
|
|
|
330
328
|
export function Path_appendBuffer(self_, buffer_) {
|
|
331
|
-
ff_core_Path.Path_appendStream(self_, ff_core_List.List_toStream(
|
|
329
|
+
ff_core_Path.Path_appendStream(self_, ff_core_List.List_toStream([buffer_], false))
|
|
332
330
|
}
|
|
333
331
|
|
|
334
332
|
export function Path_readStream(self_) {
|
|
@@ -478,7 +476,7 @@ async function go_$(pathOption_, reversed_, $task) {
|
|
|
478
476
|
const pathOption_a = pathOption_;
|
|
479
477
|
const reversed_a = reversed_;
|
|
480
478
|
{
|
|
481
|
-
if(reversed_a.
|
|
479
|
+
if(reversed_a.length === 0) {
|
|
482
480
|
return true
|
|
483
481
|
return
|
|
484
482
|
}
|
|
@@ -486,9 +484,9 @@ return
|
|
|
486
484
|
{
|
|
487
485
|
if(pathOption_a.Some) {
|
|
488
486
|
const path_ = pathOption_a.value_;
|
|
489
|
-
if(reversed_a.
|
|
490
|
-
const p_ = reversed_a
|
|
491
|
-
const ps_ = reversed_a.
|
|
487
|
+
if(reversed_a.length > 0) {
|
|
488
|
+
const p_ = reversed_a[0];
|
|
489
|
+
const ps_ = reversed_a.slice(1);
|
|
492
490
|
return (((await ff_core_Path.Path_base$(path_, $task)) === p_) && (await go_$((await ff_core_Path.Path_parent$(path_, $task)), ps_, $task)))
|
|
493
491
|
return
|
|
494
492
|
}
|
|
@@ -651,11 +649,11 @@ return (await ff_core_Stream.Stream_toBuffer$((await ff_core_Path.Path_readStrea
|
|
|
651
649
|
}
|
|
652
650
|
|
|
653
651
|
export async function Path_writeBuffer$(self_, buffer_, $task) {
|
|
654
|
-
(await ff_core_Path.Path_writeStream$(self_, (await ff_core_List.List_toStream$(
|
|
652
|
+
(await ff_core_Path.Path_writeStream$(self_, (await ff_core_List.List_toStream$([buffer_], false, $task)), false, $task))
|
|
655
653
|
}
|
|
656
654
|
|
|
657
655
|
export async function Path_appendBuffer$(self_, buffer_, $task) {
|
|
658
|
-
(await ff_core_Path.Path_appendStream$(self_, (await ff_core_List.List_toStream$(
|
|
656
|
+
(await ff_core_Path.Path_appendStream$(self_, (await ff_core_List.List_toStream$([buffer_], false, $task)), $task))
|
|
659
657
|
}
|
|
660
658
|
|
|
661
659
|
export async function Path_readStream$(self_, $task) {
|