firefly-compiler 0.4.18 → 0.4.20
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 +17 -5
- package/compiler/Main.ff +6 -6
- package/compiler/Parser.ff +50 -52
- 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 +21 -30
- 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/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 +18 -18
- package/lsp/Handler.ff +45 -34
- package/lsp/HoverHandler.ff +2 -2
- package/lsp/LanguageServer.ff +2 -2
- package/lsp/SignatureHelpHandler.ff +1 -1
- package/lsp/SymbolHandler.ff +19 -5
- 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 +872 -51
- package/output/js/ff/compiler/Main.mjs +109 -111
- package/output/js/ff/compiler/Parser.mjs +427 -441
- 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 +25 -58
- 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/client/src/extension.ts +30 -2
- package/vscode/package.json +17 -1
- package/webserver/WebServer.ff +8 -8
- package/core/Stack.ff +0 -263
- 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"
|
|
@@ -100,11 +98,11 @@ return {files_};
|
|
|
100
98
|
|
|
101
99
|
|
|
102
100
|
export function create_() {
|
|
103
|
-
return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(
|
|
101
|
+
return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
export async function create_$($task) {
|
|
107
|
-
return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(
|
|
105
|
+
return ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
export function AssetSystem_addAssets(self_, path_, assets_) {
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -121,7 +119,7 @@ return ff_core_Stream.Stream_flatMap(ff_core_Path.Path_entries(currentPath_), ((
|
|
|
121
119
|
if(ff_core_Path.PathEntry_isDirectory(file_)) {
|
|
122
120
|
return go_(ff_core_Path.PathEntry_path(file_))
|
|
123
121
|
} else {
|
|
124
|
-
return ff_core_List.List_toStream(
|
|
122
|
+
return ff_core_List.List_toStream([ff_core_Path.PathEntry_path(file_)], false)
|
|
125
123
|
}
|
|
126
124
|
}))
|
|
127
125
|
}
|
|
@@ -182,7 +180,7 @@ return (await ff_core_Stream.Stream_flatMap$((await ff_core_Path.Path_entries$(c
|
|
|
182
180
|
if((await ff_core_Path.PathEntry_isDirectory$(file_, $task))) {
|
|
183
181
|
return (await go_$((await ff_core_Path.PathEntry_path$(file_, $task)), $task))
|
|
184
182
|
} else {
|
|
185
|
-
return (await ff_core_List.List_toStream$(
|
|
183
|
+
return (await ff_core_List.List_toStream$([(await ff_core_Path.PathEntry_path$(file_, $task))], false, $task))
|
|
186
184
|
}
|
|
187
185
|
}), $task))
|
|
188
186
|
}
|
|
@@ -286,13 +284,13 @@ const mainJsFile_ = ((((((prefix_ + "/") + self_.packageGroup_) + "/") + self_.p
|
|
|
286
284
|
const mainDirectory_ = ff_core_Option.Option_grab(ff_core_Path.Path_parent(self_.mainFile_));
|
|
287
285
|
const file_ = (prefix_ + "/Main.bundle.js");
|
|
288
286
|
ff_core_BuildSystem.internalCallEsBuild_(self_, mainJsFile_, file_, minify_, sourceMap_);
|
|
289
|
-
const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(
|
|
287
|
+
const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([ff_core_Pair.Pair(ff_core_String.String_dropFirst(file_, ff_core_String.String_size(prefix_)), (() => {
|
|
290
288
|
return ff_core_Path.Path_readStream(ff_core_Path.Path_path(mainDirectory_, file_))
|
|
291
|
-
})), (sourceMap_
|
|
292
|
-
?
|
|
289
|
+
})), ...(sourceMap_
|
|
290
|
+
? [ff_core_Pair.Pair((ff_core_String.String_dropFirst(file_, ff_core_String.String_size(prefix_)) + ".map"), (() => {
|
|
293
291
|
return ff_core_Path.Path_readStream(ff_core_Path.Path_path(mainDirectory_, (file_ + ".map")))
|
|
294
|
-
}))
|
|
295
|
-
:
|
|
292
|
+
}))]
|
|
293
|
+
: [])], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String));
|
|
296
294
|
return ff_core_BuildSystem.BrowserBundle(assets_)
|
|
297
295
|
}
|
|
298
296
|
|
|
@@ -307,13 +305,13 @@ const mainJsFile_ = ((((((prefix_ + "/") + self_.packageGroup_) + "/") + self_.p
|
|
|
307
305
|
const mainDirectory_ = ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(self_.mainFile_, $task)));
|
|
308
306
|
const file_ = (prefix_ + "/Main.bundle.js");
|
|
309
307
|
(await ff_core_BuildSystem.internalCallEsBuild_$(self_, mainJsFile_, file_, minify_, sourceMap_, $task));
|
|
310
|
-
const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap(
|
|
308
|
+
const assets_ = ff_core_AssetSystem.AssetSystem(ff_core_List.List_toMap([ff_core_Pair.Pair(ff_core_String.String_dropFirst(file_, ff_core_String.String_size(prefix_)), (async ($task) => {
|
|
311
309
|
return (await ff_core_Path.Path_readStream$((await ff_core_Path.Path_path$(mainDirectory_, file_, $task)), $task))
|
|
312
|
-
})), (sourceMap_
|
|
313
|
-
?
|
|
310
|
+
})), ...(sourceMap_
|
|
311
|
+
? [ff_core_Pair.Pair((ff_core_String.String_dropFirst(file_, ff_core_String.String_size(prefix_)) + ".map"), (async ($task) => {
|
|
314
312
|
return (await ff_core_Path.Path_readStream$((await ff_core_Path.Path_path$(mainDirectory_, (file_ + ".map"), $task)), $task))
|
|
315
|
-
}))
|
|
316
|
-
:
|
|
313
|
+
}))]
|
|
314
|
+
: [])], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String));
|
|
317
315
|
return ff_core_BuildSystem.BrowserBundle(assets_)
|
|
318
316
|
}
|
|
319
317
|
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -160,24 +158,4 @@ throw new Error('Function equals is missing on this target in async context.');
|
|
|
160
158
|
}
|
|
161
159
|
};
|
|
162
160
|
|
|
163
|
-
export const ff_core_Equal_Equal$ff_core_List_List = {
|
|
164
|
-
equals_(x_, y_) {
|
|
165
|
-
|
|
166
|
-
let a = x_
|
|
167
|
-
let b = y_
|
|
168
|
-
if(a === b) return true
|
|
169
|
-
while(a.Link && b.Link) {
|
|
170
|
-
if(a === b) return true
|
|
171
|
-
if(!ff_core_Equal_Equal$T.equals_(a.head_, b.head_)) return false
|
|
172
|
-
a = a.tail_
|
|
173
|
-
b = b.tail_
|
|
174
|
-
}
|
|
175
|
-
return a.Empty && b.Empty
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
async equals_$(x_, y_, $task) {
|
|
179
|
-
throw new Error('Function equals is missing on this target in async context.');
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
|
|
183
161
|
|
|
@@ -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"
|
|
@@ -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"
|
|
@@ -115,7 +113,7 @@ export function RedirectManual() {
|
|
|
115
113
|
return RedirectManual$;
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
export const emptyList_ =
|
|
116
|
+
export const emptyList_ = [];
|
|
119
117
|
|
|
120
118
|
export function bodyText_(body_) {
|
|
121
119
|
return body_
|
|
@@ -142,7 +140,7 @@ export async function HttpClient_fetch$(self_, url_, method_ = "GET", headers_ =
|
|
|
142
140
|
try {
|
|
143
141
|
const options = {headers: {}, signal: $task.controller.signal}
|
|
144
142
|
options.method = method_
|
|
145
|
-
|
|
143
|
+
headers_.forEach(pair => {options.headers[pair.first_] = pair.second_})
|
|
146
144
|
if(body_.value_) options.body = body_.value_
|
|
147
145
|
if(redirect_.RedirectError) options.redirect = "error"
|
|
148
146
|
else if(redirect_.RedirectManual) options.redirect = "manual"
|
|
@@ -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"
|
|
@@ -134,20 +132,20 @@ return signed_ ? self_ >> bits_ : self_ >>> bits_;
|
|
|
134
132
|
}
|
|
135
133
|
|
|
136
134
|
export function Int_to(self_, inclusiveEnd_) {
|
|
137
|
-
let result_ =
|
|
135
|
+
let result_ = [];
|
|
138
136
|
let n_ = inclusiveEnd_;
|
|
139
137
|
while((self_ <= n_)) {
|
|
140
|
-
result_ =
|
|
138
|
+
result_ = [n_, ...result_];
|
|
141
139
|
n_ -= 1
|
|
142
140
|
};
|
|
143
141
|
return result_
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
export function Int_until(self_, exclusiveEnd_) {
|
|
147
|
-
let result_ =
|
|
145
|
+
let result_ = [];
|
|
148
146
|
let n_ = exclusiveEnd_;
|
|
149
147
|
while((self_ < n_)) {
|
|
150
|
-
result_ =
|
|
148
|
+
result_ = [(n_ - 1), ...result_];
|
|
151
149
|
n_ -= 1
|
|
152
150
|
};
|
|
153
151
|
return result_
|
|
@@ -216,20 +214,20 @@ throw new Error('Function Int_bitRight is missing on this target in async contex
|
|
|
216
214
|
}
|
|
217
215
|
|
|
218
216
|
export async function Int_to$(self_, inclusiveEnd_, $task) {
|
|
219
|
-
let result_ =
|
|
217
|
+
let result_ = [];
|
|
220
218
|
let n_ = inclusiveEnd_;
|
|
221
219
|
while((self_ <= n_)) {
|
|
222
|
-
result_ =
|
|
220
|
+
result_ = [n_, ...result_];
|
|
223
221
|
n_ -= 1
|
|
224
222
|
};
|
|
225
223
|
return result_
|
|
226
224
|
}
|
|
227
225
|
|
|
228
226
|
export async function Int_until$(self_, exclusiveEnd_, $task) {
|
|
229
|
-
let result_ =
|
|
227
|
+
let result_ = [];
|
|
230
228
|
let n_ = exclusiveEnd_;
|
|
231
229
|
while((self_ < n_)) {
|
|
232
|
-
result_ =
|
|
230
|
+
result_ = [(n_ - 1), ...result_];
|
|
233
231
|
n_ -= 1
|
|
234
232
|
};
|
|
235
233
|
return result_
|
|
@@ -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"
|
|
@@ -147,44 +145,40 @@ export function IntMap_eachWhile(self_, body_) {
|
|
|
147
145
|
for(const [k, v] of self_) if(!body_(k, v)) break
|
|
148
146
|
}
|
|
149
147
|
|
|
150
|
-
export function
|
|
151
|
-
const
|
|
148
|
+
export function IntMap_toArray(self_) {
|
|
149
|
+
const array_ = ff_core_Array.make_();
|
|
152
150
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
153
|
-
|
|
151
|
+
ff_core_Array.Array_push(array_, ff_core_Pair.Pair(k_, v_))
|
|
154
152
|
}));
|
|
155
|
-
return
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export function IntMap_toArray(self_) {
|
|
159
|
-
return ff_core_Stack.Stack_drain(ff_core_IntMap.IntMap_toStack(self_))
|
|
153
|
+
return array_
|
|
160
154
|
}
|
|
161
155
|
|
|
162
156
|
export function IntMap_toList(self_) {
|
|
163
|
-
return ff_core_Array.
|
|
157
|
+
return ff_core_Array.Array_drain(ff_core_IntMap.IntMap_toArray(self_))
|
|
164
158
|
}
|
|
165
159
|
|
|
166
160
|
export function IntMap_toStream(self_) {
|
|
167
|
-
return ff_core_Array.Array_toStream(ff_core_IntMap.IntMap_toArray(self_),
|
|
161
|
+
return ff_core_Array.Array_toStream(ff_core_IntMap.IntMap_toArray(self_), 0, 9007199254740991)
|
|
168
162
|
}
|
|
169
163
|
|
|
170
164
|
export function IntMap_toMap(self_) {
|
|
171
|
-
return
|
|
165
|
+
return ff_core_List.List_toMap(ff_core_IntMap.IntMap_toList(self_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
172
166
|
}
|
|
173
167
|
|
|
174
168
|
export function IntMap_keys(self_) {
|
|
175
|
-
const
|
|
169
|
+
const array_ = ff_core_Array.make_();
|
|
176
170
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
177
|
-
|
|
171
|
+
ff_core_Array.Array_push(array_, k_)
|
|
178
172
|
}));
|
|
179
|
-
return
|
|
173
|
+
return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
180
174
|
}
|
|
181
175
|
|
|
182
176
|
export function IntMap_values(self_) {
|
|
183
|
-
const
|
|
177
|
+
const array_ = ff_core_Array.make_();
|
|
184
178
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
185
|
-
|
|
179
|
+
ff_core_Array.Array_push(array_, v_)
|
|
186
180
|
}));
|
|
187
|
-
return
|
|
181
|
+
return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
188
182
|
}
|
|
189
183
|
|
|
190
184
|
export function IntMap_copy(self_) {
|
|
@@ -234,44 +228,40 @@ export async function IntMap_eachWhile$(self_, body_, $task) {
|
|
|
234
228
|
for(const [k, v] of self_) if(!await body_(k, v)) break
|
|
235
229
|
}
|
|
236
230
|
|
|
237
|
-
export async function
|
|
238
|
-
const
|
|
231
|
+
export async function IntMap_toArray$(self_, $task) {
|
|
232
|
+
const array_ = ff_core_Array.make_();
|
|
239
233
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
240
|
-
|
|
234
|
+
ff_core_Array.Array_push(array_, ff_core_Pair.Pair(k_, v_))
|
|
241
235
|
}));
|
|
242
|
-
return
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export async function IntMap_toArray$(self_, $task) {
|
|
246
|
-
return ff_core_Stack.Stack_drain(ff_core_IntMap.IntMap_toStack(self_))
|
|
236
|
+
return array_
|
|
247
237
|
}
|
|
248
238
|
|
|
249
239
|
export async function IntMap_toList$(self_, $task) {
|
|
250
|
-
return ff_core_Array.
|
|
240
|
+
return ff_core_Array.Array_drain(ff_core_IntMap.IntMap_toArray(self_))
|
|
251
241
|
}
|
|
252
242
|
|
|
253
243
|
export async function IntMap_toStream$(self_, $task) {
|
|
254
|
-
return (await ff_core_Array.Array_toStream$(ff_core_IntMap.IntMap_toArray(self_),
|
|
244
|
+
return (await ff_core_Array.Array_toStream$(ff_core_IntMap.IntMap_toArray(self_), 0, 9007199254740991, $task))
|
|
255
245
|
}
|
|
256
246
|
|
|
257
247
|
export async function IntMap_toMap$(self_, $task) {
|
|
258
|
-
return
|
|
248
|
+
return ff_core_List.List_toMap(ff_core_IntMap.IntMap_toList(self_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int)
|
|
259
249
|
}
|
|
260
250
|
|
|
261
251
|
export async function IntMap_keys$(self_, $task) {
|
|
262
|
-
const
|
|
252
|
+
const array_ = ff_core_Array.make_();
|
|
263
253
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
264
|
-
|
|
254
|
+
ff_core_Array.Array_push(array_, k_)
|
|
265
255
|
}));
|
|
266
|
-
return
|
|
256
|
+
return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
267
257
|
}
|
|
268
258
|
|
|
269
259
|
export async function IntMap_values$(self_, $task) {
|
|
270
|
-
const
|
|
260
|
+
const array_ = ff_core_Array.make_();
|
|
271
261
|
ff_core_IntMap.IntMap_each(self_, ((k_, v_) => {
|
|
272
|
-
|
|
262
|
+
ff_core_Array.Array_push(array_, v_)
|
|
273
263
|
}));
|
|
274
|
-
return
|
|
264
|
+
return ff_core_Array.Array_toList(array_, 0, 9007199254740991)
|
|
275
265
|
}
|
|
276
266
|
|
|
277
267
|
export async function IntMap_copy$(self_, $task) {
|
|
@@ -290,14 +280,14 @@ export function IntMap_push(self_, key_, value_) {
|
|
|
290
280
|
const _1 = ff_core_IntMap.IntMap_get(self_, key_);
|
|
291
281
|
{
|
|
292
282
|
if(_1.None) {
|
|
293
|
-
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.
|
|
283
|
+
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.List_toArray([value_]))
|
|
294
284
|
return
|
|
295
285
|
}
|
|
296
286
|
}
|
|
297
287
|
{
|
|
298
288
|
if(_1.Some) {
|
|
299
|
-
const
|
|
300
|
-
|
|
289
|
+
const array_ = _1.value_;
|
|
290
|
+
ff_core_Array.Array_push(array_, value_)
|
|
301
291
|
return
|
|
302
292
|
}
|
|
303
293
|
}
|
|
@@ -309,14 +299,14 @@ export async function IntMap_push$(self_, key_, value_, $task) {
|
|
|
309
299
|
const _1 = ff_core_IntMap.IntMap_get(self_, key_);
|
|
310
300
|
{
|
|
311
301
|
if(_1.None) {
|
|
312
|
-
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.
|
|
302
|
+
ff_core_IntMap.IntMap_set(self_, key_, ff_core_List.List_toArray([value_]))
|
|
313
303
|
return
|
|
314
304
|
}
|
|
315
305
|
}
|
|
316
306
|
{
|
|
317
307
|
if(_1.Some) {
|
|
318
|
-
const
|
|
319
|
-
|
|
308
|
+
const array_ = _1.value_;
|
|
309
|
+
ff_core_Array.Array_push(array_, value_)
|
|
320
310
|
return
|
|
321
311
|
}
|
|
322
312
|
}
|
|
@@ -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"
|
|
@@ -126,7 +124,7 @@ return {}
|
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
export function JsSystem_array(self_, values_) {
|
|
129
|
-
return
|
|
127
|
+
return values_.slice()
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
export function JsSystem_json(self_, value_) {
|
|
@@ -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"
|
|
@@ -238,7 +236,7 @@ for(const value of self_) if(!body_(value)) break
|
|
|
238
236
|
}
|
|
239
237
|
|
|
240
238
|
export function JsValue_call(self_, name_, arguments_) {
|
|
241
|
-
return self_[name_].apply(this_,
|
|
239
|
+
return self_[name_].apply(this_, arguments_)
|
|
242
240
|
}
|
|
243
241
|
|
|
244
242
|
export function JsValue_call0(self_, name_) {
|
|
@@ -282,7 +280,7 @@ return self_[name_].call(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
|
|
|
282
280
|
}
|
|
283
281
|
|
|
284
282
|
export function JsValue_callValue(self_, this_, arguments_) {
|
|
285
|
-
return self_.apply(this_,
|
|
283
|
+
return self_.apply(this_, arguments_)
|
|
286
284
|
}
|
|
287
285
|
|
|
288
286
|
export function JsValue_callValue0(self_) {
|
|
@@ -326,7 +324,7 @@ return self_.call(self_, a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
|
|
|
326
324
|
}
|
|
327
325
|
|
|
328
326
|
export function JsValue_new(self_, this_, arguments_) {
|
|
329
|
-
return new (Function.prototype.bind.apply(self_,
|
|
327
|
+
return new (Function.prototype.bind.apply(self_, arguments_))
|
|
330
328
|
}
|
|
331
329
|
|
|
332
330
|
export function JsValue_new0(self_) {
|
|
@@ -372,12 +370,7 @@ return new self_(a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_)
|
|
|
372
370
|
export function JsValue_grabPairs(self_) {
|
|
373
371
|
|
|
374
372
|
if(!(self_ instanceof Object)) throw new Error('Expected object, got '+ typeof self_);;
|
|
375
|
-
|
|
376
|
-
Object.getOwnPropertyNames(self_).forEach((name, i) => {
|
|
377
|
-
let pair = ff_core_Pair.Pair(name, self_[name]);
|
|
378
|
-
result = ff_core_List.Link(pair, result);
|
|
379
|
-
})
|
|
380
|
-
return result;
|
|
373
|
+
return Object.getOwnPropertyNames(self_).map((name, i) => ff_core_Pair.Pair(name, self_[name]));
|
|
381
374
|
|
|
382
375
|
}
|
|
383
376
|
|
|
@@ -699,7 +692,7 @@ export const ff_core_JsValue_IsJsValue$ff_core_Bool_Bool = {
|
|
|
699
692
|
|
|
700
693
|
};
|
|
701
694
|
|
|
702
|
-
export function ff_core_JsValue_IsJsValue$
|
|
695
|
+
export function ff_core_JsValue_IsJsValue$ff_core_List_List(ff_core_JsValue_IsJsValue$T) { return {
|
|
703
696
|
|
|
704
697
|
}}
|
|
705
698
|
|