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,608 +1,612 @@
1
-
2
-
3
- import * as ff_compiler_Wildcards from "../../ff/compiler/Wildcards.mjs"
4
-
5
- import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
-
7
- import * as ff_core_Any from "../../ff/core/Any.mjs"
8
-
9
- import * as ff_core_Array from "../../ff/core/Array.mjs"
10
-
11
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
-
13
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
-
15
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
-
17
- import * as ff_core_Box from "../../ff/core/Box.mjs"
18
-
19
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
-
21
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
-
23
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
-
25
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
-
27
- import * as ff_core_Char from "../../ff/core/Char.mjs"
28
-
29
- import * as ff_core_Core from "../../ff/core/Core.mjs"
30
-
31
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
-
33
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
-
35
- import * as ff_core_Error from "../../ff/core/Error.mjs"
36
-
37
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
-
39
- import * as ff_core_Float from "../../ff/core/Float.mjs"
40
-
41
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
-
43
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
-
45
- import * as ff_core_Int from "../../ff/core/Int.mjs"
46
-
47
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
-
49
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
-
51
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
-
53
- import * as ff_core_List from "../../ff/core/List.mjs"
54
-
55
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
-
57
- import * as ff_core_Log from "../../ff/core/Log.mjs"
58
-
59
- import * as ff_core_Map from "../../ff/core/Map.mjs"
60
-
61
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
-
63
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
-
65
- import * as ff_core_Option from "../../ff/core/Option.mjs"
66
-
67
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
-
69
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
-
71
- import * as ff_core_Path from "../../ff/core/Path.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
- // type Wildcards
96
- export function Wildcards(seenWildcards_) {
97
- return {seenWildcards_};
98
- }
99
-
100
-
101
-
102
- export function make_() {
103
- return ff_compiler_Wildcards.Wildcards(0)
104
- }
105
-
106
- export function fail_(at_, message_) {
107
- return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
108
- }
109
-
110
- export async function make_$($task) {
111
- return ff_compiler_Wildcards.Wildcards(0)
112
- }
113
-
114
- export async function fail_$(at_, message_, $task) {
115
- return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
116
- }
117
-
118
- export function Wildcards_fixWildcards(self_, term_) {
119
- {
120
- const self_a = self_;
121
- const term_a = term_;
122
- {
123
- if(term_a.ELet) {
124
- const e_ = term_a;
125
- {
126
- const _1 = e_;
127
- {
128
- const _c = _1;
129
- return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.body_))
130
- return
131
- }
132
- }
133
- return
134
- }
135
- }
136
- {
137
- if(term_a.ESequential) {
138
- const e_ = term_a;
139
- {
140
- const _1 = e_;
141
- {
142
- const _c = _1;
143
- return ff_compiler_Syntax.ESequential(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.before_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.after_))
144
- return
145
- }
146
- }
147
- return
148
- }
149
- }
150
- {
151
- if(term_a.EAssign) {
152
- const e_ = term_a;
153
- {
154
- const _1 = e_;
155
- {
156
- const _c = _1;
157
- return ff_compiler_Syntax.EAssign(_c.at_, _c.operator_, _c.variable_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
158
- return
159
- }
160
- }
161
- return
162
- }
163
- }
164
- {
165
- if(term_a.EAssignField) {
166
- const e_ = term_a;
167
- {
168
- const _1 = e_;
169
- {
170
- const _c = _1;
171
- return ff_compiler_Syntax.EAssignField(_c.at_, _c.operator_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
172
- return
173
- }
174
- }
175
- return
176
- }
177
- }
178
- {
179
- if(term_a.EPipe) {
180
- const e_ = term_a;
181
- {
182
- const _1 = e_;
183
- {
184
- const _c = _1;
185
- return ff_compiler_Syntax.EPipe(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), _c.effect_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.function_))
186
- return
187
- }
188
- }
189
- return
190
- }
191
- }
192
- {
193
- if(term_a.ECall) {
194
- const e_ = term_a;
195
- {
196
- const _1 = e_;
197
- {
198
- const _c = _1;
199
- return ff_compiler_Syntax.ECall(_c.at_, (((_1) => {
200
- {
201
- if(_1.DynamicCall) {
202
- const call_ = _1;
203
- {
204
- const _1 = call_;
205
- {
206
- const _c = _1;
207
- return ff_compiler_Syntax.DynamicCall(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, call_.function_), _c.tailCall_)
208
- return
209
- }
210
- }
211
- return
212
- }
213
- }
214
- {
215
- return ff_compiler_Wildcards.fail_(e_.at_, "Internal error: Static calls not expected in the Wildcards phase")
216
- return
217
- }
218
- }))(e_.target_), _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((a_) => {
219
- {
220
- const _1 = a_;
221
- {
222
- const _c = _1;
223
- return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
224
- return
225
- }
226
- }
227
- })), _c.dictionaries_)
228
- return
229
- }
230
- }
231
- return
232
- }
233
- }
234
- {
235
- if(term_a.EList) {
236
- const e_ = term_a;
237
- {
238
- const _1 = e_;
239
- {
240
- const _c = _1;
241
- return ff_compiler_Syntax.EList(_c.at_, _c.elementType_, ff_core_List.List_map(e_.items_, ((_1) => {
242
- {
243
- const item_ = _1.first_;
244
- const spread_ = _1.second_;
245
- return ff_core_Pair.Pair(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, item_), spread_)
246
- return
247
- }
248
- })))
249
- return
250
- }
251
- }
252
- return
253
- }
254
- }
255
- {
256
- if(term_a.ECopy) {
257
- const e_ = term_a;
258
- {
259
- const _1 = e_;
260
- {
261
- const _c = _1;
262
- return ff_compiler_Syntax.ECopy(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), ff_core_List.List_map(e_.arguments_, ((a_) => {
263
- {
264
- const _1 = a_;
265
- {
266
- const _c = _1;
267
- return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
268
- return
269
- }
270
- }
271
- })))
272
- return
273
- }
274
- }
275
- return
276
- }
277
- }
278
- {
279
- if(term_a.EVariant) {
280
- const e_ = term_a;
281
- {
282
- const _1 = e_;
283
- {
284
- const _c = _1;
285
- return ff_compiler_Syntax.EVariant(_c.at_, _c.name_, _c.typeArguments_, ff_core_Option.Option_map(e_.arguments_, ((_w1) => {
286
- return ff_core_List.List_map(_w1, ((a_) => {
287
- {
288
- const _1 = a_;
289
- {
290
- const _c = _1;
291
- return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
292
- return
293
- }
294
- }
295
- }))
296
- })))
297
- return
298
- }
299
- }
300
- return
301
- }
302
- }
303
- {
304
- if(term_a.ERecord) {
305
- const e_ = term_a;
306
- {
307
- const _1 = e_;
308
- {
309
- const _c = _1;
310
- return ff_compiler_Syntax.ERecord(_c.at_, ff_core_List.List_map(e_.fields_, ((a_) => {
311
- {
312
- const _1 = a_;
313
- {
314
- const _c = _1;
315
- return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
316
- return
317
- }
318
- }
319
- })))
320
- return
321
- }
322
- }
323
- return
324
- }
325
- }
326
- {
327
- if(term_a.EField) {
328
- const e_ = term_a;
329
- {
330
- const _1 = e_;
331
- {
332
- const _c = _1;
333
- return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_)
334
- return
335
- }
336
- }
337
- return
338
- }
339
- }
340
- {
341
- if(term_a.EWildcard) {
342
- const e_ = term_a;
343
- self_.seenWildcards_ += 1;
344
- {
345
- const _1 = e_;
346
- {
347
- const _c = _1;
348
- return ff_compiler_Syntax.EWildcard(_c.at_, self_.seenWildcards_)
349
- return
350
- }
351
- }
352
- return
353
- }
354
- }
355
- {
356
- return term_
357
- return
358
- }
359
- }
360
- }
361
-
362
- export async function Wildcards_fixWildcards$(self_, term_, $task) {
363
- {
364
- const self_a = self_;
365
- const term_a = term_;
366
- {
367
- if(term_a.ELet) {
368
- const e_ = term_a;
369
- {
370
- const _1 = e_;
371
- {
372
- const _c = _1;
373
- return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.body_))
374
- return
375
- }
376
- }
377
- return
378
- }
379
- }
380
- {
381
- if(term_a.ESequential) {
382
- const e_ = term_a;
383
- {
384
- const _1 = e_;
385
- {
386
- const _c = _1;
387
- return ff_compiler_Syntax.ESequential(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.before_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.after_))
388
- return
389
- }
390
- }
391
- return
392
- }
393
- }
394
- {
395
- if(term_a.EAssign) {
396
- const e_ = term_a;
397
- {
398
- const _1 = e_;
399
- {
400
- const _c = _1;
401
- return ff_compiler_Syntax.EAssign(_c.at_, _c.operator_, _c.variable_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
402
- return
403
- }
404
- }
405
- return
406
- }
407
- }
408
- {
409
- if(term_a.EAssignField) {
410
- const e_ = term_a;
411
- {
412
- const _1 = e_;
413
- {
414
- const _c = _1;
415
- return ff_compiler_Syntax.EAssignField(_c.at_, _c.operator_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
416
- return
417
- }
418
- }
419
- return
420
- }
421
- }
422
- {
423
- if(term_a.EPipe) {
424
- const e_ = term_a;
425
- {
426
- const _1 = e_;
427
- {
428
- const _c = _1;
429
- return ff_compiler_Syntax.EPipe(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), _c.effect_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.function_))
430
- return
431
- }
432
- }
433
- return
434
- }
435
- }
436
- {
437
- if(term_a.ECall) {
438
- const e_ = term_a;
439
- {
440
- const _1 = e_;
441
- {
442
- const _c = _1;
443
- return ff_compiler_Syntax.ECall(_c.at_, (((_1) => {
444
- {
445
- if(_1.DynamicCall) {
446
- const call_ = _1;
447
- {
448
- const _1 = call_;
449
- {
450
- const _c = _1;
451
- return ff_compiler_Syntax.DynamicCall(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, call_.function_), _c.tailCall_)
452
- return
453
- }
454
- }
455
- return
456
- }
457
- }
458
- {
459
- return ff_compiler_Wildcards.fail_(e_.at_, "Internal error: Static calls not expected in the Wildcards phase")
460
- return
461
- }
462
- }))(e_.target_), _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((a_) => {
463
- {
464
- const _1 = a_;
465
- {
466
- const _c = _1;
467
- return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
468
- return
469
- }
470
- }
471
- })), _c.dictionaries_)
472
- return
473
- }
474
- }
475
- return
476
- }
477
- }
478
- {
479
- if(term_a.EList) {
480
- const e_ = term_a;
481
- {
482
- const _1 = e_;
483
- {
484
- const _c = _1;
485
- return ff_compiler_Syntax.EList(_c.at_, _c.elementType_, ff_core_List.List_map(e_.items_, ((_1) => {
486
- {
487
- const item_ = _1.first_;
488
- const spread_ = _1.second_;
489
- return ff_core_Pair.Pair(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, item_), spread_)
490
- return
491
- }
492
- })))
493
- return
494
- }
495
- }
496
- return
497
- }
498
- }
499
- {
500
- if(term_a.ECopy) {
501
- const e_ = term_a;
502
- {
503
- const _1 = e_;
504
- {
505
- const _c = _1;
506
- return ff_compiler_Syntax.ECopy(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), ff_core_List.List_map(e_.arguments_, ((a_) => {
507
- {
508
- const _1 = a_;
509
- {
510
- const _c = _1;
511
- return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
512
- return
513
- }
514
- }
515
- })))
516
- return
517
- }
518
- }
519
- return
520
- }
521
- }
522
- {
523
- if(term_a.EVariant) {
524
- const e_ = term_a;
525
- {
526
- const _1 = e_;
527
- {
528
- const _c = _1;
529
- return ff_compiler_Syntax.EVariant(_c.at_, _c.name_, _c.typeArguments_, ff_core_Option.Option_map(e_.arguments_, ((_w1) => {
530
- return ff_core_List.List_map(_w1, ((a_) => {
531
- {
532
- const _1 = a_;
533
- {
534
- const _c = _1;
535
- return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
536
- return
537
- }
538
- }
539
- }))
540
- })))
541
- return
542
- }
543
- }
544
- return
545
- }
546
- }
547
- {
548
- if(term_a.ERecord) {
549
- const e_ = term_a;
550
- {
551
- const _1 = e_;
552
- {
553
- const _c = _1;
554
- return ff_compiler_Syntax.ERecord(_c.at_, ff_core_List.List_map(e_.fields_, ((a_) => {
555
- {
556
- const _1 = a_;
557
- {
558
- const _c = _1;
559
- return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
560
- return
561
- }
562
- }
563
- })))
564
- return
565
- }
566
- }
567
- return
568
- }
569
- }
570
- {
571
- if(term_a.EField) {
572
- const e_ = term_a;
573
- {
574
- const _1 = e_;
575
- {
576
- const _c = _1;
577
- return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_)
578
- return
579
- }
580
- }
581
- return
582
- }
583
- }
584
- {
585
- if(term_a.EWildcard) {
586
- const e_ = term_a;
587
- self_.seenWildcards_ += 1;
588
- {
589
- const _1 = e_;
590
- {
591
- const _c = _1;
592
- return ff_compiler_Syntax.EWildcard(_c.at_, self_.seenWildcards_)
593
- return
594
- }
595
- }
596
- return
597
- }
598
- }
599
- {
600
- return term_
601
- return
602
- }
603
- }
604
- }
605
-
606
-
607
-
608
-
1
+
2
+
3
+ import * as ff_compiler_Wildcards from "../../ff/compiler/Wildcards.mjs"
4
+
5
+ import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
+
7
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
8
+
9
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
10
+
11
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
+
13
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
+
15
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
+
17
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
18
+
19
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
+
21
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
+
23
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
+
25
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
+
27
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
28
+
29
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
30
+
31
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
+
33
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
+
35
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
36
+
37
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
+
39
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
40
+
41
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
+
43
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
+
45
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
46
+
47
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
+
49
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
+
51
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
+
53
+ import * as ff_core_List from "../../ff/core/List.mjs"
54
+
55
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
+
57
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
58
+
59
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
60
+
61
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
+
63
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
+
65
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
66
+
67
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
+
69
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
+
71
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
72
+
73
+ import * as ff_core_Random from "../../ff/core/Random.mjs"
74
+
75
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
76
+
77
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
78
+
79
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
80
+
81
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
82
+
83
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
84
+
85
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
86
+
87
+ import * as ff_core_String from "../../ff/core/String.mjs"
88
+
89
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
90
+
91
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
92
+
93
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
94
+
95
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
96
+
97
+ import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
98
+
99
+ // type Wildcards
100
+ export function Wildcards(seenWildcards_) {
101
+ return {seenWildcards_};
102
+ }
103
+
104
+
105
+
106
+ export function make_() {
107
+ return ff_compiler_Wildcards.Wildcards(0)
108
+ }
109
+
110
+ export function fail_(at_, message_) {
111
+ return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
112
+ }
113
+
114
+ export async function make_$($task) {
115
+ return ff_compiler_Wildcards.Wildcards(0)
116
+ }
117
+
118
+ export async function fail_$(at_, message_, $task) {
119
+ return ff_core_Core.panic_(((message_ + " ") + ff_compiler_Syntax.Location_show(at_)))
120
+ }
121
+
122
+ export function Wildcards_fixWildcards(self_, term_) {
123
+ {
124
+ const self_a = self_;
125
+ const term_a = term_;
126
+ {
127
+ if(term_a.ELet) {
128
+ const e_ = term_a;
129
+ {
130
+ const _1 = e_;
131
+ {
132
+ const _c = _1;
133
+ return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.body_))
134
+ return
135
+ }
136
+ }
137
+ return
138
+ }
139
+ }
140
+ {
141
+ if(term_a.ESequential) {
142
+ const e_ = term_a;
143
+ {
144
+ const _1 = e_;
145
+ {
146
+ const _c = _1;
147
+ return ff_compiler_Syntax.ESequential(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.before_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.after_))
148
+ return
149
+ }
150
+ }
151
+ return
152
+ }
153
+ }
154
+ {
155
+ if(term_a.EAssign) {
156
+ const e_ = term_a;
157
+ {
158
+ const _1 = e_;
159
+ {
160
+ const _c = _1;
161
+ return ff_compiler_Syntax.EAssign(_c.at_, _c.operator_, _c.variable_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
162
+ return
163
+ }
164
+ }
165
+ return
166
+ }
167
+ }
168
+ {
169
+ if(term_a.EAssignField) {
170
+ const e_ = term_a;
171
+ {
172
+ const _1 = e_;
173
+ {
174
+ const _c = _1;
175
+ return ff_compiler_Syntax.EAssignField(_c.at_, _c.operator_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
176
+ return
177
+ }
178
+ }
179
+ return
180
+ }
181
+ }
182
+ {
183
+ if(term_a.EPipe) {
184
+ const e_ = term_a;
185
+ {
186
+ const _1 = e_;
187
+ {
188
+ const _c = _1;
189
+ return ff_compiler_Syntax.EPipe(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), _c.effect_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.function_))
190
+ return
191
+ }
192
+ }
193
+ return
194
+ }
195
+ }
196
+ {
197
+ if(term_a.ECall) {
198
+ const e_ = term_a;
199
+ {
200
+ const _1 = e_;
201
+ {
202
+ const _c = _1;
203
+ return ff_compiler_Syntax.ECall(_c.at_, (((_1) => {
204
+ {
205
+ if(_1.DynamicCall) {
206
+ const call_ = _1;
207
+ {
208
+ const _1 = call_;
209
+ {
210
+ const _c = _1;
211
+ return ff_compiler_Syntax.DynamicCall(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, call_.function_), _c.tailCall_)
212
+ return
213
+ }
214
+ }
215
+ return
216
+ }
217
+ }
218
+ {
219
+ return ff_compiler_Wildcards.fail_(e_.at_, "Internal error: Static calls not expected in the Wildcards phase")
220
+ return
221
+ }
222
+ }))(e_.target_), _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((a_) => {
223
+ {
224
+ const _1 = a_;
225
+ {
226
+ const _c = _1;
227
+ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
228
+ return
229
+ }
230
+ }
231
+ })), _c.dictionaries_)
232
+ return
233
+ }
234
+ }
235
+ return
236
+ }
237
+ }
238
+ {
239
+ if(term_a.EList) {
240
+ const e_ = term_a;
241
+ {
242
+ const _1 = e_;
243
+ {
244
+ const _c = _1;
245
+ return ff_compiler_Syntax.EList(_c.at_, _c.elementType_, ff_core_List.List_map(e_.items_, ((_1) => {
246
+ {
247
+ const item_ = _1.first_;
248
+ const spread_ = _1.second_;
249
+ return ff_core_Pair.Pair(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, item_), spread_)
250
+ return
251
+ }
252
+ })))
253
+ return
254
+ }
255
+ }
256
+ return
257
+ }
258
+ }
259
+ {
260
+ if(term_a.ECopy) {
261
+ const e_ = term_a;
262
+ {
263
+ const _1 = e_;
264
+ {
265
+ const _c = _1;
266
+ return ff_compiler_Syntax.ECopy(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), ff_core_List.List_map(e_.arguments_, ((a_) => {
267
+ {
268
+ const _1 = a_;
269
+ {
270
+ const _c = _1;
271
+ return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
272
+ return
273
+ }
274
+ }
275
+ })))
276
+ return
277
+ }
278
+ }
279
+ return
280
+ }
281
+ }
282
+ {
283
+ if(term_a.EVariant) {
284
+ const e_ = term_a;
285
+ {
286
+ const _1 = e_;
287
+ {
288
+ const _c = _1;
289
+ return ff_compiler_Syntax.EVariant(_c.at_, _c.name_, _c.typeArguments_, ff_core_Option.Option_map(e_.arguments_, ((_w1) => {
290
+ return ff_core_List.List_map(_w1, ((a_) => {
291
+ {
292
+ const _1 = a_;
293
+ {
294
+ const _c = _1;
295
+ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
296
+ return
297
+ }
298
+ }
299
+ }))
300
+ })))
301
+ return
302
+ }
303
+ }
304
+ return
305
+ }
306
+ }
307
+ {
308
+ if(term_a.ERecord) {
309
+ const e_ = term_a;
310
+ {
311
+ const _1 = e_;
312
+ {
313
+ const _c = _1;
314
+ return ff_compiler_Syntax.ERecord(_c.at_, ff_core_List.List_map(e_.fields_, ((a_) => {
315
+ {
316
+ const _1 = a_;
317
+ {
318
+ const _c = _1;
319
+ return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
320
+ return
321
+ }
322
+ }
323
+ })))
324
+ return
325
+ }
326
+ }
327
+ return
328
+ }
329
+ }
330
+ {
331
+ if(term_a.EField) {
332
+ const e_ = term_a;
333
+ {
334
+ const _1 = e_;
335
+ {
336
+ const _c = _1;
337
+ return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_)
338
+ return
339
+ }
340
+ }
341
+ return
342
+ }
343
+ }
344
+ {
345
+ if(term_a.EWildcard) {
346
+ const e_ = term_a;
347
+ self_.seenWildcards_ += 1;
348
+ {
349
+ const _1 = e_;
350
+ {
351
+ const _c = _1;
352
+ return ff_compiler_Syntax.EWildcard(_c.at_, self_.seenWildcards_)
353
+ return
354
+ }
355
+ }
356
+ return
357
+ }
358
+ }
359
+ {
360
+ return term_
361
+ return
362
+ }
363
+ }
364
+ }
365
+
366
+ export async function Wildcards_fixWildcards$(self_, term_, $task) {
367
+ {
368
+ const self_a = self_;
369
+ const term_a = term_;
370
+ {
371
+ if(term_a.ELet) {
372
+ const e_ = term_a;
373
+ {
374
+ const _1 = e_;
375
+ {
376
+ const _c = _1;
377
+ return ff_compiler_Syntax.ELet(_c.at_, _c.mutable_, _c.name_, _c.valueType_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.body_))
378
+ return
379
+ }
380
+ }
381
+ return
382
+ }
383
+ }
384
+ {
385
+ if(term_a.ESequential) {
386
+ const e_ = term_a;
387
+ {
388
+ const _1 = e_;
389
+ {
390
+ const _c = _1;
391
+ return ff_compiler_Syntax.ESequential(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.before_), ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.after_))
392
+ return
393
+ }
394
+ }
395
+ return
396
+ }
397
+ }
398
+ {
399
+ if(term_a.EAssign) {
400
+ const e_ = term_a;
401
+ {
402
+ const _1 = e_;
403
+ {
404
+ const _c = _1;
405
+ return ff_compiler_Syntax.EAssign(_c.at_, _c.operator_, _c.variable_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
406
+ return
407
+ }
408
+ }
409
+ return
410
+ }
411
+ }
412
+ {
413
+ if(term_a.EAssignField) {
414
+ const e_ = term_a;
415
+ {
416
+ const _1 = e_;
417
+ {
418
+ const _c = _1;
419
+ return ff_compiler_Syntax.EAssignField(_c.at_, _c.operator_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_))
420
+ return
421
+ }
422
+ }
423
+ return
424
+ }
425
+ }
426
+ {
427
+ if(term_a.EPipe) {
428
+ const e_ = term_a;
429
+ {
430
+ const _1 = e_;
431
+ {
432
+ const _c = _1;
433
+ return ff_compiler_Syntax.EPipe(_c.at_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.value_), _c.effect_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.function_))
434
+ return
435
+ }
436
+ }
437
+ return
438
+ }
439
+ }
440
+ {
441
+ if(term_a.ECall) {
442
+ const e_ = term_a;
443
+ {
444
+ const _1 = e_;
445
+ {
446
+ const _c = _1;
447
+ return ff_compiler_Syntax.ECall(_c.at_, (((_1) => {
448
+ {
449
+ if(_1.DynamicCall) {
450
+ const call_ = _1;
451
+ {
452
+ const _1 = call_;
453
+ {
454
+ const _c = _1;
455
+ return ff_compiler_Syntax.DynamicCall(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, call_.function_), _c.tailCall_)
456
+ return
457
+ }
458
+ }
459
+ return
460
+ }
461
+ }
462
+ {
463
+ return ff_compiler_Wildcards.fail_(e_.at_, "Internal error: Static calls not expected in the Wildcards phase")
464
+ return
465
+ }
466
+ }))(e_.target_), _c.effect_, _c.typeArguments_, ff_core_List.List_map(e_.arguments_, ((a_) => {
467
+ {
468
+ const _1 = a_;
469
+ {
470
+ const _c = _1;
471
+ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
472
+ return
473
+ }
474
+ }
475
+ })), _c.dictionaries_)
476
+ return
477
+ }
478
+ }
479
+ return
480
+ }
481
+ }
482
+ {
483
+ if(term_a.EList) {
484
+ const e_ = term_a;
485
+ {
486
+ const _1 = e_;
487
+ {
488
+ const _c = _1;
489
+ return ff_compiler_Syntax.EList(_c.at_, _c.elementType_, ff_core_List.List_map(e_.items_, ((_1) => {
490
+ {
491
+ const item_ = _1.first_;
492
+ const spread_ = _1.second_;
493
+ return ff_core_Pair.Pair(ff_compiler_Wildcards.Wildcards_fixWildcards(self_, item_), spread_)
494
+ return
495
+ }
496
+ })))
497
+ return
498
+ }
499
+ }
500
+ return
501
+ }
502
+ }
503
+ {
504
+ if(term_a.ECopy) {
505
+ const e_ = term_a;
506
+ {
507
+ const _1 = e_;
508
+ {
509
+ const _c = _1;
510
+ return ff_compiler_Syntax.ECopy(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), ff_core_List.List_map(e_.arguments_, ((a_) => {
511
+ {
512
+ const _1 = a_;
513
+ {
514
+ const _c = _1;
515
+ return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
516
+ return
517
+ }
518
+ }
519
+ })))
520
+ return
521
+ }
522
+ }
523
+ return
524
+ }
525
+ }
526
+ {
527
+ if(term_a.EVariant) {
528
+ const e_ = term_a;
529
+ {
530
+ const _1 = e_;
531
+ {
532
+ const _c = _1;
533
+ return ff_compiler_Syntax.EVariant(_c.at_, _c.name_, _c.typeArguments_, ff_core_Option.Option_map(e_.arguments_, ((_w1) => {
534
+ return ff_core_List.List_map(_w1, ((a_) => {
535
+ {
536
+ const _1 = a_;
537
+ {
538
+ const _c = _1;
539
+ return ff_compiler_Syntax.Argument(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
540
+ return
541
+ }
542
+ }
543
+ }))
544
+ })))
545
+ return
546
+ }
547
+ }
548
+ return
549
+ }
550
+ }
551
+ {
552
+ if(term_a.ERecord) {
553
+ const e_ = term_a;
554
+ {
555
+ const _1 = e_;
556
+ {
557
+ const _c = _1;
558
+ return ff_compiler_Syntax.ERecord(_c.at_, ff_core_List.List_map(e_.fields_, ((a_) => {
559
+ {
560
+ const _1 = a_;
561
+ {
562
+ const _c = _1;
563
+ return ff_compiler_Syntax.Field(_c.at_, _c.name_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, a_.value_))
564
+ return
565
+ }
566
+ }
567
+ })))
568
+ return
569
+ }
570
+ }
571
+ return
572
+ }
573
+ }
574
+ {
575
+ if(term_a.EField) {
576
+ const e_ = term_a;
577
+ {
578
+ const _1 = e_;
579
+ {
580
+ const _c = _1;
581
+ return ff_compiler_Syntax.EField(_c.at_, _c.newtype_, ff_compiler_Wildcards.Wildcards_fixWildcards(self_, e_.record_), _c.field_)
582
+ return
583
+ }
584
+ }
585
+ return
586
+ }
587
+ }
588
+ {
589
+ if(term_a.EWildcard) {
590
+ const e_ = term_a;
591
+ self_.seenWildcards_ += 1;
592
+ {
593
+ const _1 = e_;
594
+ {
595
+ const _c = _1;
596
+ return ff_compiler_Syntax.EWildcard(_c.at_, self_.seenWildcards_)
597
+ return
598
+ }
599
+ }
600
+ return
601
+ }
602
+ }
603
+ {
604
+ return term_
605
+ return
606
+ }
607
+ }
608
+ }
609
+
610
+
611
+
612
+