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.
Files changed (90) hide show
  1. package/compiler/Compiler.ff +2 -0
  2. package/compiler/Deriver.ff +7 -0
  3. package/core/Array.ff +17 -4
  4. package/core/AssetSystem.ff +1 -1
  5. package/core/BrowserSystem.ff +27 -0
  6. package/core/List.ff +4 -0
  7. package/core/Lock.ff +2 -2
  8. package/core/Random.ff +148 -0
  9. package/core/SourceLocation.ff +27 -0
  10. package/core/Task.ff +3 -0
  11. package/core/WebSocket.ff +127 -0
  12. package/httpserver/HttpServer.ff +1 -1
  13. package/lux/Css.ff +648 -0
  14. package/lux/CssTest.ff +48 -0
  15. package/lux/Lux.ff +33 -18
  16. package/lux/Main.ff +4 -1
  17. package/output/js/ff/compiler/Builder.mjs +448 -444
  18. package/output/js/ff/compiler/Compiler.mjs +420 -416
  19. package/output/js/ff/compiler/Dependencies.mjs +393 -389
  20. package/output/js/ff/compiler/Deriver.mjs +1178 -1170
  21. package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
  22. package/output/js/ff/compiler/Environment.mjs +1025 -1015
  23. package/output/js/ff/compiler/Inference.mjs +4272 -4268
  24. package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
  25. package/output/js/ff/compiler/JsImporter.mjs +270 -266
  26. package/output/js/ff/compiler/LspHook.mjs +799 -793
  27. package/output/js/ff/compiler/Main.mjs +1691 -1675
  28. package/output/js/ff/compiler/Parser.mjs +4016 -4008
  29. package/output/js/ff/compiler/Patterns.mjs +935 -927
  30. package/output/js/ff/compiler/Resolver.mjs +2311 -2307
  31. package/output/js/ff/compiler/Substitution.mjs +1154 -1150
  32. package/output/js/ff/compiler/Syntax.mjs +12566 -12434
  33. package/output/js/ff/compiler/Token.mjs +3152 -3096
  34. package/output/js/ff/compiler/Tokenizer.mjs +597 -593
  35. package/output/js/ff/compiler/Unification.mjs +1762 -1752
  36. package/output/js/ff/compiler/Wildcards.mjs +612 -608
  37. package/output/js/ff/compiler/Workspace.mjs +695 -687
  38. package/output/js/ff/core/Any.mjs +147 -143
  39. package/output/js/ff/core/Array.mjs +573 -547
  40. package/output/js/ff/core/AssetSystem.mjs +278 -274
  41. package/output/js/ff/core/Atomic.mjs +158 -154
  42. package/output/js/ff/core/Bool.mjs +156 -152
  43. package/output/js/ff/core/Box.mjs +116 -112
  44. package/output/js/ff/core/BrowserSystem.mjs +181 -126
  45. package/output/js/ff/core/Buffer.mjs +399 -395
  46. package/output/js/ff/core/BuildSystem.mjs +300 -296
  47. package/output/js/ff/core/Channel.mjs +193 -189
  48. package/output/js/ff/core/Char.mjs +153 -149
  49. package/output/js/ff/core/Core.mjs +304 -300
  50. package/output/js/ff/core/Duration.mjs +120 -116
  51. package/output/js/ff/core/Equal.mjs +183 -179
  52. package/output/js/ff/core/Error.mjs +146 -142
  53. package/output/js/ff/core/FileHandle.mjs +154 -150
  54. package/output/js/ff/core/Float.mjs +229 -225
  55. package/output/js/ff/core/HttpClient.mjs +195 -191
  56. package/output/js/ff/core/Instant.mjs +113 -109
  57. package/output/js/ff/core/Int.mjs +269 -265
  58. package/output/js/ff/core/IntMap.mjs +284 -280
  59. package/output/js/ff/core/JsSystem.mjs +242 -238
  60. package/output/js/ff/core/JsValue.mjs +712 -708
  61. package/output/js/ff/core/List.mjs +2346 -2334
  62. package/output/js/ff/core/Lock.mjs +235 -231
  63. package/output/js/ff/core/Log.mjs +167 -163
  64. package/output/js/ff/core/Map.mjs +366 -362
  65. package/output/js/ff/core/NodeSystem.mjs +298 -294
  66. package/output/js/ff/core/Nothing.mjs +108 -104
  67. package/output/js/ff/core/Option.mjs +1023 -1015
  68. package/output/js/ff/core/Ordering.mjs +734 -730
  69. package/output/js/ff/core/Pair.mjs +337 -331
  70. package/output/js/ff/core/Path.mjs +549 -545
  71. package/output/js/ff/core/Random.mjs +340 -0
  72. package/output/js/ff/core/RbMap.mjs +1944 -1940
  73. package/output/js/ff/core/Serializable.mjs +432 -428
  74. package/output/js/ff/core/Set.mjs +258 -254
  75. package/output/js/ff/core/Show.mjs +209 -205
  76. package/output/js/ff/core/SourceLocation.mjs +273 -229
  77. package/output/js/ff/core/Stack.mjs +533 -529
  78. package/output/js/ff/core/Stream.mjs +1308 -1304
  79. package/output/js/ff/core/String.mjs +369 -365
  80. package/output/js/ff/core/StringMap.mjs +284 -280
  81. package/output/js/ff/core/Task.mjs +325 -319
  82. package/output/js/ff/core/Try.mjs +511 -507
  83. package/output/js/ff/core/Unit.mjs +155 -151
  84. package/output/js/ff/core/WebSocket.mjs +198 -0
  85. package/package.json +1 -1
  86. package/vscode/package.json +1 -1
  87. package/webserver/.firefly/include/package-lock.json +16 -0
  88. package/webserver/.firefly/include/package.json +5 -0
  89. package/webserver/.firefly/package.ff +2 -0
  90. package/webserver/WebServer.ff +608 -0
