firefly-compiler 0.4.6 → 0.4.8
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/Compiler.ff +2 -0
- package/compiler/Deriver.ff +7 -0
- package/core/Array.ff +17 -4
- package/core/AssetSystem.ff +1 -1
- package/core/BrowserSystem.ff +27 -0
- package/core/List.ff +4 -0
- package/core/Lock.ff +2 -2
- package/core/Random.ff +148 -0
- package/core/SourceLocation.ff +27 -0
- package/core/Task.ff +3 -0
- package/core/WebSocket.ff +127 -0
- package/httpserver/HttpServer.ff +1 -1
- package/lux/Css.ff +648 -0
- package/lux/CssTest.ff +48 -0
- package/lux/Lux.ff +33 -18
- package/lux/Main.ff +4 -1
- package/output/js/ff/compiler/Builder.mjs +448 -444
- package/output/js/ff/compiler/Compiler.mjs +420 -416
- package/output/js/ff/compiler/Dependencies.mjs +393 -389
- package/output/js/ff/compiler/Deriver.mjs +1178 -1170
- package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
- package/output/js/ff/compiler/Environment.mjs +1025 -1015
- package/output/js/ff/compiler/Inference.mjs +4272 -4268
- package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
- package/output/js/ff/compiler/JsImporter.mjs +270 -266
- package/output/js/ff/compiler/LspHook.mjs +799 -793
- package/output/js/ff/compiler/Main.mjs +1691 -1675
- package/output/js/ff/compiler/Parser.mjs +4016 -4008
- package/output/js/ff/compiler/Patterns.mjs +935 -927
- package/output/js/ff/compiler/Resolver.mjs +2311 -2307
- package/output/js/ff/compiler/Substitution.mjs +1154 -1150
- package/output/js/ff/compiler/Syntax.mjs +12566 -12434
- package/output/js/ff/compiler/Token.mjs +3152 -3096
- package/output/js/ff/compiler/Tokenizer.mjs +597 -593
- package/output/js/ff/compiler/Unification.mjs +1762 -1752
- package/output/js/ff/compiler/Wildcards.mjs +612 -608
- package/output/js/ff/compiler/Workspace.mjs +695 -687
- package/output/js/ff/core/Any.mjs +147 -143
- package/output/js/ff/core/Array.mjs +573 -547
- package/output/js/ff/core/AssetSystem.mjs +278 -274
- package/output/js/ff/core/Atomic.mjs +158 -154
- package/output/js/ff/core/Bool.mjs +156 -152
- package/output/js/ff/core/Box.mjs +116 -112
- package/output/js/ff/core/BrowserSystem.mjs +181 -126
- package/output/js/ff/core/Buffer.mjs +399 -395
- package/output/js/ff/core/BuildSystem.mjs +300 -296
- package/output/js/ff/core/Channel.mjs +193 -189
- package/output/js/ff/core/Char.mjs +153 -149
- package/output/js/ff/core/Core.mjs +304 -300
- package/output/js/ff/core/Duration.mjs +120 -116
- package/output/js/ff/core/Equal.mjs +183 -179
- package/output/js/ff/core/Error.mjs +146 -142
- package/output/js/ff/core/FileHandle.mjs +154 -150
- package/output/js/ff/core/Float.mjs +229 -225
- package/output/js/ff/core/HttpClient.mjs +195 -191
- package/output/js/ff/core/Instant.mjs +113 -109
- package/output/js/ff/core/Int.mjs +269 -265
- package/output/js/ff/core/IntMap.mjs +284 -280
- package/output/js/ff/core/JsSystem.mjs +242 -238
- package/output/js/ff/core/JsValue.mjs +712 -708
- package/output/js/ff/core/List.mjs +2346 -2334
- package/output/js/ff/core/Lock.mjs +235 -231
- package/output/js/ff/core/Log.mjs +167 -163
- package/output/js/ff/core/Map.mjs +366 -362
- package/output/js/ff/core/NodeSystem.mjs +298 -294
- package/output/js/ff/core/Nothing.mjs +108 -104
- package/output/js/ff/core/Option.mjs +1023 -1015
- package/output/js/ff/core/Ordering.mjs +734 -730
- package/output/js/ff/core/Pair.mjs +337 -331
- package/output/js/ff/core/Path.mjs +549 -545
- package/output/js/ff/core/Random.mjs +340 -0
- package/output/js/ff/core/RbMap.mjs +1944 -1940
- package/output/js/ff/core/Serializable.mjs +432 -428
- package/output/js/ff/core/Set.mjs +258 -254
- package/output/js/ff/core/Show.mjs +209 -205
- package/output/js/ff/core/SourceLocation.mjs +273 -229
- package/output/js/ff/core/Stack.mjs +533 -529
- package/output/js/ff/core/Stream.mjs +1308 -1304
- package/output/js/ff/core/String.mjs +369 -365
- package/output/js/ff/core/StringMap.mjs +284 -280
- package/output/js/ff/core/Task.mjs +325 -319
- package/output/js/ff/core/Try.mjs +511 -507
- package/output/js/ff/core/Unit.mjs +155 -151
- package/output/js/ff/core/WebSocket.mjs +198 -0
- package/package.json +1 -1
- package/vscode/package.json +1 -1
- package/webserver/.firefly/include/package-lock.json +16 -0
- package/webserver/.firefly/include/package.json +5 -0
- package/webserver/.firefly/package.ff +2 -0
- package/webserver/WebServer.ff +608 -0
|
@@ -1,200 +1,218 @@
|
|
|
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_Box from "../../ff/core/Box.mjs"
|
|
14
|
-
|
|
15
|
-
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
16
|
-
|
|
17
|
-
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
18
|
-
|
|
19
|
-
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
20
|
-
|
|
21
|
-
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
22
|
-
|
|
23
|
-
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
24
|
-
|
|
25
|
-
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
26
|
-
|
|
27
|
-
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
28
|
-
|
|
29
|
-
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
30
|
-
|
|
31
|
-
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
32
|
-
|
|
33
|
-
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
34
|
-
|
|
35
|
-
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
36
|
-
|
|
37
|
-
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
38
|
-
|
|
39
|
-
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
40
|
-
|
|
41
|
-
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
42
|
-
|
|
43
|
-
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
44
|
-
|
|
45
|
-
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
46
|
-
|
|
47
|
-
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
48
|
-
|
|
49
|
-
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
50
|
-
|
|
51
|
-
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
52
|
-
|
|
53
|
-
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
54
|
-
|
|
55
|
-
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
56
|
-
|
|
57
|
-
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
58
|
-
|
|
59
|
-
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
60
|
-
|
|
61
|
-
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
62
|
-
|
|
63
|
-
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
64
|
-
|
|
65
|
-
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
66
|
-
|
|
67
|
-
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
68
|
-
|
|
69
|
-
import * as
|
|
70
|
-
|
|
71
|
-
import * as
|
|
72
|
-
|
|
73
|
-
import * as
|
|
74
|
-
|
|
75
|
-
import * as
|
|
76
|
-
|
|
77
|
-
import * as
|
|
78
|
-
|
|
79
|
-
import * as
|
|
80
|
-
|
|
81
|
-
import * as
|
|
82
|
-
|
|
83
|
-
import * as
|
|
84
|
-
|
|
85
|
-
import * as
|
|
86
|
-
|
|
87
|
-
import * as
|
|
88
|
-
|
|
89
|
-
import * as
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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_Box from "../../ff/core/Box.mjs"
|
|
14
|
+
|
|
15
|
+
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
16
|
+
|
|
17
|
+
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
18
|
+
|
|
19
|
+
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
20
|
+
|
|
21
|
+
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
22
|
+
|
|
23
|
+
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
24
|
+
|
|
25
|
+
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
26
|
+
|
|
27
|
+
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
28
|
+
|
|
29
|
+
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
30
|
+
|
|
31
|
+
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
32
|
+
|
|
33
|
+
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
34
|
+
|
|
35
|
+
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
36
|
+
|
|
37
|
+
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
38
|
+
|
|
39
|
+
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
40
|
+
|
|
41
|
+
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
42
|
+
|
|
43
|
+
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
44
|
+
|
|
45
|
+
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
46
|
+
|
|
47
|
+
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
48
|
+
|
|
49
|
+
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
50
|
+
|
|
51
|
+
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
52
|
+
|
|
53
|
+
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
54
|
+
|
|
55
|
+
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
56
|
+
|
|
57
|
+
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
58
|
+
|
|
59
|
+
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
60
|
+
|
|
61
|
+
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
62
|
+
|
|
63
|
+
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
64
|
+
|
|
65
|
+
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
66
|
+
|
|
67
|
+
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
68
|
+
|
|
69
|
+
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
70
|
+
|
|
71
|
+
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
72
|
+
|
|
73
|
+
import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
74
|
+
|
|
75
|
+
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
|
+
|
|
77
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
78
|
+
|
|
79
|
+
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
80
|
+
|
|
81
|
+
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
82
|
+
|
|
83
|
+
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
84
|
+
|
|
85
|
+
import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
|
|
86
|
+
|
|
87
|
+
import * as ff_core_Task from "../../ff/core/Task.mjs"
|
|
88
|
+
|
|
89
|
+
import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
90
|
+
|
|
91
|
+
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
|
+
|
|
93
|
+
import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
|
|
94
|
+
|
|
95
|
+
// type Array
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export function empty_() {
|
|
97
101
|
|
|
98
102
|
return [];
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function fill_(size_, value_) {
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function fill_(size_, value_) {
|
|
103
107
|
|
|
104
108
|
return new Array(size_).fill(value_);
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function fillBy_(size_, body_) {
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function fillBy_(size_, body_) {
|
|
109
113
|
|
|
110
114
|
return Array.from({length: size_}, (_, i) => body_(i));
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export function range_(size_) {
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function range_(size_) {
|
|
115
119
|
|
|
116
120
|
return Array.from({length: size_}, (_, i) => i);
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export function internalSame_(left_, right_) {
|
|
121
|
-
return left_ === right_
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export async function empty_$($task) {
|
|
125
|
-
throw new Error('Function empty is missing on this target in async context.');
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export async function fill_$(size_, value_, $task) {
|
|
129
|
-
throw new Error('Function fill is missing on this target in async context.');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export async function fillBy_$(size_, body_, $task) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function internalSame_(left_, right_) {
|
|
125
|
+
return left_ === right_
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export async function empty_$($task) {
|
|
129
|
+
throw new Error('Function empty is missing on this target in async context.');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export async function fill_$(size_, value_, $task) {
|
|
133
|
+
throw new Error('Function fill is missing on this target in async context.');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function fillBy_$(size_, body_, $task) {
|
|
137
|
+
|
|
138
|
+
const array = new Array(size_);
|
|
139
|
+
for(let i = 0; i < size_; i++) {
|
|
140
|
+
array[i] = await(body_(_i));
|
|
141
|
+
}
|
|
142
|
+
return array;
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export async function range_$(size_, $task) {
|
|
147
|
+
throw new Error('Function range is missing on this target in async context.');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export async function internalSame_$(left_, right_, $task) {
|
|
151
|
+
throw new Error('Function internalSame is missing on this target in async context.');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function Array_addAll(self_, that_) {
|
|
155
|
+
return self_.concat(that_)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function Array_isEmpty(self_) {
|
|
159
|
+
return self_.length === 0
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function Array_size(self_) {
|
|
163
|
+
return self_.length
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function Array_get(self_, index_) {
|
|
157
167
|
|
|
158
168
|
return index_ >= 0 && index_ < self_.length
|
|
159
169
|
? ff_core_Option.Some(self_[index_])
|
|
160
170
|
: ff_core_Option.None()
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function Array_grab(self_, index_) {
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function Array_grab(self_, index_) {
|
|
165
175
|
|
|
166
176
|
if(index_ < 0 || index_ >= self_.length) {
|
|
167
177
|
ff_core_Try.internalThrowGrabException_()
|
|
168
178
|
}
|
|
169
179
|
return self_[index_]
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function Array_first(self_) {
|
|
174
|
-
return ff_core_Array.Array_get(self_, 0)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function Array_last(self_) {
|
|
178
|
-
return ff_core_Array.Array_get(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export function Array_grabFirst(self_) {
|
|
182
|
-
return ff_core_Array.Array_grab(self_, 0)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export function Array_grabLast(self_) {
|
|
186
|
-
return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export function
|
|
190
|
-
return self_.slice(count_)
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export function
|
|
194
|
-
return self_.slice(
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export function
|
|
180
|
+
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function Array_first(self_) {
|
|
184
|
+
return ff_core_Array.Array_get(self_, 0)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function Array_last(self_) {
|
|
188
|
+
return ff_core_Array.Array_get(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function Array_grabFirst(self_) {
|
|
192
|
+
return ff_core_Array.Array_grab(self_, 0)
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function Array_grabLast(self_) {
|
|
196
|
+
return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function Array_takeFirst(self_, count_ = 1) {
|
|
200
|
+
return self_.slice(0, count_)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function Array_takeLast(self_, count_ = 1) {
|
|
204
|
+
return self_.slice(-count_)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function Array_dropFirst(self_, count_ = 1) {
|
|
208
|
+
return self_.slice(count_)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function Array_dropLast(self_, count_ = 1) {
|
|
212
|
+
return self_.slice(0, self_.length - count_)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function Array_update(self_, index_, body_) {
|
|
198
216
|
|
|
199
217
|
if(index_ < 0 || index_ >= self_.length) {
|
|
200
218
|
ff_core_Try.internalThrowGrabException_()
|
|
@@ -202,154 +220,162 @@ export function Array_update(self_, index_, body_) {
|
|
|
202
220
|
let result = self_.slice();
|
|
203
221
|
result[index_] = body_(result[index_]);
|
|
204
222
|
return result;
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export function Array_chunk(self_, chunkSize_) {
|
|
209
|
-
const results_ = ff_core_Stack.make_();
|
|
210
|
-
const result_ = ff_core_Stack.make_();
|
|
211
|
-
let added_ = 0;
|
|
212
|
-
ff_core_Array.Array_each(self_, ((item_) => {
|
|
213
|
-
if((added_ < chunkSize_)) {
|
|
214
|
-
added_ += 1
|
|
215
|
-
} else {
|
|
216
|
-
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_));
|
|
217
|
-
added_ = 1
|
|
218
|
-
};
|
|
219
|
-
ff_core_Stack.Stack_push(result_, item_)
|
|
220
|
-
}));
|
|
221
|
-
if((added_ !== 0)) {
|
|
222
|
-
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_))
|
|
223
|
-
};
|
|
224
|
-
return ff_core_Stack.Stack_drain(results_)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export function Array_toList(self_) {
|
|
223
|
+
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function Array_chunk(self_, chunkSize_) {
|
|
227
|
+
const results_ = ff_core_Stack.make_();
|
|
228
|
+
const result_ = ff_core_Stack.make_();
|
|
229
|
+
let added_ = 0;
|
|
230
|
+
ff_core_Array.Array_each(self_, ((item_) => {
|
|
231
|
+
if((added_ < chunkSize_)) {
|
|
232
|
+
added_ += 1
|
|
233
|
+
} else {
|
|
234
|
+
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_));
|
|
235
|
+
added_ = 1
|
|
236
|
+
};
|
|
237
|
+
ff_core_Stack.Stack_push(result_, item_)
|
|
238
|
+
}));
|
|
239
|
+
if((added_ !== 0)) {
|
|
240
|
+
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_))
|
|
241
|
+
};
|
|
242
|
+
return ff_core_Stack.Stack_drain(results_)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function Array_toList(self_) {
|
|
228
246
|
|
|
229
247
|
let result = ff_core_List.Empty();
|
|
230
248
|
for(let i = self_.length - 1; i >= 0; i--) {
|
|
231
249
|
result = ff_core_List.Link(self_[i], result);
|
|
232
250
|
}
|
|
233
251
|
return result;
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export function Array_toStream(self_, cycle_ = false) {
|
|
238
|
-
let index_ = 0;
|
|
239
|
-
return ff_core_Stream.make_((() => {
|
|
240
|
-
if((index_ < ff_core_Array.Array_size(self_))) {
|
|
241
|
-
return ff_core_Option.Some((function() {
|
|
242
|
-
const result_ = ff_core_Array.Array_grab(self_, index_);
|
|
243
|
-
index_ += 1;
|
|
244
|
-
return result_
|
|
245
|
-
})())
|
|
246
|
-
} else if((cycle_ && (index_ !== 0))) {
|
|
247
|
-
return ff_core_Option.Some((function() {
|
|
248
|
-
const result_ = ff_core_Array.Array_grab(self_, 0);
|
|
249
|
-
index_ = 1;
|
|
250
|
-
return result_
|
|
251
|
-
})())
|
|
252
|
-
} else return ff_core_Option.None()
|
|
253
|
-
}), (() => {
|
|
254
|
-
|
|
255
|
-
}))
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export function Array_toStack(self_) {
|
|
259
|
-
return {array: self_.slice()}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export function Array_each(self_, body_) {
|
|
252
|
+
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function Array_toStream(self_, cycle_ = false) {
|
|
256
|
+
let index_ = 0;
|
|
257
|
+
return ff_core_Stream.make_((() => {
|
|
258
|
+
if((index_ < ff_core_Array.Array_size(self_))) {
|
|
259
|
+
return ff_core_Option.Some((function() {
|
|
260
|
+
const result_ = ff_core_Array.Array_grab(self_, index_);
|
|
261
|
+
index_ += 1;
|
|
262
|
+
return result_
|
|
263
|
+
})())
|
|
264
|
+
} else if((cycle_ && (index_ !== 0))) {
|
|
265
|
+
return ff_core_Option.Some((function() {
|
|
266
|
+
const result_ = ff_core_Array.Array_grab(self_, 0);
|
|
267
|
+
index_ = 1;
|
|
268
|
+
return result_
|
|
269
|
+
})())
|
|
270
|
+
} else return ff_core_Option.None()
|
|
271
|
+
}), (() => {
|
|
272
|
+
|
|
273
|
+
}))
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function Array_toStack(self_) {
|
|
277
|
+
return {array: self_.slice()}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function Array_each(self_, body_) {
|
|
263
281
|
|
|
264
282
|
return self_.forEach(body_);
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export function Array_eachWhile(self_, body_) {
|
|
269
|
-
for(const value of self_) if(!body_(value)) break
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export function Array_all(self_, body_) {
|
|
273
|
-
let result_ = true;
|
|
274
|
-
ff_core_Array.Array_eachWhile(self_, ((x_) => {
|
|
275
|
-
result_ = (result_ && body_(x_));
|
|
276
|
-
return result_
|
|
277
|
-
}));
|
|
278
|
-
return result_
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export function Array_any(self_, body_) {
|
|
282
|
-
let result_ = false;
|
|
283
|
-
ff_core_Array.Array_eachWhile(self_, ((x_) => {
|
|
284
|
-
result_ = (result_ || body_(x_));
|
|
285
|
-
return (!result_)
|
|
286
|
-
}));
|
|
287
|
-
return result_
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function Array_map(self_, body_) {
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export function Array_eachWhile(self_, body_) {
|
|
287
|
+
for(const value of self_) if(!body_(value)) break
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export function Array_all(self_, body_) {
|
|
291
|
+
let result_ = true;
|
|
292
|
+
ff_core_Array.Array_eachWhile(self_, ((x_) => {
|
|
293
|
+
result_ = (result_ && body_(x_));
|
|
294
|
+
return result_
|
|
295
|
+
}));
|
|
296
|
+
return result_
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export function Array_any(self_, body_) {
|
|
300
|
+
let result_ = false;
|
|
301
|
+
ff_core_Array.Array_eachWhile(self_, ((x_) => {
|
|
302
|
+
result_ = (result_ || body_(x_));
|
|
303
|
+
return (!result_)
|
|
304
|
+
}));
|
|
305
|
+
return result_
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function Array_map(self_, body_) {
|
|
291
309
|
|
|
292
310
|
return self_.map(body_)
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export function Array_sortBy(self_, body_, ff_core_Ordering_Order$S) {
|
|
297
|
-
return ff_core_Array.Array_sortWith(self_, ((_w1, _w2) => {
|
|
298
|
-
return ff_core_Ordering_Order$S.compare_(body_(_w1), body_(_w2))
|
|
299
|
-
}))
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export function Array_sortWith(self_, ordering_) {
|
|
303
|
-
const stack_ = ff_core_Array.Array_toStack(self_);
|
|
304
|
-
ff_core_Stack.Stack_sortWith(stack_, ordering_);
|
|
305
|
-
return ff_core_Stack.Stack_drain(stack_)
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export async function Array_addAll$(self_, that_, $task) {
|
|
309
|
-
throw new Error('Function Array_addAll is missing on this target in async context.');
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
export async function Array_isEmpty$(self_, $task) {
|
|
313
|
-
throw new Error('Function Array_isEmpty is missing on this target in async context.');
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
export async function Array_size$(self_, $task) {
|
|
317
|
-
throw new Error('Function Array_size is missing on this target in async context.');
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export async function Array_get$(self_, index_, $task) {
|
|
321
|
-
throw new Error('Function Array_get is missing on this target in async context.');
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
export async function Array_grab$(self_, index_, $task) {
|
|
325
|
-
throw new Error('Function Array_grab is missing on this target in async context.');
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export async function Array_first$(self_, $task) {
|
|
329
|
-
return ff_core_Array.Array_get(self_, 0)
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export async function Array_last$(self_, $task) {
|
|
333
|
-
return ff_core_Array.Array_get(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export async function Array_grabFirst$(self_, $task) {
|
|
337
|
-
return ff_core_Array.Array_grab(self_, 0)
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export async function Array_grabLast$(self_, $task) {
|
|
341
|
-
return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export async function
|
|
345
|
-
throw new Error('Function
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
export async function
|
|
349
|
-
throw new Error('Function
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
export async function
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export function Array_sortBy(self_, body_, ff_core_Ordering_Order$S) {
|
|
315
|
+
return ff_core_Array.Array_sortWith(self_, ((_w1, _w2) => {
|
|
316
|
+
return ff_core_Ordering_Order$S.compare_(body_(_w1), body_(_w2))
|
|
317
|
+
}))
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function Array_sortWith(self_, ordering_) {
|
|
321
|
+
const stack_ = ff_core_Array.Array_toStack(self_);
|
|
322
|
+
ff_core_Stack.Stack_sortWith(stack_, ordering_);
|
|
323
|
+
return ff_core_Stack.Stack_drain(stack_)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export async function Array_addAll$(self_, that_, $task) {
|
|
327
|
+
throw new Error('Function Array_addAll is missing on this target in async context.');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export async function Array_isEmpty$(self_, $task) {
|
|
331
|
+
throw new Error('Function Array_isEmpty is missing on this target in async context.');
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export async function Array_size$(self_, $task) {
|
|
335
|
+
throw new Error('Function Array_size is missing on this target in async context.');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export async function Array_get$(self_, index_, $task) {
|
|
339
|
+
throw new Error('Function Array_get is missing on this target in async context.');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export async function Array_grab$(self_, index_, $task) {
|
|
343
|
+
throw new Error('Function Array_grab is missing on this target in async context.');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export async function Array_first$(self_, $task) {
|
|
347
|
+
return ff_core_Array.Array_get(self_, 0)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export async function Array_last$(self_, $task) {
|
|
351
|
+
return ff_core_Array.Array_get(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export async function Array_grabFirst$(self_, $task) {
|
|
355
|
+
return ff_core_Array.Array_grab(self_, 0)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export async function Array_grabLast$(self_, $task) {
|
|
359
|
+
return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export async function Array_takeFirst$(self_, count_ = 1, $task) {
|
|
363
|
+
throw new Error('Function Array_takeFirst is missing on this target in async context.');
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export async function Array_takeLast$(self_, count_ = 1, $task) {
|
|
367
|
+
throw new Error('Function Array_takeLast is missing on this target in async context.');
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export async function Array_dropFirst$(self_, count_ = 1, $task) {
|
|
371
|
+
throw new Error('Function Array_dropFirst is missing on this target in async context.');
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export async function Array_dropLast$(self_, count_ = 1, $task) {
|
|
375
|
+
throw new Error('Function Array_dropLast is missing on this target in async context.');
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export async function Array_update$(self_, index_, body_, $task) {
|
|
353
379
|
|
|
354
380
|
if(index_ < 0 || index_ >= self_.length) {
|
|
355
381
|
ff_core_Try.internalThrowGrabException_()
|
|
@@ -357,242 +383,242 @@ export async function Array_update$(self_, index_, body_, $task) {
|
|
|
357
383
|
let result = self_.slice();
|
|
358
384
|
result[index_] = await body_(result[index_], $task);
|
|
359
385
|
return result;
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
export async function Array_chunk$(self_, chunkSize_, $task) {
|
|
364
|
-
const results_ = ff_core_Stack.make_();
|
|
365
|
-
const result_ = ff_core_Stack.make_();
|
|
366
|
-
let added_ = 0;
|
|
367
|
-
ff_core_Array.Array_each(self_, ((item_) => {
|
|
368
|
-
if((added_ < chunkSize_)) {
|
|
369
|
-
added_ += 1
|
|
370
|
-
} else {
|
|
371
|
-
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_));
|
|
372
|
-
added_ = 1
|
|
373
|
-
};
|
|
374
|
-
ff_core_Stack.Stack_push(result_, item_)
|
|
375
|
-
}));
|
|
376
|
-
if((added_ !== 0)) {
|
|
377
|
-
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_))
|
|
378
|
-
};
|
|
379
|
-
return ff_core_Stack.Stack_drain(results_)
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export async function Array_toList$(self_, $task) {
|
|
383
|
-
throw new Error('Function Array_toList is missing on this target in async context.');
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export async function Array_toStream$(self_, cycle_ = false, $task) {
|
|
387
|
-
let index_ = 0;
|
|
388
|
-
return (await ff_core_Stream.make_$((async ($task) => {
|
|
389
|
-
if((index_ < ff_core_Array.Array_size(self_))) {
|
|
390
|
-
return ff_core_Option.Some((await (async function() {
|
|
391
|
-
const result_ = ff_core_Array.Array_grab(self_, index_);
|
|
392
|
-
index_ += 1;
|
|
393
|
-
return result_
|
|
394
|
-
})()))
|
|
395
|
-
} else if((cycle_ && (index_ !== 0))) {
|
|
396
|
-
return ff_core_Option.Some((await (async function() {
|
|
397
|
-
const result_ = ff_core_Array.Array_grab(self_, 0);
|
|
398
|
-
index_ = 1;
|
|
399
|
-
return result_
|
|
400
|
-
})()))
|
|
401
|
-
} else return ff_core_Option.None()
|
|
402
|
-
}), (async ($task) => {
|
|
403
|
-
|
|
404
|
-
}), $task))
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
export async function Array_toStack$(self_, $task) {
|
|
408
|
-
throw new Error('Function Array_toStack is missing on this target in async context.');
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export async function Array_each$(self_, body_, $task) {
|
|
386
|
+
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export async function Array_chunk$(self_, chunkSize_, $task) {
|
|
390
|
+
const results_ = ff_core_Stack.make_();
|
|
391
|
+
const result_ = ff_core_Stack.make_();
|
|
392
|
+
let added_ = 0;
|
|
393
|
+
ff_core_Array.Array_each(self_, ((item_) => {
|
|
394
|
+
if((added_ < chunkSize_)) {
|
|
395
|
+
added_ += 1
|
|
396
|
+
} else {
|
|
397
|
+
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_));
|
|
398
|
+
added_ = 1
|
|
399
|
+
};
|
|
400
|
+
ff_core_Stack.Stack_push(result_, item_)
|
|
401
|
+
}));
|
|
402
|
+
if((added_ !== 0)) {
|
|
403
|
+
ff_core_Stack.Stack_push(results_, ff_core_Stack.Stack_drain(result_))
|
|
404
|
+
};
|
|
405
|
+
return ff_core_Stack.Stack_drain(results_)
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export async function Array_toList$(self_, $task) {
|
|
409
|
+
throw new Error('Function Array_toList is missing on this target in async context.');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export async function Array_toStream$(self_, cycle_ = false, $task) {
|
|
413
|
+
let index_ = 0;
|
|
414
|
+
return (await ff_core_Stream.make_$((async ($task) => {
|
|
415
|
+
if((index_ < ff_core_Array.Array_size(self_))) {
|
|
416
|
+
return ff_core_Option.Some((await (async function() {
|
|
417
|
+
const result_ = ff_core_Array.Array_grab(self_, index_);
|
|
418
|
+
index_ += 1;
|
|
419
|
+
return result_
|
|
420
|
+
})()))
|
|
421
|
+
} else if((cycle_ && (index_ !== 0))) {
|
|
422
|
+
return ff_core_Option.Some((await (async function() {
|
|
423
|
+
const result_ = ff_core_Array.Array_grab(self_, 0);
|
|
424
|
+
index_ = 1;
|
|
425
|
+
return result_
|
|
426
|
+
})()))
|
|
427
|
+
} else return ff_core_Option.None()
|
|
428
|
+
}), (async ($task) => {
|
|
429
|
+
|
|
430
|
+
}), $task))
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export async function Array_toStack$(self_, $task) {
|
|
434
|
+
throw new Error('Function Array_toStack is missing on this target in async context.');
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export async function Array_each$(self_, body_, $task) {
|
|
412
438
|
|
|
413
439
|
for(let i = 0; i < self_.length; i++) {
|
|
414
440
|
await body_(self_[i], $task)
|
|
415
441
|
}
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
export async function Array_eachWhile$(self_, body_, $task) {
|
|
420
|
-
for(const value of self_) if(!await body_(value, $task)) break
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export async function Array_all$(self_, body_, $task) {
|
|
424
|
-
let result_ = true;
|
|
425
|
-
(await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
|
|
426
|
-
result_ = (result_ && (await body_(x_, $task)));
|
|
427
|
-
return result_
|
|
428
|
-
}), $task));
|
|
429
|
-
return result_
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export async function Array_any$(self_, body_, $task) {
|
|
433
|
-
let result_ = false;
|
|
434
|
-
(await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
|
|
435
|
-
result_ = (result_ || (await body_(x_, $task)));
|
|
436
|
-
return (!result_)
|
|
437
|
-
}), $task));
|
|
438
|
-
return result_
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
export async function Array_map$(self_, body_, $task) {
|
|
442
|
+
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export async function Array_eachWhile$(self_, body_, $task) {
|
|
446
|
+
for(const value of self_) if(!await body_(value, $task)) break
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export async function Array_all$(self_, body_, $task) {
|
|
450
|
+
let result_ = true;
|
|
451
|
+
(await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
|
|
452
|
+
result_ = (result_ && (await body_(x_, $task)));
|
|
453
|
+
return result_
|
|
454
|
+
}), $task));
|
|
455
|
+
return result_
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export async function Array_any$(self_, body_, $task) {
|
|
459
|
+
let result_ = false;
|
|
460
|
+
(await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
|
|
461
|
+
result_ = (result_ || (await body_(x_, $task)));
|
|
462
|
+
return (!result_)
|
|
463
|
+
}), $task));
|
|
464
|
+
return result_
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export async function Array_map$(self_, body_, $task) {
|
|
442
468
|
|
|
443
469
|
let result = [];
|
|
444
470
|
for(let i = self_.length - 1; i >= 0; i--) {
|
|
445
471
|
result.push(await body_(self_[i], $task));
|
|
446
472
|
}
|
|
447
473
|
return result;
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
export async function Array_sortBy$(self_, body_, ff_core_Ordering_Order$S, $task) {
|
|
452
|
-
return (await ff_core_Array.Array_sortWith$(self_, (async (_w1, _w2, $task) => {
|
|
453
|
-
return ff_core_Ordering_Order$S.compare_((await body_(_w1, $task)), (await body_(_w2, $task)))
|
|
454
|
-
}), $task))
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
export async function Array_sortWith$(self_, ordering_, $task) {
|
|
458
|
-
const stack_ = ff_core_Array.Array_toStack(self_);
|
|
459
|
-
(await ff_core_Stack.Stack_sortWith$(stack_, ordering_, $task));
|
|
460
|
-
return ff_core_Stack.Stack_drain(stack_)
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
export function Array_sort(self_, ff_core_Ordering_Order$T) {
|
|
464
|
-
return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
|
|
465
|
-
return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
466
|
-
}))
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
export function Array_toSet(self_, ff_core_Ordering_Order$T) {
|
|
470
|
-
return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export async function Array_sort$(self_, ff_core_Ordering_Order$T, $task) {
|
|
474
|
-
return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
|
|
475
|
-
return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
476
|
-
}))
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
export async function Array_toSet$(self_, ff_core_Ordering_Order$T, $task) {
|
|
480
|
-
return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
export function Array_toMap(self_, ff_core_Ordering_Order$K) {
|
|
484
|
-
return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
export async function Array_toMap$(self_, ff_core_Ordering_Order$K, $task) {
|
|
488
|
-
return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
export function Array_join(self_, separator_ = "") {
|
|
492
|
-
return self_.join(separator_)
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
export async function Array_join$(self_, separator_ = "", $task) {
|
|
496
|
-
throw new Error('Function Array_join is missing on this target in async context.');
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
export function ff_core_Show_Show$ff_core_Array_Array(ff_core_Show_Show$T) { return {
|
|
500
|
-
show_(value_) {
|
|
501
|
-
const stack_ = ff_core_Stack.make_();
|
|
502
|
-
ff_core_Stack.Stack_push(stack_, "[");
|
|
503
|
-
ff_core_Array.Array_each(value_, ((x_) => {
|
|
504
|
-
if((ff_core_Stack.Stack_size(stack_) > 1)) {
|
|
505
|
-
ff_core_Stack.Stack_push(stack_, ", ")
|
|
506
|
-
};
|
|
507
|
-
ff_core_Stack.Stack_push(stack_, ff_core_Show_Show$T.show_(x_))
|
|
508
|
-
}));
|
|
509
|
-
ff_core_Stack.Stack_push(stack_, "].toArray()");
|
|
510
|
-
return ff_core_Stack.Stack_join(stack_, "")
|
|
511
|
-
},
|
|
512
|
-
async show_$(value_, $task) {
|
|
513
|
-
const stack_ = ff_core_Stack.make_();
|
|
514
|
-
ff_core_Stack.Stack_push(stack_, "[");
|
|
515
|
-
ff_core_Array.Array_each(value_, ((x_) => {
|
|
516
|
-
if((ff_core_Stack.Stack_size(stack_) > 1)) {
|
|
517
|
-
ff_core_Stack.Stack_push(stack_, ", ")
|
|
518
|
-
};
|
|
519
|
-
ff_core_Stack.Stack_push(stack_, ff_core_Show_Show$T.show_(x_))
|
|
520
|
-
}));
|
|
521
|
-
ff_core_Stack.Stack_push(stack_, "].toArray()");
|
|
522
|
-
return ff_core_Stack.Stack_join(stack_, "")
|
|
523
|
-
}
|
|
524
|
-
}}
|
|
525
|
-
|
|
526
|
-
export function ff_core_Equal_Equal$ff_core_Array_Array(ff_core_Equal_Equal$T) { return {
|
|
527
|
-
equals_(x_, y_) {
|
|
528
|
-
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
529
|
-
return true
|
|
530
|
-
} else {
|
|
531
|
-
if((ff_core_Array.Array_size(x_) !== ff_core_Array.Array_size(y_))) {
|
|
532
|
-
return false
|
|
533
|
-
} else {
|
|
534
|
-
let i_ = (-1);
|
|
535
|
-
return ff_core_Array.Array_all(x_, ((l_) => {
|
|
536
|
-
i_ += 1;
|
|
537
|
-
return ff_core_Equal_Equal$T.equals_(l_, ff_core_Array.Array_grab(y_, i_))
|
|
538
|
-
}))
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
},
|
|
542
|
-
async equals_$(x_, y_, $task) {
|
|
543
|
-
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
544
|
-
return true
|
|
545
|
-
} else {
|
|
546
|
-
if((ff_core_Array.Array_size(x_) !== ff_core_Array.Array_size(y_))) {
|
|
547
|
-
return false
|
|
548
|
-
} else {
|
|
549
|
-
let i_ = (-1);
|
|
550
|
-
return ff_core_Array.Array_all(x_, ((l_) => {
|
|
551
|
-
i_ += 1;
|
|
552
|
-
return ff_core_Equal_Equal$T.equals_(l_, ff_core_Array.Array_grab(y_, i_))
|
|
553
|
-
}))
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}}
|
|
558
|
-
|
|
559
|
-
export function ff_core_Ordering_Order$ff_core_Array_Array(ff_core_Ordering_Order$T) { return {
|
|
560
|
-
compare_(x_, y_) {
|
|
561
|
-
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
562
|
-
return ff_core_Ordering.OrderingSame()
|
|
563
|
-
} else {
|
|
564
|
-
const size_ = ff_core_Int.Int_min(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_));
|
|
565
|
-
let i_ = 0;
|
|
566
|
-
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
567
|
-
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
568
|
-
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_Array.Array_grab(x_, i_), ff_core_Array.Array_grab(y_, i_));
|
|
569
|
-
i_ += 1
|
|
570
|
-
};
|
|
571
|
-
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
572
|
-
return ordering_
|
|
573
|
-
} else {
|
|
574
|
-
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_))
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
},
|
|
578
|
-
async compare_$(x_, y_, $task) {
|
|
579
|
-
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
580
|
-
return ff_core_Ordering.OrderingSame()
|
|
581
|
-
} else {
|
|
582
|
-
const size_ = ff_core_Int.Int_min(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_));
|
|
583
|
-
let i_ = 0;
|
|
584
|
-
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
585
|
-
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
586
|
-
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_Array.Array_grab(x_, i_), ff_core_Array.Array_grab(y_, i_));
|
|
587
|
-
i_ += 1
|
|
588
|
-
};
|
|
589
|
-
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
590
|
-
return ordering_
|
|
591
|
-
} else {
|
|
592
|
-
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_))
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
}}
|
|
597
|
-
|
|
598
|
-
|
|
474
|
+
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export async function Array_sortBy$(self_, body_, ff_core_Ordering_Order$S, $task) {
|
|
478
|
+
return (await ff_core_Array.Array_sortWith$(self_, (async (_w1, _w2, $task) => {
|
|
479
|
+
return ff_core_Ordering_Order$S.compare_((await body_(_w1, $task)), (await body_(_w2, $task)))
|
|
480
|
+
}), $task))
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export async function Array_sortWith$(self_, ordering_, $task) {
|
|
484
|
+
const stack_ = ff_core_Array.Array_toStack(self_);
|
|
485
|
+
(await ff_core_Stack.Stack_sortWith$(stack_, ordering_, $task));
|
|
486
|
+
return ff_core_Stack.Stack_drain(stack_)
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export function Array_sort(self_, ff_core_Ordering_Order$T) {
|
|
490
|
+
return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
|
|
491
|
+
return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
492
|
+
}))
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
export function Array_toSet(self_, ff_core_Ordering_Order$T) {
|
|
496
|
+
return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export async function Array_sort$(self_, ff_core_Ordering_Order$T, $task) {
|
|
500
|
+
return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
|
|
501
|
+
return ff_core_Ordering_Order$T.compare_(x_, y_)
|
|
502
|
+
}))
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export async function Array_toSet$(self_, ff_core_Ordering_Order$T, $task) {
|
|
506
|
+
return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export function Array_toMap(self_, ff_core_Ordering_Order$K) {
|
|
510
|
+
return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export async function Array_toMap$(self_, ff_core_Ordering_Order$K, $task) {
|
|
514
|
+
return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export function Array_join(self_, separator_ = "") {
|
|
518
|
+
return self_.join(separator_)
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export async function Array_join$(self_, separator_ = "", $task) {
|
|
522
|
+
throw new Error('Function Array_join is missing on this target in async context.');
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export function ff_core_Show_Show$ff_core_Array_Array(ff_core_Show_Show$T) { return {
|
|
526
|
+
show_(value_) {
|
|
527
|
+
const stack_ = ff_core_Stack.make_();
|
|
528
|
+
ff_core_Stack.Stack_push(stack_, "[");
|
|
529
|
+
ff_core_Array.Array_each(value_, ((x_) => {
|
|
530
|
+
if((ff_core_Stack.Stack_size(stack_) > 1)) {
|
|
531
|
+
ff_core_Stack.Stack_push(stack_, ", ")
|
|
532
|
+
};
|
|
533
|
+
ff_core_Stack.Stack_push(stack_, ff_core_Show_Show$T.show_(x_))
|
|
534
|
+
}));
|
|
535
|
+
ff_core_Stack.Stack_push(stack_, "].toArray()");
|
|
536
|
+
return ff_core_Stack.Stack_join(stack_, "")
|
|
537
|
+
},
|
|
538
|
+
async show_$(value_, $task) {
|
|
539
|
+
const stack_ = ff_core_Stack.make_();
|
|
540
|
+
ff_core_Stack.Stack_push(stack_, "[");
|
|
541
|
+
ff_core_Array.Array_each(value_, ((x_) => {
|
|
542
|
+
if((ff_core_Stack.Stack_size(stack_) > 1)) {
|
|
543
|
+
ff_core_Stack.Stack_push(stack_, ", ")
|
|
544
|
+
};
|
|
545
|
+
ff_core_Stack.Stack_push(stack_, ff_core_Show_Show$T.show_(x_))
|
|
546
|
+
}));
|
|
547
|
+
ff_core_Stack.Stack_push(stack_, "].toArray()");
|
|
548
|
+
return ff_core_Stack.Stack_join(stack_, "")
|
|
549
|
+
}
|
|
550
|
+
}}
|
|
551
|
+
|
|
552
|
+
export function ff_core_Equal_Equal$ff_core_Array_Array(ff_core_Equal_Equal$T) { return {
|
|
553
|
+
equals_(x_, y_) {
|
|
554
|
+
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
555
|
+
return true
|
|
556
|
+
} else {
|
|
557
|
+
if((ff_core_Array.Array_size(x_) !== ff_core_Array.Array_size(y_))) {
|
|
558
|
+
return false
|
|
559
|
+
} else {
|
|
560
|
+
let i_ = (-1);
|
|
561
|
+
return ff_core_Array.Array_all(x_, ((l_) => {
|
|
562
|
+
i_ += 1;
|
|
563
|
+
return ff_core_Equal_Equal$T.equals_(l_, ff_core_Array.Array_grab(y_, i_))
|
|
564
|
+
}))
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
async equals_$(x_, y_, $task) {
|
|
569
|
+
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
570
|
+
return true
|
|
571
|
+
} else {
|
|
572
|
+
if((ff_core_Array.Array_size(x_) !== ff_core_Array.Array_size(y_))) {
|
|
573
|
+
return false
|
|
574
|
+
} else {
|
|
575
|
+
let i_ = (-1);
|
|
576
|
+
return ff_core_Array.Array_all(x_, ((l_) => {
|
|
577
|
+
i_ += 1;
|
|
578
|
+
return ff_core_Equal_Equal$T.equals_(l_, ff_core_Array.Array_grab(y_, i_))
|
|
579
|
+
}))
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}}
|
|
584
|
+
|
|
585
|
+
export function ff_core_Ordering_Order$ff_core_Array_Array(ff_core_Ordering_Order$T) { return {
|
|
586
|
+
compare_(x_, y_) {
|
|
587
|
+
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
588
|
+
return ff_core_Ordering.OrderingSame()
|
|
589
|
+
} else {
|
|
590
|
+
const size_ = ff_core_Int.Int_min(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_));
|
|
591
|
+
let i_ = 0;
|
|
592
|
+
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
593
|
+
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
594
|
+
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_Array.Array_grab(x_, i_), ff_core_Array.Array_grab(y_, i_));
|
|
595
|
+
i_ += 1
|
|
596
|
+
};
|
|
597
|
+
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
598
|
+
return ordering_
|
|
599
|
+
} else {
|
|
600
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_))
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
async compare_$(x_, y_, $task) {
|
|
605
|
+
if(ff_core_Array.internalSame_(x_, y_)) {
|
|
606
|
+
return ff_core_Ordering.OrderingSame()
|
|
607
|
+
} else {
|
|
608
|
+
const size_ = ff_core_Int.Int_min(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_));
|
|
609
|
+
let i_ = 0;
|
|
610
|
+
let ordering_ = ff_core_Ordering.OrderingSame();
|
|
611
|
+
while(((ordering_ === ff_core_Ordering.OrderingSame()) && (i_ < size_))) {
|
|
612
|
+
ordering_ = ff_core_Ordering_Order$T.compare_(ff_core_Array.Array_grab(x_, i_), ff_core_Array.Array_grab(y_, i_));
|
|
613
|
+
i_ += 1
|
|
614
|
+
};
|
|
615
|
+
if((ordering_ !== ff_core_Ordering.OrderingSame())) {
|
|
616
|
+
return ordering_
|
|
617
|
+
} else {
|
|
618
|
+
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(ff_core_Array.Array_size(x_), ff_core_Array.Array_size(y_))
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}}
|
|
623
|
+
|
|
624
|
+
|