firefly-compiler 0.4.4 → 0.4.5
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/.hintrc +5 -0
- package/README.md +42 -61
- package/compiler/Compiler.ff +6 -2
- package/compiler/Deriver.ff +10 -0
- package/compiler/Environment.ff +2 -1
- package/compiler/JsEmitter.ff +29 -17
- package/compiler/Resolver.ff +1 -1
- package/core/.firefly/package.ff +1 -2
- package/core/Box.ff +7 -0
- package/core/BuildSystem.ff +5 -4
- package/core/Core.ff +4 -0
- package/core/JsValue.ff +22 -1
- package/core/Lock.ff +4 -4
- package/core/NodeSystem.ff +12 -3
- package/core/Path.ff +1 -1
- package/core/SourceLocation.ff +41 -0
- package/core/Stack.ff +6 -6
- package/core/StringMap.ff +3 -3
- package/lux/.firefly/package.ff +2 -0
- package/lux/Lux.ff +473 -0
- package/lux/LuxEvent.ff +116 -0
- package/lux/Main.ff +72 -0
- package/lux/Main2.ff +144 -0
- package/output/js/ff/compiler/Builder.mjs +4 -0
- package/output/js/ff/compiler/Compiler.mjs +11 -5
- package/output/js/ff/compiler/Dependencies.mjs +4 -0
- package/output/js/ff/compiler/Deriver.mjs +8 -4
- package/output/js/ff/compiler/Dictionaries.mjs +4 -0
- package/output/js/ff/compiler/Environment.mjs +12 -2
- package/output/js/ff/compiler/Inference.mjs +4 -0
- package/output/js/ff/compiler/JsEmitter.mjs +78 -40
- package/output/js/ff/compiler/JsImporter.mjs +4 -0
- package/output/js/ff/compiler/LspHook.mjs +4 -0
- package/output/js/ff/compiler/Main.mjs +28 -24
- package/output/js/ff/compiler/Parser.mjs +4 -0
- package/output/js/ff/compiler/Patterns.mjs +4 -0
- package/output/js/ff/compiler/Resolver.mjs +6 -2
- package/output/js/ff/compiler/Substitution.mjs +4 -0
- package/output/js/ff/compiler/Syntax.mjs +4 -0
- package/output/js/ff/compiler/Token.mjs +4 -0
- package/output/js/ff/compiler/Tokenizer.mjs +4 -0
- package/output/js/ff/compiler/Unification.mjs +4 -0
- package/output/js/ff/compiler/Wildcards.mjs +4 -0
- package/output/js/ff/compiler/Workspace.mjs +4 -0
- package/output/js/ff/core/Any.mjs +4 -0
- package/output/js/ff/core/Array.mjs +4 -0
- package/output/js/ff/core/AssetSystem.mjs +4 -0
- package/output/js/ff/core/Atomic.mjs +4 -0
- package/output/js/ff/core/Bool.mjs +12 -1
- package/output/js/ff/core/Box.mjs +112 -0
- package/output/js/ff/core/BrowserSystem.mjs +4 -0
- package/output/js/ff/core/Buffer.mjs +4 -0
- package/output/js/ff/core/BuildSystem.mjs +14 -8
- package/output/js/ff/core/Channel.mjs +4 -0
- package/output/js/ff/core/Char.mjs +4 -0
- package/output/js/ff/core/Core.mjs +12 -0
- package/output/js/ff/core/Duration.mjs +4 -0
- package/output/js/ff/core/Equal.mjs +4 -0
- package/output/js/ff/core/Error.mjs +4 -0
- package/output/js/ff/core/FileHandle.mjs +4 -0
- package/output/js/ff/core/Float.mjs +12 -1
- package/output/js/ff/core/HttpClient.mjs +4 -0
- package/output/js/ff/core/Instant.mjs +4 -0
- package/output/js/ff/core/Int.mjs +12 -1
- package/output/js/ff/core/IntMap.mjs +4 -0
- package/output/js/ff/core/JsSystem.mjs +4 -0
- package/output/js/ff/core/JsValue.mjs +50 -0
- package/output/js/ff/core/List.mjs +13 -0
- package/output/js/ff/core/Lock.mjs +11 -7
- package/output/js/ff/core/Log.mjs +4 -0
- package/output/js/ff/core/Map.mjs +4 -0
- package/output/js/ff/core/NodeSystem.mjs +33 -14
- package/output/js/ff/core/Nothing.mjs +4 -0
- package/output/js/ff/core/Option.mjs +13 -0
- package/output/js/ff/core/Ordering.mjs +4 -0
- package/output/js/ff/core/Pair.mjs +13 -0
- package/output/js/ff/core/Path.mjs +5 -1
- package/output/js/ff/core/RbMap.mjs +24 -20
- package/output/js/ff/core/Serializable.mjs +4 -0
- package/output/js/ff/core/Set.mjs +4 -0
- package/output/js/ff/core/Show.mjs +4 -0
- package/output/js/ff/core/SourceLocation.mjs +229 -0
- package/output/js/ff/core/Stack.mjs +10 -6
- package/output/js/ff/core/Stream.mjs +4 -0
- package/output/js/ff/core/String.mjs +12 -1
- package/output/js/ff/core/StringMap.mjs +5 -1
- package/output/js/ff/core/Task.mjs +4 -0
- package/output/js/ff/core/Try.mjs +4 -0
- package/output/js/ff/core/Unit.mjs +49 -1
- package/package.json +1 -1
package/lux/Main2.ff
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import HttpServer from ff:httpserver
|
|
2
|
+
|
|
3
|
+
import Lux
|
|
4
|
+
import LuxEvent
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
mainComponent(lux: Lux, system: BrowserSystem) {
|
|
8
|
+
sleepComponent(lux, system)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
sleepComponent(lux: Lux, system: BrowserSystem) {
|
|
12
|
+
lux.useState(False): start, setStart =>
|
|
13
|
+
if(start) {
|
|
14
|
+
lux.useSuspense {
|
|
15
|
+
lux.div {
|
|
16
|
+
lux.div {lux.text("Sleeping")}
|
|
17
|
+
lux.button {
|
|
18
|
+
lux.text("Cancel")
|
|
19
|
+
lux.onClick {event =>
|
|
20
|
+
event.preventDefault()
|
|
21
|
+
setStart(False)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} {lux =>
|
|
26
|
+
trySleep(lux.task, "A")
|
|
27
|
+
lux.div {lux.text("Done sleeping")}
|
|
28
|
+
}
|
|
29
|
+
} else {
|
|
30
|
+
lux.button {
|
|
31
|
+
lux.text("Start")
|
|
32
|
+
lux.onClick {event =>
|
|
33
|
+
event.preventDefault()
|
|
34
|
+
setStart(True)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ifComponent(lux: Lux, system: BrowserSystem) {
|
|
41
|
+
lux.useState(False): start, setStart =>
|
|
42
|
+
if(start) {
|
|
43
|
+
lux.div {lux.text("Started")}
|
|
44
|
+
} else {
|
|
45
|
+
lux.button {
|
|
46
|
+
lux.text("Start")
|
|
47
|
+
lux.onClick {event =>
|
|
48
|
+
event.preventDefault()
|
|
49
|
+
setStart(True)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
rhymeComponent(lux: Lux, system: BrowserSystem) {
|
|
56
|
+
lux.div {
|
|
57
|
+
lux.useState(0): count, setCount =>
|
|
58
|
+
Log.debug("useState(0)")
|
|
59
|
+
lux.useState("Ɛ"): text, setText =>
|
|
60
|
+
lux.div {
|
|
61
|
+
lux.button {
|
|
62
|
+
lux.text("Count: " + count)
|
|
63
|
+
lux.onClick {event =>
|
|
64
|
+
setCount(count + 1)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
lux.div {
|
|
68
|
+
lux.useCallback1(setText): setText =>
|
|
69
|
+
lux.useLazy1(text): text =>
|
|
70
|
+
lux.div {
|
|
71
|
+
lux.div {
|
|
72
|
+
lux.text("Text: " + text + " -> ")
|
|
73
|
+
lux.useSuspense {lux.span {lux.text("Rhyming...")}} {lux =>
|
|
74
|
+
lux.span {
|
|
75
|
+
lux.text(rhyme(system, text))
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
lux.input {
|
|
80
|
+
lux.setValue(text)
|
|
81
|
+
Log.debug("setValue: " + text)
|
|
82
|
+
lux.onInput {event =>
|
|
83
|
+
Log.debug(text + " -> " + event.text())
|
|
84
|
+
setText(event.text())
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
rhyme(system: BrowserSystem, text: String): String {
|
|
95
|
+
let result = system.httpClient().fetch("https://api.datamuse.com/words?rel_rhy=" + text)
|
|
96
|
+
let json = system.js().parseJson(result.readText())
|
|
97
|
+
if(json.get(0).isNullOrUndefined()) {"?"} else {json.get(0).get("word").grabString()}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
browserMain(system: BrowserSystem): Unit {
|
|
101
|
+
Lux.renderById(system, "main") {lux =>
|
|
102
|
+
lux.div {
|
|
103
|
+
mainComponent(lux, system)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
nodeMain(system: NodeSystem): Unit {
|
|
109
|
+
HttpServer.listen(system, "localhost", 8080) {request, response =>
|
|
110
|
+
if(request.path() == "/") {
|
|
111
|
+
response.setHeader("Content-Type", ["text/html; charset=UTF-8"])
|
|
112
|
+
response.writeText("<!doctype html>")
|
|
113
|
+
response.writeText("<div id='main'></div>")
|
|
114
|
+
response.writeText("<script type='module' src='/js/script/script/Main2.mjs'></script>")
|
|
115
|
+
} elseIf {request.path().startsWith("/js/") && !request.path().contains("..")} {
|
|
116
|
+
response.setHeader("Content-Type", ["text/javascript; charset=UTF-8"])
|
|
117
|
+
response.writeText(system.assets().readText(request.path()))
|
|
118
|
+
} elseIf {request.path() == "/chat"} {
|
|
119
|
+
system.mainTask().sleep(Duration(request.readText().size().toFloat()))
|
|
120
|
+
response.setHeader("Content-Type", ["text/plain; charset=UTF-8"])
|
|
121
|
+
response.writeText("Hello there!")
|
|
122
|
+
} else {
|
|
123
|
+
response.writeStatus(404, Some("Not found"))
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
buildMain(system: BuildSystem) {
|
|
129
|
+
let browser = system.compileForBrowser("Main2.ff")
|
|
130
|
+
let assets = AssetSystem.create().addAssets("/js", browser.assets())
|
|
131
|
+
system.setAssets(assets)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
trySleep(task: Task, name: String) {
|
|
135
|
+
try {
|
|
136
|
+
task.sleep(Duration(4.0))
|
|
137
|
+
Log.debug("Slept!")
|
|
138
|
+
} catchAny {error =>
|
|
139
|
+
if(error.name() == "AbortError") {
|
|
140
|
+
Log.debug(name + " aborted")
|
|
141
|
+
}
|
|
142
|
+
error.rethrow()
|
|
143
|
+
} grab()
|
|
144
|
+
}
|
|
@@ -30,6 +30,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
30
30
|
|
|
31
31
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
32
32
|
|
|
33
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
34
|
+
|
|
33
35
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
34
36
|
|
|
35
37
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -90,6 +92,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
90
92
|
|
|
91
93
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
92
94
|
|
|
95
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
96
|
+
|
|
93
97
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
94
98
|
|
|
95
99
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -32,6 +32,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
32
32
|
|
|
33
33
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
34
34
|
|
|
35
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
36
|
+
|
|
35
37
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
36
38
|
|
|
37
39
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -92,6 +94,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
92
94
|
|
|
93
95
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
94
96
|
|
|
97
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
98
|
+
|
|
95
99
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
96
100
|
|
|
97
101
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -111,7 +115,7 @@ export function Compiler(emitTarget_, task_, compilerModulePath_, jsOutputPath_,
|
|
|
111
115
|
return {emitTarget_, task_, compilerModulePath_, jsOutputPath_, packagePaths_, singleFilePackages_, virtualFiles_, lspHook_, parsedModules_, resolvedModules_, derivedModules_, inferredModules_, emittedModules_, phaseDurations_, phaseDurationDelta_};
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Empty())))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
|
|
118
|
+
export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("Box", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("SourceLocation", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Empty())))))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
|
|
115
119
|
return ff_compiler_Syntax.DImport(ff_compiler_Syntax.Location("<prelude>", 1, 1), moduleName_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_List.Empty(), moduleName_)
|
|
116
120
|
}));
|
|
117
121
|
|
|
@@ -209,7 +213,7 @@ return ff_core_Option.Option_else(ff_core_Map.Map_get(self_.resolvedModules_, ((
|
|
|
209
213
|
return ff_compiler_Compiler.Compiler_measure(self_, "Resolve", packagePair_, moduleName_, (() => {
|
|
210
214
|
const module_ = ff_compiler_Compiler.Compiler_parse(self_, packagePair_, moduleName_, ff_core_Option.None());
|
|
211
215
|
const otherModules_ = ff_compiler_Compiler.Compiler_imports(self_, module_);
|
|
212
|
-
const resolver_ = ff_compiler_Resolver.make_(self_.lspHook_);
|
|
216
|
+
const resolver_ = ff_compiler_Resolver.make_(packagePair_, moduleName_, self_.lspHook_);
|
|
213
217
|
const result_ = ff_compiler_Resolver.Resolver_resolveModule(resolver_, module_, otherModules_);
|
|
214
218
|
self_.resolvedModules_ = ff_core_Map.Map_add(self_.resolvedModules_, ((packageName_ + ":") + moduleName_), result_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
215
219
|
return result_
|
|
@@ -259,7 +263,8 @@ const newModuleName_ = ff_core_String.String_dropLast(i_.file_, ff_core_String.S
|
|
|
259
263
|
ff_compiler_Compiler.Compiler_emit(self_, i_.packagePair_, newModuleName_, false);
|
|
260
264
|
return ff_compiler_Compiler.Compiler_infer(self_, i_.packagePair_, newModuleName_)
|
|
261
265
|
}));
|
|
262
|
-
const
|
|
266
|
+
const allModules_ = ff_core_List.Link(module_, otherModules_);
|
|
267
|
+
const js_ = ff_compiler_JsEmitter.JsEmitter_emitModule(ff_compiler_JsEmitter.make_(allModules_, self_.emitTarget_, isMainModule_, self_.compilerModulePath_, packagePair_, moduleName_), packagePair_, module_);
|
|
263
268
|
const jsPath_ = ff_core_Path.Path_slash(ff_core_Path.Path_slash(self_.jsOutputPath_, packagePair_.group_), packagePair_.name_);
|
|
264
269
|
const jsFile_ = ff_core_Path.Path_slash(jsPath_, (moduleName_ + ".mjs"));
|
|
265
270
|
ff_core_Path.Path_createDirectory(jsPath_, true);
|
|
@@ -346,7 +351,7 @@ return (await ff_core_Option.Option_else$(ff_core_Map.Map_get(self_.resolvedModu
|
|
|
346
351
|
return (await ff_compiler_Compiler.Compiler_measure$(self_, "Resolve", packagePair_, moduleName_, (async ($task) => {
|
|
347
352
|
const module_ = (await ff_compiler_Compiler.Compiler_parse$(self_, packagePair_, moduleName_, ff_core_Option.None(), $task));
|
|
348
353
|
const otherModules_ = (await ff_compiler_Compiler.Compiler_imports$(self_, module_, $task));
|
|
349
|
-
const resolver_ = ff_compiler_Resolver.make_(self_.lspHook_);
|
|
354
|
+
const resolver_ = ff_compiler_Resolver.make_(packagePair_, moduleName_, self_.lspHook_);
|
|
350
355
|
const result_ = ff_compiler_Resolver.Resolver_resolveModule(resolver_, module_, otherModules_);
|
|
351
356
|
self_.resolvedModules_ = ff_core_Map.Map_add(self_.resolvedModules_, ((packageName_ + ":") + moduleName_), result_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
352
357
|
return result_
|
|
@@ -396,7 +401,8 @@ const newModuleName_ = ff_core_String.String_dropLast(i_.file_, ff_core_String.S
|
|
|
396
401
|
(await ff_compiler_Compiler.Compiler_emit$(self_, i_.packagePair_, newModuleName_, false, $task));
|
|
397
402
|
return (await ff_compiler_Compiler.Compiler_infer$(self_, i_.packagePair_, newModuleName_, $task))
|
|
398
403
|
}), $task));
|
|
399
|
-
const
|
|
404
|
+
const allModules_ = ff_core_List.Link(module_, otherModules_);
|
|
405
|
+
const js_ = (await ff_compiler_JsEmitter.JsEmitter_emitModule$((await ff_compiler_JsEmitter.make_$(allModules_, self_.emitTarget_, isMainModule_, self_.compilerModulePath_, packagePair_, moduleName_, $task)), packagePair_, module_, $task));
|
|
400
406
|
const jsPath_ = (await ff_core_Path.Path_slash$((await ff_core_Path.Path_slash$(self_.jsOutputPath_, packagePair_.group_, $task)), packagePair_.name_, $task));
|
|
401
407
|
const jsFile_ = (await ff_core_Path.Path_slash$(jsPath_, (moduleName_ + ".mjs"), $task));
|
|
402
408
|
(await ff_core_Path.Path_createDirectory$(jsPath_, true, $task));
|
|
@@ -22,6 +22,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
22
22
|
|
|
23
23
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
24
24
|
|
|
25
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
26
|
+
|
|
25
27
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
26
28
|
|
|
27
29
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -82,6 +84,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
82
84
|
|
|
83
85
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
84
86
|
|
|
87
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
88
|
+
|
|
85
89
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
90
|
|
|
87
91
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -125,7 +129,7 @@ return
|
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
export function Deriver_makeHasAnyTagInstances(self_, modulePrefix_, module_) {
|
|
128
|
-
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Serializable.DeserializationChecksumException", ff_core_List.Link("ff:core/Core.GrabException", ff_core_List.Empty())), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
132
|
+
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Serializable.DeserializationChecksumException", ff_core_List.Link("ff:core/Core.GrabException", ff_core_List.Link("ff:core/Unit.Unit", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/Int.Int", ff_core_List.Link("ff:core/Float.Float", ff_core_List.Link("ff:core/String.String", ff_core_List.Link("ff:core/Char.Char", ff_core_List.Link("ff:core/Bool.Bool", ff_core_List.Link("ff:core/List.List", ff_core_List.Empty()))))))))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
129
133
|
const missingInstance_ = ff_compiler_Deriver.Deriver_findTypesThatNeedInstances(self_, "ff:core/Any.HasAnyTag", modulePrefix_, coreWhitelist_, true, module_);
|
|
130
134
|
return ff_core_List.List_map(missingInstance_, ((_w1) => {
|
|
131
135
|
return ff_compiler_Deriver.Deriver_makeHasAnyTagInstance(self_, modulePrefix_, _w1)
|
|
@@ -316,7 +320,7 @@ return go_(fields_)
|
|
|
316
320
|
}
|
|
317
321
|
|
|
318
322
|
export function Deriver_makeEqualInstances(self_, modulePrefix_, module_) {
|
|
319
|
-
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/List.List", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Empty()))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
323
|
+
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/List.List", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Link("ff:core/Unit.Unit", ff_core_List.Empty())))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
320
324
|
const missingInstance_ = ff_compiler_Deriver.Deriver_findTypesThatNeedInstances(self_, "ff:core/Equal.Equal", modulePrefix_, coreWhitelist_, true, module_);
|
|
321
325
|
return ff_core_List.List_map(missingInstance_, ((_w1) => {
|
|
322
326
|
return ff_compiler_Deriver.Deriver_makeEqualInstance(self_, modulePrefix_, _w1)
|
|
@@ -565,7 +569,7 @@ return
|
|
|
565
569
|
}
|
|
566
570
|
|
|
567
571
|
export async function Deriver_makeHasAnyTagInstances$(self_, modulePrefix_, module_, $task) {
|
|
568
|
-
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Serializable.DeserializationChecksumException", ff_core_List.Link("ff:core/Core.GrabException", ff_core_List.Empty())), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
572
|
+
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Serializable.DeserializationChecksumException", ff_core_List.Link("ff:core/Core.GrabException", ff_core_List.Link("ff:core/Unit.Unit", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/Int.Int", ff_core_List.Link("ff:core/Float.Float", ff_core_List.Link("ff:core/String.String", ff_core_List.Link("ff:core/Char.Char", ff_core_List.Link("ff:core/Bool.Bool", ff_core_List.Link("ff:core/List.List", ff_core_List.Empty()))))))))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
569
573
|
const missingInstance_ = ff_compiler_Deriver.Deriver_findTypesThatNeedInstances(self_, "ff:core/Any.HasAnyTag", modulePrefix_, coreWhitelist_, true, module_);
|
|
570
574
|
return ff_core_List.List_map(missingInstance_, ((_w1) => {
|
|
571
575
|
return ff_compiler_Deriver.Deriver_makeHasAnyTagInstance(self_, modulePrefix_, _w1)
|
|
@@ -756,7 +760,7 @@ return go_(fields_)
|
|
|
756
760
|
}
|
|
757
761
|
|
|
758
762
|
export async function Deriver_makeEqualInstances$(self_, modulePrefix_, module_, $task) {
|
|
759
|
-
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/List.List", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Empty()))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
763
|
+
const coreWhitelist_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Option.Option", ff_core_List.Link("ff:core/List.List", ff_core_List.Link("ff:core/Pair.Pair", ff_core_List.Link("ff:core/Unit.Unit", ff_core_List.Empty())))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
760
764
|
const missingInstance_ = ff_compiler_Deriver.Deriver_findTypesThatNeedInstances(self_, "ff:core/Equal.Equal", modulePrefix_, coreWhitelist_, true, module_);
|
|
761
765
|
return ff_core_List.List_map(missingInstance_, ((_w1) => {
|
|
762
766
|
return ff_compiler_Deriver.Deriver_makeEqualInstance(self_, modulePrefix_, _w1)
|
|
@@ -18,6 +18,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
18
18
|
|
|
19
19
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
20
20
|
|
|
21
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
22
|
+
|
|
21
23
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
24
|
|
|
23
25
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -78,6 +80,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
78
80
|
|
|
79
81
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
80
82
|
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
81
85
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
86
|
|
|
83
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -182,8 +186,11 @@ return (_w1 !== "Q$")
|
|
|
182
186
|
const outerGenerics_ = (alreadyFlat_
|
|
183
187
|
? ff_core_List.Empty()
|
|
184
188
|
: d_.generics_);
|
|
189
|
+
const outerConstraints_ = (alreadyFlat_
|
|
190
|
+
? ff_core_List.Empty()
|
|
191
|
+
: d_.constraints_);
|
|
185
192
|
return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
|
|
186
|
-
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(
|
|
193
|
+
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
|
|
187
194
|
}))(method_.signature_)))
|
|
188
195
|
}))
|
|
189
196
|
return
|
|
@@ -295,8 +302,11 @@ return (_w1 !== "Q$")
|
|
|
295
302
|
const outerGenerics_ = (alreadyFlat_
|
|
296
303
|
? ff_core_List.Empty()
|
|
297
304
|
: d_.generics_);
|
|
305
|
+
const outerConstraints_ = (alreadyFlat_
|
|
306
|
+
? ff_core_List.Empty()
|
|
307
|
+
: d_.constraints_);
|
|
298
308
|
return ff_core_Pair.Pair((prefix_ + method_.signature_.name_), ff_compiler_Environment.Scheme(false, false, false, false, (((_c) => {
|
|
299
|
-
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(
|
|
309
|
+
return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(outerGenerics_, normalGenerics_)), ff_core_List.List_addAll(outerConstraints_, method_.signature_.constraints_), ff_core_List.Link(selfParameter_, method_.signature_.parameters_), _c.returnType_, _c.effect_)
|
|
300
310
|
}))(method_.signature_)))
|
|
301
311
|
}))
|
|
302
312
|
return
|
|
@@ -22,6 +22,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
22
22
|
|
|
23
23
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
24
24
|
|
|
25
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
26
|
+
|
|
25
27
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
26
28
|
|
|
27
29
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -82,6 +84,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
82
84
|
|
|
83
85
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
84
86
|
|
|
87
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
88
|
+
|
|
85
89
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
90
|
|
|
87
91
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|