@@ -1,362 +1,366 @@
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_RbMap from "../../ff/core/RbMap.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
- // newtype Map
94
-
95
-
96
-
97
- export function empty_() {
98
- return ff_core_RbMap.E()
99
- }
100
-
101
- export async function empty_$($task) {
102
- return ff_core_RbMap.E()
103
- }
104
-
105
- export function Map_add(self_, key_, value_, ff_core_Ordering_Order$K) {
106
- return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
107
- }
108
-
109
- export function Map_addAll(self_, that_, ff_core_Ordering_Order$K) {
110
- let result_ = self_;
111
- ff_core_RbMap.RB_each(that_, ((k_, v_) => {
112
- result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
113
- }), ff_core_Ordering_Order$K);
114
- return result_
115
- }
116
-
117
- export function Map_get(self_, key_, ff_core_Ordering_Order$K) {
118
- return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
119
- }
120
-
121
- export function Map_remove(self_, key_, ff_core_Ordering_Order$K) {
122
- return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
123
- }
124
-
125
- export function Map_removeAll(self_, that_, ff_core_Ordering_Order$K) {
126
- let result_ = self_;
127
- ff_core_RbMap.RB_each(that_, ((k_, _) => {
128
- result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
129
- }), ff_core_Ordering_Order$K);
130
- return result_
131
- }
132
-
133
- export function Map_pairs(self_, ff_core_Ordering_Order$K) {
134
- return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
135
- }
136
-
137
- export function Map_toList(self_, ff_core_Ordering_Order$K) {
138
- return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
139
- }
140
-
141
- export function Map_toArray(self_, ff_core_Ordering_Order$K) {
142
- return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
143
- }
144
-
145
- export function Map_toStream(self_, cycle_ = false, ff_core_Ordering_Order$K) {
146
- return ff_core_RbMap.RB_toStream(self_, cycle_, ff_core_Ordering_Order$K)
147
- }
148
-
149
- export function Map_keys(self_, ff_core_Ordering_Order$K) {
150
- return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
151
- return _w1.first_
152
- })), ff_core_Ordering_Order$K)
153
- }
154
-
155
- export function Map_values(self_, ff_core_Ordering_Order$K) {
156
- return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
157
- return _w1.second_
158
- }))
159
- }
160
-
161
- export function Map_size(self_, ff_core_Ordering_Order$K) {
162
- return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
163
- }
164
-
165
- export function Map_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1) {
166
- return ff_core_RbMap.RB_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1)
167
- }
168
-
169
- export function Map_mapValues(self_, body_, ff_core_Ordering_Order$K) {
170
- return ff_core_RbMap.RB_mapValues(self_, body_, ff_core_Ordering_Order$K)
171
- }
172
-
173
- export function Map_contains(self_, key_, ff_core_Ordering_Order$K) {
174
- return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
175
- }
176
-
177
- export function Map_grab(self_, key_, ff_core_Ordering_Order$K) {
178
- return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
179
- }
180
-
181
- export function Map_updateOrInsert(self_, key_, update_, default_, ff_core_Ordering_Order$K) {
182
- {
183
- const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
184
- {
185
- if(_1.None) {
186
- return ff_core_Map.Map_add(self_, key_, default_(), ff_core_Ordering_Order$K)
187
- return
188
- }
189
- }
190
- {
191
- if(_1.Some) {
192
- const v_ = _1.value_;
193
- return ff_core_Map.Map_add(self_, key_, update_(v_), ff_core_Ordering_Order$K)
194
- return
195
- }
196
- }
197
- }
198
- }
199
-
200
- export function Map_each(self_, body_, ff_core_Ordering_Order$K) {
201
- ff_core_RbMap.RB_each(self_, body_, ff_core_Ordering_Order$K)
202
- }
203
-
204
- export function Map_eachWhile(self_, body_, ff_core_Ordering_Order$K) {
205
- return ff_core_RbMap.RB_eachWhile(self_, body_, ff_core_Ordering_Order$K)
206
- }
207
-
208
- export function Map_find(self_, body_, ff_core_Ordering_Order$K) {
209
- return ff_core_RbMap.RB_find(self_, body_, ff_core_Ordering_Order$K)
210
- }
211
-
212
- export async function Map_add$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
213
- return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
214
- }
215
-
216
- export async function Map_addAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
217
- let result_ = self_;
218
- ff_core_RbMap.RB_each(that_, ((k_, v_) => {
219
- result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
220
- }), ff_core_Ordering_Order$K);
221
- return result_
222
- }
223
-
224
- export async function Map_get$(self_, key_, ff_core_Ordering_Order$K, $task) {
225
- return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
226
- }
227
-
228
- export async function Map_remove$(self_, key_, ff_core_Ordering_Order$K, $task) {
229
- return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
230
- }
231
-
232
- export async function Map_removeAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
233
- let result_ = self_;
234
- ff_core_RbMap.RB_each(that_, ((k_, _) => {
235
- result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
236
- }), ff_core_Ordering_Order$K);
237
- return result_
238
- }
239
-
240
- export async function Map_pairs$(self_, ff_core_Ordering_Order$K, $task) {
241
- return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
242
- }
243
-
244
- export async function Map_toList$(self_, ff_core_Ordering_Order$K, $task) {
245
- return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
246
- }
247
-
248
- export async function Map_toArray$(self_, ff_core_Ordering_Order$K, $task) {
249
- return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
250
- }
251
-
252
- export async function Map_toStream$(self_, cycle_ = false, ff_core_Ordering_Order$K, $task) {
253
- return (await ff_core_RbMap.RB_toStream$(self_, cycle_, ff_core_Ordering_Order$K, $task))
254
- }
255
-
256
- export async function Map_keys$(self_, ff_core_Ordering_Order$K, $task) {
257
- return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
258
- return _w1.first_
259
- })), ff_core_Ordering_Order$K)
260
- }
261
-
262
- export async function Map_values$(self_, ff_core_Ordering_Order$K, $task) {
263
- return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
264
- return _w1.second_
265
- }))
266
- }
267
-
268
- export async function Map_size$(self_, ff_core_Ordering_Order$K, $task) {
269
- return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
270
- }
271
-
272
- export async function Map_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task) {
273
- return (await ff_core_RbMap.RB_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task))
274
- }
275
-
276
- export async function Map_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task) {
277
- return (await ff_core_RbMap.RB_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task))
278
- }
279
-
280
- export async function Map_contains$(self_, key_, ff_core_Ordering_Order$K, $task) {
281
- return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
282
- }
283
-
284
- export async function Map_grab$(self_, key_, ff_core_Ordering_Order$K, $task) {
285
- return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
286
- }
287
-
288
- export async function Map_updateOrInsert$(self_, key_, update_, default_, ff_core_Ordering_Order$K, $task) {
289
- {
290
- const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
291
- {
292
- if(_1.None) {
293
- return ff_core_Map.Map_add(self_, key_, (await default_($task)), ff_core_Ordering_Order$K)
294
- return
295
- }
296
- }
297
- {
298
- if(_1.Some) {
299
- const v_ = _1.value_;
300
- return ff_core_Map.Map_add(self_, key_, (await update_(v_, $task)), ff_core_Ordering_Order$K)
301
- return
302
- }
303
- }
304
- }
305
- }
306
-
307
- export async function Map_each$(self_, body_, ff_core_Ordering_Order$K, $task) {
308
- (await ff_core_RbMap.RB_each$(self_, body_, ff_core_Ordering_Order$K, $task))
309
- }
310
-
311
- export async function Map_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task) {
312
- return (await ff_core_RbMap.RB_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task))
313
- }
314
-
315
- export async function Map_find$(self_, body_, ff_core_Ordering_Order$K, $task) {
316
- return (await ff_core_RbMap.RB_find$(self_, body_, ff_core_Ordering_Order$K, $task))
317
- }
318
-
319
- export function Map_addToList(self_, key_, value_, ff_core_Ordering_Order$K) {
320
- return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
321
- return ff_core_List.Link(value_, _w1)
322
- }), (() => {
323
- return ff_core_List.Link(value_, ff_core_List.Empty())
324
- }), ff_core_Ordering_Order$K)
325
- }
326
-
327
- export async function Map_addToList$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
328
- return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
329
- return ff_core_List.Link(value_, _w1)
330
- }), (() => {
331
- return ff_core_List.Link(value_, ff_core_List.Empty())
332
- }), ff_core_Ordering_Order$K)
333
- }
334
-
335
- export function ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal_Equal$K, ff_core_Ordering_Order$K, ff_core_Equal_Equal$V) { return {
336
- equals_(x_, y_) {
337
- return ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
338
- },
339
- async equals_$(x_, y_, $task) {
340
- return ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
341
- }
342
- }}
343
-
344
- export function ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V) { return {
345
- compare_(x_, y_) {
346
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
347
- },
348
- async compare_$(x_, y_, $task) {
349
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
350
- }
351
- }}
352
-
353
- export function ff_core_Show_Show$ff_core_Map_Map(ff_core_Show_Show$K, ff_core_Ordering_Order$K, ff_core_Show_Show$V) { return {
354
- show_(value_) {
355
- return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
356
- },
357
- async show_$(value_, $task) {
358
- return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
359
- }
360
- }}
361
-
362
-
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_RbMap from "../../ff/core/RbMap.mjs"
72
+
73
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
74
+
75
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
76
+
77
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
+
79
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
+
81
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
+
83
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
+
85
+ import * as ff_core_String from "../../ff/core/String.mjs"
86
+
87
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
88
+
89
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
90
+
91
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
+
93
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
+
95
+ import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
+
97
+ // newtype Map
98
+
99
+
100
+
101
+ export function empty_() {
102
+ return ff_core_RbMap.E()
103
+ }
104
+
105
+ export async function empty_$($task) {
106
+ return ff_core_RbMap.E()
107
+ }
108
+
109
+ export function Map_add(self_, key_, value_, ff_core_Ordering_Order$K) {
110
+ return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
111
+ }
112
+
113
+ export function Map_addAll(self_, that_, ff_core_Ordering_Order$K) {
114
+ let result_ = self_;
115
+ ff_core_RbMap.RB_each(that_, ((k_, v_) => {
116
+ result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
117
+ }), ff_core_Ordering_Order$K);
118
+ return result_
119
+ }
120
+
121
+ export function Map_get(self_, key_, ff_core_Ordering_Order$K) {
122
+ return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
123
+ }
124
+
125
+ export function Map_remove(self_, key_, ff_core_Ordering_Order$K) {
126
+ return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
127
+ }
128
+
129
+ export function Map_removeAll(self_, that_, ff_core_Ordering_Order$K) {
130
+ let result_ = self_;
131
+ ff_core_RbMap.RB_each(that_, ((k_, _) => {
132
+ result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
133
+ }), ff_core_Ordering_Order$K);
134
+ return result_
135
+ }
136
+
137
+ export function Map_pairs(self_, ff_core_Ordering_Order$K) {
138
+ return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
139
+ }
140
+
141
+ export function Map_toList(self_, ff_core_Ordering_Order$K) {
142
+ return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
143
+ }
144
+
145
+ export function Map_toArray(self_, ff_core_Ordering_Order$K) {
146
+ return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
147
+ }
148
+
149
+ export function Map_toStream(self_, cycle_ = false, ff_core_Ordering_Order$K) {
150
+ return ff_core_RbMap.RB_toStream(self_, cycle_, ff_core_Ordering_Order$K)
151
+ }
152
+
153
+ export function Map_keys(self_, ff_core_Ordering_Order$K) {
154
+ return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
155
+ return _w1.first_
156
+ })), ff_core_Ordering_Order$K)
157
+ }
158
+
159
+ export function Map_values(self_, ff_core_Ordering_Order$K) {
160
+ return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
161
+ return _w1.second_
162
+ }))
163
+ }
164
+
165
+ export function Map_size(self_, ff_core_Ordering_Order$K) {
166
+ return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
167
+ }
168
+
169
+ export function Map_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1) {
170
+ return ff_core_RbMap.RB_map(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1)
171
+ }
172
+
173
+ export function Map_mapValues(self_, body_, ff_core_Ordering_Order$K) {
174
+ return ff_core_RbMap.RB_mapValues(self_, body_, ff_core_Ordering_Order$K)
175
+ }
176
+
177
+ export function Map_contains(self_, key_, ff_core_Ordering_Order$K) {
178
+ return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
179
+ }
180
+
181
+ export function Map_grab(self_, key_, ff_core_Ordering_Order$K) {
182
+ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
183
+ }
184
+
185
+ export function Map_updateOrInsert(self_, key_, update_, default_, ff_core_Ordering_Order$K) {
186
+ {
187
+ const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
188
+ {
189
+ if(_1.None) {
190
+ return ff_core_Map.Map_add(self_, key_, default_(), ff_core_Ordering_Order$K)
191
+ return
192
+ }
193
+ }
194
+ {
195
+ if(_1.Some) {
196
+ const v_ = _1.value_;
197
+ return ff_core_Map.Map_add(self_, key_, update_(v_), ff_core_Ordering_Order$K)
198
+ return
199
+ }
200
+ }
201
+ }
202
+ }
203
+
204
+ export function Map_each(self_, body_, ff_core_Ordering_Order$K) {
205
+ ff_core_RbMap.RB_each(self_, body_, ff_core_Ordering_Order$K)
206
+ }
207
+
208
+ export function Map_eachWhile(self_, body_, ff_core_Ordering_Order$K) {
209
+ return ff_core_RbMap.RB_eachWhile(self_, body_, ff_core_Ordering_Order$K)
210
+ }
211
+
212
+ export function Map_find(self_, body_, ff_core_Ordering_Order$K) {
213
+ return ff_core_RbMap.RB_find(self_, body_, ff_core_Ordering_Order$K)
214
+ }
215
+
216
+ export async function Map_add$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
217
+ return ff_core_RbMap.insert_(key_, value_, self_, ff_core_Ordering_Order$K)
218
+ }
219
+
220
+ export async function Map_addAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
221
+ let result_ = self_;
222
+ ff_core_RbMap.RB_each(that_, ((k_, v_) => {
223
+ result_ = ff_core_RbMap.insert_(k_, v_, result_, ff_core_Ordering_Order$K)
224
+ }), ff_core_Ordering_Order$K);
225
+ return result_
226
+ }
227
+
228
+ export async function Map_get$(self_, key_, ff_core_Ordering_Order$K, $task) {
229
+ return ff_core_RbMap.RB_get(self_, key_, ff_core_Ordering_Order$K)
230
+ }
231
+
232
+ export async function Map_remove$(self_, key_, ff_core_Ordering_Order$K, $task) {
233
+ return ff_core_RbMap.delete_(key_, self_, ff_core_Ordering_Order$K)
234
+ }
235
+
236
+ export async function Map_removeAll$(self_, that_, ff_core_Ordering_Order$K, $task) {
237
+ let result_ = self_;
238
+ ff_core_RbMap.RB_each(that_, ((k_, _) => {
239
+ result_ = ff_core_RbMap.delete_(k_, result_, ff_core_Ordering_Order$K)
240
+ }), ff_core_Ordering_Order$K);
241
+ return result_
242
+ }
243
+
244
+ export async function Map_pairs$(self_, ff_core_Ordering_Order$K, $task) {
245
+ return ff_core_Map.Map_toList(self_, ff_core_Ordering_Order$K)
246
+ }
247
+
248
+ export async function Map_toList$(self_, ff_core_Ordering_Order$K, $task) {
249
+ return ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K)
250
+ }
251
+
252
+ export async function Map_toArray$(self_, ff_core_Ordering_Order$K, $task) {
253
+ return ff_core_List.List_toArray(ff_core_RbMap.RB_pairs(self_, ff_core_Ordering_Order$K))
254
+ }
255
+
256
+ export async function Map_toStream$(self_, cycle_ = false, ff_core_Ordering_Order$K, $task) {
257
+ return (await ff_core_RbMap.RB_toStream$(self_, cycle_, ff_core_Ordering_Order$K, $task))
258
+ }
259
+
260
+ export async function Map_keys$(self_, ff_core_Ordering_Order$K, $task) {
261
+ return ff_core_List.List_toSet(ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
262
+ return _w1.first_
263
+ })), ff_core_Ordering_Order$K)
264
+ }
265
+
266
+ export async function Map_values$(self_, ff_core_Ordering_Order$K, $task) {
267
+ return ff_core_List.List_map(ff_core_Map.Map_pairs(self_, ff_core_Ordering_Order$K), ((_w1) => {
268
+ return _w1.second_
269
+ }))
270
+ }
271
+
272
+ export async function Map_size$(self_, ff_core_Ordering_Order$K, $task) {
273
+ return ff_core_RbMap.RB_size(self_, ff_core_Ordering_Order$K)
274
+ }
275
+
276
+ export async function Map_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task) {
277
+ return (await ff_core_RbMap.RB_map$(self_, body_, ff_core_Ordering_Order$K, ff_core_Ordering_Order$K1, $task))
278
+ }
279
+
280
+ export async function Map_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task) {
281
+ return (await ff_core_RbMap.RB_mapValues$(self_, body_, ff_core_Ordering_Order$K, $task))
282
+ }
283
+
284
+ export async function Map_contains$(self_, key_, ff_core_Ordering_Order$K, $task) {
285
+ return (!ff_core_Option.Option_isEmpty(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K)))
286
+ }
287
+
288
+ export async function Map_grab$(self_, key_, ff_core_Ordering_Order$K, $task) {
289
+ return ff_core_Option.Option_grab(ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K))
290
+ }
291
+
292
+ export async function Map_updateOrInsert$(self_, key_, update_, default_, ff_core_Ordering_Order$K, $task) {
293
+ {
294
+ const _1 = ff_core_Map.Map_get(self_, key_, ff_core_Ordering_Order$K);
295
+ {
296
+ if(_1.None) {
297
+ return ff_core_Map.Map_add(self_, key_, (await default_($task)), ff_core_Ordering_Order$K)
298
+ return
299
+ }
300
+ }
301
+ {
302
+ if(_1.Some) {
303
+ const v_ = _1.value_;
304
+ return ff_core_Map.Map_add(self_, key_, (await update_(v_, $task)), ff_core_Ordering_Order$K)
305
+ return
306
+ }
307
+ }
308
+ }
309
+ }
310
+
311
+ export async function Map_each$(self_, body_, ff_core_Ordering_Order$K, $task) {
312
+ (await ff_core_RbMap.RB_each$(self_, body_, ff_core_Ordering_Order$K, $task))
313
+ }
314
+
315
+ export async function Map_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task) {
316
+ return (await ff_core_RbMap.RB_eachWhile$(self_, body_, ff_core_Ordering_Order$K, $task))
317
+ }
318
+
319
+ export async function Map_find$(self_, body_, ff_core_Ordering_Order$K, $task) {
320
+ return (await ff_core_RbMap.RB_find$(self_, body_, ff_core_Ordering_Order$K, $task))
321
+ }
322
+
323
+ export function Map_addToList(self_, key_, value_, ff_core_Ordering_Order$K) {
324
+ return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
325
+ return ff_core_List.Link(value_, _w1)
326
+ }), (() => {
327
+ return ff_core_List.Link(value_, ff_core_List.Empty())
328
+ }), ff_core_Ordering_Order$K)
329
+ }
330
+
331
+ export async function Map_addToList$(self_, key_, value_, ff_core_Ordering_Order$K, $task) {
332
+ return ff_core_Map.Map_updateOrInsert(self_, key_, ((_w1) => {
333
+ return ff_core_List.Link(value_, _w1)
334
+ }), (() => {
335
+ return ff_core_List.Link(value_, ff_core_List.Empty())
336
+ }), ff_core_Ordering_Order$K)
337
+ }
338
+
339
+ export function ff_core_Equal_Equal$ff_core_Map_Map(ff_core_Equal_Equal$K, ff_core_Ordering_Order$K, ff_core_Equal_Equal$V) { return {
340
+ equals_(x_, y_) {
341
+ return ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
342
+ },
343
+ async equals_$(x_, y_, $task) {
344
+ return ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_core_Pair.ff_core_Equal_Equal$ff_core_Pair_Pair(ff_core_Equal_Equal$K, ff_core_Equal_Equal$V)).equals_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
345
+ }
346
+ }}
347
+
348
+ export function ff_core_Ordering_Order$ff_core_Map_Map(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V) { return {
349
+ compare_(x_, y_) {
350
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
351
+ },
352
+ async compare_$(x_, y_, $task) {
353
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_core_Ordering.ff_core_Ordering_Order$ff_core_Pair_Pair(ff_core_Ordering_Order$K, ff_core_Ordering_Order$V)).compare_(ff_core_Map.Map_pairs(x_, ff_core_Ordering_Order$K), ff_core_Map.Map_pairs(y_, ff_core_Ordering_Order$K))
354
+ }
355
+ }}
356
+
357
+ export function ff_core_Show_Show$ff_core_Map_Map(ff_core_Show_Show$K, ff_core_Ordering_Order$K, ff_core_Show_Show$V) { return {
358
+ show_(value_) {
359
+ return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
360
+ },
361
+ async show_$(value_, $task) {
362
+ return (ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_core_Show.ff_core_Show_Show$ff_core_Pair_Pair(ff_core_Show_Show$K, ff_core_Show_Show$V)).show_(ff_core_Map.Map_pairs(value_, ff_core_Ordering_Order$K)) + ".toMap()")
363
+ }
364
+ }}
365
+
366
+