firefly-compiler 0.4.4
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/.firefly-workspace +1 -0
- package/.vscode/settings.json +5 -0
- package/LICENSE.txt +21 -0
- package/README.md +96 -0
- package/bin/firefly.mjs +2 -0
- package/compiler/.firefly/package.ff +1 -0
- package/compiler/Builder.ff +218 -0
- package/compiler/Compiler.ff +241 -0
- package/compiler/Dependencies.ff +179 -0
- package/compiler/Deriver.ff +647 -0
- package/compiler/Dictionaries.ff +205 -0
- package/compiler/Environment.ff +166 -0
- package/compiler/Inference.ff +1117 -0
- package/compiler/JsEmitter.ff +861 -0
- package/compiler/JsImporter.ff +56 -0
- package/compiler/LspHook.ff +188 -0
- package/compiler/Main.ff +237 -0
- package/compiler/Parser.ff +1383 -0
- package/compiler/Patterns.ff +111 -0
- package/compiler/Resolver.ff +620 -0
- package/compiler/Substitution.ff +178 -0
- package/compiler/Syntax.ff +299 -0
- package/compiler/Token.ff +180 -0
- package/compiler/Tokenizer.ff +278 -0
- package/compiler/Unification.ff +220 -0
- package/compiler/Wildcards.ff +50 -0
- package/compiler/Workspace.ff +88 -0
- package/core/.firefly/package.ff +2 -0
- package/core/Any.ff +30 -0
- package/core/Array.ff +249 -0
- package/core/AssetSystem.ff +61 -0
- package/core/Atomic.ff +64 -0
- package/core/Bool.ff +13 -0
- package/core/BrowserSystem.ff +14 -0
- package/core/Buffer.ff +211 -0
- package/core/BuildSystem.ff +144 -0
- package/core/Channel.ff +131 -0
- package/core/Char.ff +18 -0
- package/core/Core.ff +58 -0
- package/core/Duration.ff +15 -0
- package/core/Equal.ff +52 -0
- package/core/Error.ff +20 -0
- package/core/FileHandle.ff +41 -0
- package/core/Float.ff +41 -0
- package/core/HttpClient.ff +84 -0
- package/core/Instant.ff +9 -0
- package/core/Int.ff +61 -0
- package/core/IntMap.ff +85 -0
- package/core/JsSystem.ff +66 -0
- package/core/JsValue.ff +240 -0
- package/core/List.ff +440 -0
- package/core/Lock.ff +144 -0
- package/core/Log.ff +24 -0
- package/core/Map.ff +126 -0
- package/core/NodeSystem.ff +88 -0
- package/core/Nothing.ff +1 -0
- package/core/Option.ff +133 -0
- package/core/Ordering.ff +157 -0
- package/core/Pair.ff +55 -0
- package/core/Path.ff +393 -0
- package/core/RbMap.ff +216 -0
- package/core/Serializable.ff +173 -0
- package/core/Set.ff +38 -0
- package/core/Show.ff +43 -0
- package/core/Stack.ff +263 -0
- package/core/Stream.ff +406 -0
- package/core/String.ff +175 -0
- package/core/StringMap.ff +85 -0
- package/core/Task.ff +138 -0
- package/core/Try.ff +81 -0
- package/core/Unit.ff +3 -0
- package/experimental/random/AltGeneric.ff +44 -0
- package/experimental/random/Async.ff +68 -0
- package/experimental/random/Buffer2.ff +77 -0
- package/experimental/random/Cat.ff +12 -0
- package/experimental/random/Dictionary.ff +52 -0
- package/experimental/random/Example.ff +46 -0
- package/experimental/random/Generic.ff +102 -0
- package/experimental/random/HappyEyeballs.ff +40 -0
- package/experimental/random/HashMap.ff +72 -0
- package/experimental/random/IfElseUnit.ff +9 -0
- package/experimental/random/InputOutput.ff +23 -0
- package/experimental/random/ListVsArray.ff +45 -0
- package/experimental/random/Main.ff +44 -0
- package/experimental/random/MapTest.ff +67 -0
- package/experimental/random/OldTaskSystem.ff +210 -0
- package/experimental/random/PatternTest.ff +39 -0
- package/experimental/random/Patterns.ff +226 -0
- package/experimental/random/ReadBytesTest.ff +10 -0
- package/experimental/random/RunLength.ff +65 -0
- package/experimental/random/Scrape.ff +51 -0
- package/experimental/random/Serialization.ff +217 -0
- package/experimental/random/SerializationTest.ff +46 -0
- package/experimental/random/Serializer.ff +36 -0
- package/experimental/random/StdInOutErr.ff +4 -0
- package/experimental/random/Symbols.ff +74 -0
- package/experimental/random/Tag.ff +49 -0
- package/experimental/random/Tensor.ff +52 -0
- package/experimental/random/Try.ff +56 -0
- package/experimental/random/Tsv.ff +9 -0
- package/experimental/random/TypesAreModules.ff +87 -0
- package/experimental/random/blueprints/Blueprint.ff +52 -0
- package/experimental/random/blueprints/Main.ff +11 -0
- package/experimental/random/blueprints/Pretty.ff +58 -0
- package/experimental/random/blueprints/User.ff +64 -0
- package/experimental/random/blueprintsystem/BlueprintSystem.ff +48 -0
- package/experimental/random/blueprintsystem/Deserialize.ff +53 -0
- package/experimental/random/blueprintsystem/ReadJs.ff +13 -0
- package/experimental/random/blueprintsystem/User.ff +2 -0
- package/experimental/random/kahrs/Kahrs.ff +112 -0
- package/experimental/random/kahrs/TestKahrs.ff +22 -0
- package/experimental/random/kahrs/TestMap.ff +18 -0
- package/experimental/random/streaming/Gzip.ff +3 -0
- package/experimental/random/streaming/Main.ff +34 -0
- package/experimental/random/streaming/S3Bucket.ff +11 -0
- package/experimental/random/streaming/Tar.ff +5 -0
- package/experimental/rhymeapp/Main.ff +81 -0
- package/experimental/rhymeapp/index.html +14 -0
- package/firefly.sh +5 -0
- package/fireflysite/Main.ff +13 -0
- package/httpserver/.firefly/package.ff +1 -0
- package/httpserver/HttpServer.ff +184 -0
- package/lsp/.firefly/package.ff +1 -0
- package/lsp/CompletionHandler.ff +814 -0
- package/lsp/Handler.ff +551 -0
- package/lsp/HoverHandler.ff +82 -0
- package/lsp/LanguageServer.ff +229 -0
- package/lsp/SignatureHelpHandler.ff +55 -0
- package/lsp/SymbolHandler.ff +167 -0
- package/output/js/ff/compiler/Builder.mjs +483 -0
- package/output/js/ff/compiler/Compiler.mjs +410 -0
- package/output/js/ff/compiler/Dependencies.mjs +388 -0
- package/output/js/ff/compiler/Deriver.mjs +1166 -0
- package/output/js/ff/compiler/Dictionaries.mjs +1305 -0
- package/output/js/ff/compiler/Environment.mjs +1005 -0
- package/output/js/ff/compiler/Inference.mjs +4264 -0
- package/output/js/ff/compiler/JsEmitter.mjs +5353 -0
- package/output/js/ff/compiler/JsImporter.mjs +262 -0
- package/output/js/ff/compiler/LspHook.mjs +789 -0
- package/output/js/ff/compiler/Main.mjs +1695 -0
- package/output/js/ff/compiler/Parser.mjs +4004 -0
- package/output/js/ff/compiler/Patterns.mjs +923 -0
- package/output/js/ff/compiler/Resolver.mjs +2303 -0
- package/output/js/ff/compiler/Substitution.mjs +1146 -0
- package/output/js/ff/compiler/Syntax.mjs +12430 -0
- package/output/js/ff/compiler/Token.mjs +3092 -0
- package/output/js/ff/compiler/Tokenizer.mjs +589 -0
- package/output/js/ff/compiler/Unification.mjs +1748 -0
- package/output/js/ff/compiler/Wildcards.mjs +604 -0
- package/output/js/ff/compiler/Workspace.mjs +683 -0
- package/output/js/ff/core/Any.mjs +139 -0
- package/output/js/ff/core/Array.mjs +594 -0
- package/output/js/ff/core/AssetSystem.mjs +270 -0
- package/output/js/ff/core/Atomic.mjs +186 -0
- package/output/js/ff/core/Bool.mjs +141 -0
- package/output/js/ff/core/BrowserSystem.mjs +122 -0
- package/output/js/ff/core/Buffer.mjs +467 -0
- package/output/js/ff/core/BuildSystem.mjs +320 -0
- package/output/js/ff/core/Channel.mjs +268 -0
- package/output/js/ff/core/Char.mjs +145 -0
- package/output/js/ff/core/Core.mjs +300 -0
- package/output/js/ff/core/Duration.mjs +112 -0
- package/output/js/ff/core/Equal.mjs +175 -0
- package/output/js/ff/core/Error.mjs +138 -0
- package/output/js/ff/core/FileHandle.mjs +164 -0
- package/output/js/ff/core/Float.mjs +214 -0
- package/output/js/ff/core/HttpClient.mjs +210 -0
- package/output/js/ff/core/Instant.mjs +105 -0
- package/output/js/ff/core/Int.mjs +254 -0
- package/output/js/ff/core/IntMap.mjs +282 -0
- package/output/js/ff/core/JsSystem.mjs +234 -0
- package/output/js/ff/core/JsValue.mjs +678 -0
- package/output/js/ff/core/List.mjs +2335 -0
- package/output/js/ff/core/Lock.mjs +322 -0
- package/output/js/ff/core/Log.mjs +159 -0
- package/output/js/ff/core/Map.mjs +358 -0
- package/output/js/ff/core/NodeSystem.mjs +288 -0
- package/output/js/ff/core/Nothing.mjs +100 -0
- package/output/js/ff/core/Option.mjs +1002 -0
- package/output/js/ff/core/Ordering.mjs +734 -0
- package/output/js/ff/core/Pair.mjs +318 -0
- package/output/js/ff/core/Path.mjs +768 -0
- package/output/js/ff/core/RbMap.mjs +1936 -0
- package/output/js/ff/core/Serializable.mjs +434 -0
- package/output/js/ff/core/Set.mjs +250 -0
- package/output/js/ff/core/Show.mjs +201 -0
- package/output/js/ff/core/Stack.mjs +595 -0
- package/output/js/ff/core/Stream.mjs +1300 -0
- package/output/js/ff/core/String.mjs +433 -0
- package/output/js/ff/core/StringMap.mjs +282 -0
- package/output/js/ff/core/Task.mjs +345 -0
- package/output/js/ff/core/Try.mjs +503 -0
- package/output/js/ff/core/Unit.mjs +103 -0
- package/package.json +29 -0
- package/postgresql/.firefly/include/package-lock.json +250 -0
- package/postgresql/.firefly/include/package.json +5 -0
- package/postgresql/.firefly/include/prepare.sh +2 -0
- package/postgresql/.firefly/package.ff +3 -0
- package/postgresql/Pg.ff +530 -0
- package/unsafejs/.firefly/package.ff +1 -0
- package/unsafejs/UnsafeJs.ff +19 -0
- package/vscode/.vscode/launch.json +18 -0
- package/vscode/.vscode/tasks.json +33 -0
- package/vscode/LICENSE.txt +21 -0
- package/vscode/Prepublish.ff +15 -0
- package/vscode/README.md +17 -0
- package/vscode/client/package-lock.json +544 -0
- package/vscode/client/package.json +22 -0
- package/vscode/client/src/extension.ts +64 -0
- package/vscode/client/tsconfig.json +12 -0
- package/vscode/icons/firefly-icon.png +0 -0
- package/vscode/icons/firefly-icon.svg +10 -0
- package/vscode/icons/firefly-logo-notext.png +0 -0
- package/vscode/icons/firefly-logo.png +0 -0
- package/vscode/language-configuration.json +39 -0
- package/vscode/package-lock.json +3623 -0
- package/vscode/package.json +144 -0
- package/vscode/snippets-none.json +1 -0
- package/vscode/snippets.json +241 -0
- package/vscode/syntaxes/firefly.tmLanguage.json +294 -0
- package/vscode/tsconfig.json +20 -0
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
4
|
+
|
|
5
|
+
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
6
|
+
|
|
7
|
+
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
8
|
+
|
|
9
|
+
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
10
|
+
|
|
11
|
+
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
12
|
+
|
|
13
|
+
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
14
|
+
|
|
15
|
+
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
16
|
+
|
|
17
|
+
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
18
|
+
|
|
19
|
+
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
20
|
+
|
|
21
|
+
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
22
|
+
|
|
23
|
+
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
24
|
+
|
|
25
|
+
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
26
|
+
|
|
27
|
+
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
28
|
+
|
|
29
|
+
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
30
|
+
|
|
31
|
+
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
32
|
+
|
|
33
|
+
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
34
|
+
|
|
35
|
+
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
36
|
+
|
|
37
|
+
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
38
|
+
|
|
39
|
+
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
40
|
+
|
|
41
|
+
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
42
|
+
|
|
43
|
+
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
44
|
+
|
|
45
|
+
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
46
|
+
|
|
47
|
+
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
48
|
+
|
|
49
|
+
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
50
|
+
|
|
51
|
+
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
52
|
+
|
|
53
|
+
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
54
|
+
|
|
55
|
+
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
56
|
+
|
|
57
|
+
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
58
|
+
|
|
59
|
+
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
60
|
+
|
|
61
|
+
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
62
|
+
|
|
63
|
+
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
64
|
+
|
|
65
|
+
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
66
|
+
|
|
67
|
+
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
68
|
+
|
|
69
|
+
import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
70
|
+
|
|
71
|
+
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
72
|
+
|
|
73
|
+
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
74
|
+
|
|
75
|
+
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
76
|
+
|
|
77
|
+
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
78
|
+
|
|
79
|
+
import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
|
|
80
|
+
|
|
81
|
+
import * as ff_core_Task from "../../ff/core/Task.mjs"
|
|
82
|
+
|
|
83
|
+
import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
84
|
+
|
|
85
|
+
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
86
|
+
|
|
87
|
+
// type Ordering
|
|
88
|
+
const OrderingBefore$ = {OrderingBefore: true};
|
|
89
|
+
export function OrderingBefore() {
|
|
90
|
+
return OrderingBefore$;
|
|
91
|
+
}
|
|
92
|
+
const OrderingSame$ = {OrderingSame: true};
|
|
93
|
+
export function OrderingSame() {
|
|
94
|
+
return OrderingSame$;
|
|
95
|
+
}
|
|
96
|
+
const OrderingAfter$ = {OrderingAfter: true};
|
|
97
|
+
export function OrderingAfter() {
|
|
98
|
+
return OrderingAfter$;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
export function before_(x_, y_, ff_core_Ordering_Order$T) {
|
|
104
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) === ff_core_Ordering.OrderingBefore())
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function notBefore_(x_, y_, ff_core_Ordering_Order$T) {
|
|
108
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) !== ff_core_Ordering.OrderingBefore())
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function after_(x_, y_, ff_core_Ordering_Order$T) {
|
|
112
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) === ff_core_Ordering.OrderingAfter())
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function notAfter_(x_, y_, ff_core_Ordering_Order$T) {
|
|
116
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) !== ff_core_Ordering.OrderingAfter())
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function reverse_(compare_) {
|
|
120
|
+
return ((x_, y_) => {
|
|
121
|
+
{
|
|
122
|
+
const _1 = compare_(x_, y_);
|
|
123
|
+
{
|
|
124
|
+
if(_1.OrderingBefore) {
|
|
125
|
+
return ff_core_Ordering.OrderingAfter()
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
{
|
|
130
|
+
if(_1.OrderingSame) {
|
|
131
|
+
return ff_core_Ordering.OrderingSame()
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
{
|
|
136
|
+
if(_1.OrderingAfter) {
|
|
137
|
+
return ff_core_Ordering.OrderingBefore()
|
|
138
|
+
return
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function pair_(compareFirst_, compareSecond_) {
|
|
146
|
+
return ((x_, y_) => {
|
|
147
|
+
{
|
|
148
|
+
const _1 = compareFirst_(x_.first_, y_.first_);
|
|
149
|
+
{
|
|
150
|
+
if(_1.OrderingSame) {
|
|
151
|
+
return compareSecond_(x_.second_, y_.second_)
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
{
|
|
156
|
+
const ordering_ = _1;
|
|
157
|
+
return ordering_
|
|
158
|
+
return
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function fromInt_(order_) {
|
|
165
|
+
if((order_ < 0)) {
|
|
166
|
+
return ff_core_Ordering.OrderingBefore()
|
|
167
|
+
} else if((order_ === 0)) {
|
|
168
|
+
return ff_core_Ordering.OrderingSame()
|
|
169
|
+
} else {
|
|
170
|
+
return ff_core_Ordering.OrderingAfter()
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function fromFloat_(order_) {
|
|
175
|
+
if((order_ < 0.0)) {
|
|
176
|
+
return ff_core_Ordering.OrderingBefore()
|
|
177
|
+
} else if((order_ === 0.0)) {
|
|
178
|
+
return ff_core_Ordering.OrderingSame()
|
|
179
|
+
} else {
|
|
180
|
+
return ff_core_Ordering.OrderingAfter()
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function fromLessThan_(lessThan_) {
|
|
185
|
+
return ((_1, _2) => {
|
|
186
|
+
{
|
|
187
|
+
const x_ = _1;
|
|
188
|
+
const y_ = _2;
|
|
189
|
+
const _guard1 = lessThan_(x_, y_);
|
|
190
|
+
if(_guard1) {
|
|
191
|
+
return ff_core_Ordering.OrderingBefore()
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
{
|
|
196
|
+
const x_ = _1;
|
|
197
|
+
const y_ = _2;
|
|
198
|
+
const _guard1 = lessThan_(y_, x_);
|
|
199
|
+
if(_guard1) {
|
|
200
|
+
return ff_core_Ordering.OrderingAfter()
|
|
201
|
+
return
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
{
|
|
205
|
+
return ff_core_Ordering.OrderingSame()
|
|
206
|
+
return
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export async function before_$(x_, y_, ff_core_Ordering_Order$T, $task) {
|
|
212
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) === ff_core_Ordering.OrderingBefore())
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export async function notBefore_$(x_, y_, ff_core_Ordering_Order$T, $task) {
|
|
216
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) !== ff_core_Ordering.OrderingBefore())
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export async function after_$(x_, y_, ff_core_Ordering_Order$T, $task) {
|
|
220
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) === ff_core_Ordering.OrderingAfter())
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export async function notAfter_$(x_, y_, ff_core_Ordering_Order$T, $task) {
|
|
224
|
+
return (ff_core_Ordering_Order$T.compare_(x_, y_) !== ff_core_Ordering.OrderingAfter())
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export async function reverse_$(compare_, $task) {
|
|
228
|
+
return (async (x_, y_, $task) => {
|
|
229
|
+
{
|
|
230
|
+
const _1 = (await compare_(x_, y_, $task));
|
|
231
|
+
{
|
|
232
|
+
if(_1.OrderingBefore) {
|
|
233
|
+
return ff_core_Ordering.OrderingAfter()
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
{
|
|
238
|
+
if(_1.OrderingSame) {
|
|
239
|
+
return ff_core_Ordering.OrderingSame()
|
|
240
|
+
return
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
{
|
|
244
|
+
if(_1.OrderingAfter) {
|
|
245
|
+
return ff_core_Ordering.OrderingBefore()
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export async function pair_$(compareFirst_, compareSecond_, $task) {
|
|
254
|
+
return (async (x_, y_, $task) => {
|
|
255
|
+
{
|
|
256
|
+
const _1 = (await compareFirst_(x_.first_, y_.first_, $task));
|
|
257
|
+
{
|
|
258
|
+
if(_1.OrderingSame) {
|
|
259
|
+
return (await compareSecond_(x_.second_, y_.second_, $task))
|
|
260
|
+
return
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
{
|
|
264
|
+
const ordering_ = _1;
|
|
265
|
+
return ordering_
|
|
266
|
+
return
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export async function fromInt_$(order_, $task) {
|
|
273
|
+
if((order_ < 0)) {
|
|
274
|
+
return ff_core_Ordering.OrderingBefore()
|
|
275
|
+
} else if((order_ === 0)) {
|
|
276
|
+
return ff_core_Ordering.OrderingSame()
|
|
277
|
+
} else {
|
|
278
|
+
return ff_core_Ordering.OrderingAfter()
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export async function fromFloat_$(order_, $task) {
|
|
283
|
+
if((order_ < 0.0)) {
|
|
284
|
+
return ff_core_Ordering.OrderingBefore()
|
|
285
|
+
} else if((order_ === 0.0)) {
|
|
286
|
+
return ff_core_Ordering.OrderingSame()
|
|
287
|
+
} else {
|
|
288
|
+
return ff_core_Ordering.OrderingAfter()
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export async function fromLessThan_$(lessThan_, $task) {
|
|
293
|
+
return (async (_1, _2, $task) => {
|
|
294
|
+
{
|
|
295
|
+
const x_ = _1;
|
|
296
|
+
const y_ = _2;
|
|
297
|
+
const _guard1 = (await lessThan_(x_, y_, $task));
|
|
298
|
+
if(_guard1) {
|
|
299
|
+
return ff_core_Ordering.OrderingBefore()
|
|
300
|
+
return
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
{
|
|
304
|
+
const x_ = _1;
|
|
305
|
+
const y_ = _2;
|
|
306
|
+
const _guard1 = (await lessThan_(y_, x_, $task));
|
|
307
|
+
if(_guard1) {
|
|
308
|
+
return ff_core_Ordering.OrderingAfter()
|
|
309
|
+
return
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
{
|
|
313
|
+
return ff_core_Ordering.OrderingSame()
|
|
314
|
+
return
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export function Ordering_toInt(self_) {
|
|
320
|
+
{
|
|
321
|
+
const _1 = self_;
|
|
322
|
+
{
|
|
323
|
+
if(_1.OrderingBefore) {
|
|
324
|
+
return (-1)
|
|
325
|
+
return
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
{
|
|
329
|
+
if(_1.OrderingSame) {
|
|
330
|
+
return 0
|
|
331
|
+
return
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
{
|
|
335
|
+
if(_1.OrderingAfter) {
|
|
336
|
+
return 1
|
|
337
|
+
return
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export function Ordering_reverse(self_) {
|
|
344
|
+
{
|
|
345
|
+
const _1 = self_;
|
|
346
|
+
{
|
|
347
|
+
if(_1.OrderingBefore) {
|
|
348
|
+
return ff_core_Ordering.OrderingAfter()
|
|
349
|
+
return
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
{
|
|
353
|
+
if(_1.OrderingSame) {
|
|
354
|
+
return ff_core_Ordering.OrderingSame()
|
|
355
|
+
return
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
{
|
|
359
|
+
if(_1.OrderingAfter) {
|
|
360
|
+
return ff_core_Ordering.OrderingBefore()
|
|
361
|
+
return
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export async function Ordering_toInt$(self_, $task) {
|
|
368
|
+
{
|
|
369
|
+
const _1 = self_;
|
|
370
|
+
{
|
|
371
|
+
if(_1.OrderingBefore) {
|
|
372
|
+
return (-1)
|
|
373
|
+
return
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
{
|
|
377
|
+
if(_1.OrderingSame) {
|
|
378
|
+
return 0
|
|
379
|
+
return
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
{
|
|
383
|
+
if(_1.OrderingAfter) {
|
|
384
|
+
return 1
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export async function Ordering_reverse$(self_, $task) {
|
|
392
|
+
{
|
|
393
|
+
const _1 = self_;
|
|
394
|
+
{
|
|
395
|
+
if(_1.OrderingBefore) {
|
|
396
|
+
return ff_core_Ordering.OrderingAfter()
|
|
397
|
+
return
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
{
|
|
401
|
+
if(_1.OrderingSame) {
|
|
402
|
+
return ff_core_Ordering.OrderingSame()
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
{
|
|
407
|
+
if(_1.OrderingAfter) {
|
|
408
|
+
return ff_core_Ordering.OrderingBefore()
|
|
409
|
+
return
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export const ff_core_Ordering_Order$ff_core_Nothing_Nothing = {
|
|
416
|
+
compare_(x_, y_) {
|
|
417
|
+
return ff_core_Ordering.OrderingSame()
|
|
418
|
+
},
|
|
419
|
+
async compare_$(x_, y_, $task) {
|
|
420
|
+
return ff_core_Ordering.OrderingSame()
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
export const ff_core_Ordering_Order$ff_core_Bool_Bool = {
|
|
425
|
+
compare_(x_, y_) {
|
|
426
|
+
{
|
|
427
|
+
const x_a = x_;
|
|
428
|
+
const y_a = y_;
|
|
429
|
+
{
|
|
430
|
+
if(!x_a) {
|
|
431
|
+
if(y_a) {
|
|
432
|
+
return ff_core_Ordering.OrderingBefore()
|
|
433
|
+
return
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
{
|
|
438
|
+
if(x_a) {
|
|
439
|
+
if(!y_a) {
|
|
440
|
+
return ff_core_Ordering.OrderingAfter()
|
|
441
|
+
return
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
{
|
|
446
|
+
return ff_core_Ordering.OrderingSame()
|
|
447
|
+
return
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
async compare_$(x_, y_, $task) {
|
|
452
|
+
{
|
|
453
|
+
const x_a = x_;
|
|
454
|
+
const y_a = y_;
|
|
455
|
+
{
|
|
456
|
+
if(!x_a) {
|
|
457
|
+
if(y_a) {
|
|
458
|
+
return ff_core_Ordering.OrderingBefore()
|
|
459
|
+
return
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
{
|
|
464
|
+
if(x_a) {
|
|
465
|
+
if(!y_a) {
|
|
466
|
+
return ff_core_Ordering.OrderingAfter()
|
|
467
|
+
return
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
{
|
|
472
|
+
return ff_core_Ordering.OrderingSame()
|
|
473
|
+
return
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
export const ff_core_Ordering_Order$ff_core_Char_Char = {
|
|
480
|
+
compare_(x_, y_) {
|
|
481
|
+
return ff_core_Ordering.fromInt_((x_ - y_))
|
|
482
|
+
},
|
|
483
|
+
async compare_$(x_, y_, $task) {
|
|
484
|
+
return ff_core_Ordering.fromInt_((x_ - y_))
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
export const ff_core_Ordering_Order$ff_core_Int_Int = {
|
|
489
|
+
compare_(x_, y_) {
|
|
490
|
+
return ff_core_Ordering.fromInt_((x_ - y_))
|
|
491
|
+
},
|
|
492
|
+
async compare_$(x_, y_, $task) {
|
|
493
|
+
return ff_core_Ordering.fromInt_((x_ - y_))
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
export const ff_core_Ordering_Order$ff_core_Float_Float = {
|
|
498
|
+
compare_(x_, y_) {
|
|
499
|
+
return ff_core_Ordering.fromFloat_((x_ - y_))
|
|
500
|
+
},
|
|
501
|
+
async compare_$(x_, y_, $task) {
|
|
502
|
+
return ff_core_Ordering.fromFloat_((x_ - y_))
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
export const ff_core_Ordering_Order$ff_core_String_String = {
|
|
507
|
+
compare_(x_, y_) {
|
|
508
|
+
|
|
509
|
+
if(x_ < y_) {
|
|
510
|
+
return ff_core_Ordering.OrderingBefore()
|
|
511
|
+
} else if(x_ > y_) {
|
|
512
|
+
return ff_core_Ordering.OrderingAfter()
|
|
513
|
+
} else {
|
|
514
|
+
return ff_core_Ordering.OrderingSame()
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
},
|
|
518
|
+
async compare_$(x_, y_, $task) {
|
|
519
|
+
throw new Error('Function compare is missing on this target in async context.');
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
export function ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering_Order$A, ff_core_Ordering_Order$B) { return {
|
|
524
|
+
compare_(x_, y_) {
|
|
525
|
+
{
|
|
526
|
+
const _1 = ff_core_Ordering_Order$A.compare_(x_.first_, y_.first_);
|
|
527
|
+
{
|
|
528
|
+
if(_1.OrderingSame) {
|
|
529
|
+
return ff_core_Ordering_Order$B.compare_(x_.second_, y_.second_)
|
|
530
|
+
return
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
{
|
|
534
|
+
const o_ = _1;
|
|
535
|
+
return o_
|
|
536
|
+
return
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
async compare_$(x_, y_, $task) {
|
|
541
|
+
{
|
|
542
|
+
const _1 = ff_core_Ordering_Order$A.compare_(x_.first_, y_.first_);
|
|
543
|
+
{
|
|
544
|
+
if(_1.OrderingSame) {
|
|
545
|
+
return ff_core_Ordering_Order$B.compare_(x_.second_, y_.second_)
|
|
546
|
+
return
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
{
|
|
550
|
+
const o_ = _1;
|
|
551
|
+
return o_
|
|
552
|
+
return
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}}
|
|
557
|
+
|
|
558
|
+
export function ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T) { return {
|
|
559
|
+
compare_(x_, y_) {
|
|
560
|
+
{
|
|
561
|
+
const x_a = x_;
|
|
562
|
+
const y_a = y_;
|
|
563
|
+
{
|
|
564
|
+
if(x_a.Empty) {
|
|
565
|
+
if(y_a.Empty) {
|
|
566
|
+
return ff_core_Ordering.OrderingSame()
|
|
567
|
+
return
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
{
|
|
572
|
+
if(x_a.Empty) {
|
|
573
|
+
return ff_core_Ordering.OrderingBefore()
|
|
574
|
+
return
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
{
|
|
578
|
+
if(y_a.Empty) {
|
|
579
|
+
return ff_core_Ordering.OrderingAfter()
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
{
|
|
584
|
+
if(x_a.Link) {
|
|
585
|
+
const a_ = x_a.head_;
|
|
586
|
+
const as_ = x_a.tail_;
|
|
587
|
+
if(y_a.Link) {
|
|
588
|
+
const b_ = y_a.head_;
|
|
589
|
+
const bs_ = y_a.tail_;
|
|
590
|
+
{
|
|
591
|
+
const _1 = ff_core_Ordering_Order$T.compare_(a_, b_);
|
|
592
|
+
{
|
|
593
|
+
if(_1.OrderingSame) {
|
|
594
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T).compare_(as_, bs_)
|
|
595
|
+
return
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
{
|
|
599
|
+
const o_ = _1;
|
|
600
|
+
return o_
|
|
601
|
+
return
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
async compare_$(x_, y_, $task) {
|
|
611
|
+
{
|
|
612
|
+
const x_a = x_;
|
|
613
|
+
const y_a = y_;
|
|
614
|
+
{
|
|
615
|
+
if(x_a.Empty) {
|
|
616
|
+
if(y_a.Empty) {
|
|
617
|
+
return ff_core_Ordering.OrderingSame()
|
|
618
|
+
return
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
{
|
|
623
|
+
if(x_a.Empty) {
|
|
624
|
+
return ff_core_Ordering.OrderingBefore()
|
|
625
|
+
return
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
{
|
|
629
|
+
if(y_a.Empty) {
|
|
630
|
+
return ff_core_Ordering.OrderingAfter()
|
|
631
|
+
return
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
{
|
|
635
|
+
if(x_a.Link) {
|
|
636
|
+
const a_ = x_a.head_;
|
|
637
|
+
const as_ = x_a.tail_;
|
|
638
|
+
if(y_a.Link) {
|
|
639
|
+
const b_ = y_a.head_;
|
|
640
|
+
const bs_ = y_a.tail_;
|
|
641
|
+
{
|
|
642
|
+
const _1 = ff_core_Ordering_Order$T.compare_(a_, b_);
|
|
643
|
+
{
|
|
644
|
+
if(_1.OrderingSame) {
|
|
645
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering_Order$T).compare_(as_, bs_)
|
|
646
|
+
return
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
{
|
|
650
|
+
const o_ = _1;
|
|
651
|
+
return o_
|
|
652
|
+
return
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}}
|
|
662
|
+
|
|
663
|
+
export const ff_core_Equal_Equal$ff_core_Ordering_Ordering = {
|
|
664
|
+
equals_(x_, y_) {
|
|
665
|
+
{
|
|
666
|
+
const x_a = x_;
|
|
667
|
+
const y_a = y_;
|
|
668
|
+
{
|
|
669
|
+
if(x_a.OrderingBefore) {
|
|
670
|
+
if(y_a.OrderingBefore) {
|
|
671
|
+
return true
|
|
672
|
+
return
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
{
|
|
677
|
+
if(x_a.OrderingSame) {
|
|
678
|
+
if(y_a.OrderingSame) {
|
|
679
|
+
return true
|
|
680
|
+
return
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
{
|
|
685
|
+
if(x_a.OrderingAfter) {
|
|
686
|
+
if(y_a.OrderingAfter) {
|
|
687
|
+
return true
|
|
688
|
+
return
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
{
|
|
693
|
+
return false
|
|
694
|
+
return
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
async equals_$(x_, y_, $task) {
|
|
699
|
+
{
|
|
700
|
+
const x_a = x_;
|
|
701
|
+
const y_a = y_;
|
|
702
|
+
{
|
|
703
|
+
if(x_a.OrderingBefore) {
|
|
704
|
+
if(y_a.OrderingBefore) {
|
|
705
|
+
return true
|
|
706
|
+
return
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
{
|
|
711
|
+
if(x_a.OrderingSame) {
|
|
712
|
+
if(y_a.OrderingSame) {
|
|
713
|
+
return true
|
|
714
|
+
return
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
{
|
|
719
|
+
if(x_a.OrderingAfter) {
|
|
720
|
+
if(y_a.OrderingAfter) {
|
|
721
|
+
return true
|
|
722
|
+
return
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
{
|
|
727
|
+
return false
|
|
728
|
+
return
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
|
|
734
|
+
|