firefly-compiler 0.4.5 → 0.4.6

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 (78) hide show
  1. package/.hintrc +4 -4
  2. package/README.md +1 -1
  3. package/core/HttpClient.ff +1 -1
  4. package/lsp/LanguageServer.ff +32 -7
  5. package/lsp/stderr.txt +1 -0
  6. package/lsp/stdin.txt +11 -0
  7. package/lsp/stdout.txt +41 -0
  8. package/lux/Main.ff +56 -2
  9. package/meetup/AutoCompletion.ff +6 -0
  10. package/output/js/ff/compiler/Builder.mjs +444 -444
  11. package/output/js/ff/compiler/Compiler.mjs +416 -416
  12. package/output/js/ff/compiler/Dependencies.mjs +389 -389
  13. package/output/js/ff/compiler/Deriver.mjs +1170 -1170
  14. package/output/js/ff/compiler/Dictionaries.mjs +1309 -1309
  15. package/output/js/ff/compiler/Environment.mjs +1015 -1015
  16. package/output/js/ff/compiler/Inference.mjs +4268 -4268
  17. package/output/js/ff/compiler/JsEmitter.mjs +5391 -5391
  18. package/output/js/ff/compiler/JsImporter.mjs +266 -266
  19. package/output/js/ff/compiler/LspHook.mjs +793 -793
  20. package/output/js/ff/compiler/Main.mjs +1675 -1675
  21. package/output/js/ff/compiler/Parser.mjs +4008 -4008
  22. package/output/js/ff/compiler/Patterns.mjs +927 -927
  23. package/output/js/ff/compiler/Resolver.mjs +2307 -2307
  24. package/output/js/ff/compiler/Substitution.mjs +1150 -1150
  25. package/output/js/ff/compiler/Syntax.mjs +12434 -12434
  26. package/output/js/ff/compiler/Token.mjs +3096 -3096
  27. package/output/js/ff/compiler/Tokenizer.mjs +593 -593
  28. package/output/js/ff/compiler/Unification.mjs +1752 -1752
  29. package/output/js/ff/compiler/Wildcards.mjs +608 -608
  30. package/output/js/ff/compiler/Workspace.mjs +687 -687
  31. package/output/js/ff/core/Any.mjs +143 -143
  32. package/output/js/ff/core/Array.mjs +547 -547
  33. package/output/js/ff/core/AssetSystem.mjs +274 -274
  34. package/output/js/ff/core/Atomic.mjs +154 -154
  35. package/output/js/ff/core/Bool.mjs +152 -152
  36. package/output/js/ff/core/Box.mjs +112 -112
  37. package/output/js/ff/core/BrowserSystem.mjs +126 -126
  38. package/output/js/ff/core/Buffer.mjs +395 -395
  39. package/output/js/ff/core/BuildSystem.mjs +296 -296
  40. package/output/js/ff/core/Channel.mjs +189 -189
  41. package/output/js/ff/core/Char.mjs +149 -149
  42. package/output/js/ff/core/Core.mjs +300 -300
  43. package/output/js/ff/core/Duration.mjs +116 -116
  44. package/output/js/ff/core/Equal.mjs +179 -179
  45. package/output/js/ff/core/Error.mjs +142 -142
  46. package/output/js/ff/core/FileHandle.mjs +150 -150
  47. package/output/js/ff/core/Float.mjs +225 -225
  48. package/output/js/ff/core/HttpClient.mjs +190 -190
  49. package/output/js/ff/core/Instant.mjs +109 -109
  50. package/output/js/ff/core/Int.mjs +265 -265
  51. package/output/js/ff/core/IntMap.mjs +280 -280
  52. package/output/js/ff/core/JsSystem.mjs +238 -238
  53. package/output/js/ff/core/JsValue.mjs +708 -708
  54. package/output/js/ff/core/List.mjs +2334 -2334
  55. package/output/js/ff/core/Lock.mjs +229 -229
  56. package/output/js/ff/core/Log.mjs +163 -163
  57. package/output/js/ff/core/Map.mjs +362 -362
  58. package/output/js/ff/core/NodeSystem.mjs +294 -294
  59. package/output/js/ff/core/Nothing.mjs +104 -104
  60. package/output/js/ff/core/Option.mjs +1015 -1015
  61. package/output/js/ff/core/Ordering.mjs +730 -730
  62. package/output/js/ff/core/Pair.mjs +331 -331
  63. package/output/js/ff/core/Path.mjs +545 -545
  64. package/output/js/ff/core/RbMap.mjs +1940 -1940
  65. package/output/js/ff/core/Serializable.mjs +428 -428
  66. package/output/js/ff/core/Set.mjs +254 -254
  67. package/output/js/ff/core/Show.mjs +205 -205
  68. package/output/js/ff/core/SourceLocation.mjs +229 -229
  69. package/output/js/ff/core/Stack.mjs +529 -529
  70. package/output/js/ff/core/Stream.mjs +1304 -1304
  71. package/output/js/ff/core/String.mjs +365 -365
  72. package/output/js/ff/core/StringMap.mjs +280 -280
  73. package/output/js/ff/core/Task.mjs +320 -320
  74. package/output/js/ff/core/Try.mjs +507 -507
  75. package/output/js/ff/core/Unit.mjs +151 -151
  76. package/package.json +29 -29
  77. package/vscode/package-lock.json +5 -5
  78. package/vscode/package.json +1 -1
@@ -1,1015 +1,1015 @@
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_Serializable from "../../ff/core/Serializable.mjs"
70
-
71
- import * as ff_core_Set from "../../ff/core/Set.mjs"
72
-
73
- import * as ff_core_Show from "../../ff/core/Show.mjs"
74
-
75
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
76
-
77
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
78
-
79
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
80
-
81
- import * as ff_core_String from "../../ff/core/String.mjs"
82
-
83
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
84
-
85
- import * as ff_core_Task from "../../ff/core/Task.mjs"
86
-
87
- import * as ff_core_Try from "../../ff/core/Try.mjs"
88
-
89
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
90
-
91
- // type Option
92
- const None$ = {None: true};
93
- export function None() {
94
- return None$;
95
- }
96
- export function Some(value_) {
97
- return {Some: true, value_};
98
- }
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
- export function Option_else(self_, body_) {
107
- {
108
- const _1 = self_;
109
- {
110
- if(_1.None) {
111
- return body_()
112
- return
113
- }
114
- }
115
- {
116
- if(_1.Some) {
117
- const value_ = _1.value_;
118
- return value_
119
- return
120
- }
121
- }
122
- }
123
- }
124
-
125
- export function Option_elseIf(self_, condition_, body_) {
126
- {
127
- const _1 = self_;
128
- {
129
- if(_1.None) {
130
- {
131
- const _1 = condition_();
132
- {
133
- if(_1) {
134
- return ff_core_Option.Some(body_())
135
- return
136
- }
137
- }
138
- {
139
- if(!_1) {
140
- return ff_core_Option.None()
141
- return
142
- }
143
- }
144
- }
145
- return
146
- }
147
- }
148
- {
149
- if(_1.Some) {
150
- return self_
151
- return
152
- }
153
- }
154
- }
155
- }
156
-
157
- export function Option_orElse(self_, body_) {
158
- {
159
- const _1 = self_;
160
- {
161
- if(_1.None) {
162
- return body_()
163
- return
164
- }
165
- }
166
- {
167
- if(_1.Some) {
168
- return self_
169
- return
170
- }
171
- }
172
- }
173
- }
174
-
175
- export function Option_isEmpty(self_) {
176
- {
177
- const _1 = self_;
178
- {
179
- if(_1.None) {
180
- return true
181
- return
182
- }
183
- }
184
- {
185
- if(_1.Some) {
186
- return false
187
- return
188
- }
189
- }
190
- }
191
- }
192
-
193
- export function Option_toList(self_) {
194
- {
195
- const _1 = self_;
196
- {
197
- if(_1.None) {
198
- return ff_core_List.Empty()
199
- return
200
- }
201
- }
202
- {
203
- if(_1.Some) {
204
- const v_ = _1.value_;
205
- return ff_core_List.Link(v_, ff_core_List.Empty())
206
- return
207
- }
208
- }
209
- }
210
- }
211
-
212
- export function Option_toStack(self_) {
213
- return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
214
- }
215
-
216
- export function Option_toArray(self_) {
217
- return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
218
- }
219
-
220
- export function Option_toStream(self_, cycle_ = false) {
221
- let next_ = self_;
222
- return ff_core_Stream.make_((() => {
223
- const result_ = next_;
224
- if((!cycle_)) {
225
- next_ = ff_core_Option.None()
226
- };
227
- return result_
228
- }), (() => {
229
-
230
- }))
231
- }
232
-
233
- export function Option_filter(self_, body_) {
234
- {
235
- const _1 = self_;
236
- {
237
- if(_1.Some) {
238
- const v_ = _1.value_;
239
- const _guard1 = body_(v_);
240
- if(_guard1) {
241
- return ff_core_Option.Some(v_)
242
- return
243
- }
244
- }
245
- }
246
- {
247
- return ff_core_Option.None()
248
- return
249
- }
250
- }
251
- }
252
-
253
- export function Option_map(self_, body_) {
254
- {
255
- const _1 = self_;
256
- {
257
- if(_1.None) {
258
- return ff_core_Option.None()
259
- return
260
- }
261
- }
262
- {
263
- if(_1.Some) {
264
- const v_ = _1.value_;
265
- return ff_core_Option.Some(body_(v_))
266
- return
267
- }
268
- }
269
- }
270
- }
271
-
272
- export function Option_flatMap(self_, body_) {
273
- {
274
- const _1 = self_;
275
- {
276
- if(_1.None) {
277
- return ff_core_Option.None()
278
- return
279
- }
280
- }
281
- {
282
- if(_1.Some) {
283
- const v_ = _1.value_;
284
- return body_(v_)
285
- return
286
- }
287
- }
288
- }
289
- }
290
-
291
- export function Option_each(self_, body_) {
292
- {
293
- const _1 = self_;
294
- {
295
- if(_1.None) {
296
-
297
- return
298
- }
299
- }
300
- {
301
- if(_1.Some) {
302
- const v_ = _1.value_;
303
- body_(v_)
304
- return
305
- }
306
- }
307
- }
308
- }
309
-
310
- export function Option_all(self_, body_) {
311
- {
312
- const _1 = self_;
313
- {
314
- if(_1.None) {
315
- return true
316
- return
317
- }
318
- }
319
- {
320
- if(_1.Some) {
321
- const v_ = _1.value_;
322
- return body_(v_)
323
- return
324
- }
325
- }
326
- }
327
- }
328
-
329
- export function Option_any(self_, body_) {
330
- {
331
- const _1 = self_;
332
- {
333
- if(_1.None) {
334
- return false
335
- return
336
- }
337
- }
338
- {
339
- if(_1.Some) {
340
- const v_ = _1.value_;
341
- return body_(v_)
342
- return
343
- }
344
- }
345
- }
346
- }
347
-
348
- export function Option_grab(self_) {
349
- {
350
- const _1 = self_;
351
- {
352
- if(_1.None) {
353
- return ff_core_Try.internalThrowGrabException_()
354
- return
355
- }
356
- }
357
- {
358
- if(_1.Some) {
359
- const v_ = _1.value_;
360
- return v_
361
- return
362
- }
363
- }
364
- }
365
- }
366
-
367
- export async function Option_else$(self_, body_, $task) {
368
- {
369
- const _1 = self_;
370
- {
371
- if(_1.None) {
372
- return (await body_($task))
373
- return
374
- }
375
- }
376
- {
377
- if(_1.Some) {
378
- const value_ = _1.value_;
379
- return value_
380
- return
381
- }
382
- }
383
- }
384
- }
385
-
386
- export async function Option_elseIf$(self_, condition_, body_, $task) {
387
- {
388
- const _1 = self_;
389
- {
390
- if(_1.None) {
391
- {
392
- const _1 = (await condition_($task));
393
- {
394
- if(_1) {
395
- return ff_core_Option.Some((await body_($task)))
396
- return
397
- }
398
- }
399
- {
400
- if(!_1) {
401
- return ff_core_Option.None()
402
- return
403
- }
404
- }
405
- }
406
- return
407
- }
408
- }
409
- {
410
- if(_1.Some) {
411
- return self_
412
- return
413
- }
414
- }
415
- }
416
- }
417
-
418
- export async function Option_orElse$(self_, body_, $task) {
419
- {
420
- const _1 = self_;
421
- {
422
- if(_1.None) {
423
- return (await body_($task))
424
- return
425
- }
426
- }
427
- {
428
- if(_1.Some) {
429
- return self_
430
- return
431
- }
432
- }
433
- }
434
- }
435
-
436
- export async function Option_isEmpty$(self_, $task) {
437
- {
438
- const _1 = self_;
439
- {
440
- if(_1.None) {
441
- return true
442
- return
443
- }
444
- }
445
- {
446
- if(_1.Some) {
447
- return false
448
- return
449
- }
450
- }
451
- }
452
- }
453
-
454
- export async function Option_toList$(self_, $task) {
455
- {
456
- const _1 = self_;
457
- {
458
- if(_1.None) {
459
- return ff_core_List.Empty()
460
- return
461
- }
462
- }
463
- {
464
- if(_1.Some) {
465
- const v_ = _1.value_;
466
- return ff_core_List.Link(v_, ff_core_List.Empty())
467
- return
468
- }
469
- }
470
- }
471
- }
472
-
473
- export async function Option_toStack$(self_, $task) {
474
- return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
475
- }
476
-
477
- export async function Option_toArray$(self_, $task) {
478
- return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
479
- }
480
-
481
- export async function Option_toStream$(self_, cycle_ = false, $task) {
482
- let next_ = self_;
483
- return (await ff_core_Stream.make_$((async ($task) => {
484
- const result_ = next_;
485
- if((!cycle_)) {
486
- next_ = ff_core_Option.None()
487
- };
488
- return result_
489
- }), (async ($task) => {
490
-
491
- }), $task))
492
- }
493
-
494
- export async function Option_filter$(self_, body_, $task) {
495
- {
496
- const _1 = self_;
497
- {
498
- if(_1.Some) {
499
- const v_ = _1.value_;
500
- const _guard1 = (await body_(v_, $task));
501
- if(_guard1) {
502
- return ff_core_Option.Some(v_)
503
- return
504
- }
505
- }
506
- }
507
- {
508
- return ff_core_Option.None()
509
- return
510
- }
511
- }
512
- }
513
-
514
- export async function Option_map$(self_, body_, $task) {
515
- {
516
- const _1 = self_;
517
- {
518
- if(_1.None) {
519
- return ff_core_Option.None()
520
- return
521
- }
522
- }
523
- {
524
- if(_1.Some) {
525
- const v_ = _1.value_;
526
- return ff_core_Option.Some((await body_(v_, $task)))
527
- return
528
- }
529
- }
530
- }
531
- }
532
-
533
- export async function Option_flatMap$(self_, body_, $task) {
534
- {
535
- const _1 = self_;
536
- {
537
- if(_1.None) {
538
- return ff_core_Option.None()
539
- return
540
- }
541
- }
542
- {
543
- if(_1.Some) {
544
- const v_ = _1.value_;
545
- return (await body_(v_, $task))
546
- return
547
- }
548
- }
549
- }
550
- }
551
-
552
- export async function Option_each$(self_, body_, $task) {
553
- {
554
- const _1 = self_;
555
- {
556
- if(_1.None) {
557
-
558
- return
559
- }
560
- }
561
- {
562
- if(_1.Some) {
563
- const v_ = _1.value_;
564
- (await body_(v_, $task))
565
- return
566
- }
567
- }
568
- }
569
- }
570
-
571
- export async function Option_all$(self_, body_, $task) {
572
- {
573
- const _1 = self_;
574
- {
575
- if(_1.None) {
576
- return true
577
- return
578
- }
579
- }
580
- {
581
- if(_1.Some) {
582
- const v_ = _1.value_;
583
- return (await body_(v_, $task))
584
- return
585
- }
586
- }
587
- }
588
- }
589
-
590
- export async function Option_any$(self_, body_, $task) {
591
- {
592
- const _1 = self_;
593
- {
594
- if(_1.None) {
595
- return false
596
- return
597
- }
598
- }
599
- {
600
- if(_1.Some) {
601
- const v_ = _1.value_;
602
- return (await body_(v_, $task))
603
- return
604
- }
605
- }
606
- }
607
- }
608
-
609
- export async function Option_grab$(self_, $task) {
610
- {
611
- const _1 = self_;
612
- {
613
- if(_1.None) {
614
- return ff_core_Try.internalThrowGrabException_()
615
- return
616
- }
617
- }
618
- {
619
- if(_1.Some) {
620
- const v_ = _1.value_;
621
- return v_
622
- return
623
- }
624
- }
625
- }
626
- }
627
-
628
- export function Option_contains(self_, value_, ff_core_Equal_Equal$T) {
629
- {
630
- const _1 = self_;
631
- {
632
- if(_1.None) {
633
- return false
634
- return
635
- }
636
- }
637
- {
638
- if(_1.Some) {
639
- const v_ = _1.value_;
640
- return ff_core_Equal_Equal$T.equals_(v_, value_)
641
- return
642
- }
643
- }
644
- }
645
- }
646
-
647
- export async function Option_contains$(self_, value_, ff_core_Equal_Equal$T, $task) {
648
- {
649
- const _1 = self_;
650
- {
651
- if(_1.None) {
652
- return false
653
- return
654
- }
655
- }
656
- {
657
- if(_1.Some) {
658
- const v_ = _1.value_;
659
- return ff_core_Equal_Equal$T.equals_(v_, value_)
660
- return
661
- }
662
- }
663
- }
664
- }
665
-
666
- export function Option_flatten(self_) {
667
- {
668
- const _1 = self_;
669
- {
670
- if(_1.None) {
671
- return ff_core_Option.None()
672
- return
673
- }
674
- }
675
- {
676
- if(_1.Some) {
677
- const v_ = _1.value_;
678
- return v_
679
- return
680
- }
681
- }
682
- }
683
- }
684
-
685
- export async function Option_flatten$(self_, $task) {
686
- {
687
- const _1 = self_;
688
- {
689
- if(_1.None) {
690
- return ff_core_Option.None()
691
- return
692
- }
693
- }
694
- {
695
- if(_1.Some) {
696
- const v_ = _1.value_;
697
- return v_
698
- return
699
- }
700
- }
701
- }
702
- }
703
-
704
- export function ff_core_Any_HasAnyTag$ff_core_Option_Option(ff_core_Any_HasAnyTag$T) { return {
705
- anyTag_() {
706
- return ff_core_Any.internalAnyTag_(((("ff:core/Option.Option" + "[") + ff_core_Any.AnyTag_show(ff_core_Any_HasAnyTag$T.anyTag_())) + "]"))
707
- },
708
- async anyTag_$($task) {
709
- return ff_core_Any.internalAnyTag_(((("ff:core/Option.Option" + "[") + ff_core_Any.AnyTag_show(ff_core_Any_HasAnyTag$T.anyTag_())) + "]"))
710
- }
711
- }}
712
-
713
- export function ff_core_Show_Show$ff_core_Option_Option(ff_core_Show_Show$T) { return {
714
- show_(value_) {
715
- {
716
- const value_a = value_;
717
- {
718
- if(value_a.None) {
719
- const z_ = value_a;
720
- return "None"
721
- return
722
- }
723
- }
724
- {
725
- if(value_a.Some) {
726
- const z_ = value_a;
727
- return ((("Some" + "(") + ff_core_Show_Show$T.show_(z_.value_)) + ")")
728
- return
729
- }
730
- }
731
- }
732
- },
733
- async show_$(value_, $task) {
734
- {
735
- const value_a = value_;
736
- {
737
- if(value_a.None) {
738
- const z_ = value_a;
739
- return "None"
740
- return
741
- }
742
- }
743
- {
744
- if(value_a.Some) {
745
- const z_ = value_a;
746
- return ((("Some" + "(") + ff_core_Show_Show$T.show_(z_.value_)) + ")")
747
- return
748
- }
749
- }
750
- }
751
- }
752
- }}
753
-
754
- export function ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal_Equal$T) { return {
755
- equals_(x_, y_) {
756
- {
757
- const x_a = x_;
758
- const y_a = y_;
759
- {
760
- const _guard1 = (x_ === y_);
761
- if(_guard1) {
762
- return true
763
- return
764
- }
765
- }
766
- {
767
- if(x_a.Some) {
768
- const x_ = x_a;
769
- if(y_a.Some) {
770
- const y_ = y_a;
771
- return ff_core_Equal_Equal$T.equals_(x_.value_, y_.value_)
772
- return
773
- }
774
- }
775
- }
776
- {
777
- return false
778
- return
779
- }
780
- }
781
- },
782
- async equals_$(x_, y_, $task) {
783
- {
784
- const x_a = x_;
785
- const y_a = y_;
786
- {
787
- const _guard1 = (x_ === y_);
788
- if(_guard1) {
789
- return true
790
- return
791
- }
792
- }
793
- {
794
- if(x_a.Some) {
795
- const x_ = x_a;
796
- if(y_a.Some) {
797
- const y_ = y_a;
798
- return ff_core_Equal_Equal$T.equals_(x_.value_, y_.value_)
799
- return
800
- }
801
- }
802
- }
803
- {
804
- return false
805
- return
806
- }
807
- }
808
- }
809
- }}
810
-
811
- export function ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering_Order$T) { return {
812
- compare_(x_, y_) {
813
- {
814
- const x_a = x_;
815
- const y_a = y_;
816
- {
817
- const _guard1 = (x_ === y_);
818
- if(_guard1) {
819
- return ff_core_Ordering.OrderingSame()
820
- return
821
- }
822
- }
823
- {
824
- if(x_a.Some) {
825
- const x_ = x_a;
826
- if(y_a.Some) {
827
- const y_ = y_a;
828
- const valueOrdering_ = ff_core_Ordering_Order$T.compare_(x_.value_, y_.value_);
829
- if((valueOrdering_ !== ff_core_Ordering.OrderingSame())) {
830
- return valueOrdering_
831
- } else {
832
- return ff_core_Ordering.OrderingSame()
833
- }
834
- return
835
- }
836
- }
837
- }
838
- {
839
- function number_(z_) {
840
- {
841
- const z_a = z_;
842
- {
843
- if(z_a.None) {
844
- return 0
845
- return
846
- }
847
- }
848
- {
849
- if(z_a.Some) {
850
- return 1
851
- return
852
- }
853
- }
854
- }
855
- }
856
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
857
- return
858
- }
859
- }
860
- },
861
- async compare_$(x_, y_, $task) {
862
- {
863
- const x_a = x_;
864
- const y_a = y_;
865
- {
866
- const _guard1 = (x_ === y_);
867
- if(_guard1) {
868
- return ff_core_Ordering.OrderingSame()
869
- return
870
- }
871
- }
872
- {
873
- if(x_a.Some) {
874
- const x_ = x_a;
875
- if(y_a.Some) {
876
- const y_ = y_a;
877
- const valueOrdering_ = ff_core_Ordering_Order$T.compare_(x_.value_, y_.value_);
878
- if((valueOrdering_ !== ff_core_Ordering.OrderingSame())) {
879
- return valueOrdering_
880
- } else {
881
- return ff_core_Ordering.OrderingSame()
882
- }
883
- return
884
- }
885
- }
886
- }
887
- {
888
- function number_(z_) {
889
- {
890
- const z_a = z_;
891
- {
892
- if(z_a.None) {
893
- return 0
894
- return
895
- }
896
- }
897
- {
898
- if(z_a.Some) {
899
- return 1
900
- return
901
- }
902
- }
903
- }
904
- }
905
- return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
906
- return
907
- }
908
- }
909
- }
910
- }}
911
-
912
- export function ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable_Serializable$T) { return {
913
- serializeUsing_(serialization_, value_) {
914
- {
915
- const serialization_a = serialization_;
916
- const value_a = value_;
917
- {
918
- if(value_a.None) {
919
- const v_ = value_a;
920
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
921
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
922
- serialization_.offset_ += 1
923
- return
924
- }
925
- }
926
- {
927
- if(value_a.Some) {
928
- const v_ = value_a;
929
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
930
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
931
- serialization_.offset_ += 1;
932
- ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, v_.value_)
933
- return
934
- }
935
- }
936
- }
937
- },
938
- deserializeUsing_(serialization_) {
939
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
940
- serialization_.offset_ += 1;
941
- {
942
- const _1 = variantIndex_;
943
- {
944
- if(_1 == 0) {
945
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
946
- return ff_core_Option.None()
947
- return
948
- }
949
- }
950
- {
951
- if(_1 == 1) {
952
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
953
- return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
954
- return
955
- }
956
- }
957
- {
958
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
959
- return
960
- }
961
- }
962
- },
963
- async serializeUsing_$(serialization_, value_, $task) {
964
- {
965
- const serialization_a = serialization_;
966
- const value_a = value_;
967
- {
968
- if(value_a.None) {
969
- const v_ = value_a;
970
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
971
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
972
- serialization_.offset_ += 1
973
- return
974
- }
975
- }
976
- {
977
- if(value_a.Some) {
978
- const v_ = value_a;
979
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
980
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
981
- serialization_.offset_ += 1;
982
- ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, v_.value_)
983
- return
984
- }
985
- }
986
- }
987
- },
988
- async deserializeUsing_$(serialization_, $task) {
989
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
990
- serialization_.offset_ += 1;
991
- {
992
- const _1 = variantIndex_;
993
- {
994
- if(_1 == 0) {
995
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
996
- return ff_core_Option.None()
997
- return
998
- }
999
- }
1000
- {
1001
- if(_1 == 1) {
1002
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
1003
- return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
1004
- return
1005
- }
1006
- }
1007
- {
1008
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1009
- return
1010
- }
1011
- }
1012
- }
1013
- }}
1014
-
1015
-
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_Serializable from "../../ff/core/Serializable.mjs"
70
+
71
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
72
+
73
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
74
+
75
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
76
+
77
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
78
+
79
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
80
+
81
+ import * as ff_core_String from "../../ff/core/String.mjs"
82
+
83
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
84
+
85
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
86
+
87
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
88
+
89
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
90
+
91
+ // type Option
92
+ const None$ = {None: true};
93
+ export function None() {
94
+ return None$;
95
+ }
96
+ export function Some(value_) {
97
+ return {Some: true, value_};
98
+ }
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+ export function Option_else(self_, body_) {
107
+ {
108
+ const _1 = self_;
109
+ {
110
+ if(_1.None) {
111
+ return body_()
112
+ return
113
+ }
114
+ }
115
+ {
116
+ if(_1.Some) {
117
+ const value_ = _1.value_;
118
+ return value_
119
+ return
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ export function Option_elseIf(self_, condition_, body_) {
126
+ {
127
+ const _1 = self_;
128
+ {
129
+ if(_1.None) {
130
+ {
131
+ const _1 = condition_();
132
+ {
133
+ if(_1) {
134
+ return ff_core_Option.Some(body_())
135
+ return
136
+ }
137
+ }
138
+ {
139
+ if(!_1) {
140
+ return ff_core_Option.None()
141
+ return
142
+ }
143
+ }
144
+ }
145
+ return
146
+ }
147
+ }
148
+ {
149
+ if(_1.Some) {
150
+ return self_
151
+ return
152
+ }
153
+ }
154
+ }
155
+ }
156
+
157
+ export function Option_orElse(self_, body_) {
158
+ {
159
+ const _1 = self_;
160
+ {
161
+ if(_1.None) {
162
+ return body_()
163
+ return
164
+ }
165
+ }
166
+ {
167
+ if(_1.Some) {
168
+ return self_
169
+ return
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ export function Option_isEmpty(self_) {
176
+ {
177
+ const _1 = self_;
178
+ {
179
+ if(_1.None) {
180
+ return true
181
+ return
182
+ }
183
+ }
184
+ {
185
+ if(_1.Some) {
186
+ return false
187
+ return
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ export function Option_toList(self_) {
194
+ {
195
+ const _1 = self_;
196
+ {
197
+ if(_1.None) {
198
+ return ff_core_List.Empty()
199
+ return
200
+ }
201
+ }
202
+ {
203
+ if(_1.Some) {
204
+ const v_ = _1.value_;
205
+ return ff_core_List.Link(v_, ff_core_List.Empty())
206
+ return
207
+ }
208
+ }
209
+ }
210
+ }
211
+
212
+ export function Option_toStack(self_) {
213
+ return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
214
+ }
215
+
216
+ export function Option_toArray(self_) {
217
+ return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
218
+ }
219
+
220
+ export function Option_toStream(self_, cycle_ = false) {
221
+ let next_ = self_;
222
+ return ff_core_Stream.make_((() => {
223
+ const result_ = next_;
224
+ if((!cycle_)) {
225
+ next_ = ff_core_Option.None()
226
+ };
227
+ return result_
228
+ }), (() => {
229
+
230
+ }))
231
+ }
232
+
233
+ export function Option_filter(self_, body_) {
234
+ {
235
+ const _1 = self_;
236
+ {
237
+ if(_1.Some) {
238
+ const v_ = _1.value_;
239
+ const _guard1 = body_(v_);
240
+ if(_guard1) {
241
+ return ff_core_Option.Some(v_)
242
+ return
243
+ }
244
+ }
245
+ }
246
+ {
247
+ return ff_core_Option.None()
248
+ return
249
+ }
250
+ }
251
+ }
252
+
253
+ export function Option_map(self_, body_) {
254
+ {
255
+ const _1 = self_;
256
+ {
257
+ if(_1.None) {
258
+ return ff_core_Option.None()
259
+ return
260
+ }
261
+ }
262
+ {
263
+ if(_1.Some) {
264
+ const v_ = _1.value_;
265
+ return ff_core_Option.Some(body_(v_))
266
+ return
267
+ }
268
+ }
269
+ }
270
+ }
271
+
272
+ export function Option_flatMap(self_, body_) {
273
+ {
274
+ const _1 = self_;
275
+ {
276
+ if(_1.None) {
277
+ return ff_core_Option.None()
278
+ return
279
+ }
280
+ }
281
+ {
282
+ if(_1.Some) {
283
+ const v_ = _1.value_;
284
+ return body_(v_)
285
+ return
286
+ }
287
+ }
288
+ }
289
+ }
290
+
291
+ export function Option_each(self_, body_) {
292
+ {
293
+ const _1 = self_;
294
+ {
295
+ if(_1.None) {
296
+
297
+ return
298
+ }
299
+ }
300
+ {
301
+ if(_1.Some) {
302
+ const v_ = _1.value_;
303
+ body_(v_)
304
+ return
305
+ }
306
+ }
307
+ }
308
+ }
309
+
310
+ export function Option_all(self_, body_) {
311
+ {
312
+ const _1 = self_;
313
+ {
314
+ if(_1.None) {
315
+ return true
316
+ return
317
+ }
318
+ }
319
+ {
320
+ if(_1.Some) {
321
+ const v_ = _1.value_;
322
+ return body_(v_)
323
+ return
324
+ }
325
+ }
326
+ }
327
+ }
328
+
329
+ export function Option_any(self_, body_) {
330
+ {
331
+ const _1 = self_;
332
+ {
333
+ if(_1.None) {
334
+ return false
335
+ return
336
+ }
337
+ }
338
+ {
339
+ if(_1.Some) {
340
+ const v_ = _1.value_;
341
+ return body_(v_)
342
+ return
343
+ }
344
+ }
345
+ }
346
+ }
347
+
348
+ export function Option_grab(self_) {
349
+ {
350
+ const _1 = self_;
351
+ {
352
+ if(_1.None) {
353
+ return ff_core_Try.internalThrowGrabException_()
354
+ return
355
+ }
356
+ }
357
+ {
358
+ if(_1.Some) {
359
+ const v_ = _1.value_;
360
+ return v_
361
+ return
362
+ }
363
+ }
364
+ }
365
+ }
366
+
367
+ export async function Option_else$(self_, body_, $task) {
368
+ {
369
+ const _1 = self_;
370
+ {
371
+ if(_1.None) {
372
+ return (await body_($task))
373
+ return
374
+ }
375
+ }
376
+ {
377
+ if(_1.Some) {
378
+ const value_ = _1.value_;
379
+ return value_
380
+ return
381
+ }
382
+ }
383
+ }
384
+ }
385
+
386
+ export async function Option_elseIf$(self_, condition_, body_, $task) {
387
+ {
388
+ const _1 = self_;
389
+ {
390
+ if(_1.None) {
391
+ {
392
+ const _1 = (await condition_($task));
393
+ {
394
+ if(_1) {
395
+ return ff_core_Option.Some((await body_($task)))
396
+ return
397
+ }
398
+ }
399
+ {
400
+ if(!_1) {
401
+ return ff_core_Option.None()
402
+ return
403
+ }
404
+ }
405
+ }
406
+ return
407
+ }
408
+ }
409
+ {
410
+ if(_1.Some) {
411
+ return self_
412
+ return
413
+ }
414
+ }
415
+ }
416
+ }
417
+
418
+ export async function Option_orElse$(self_, body_, $task) {
419
+ {
420
+ const _1 = self_;
421
+ {
422
+ if(_1.None) {
423
+ return (await body_($task))
424
+ return
425
+ }
426
+ }
427
+ {
428
+ if(_1.Some) {
429
+ return self_
430
+ return
431
+ }
432
+ }
433
+ }
434
+ }
435
+
436
+ export async function Option_isEmpty$(self_, $task) {
437
+ {
438
+ const _1 = self_;
439
+ {
440
+ if(_1.None) {
441
+ return true
442
+ return
443
+ }
444
+ }
445
+ {
446
+ if(_1.Some) {
447
+ return false
448
+ return
449
+ }
450
+ }
451
+ }
452
+ }
453
+
454
+ export async function Option_toList$(self_, $task) {
455
+ {
456
+ const _1 = self_;
457
+ {
458
+ if(_1.None) {
459
+ return ff_core_List.Empty()
460
+ return
461
+ }
462
+ }
463
+ {
464
+ if(_1.Some) {
465
+ const v_ = _1.value_;
466
+ return ff_core_List.Link(v_, ff_core_List.Empty())
467
+ return
468
+ }
469
+ }
470
+ }
471
+ }
472
+
473
+ export async function Option_toStack$(self_, $task) {
474
+ return ff_core_List.List_toStack(ff_core_Option.Option_toList(self_))
475
+ }
476
+
477
+ export async function Option_toArray$(self_, $task) {
478
+ return ff_core_List.List_toArray(ff_core_Option.Option_toList(self_))
479
+ }
480
+
481
+ export async function Option_toStream$(self_, cycle_ = false, $task) {
482
+ let next_ = self_;
483
+ return (await ff_core_Stream.make_$((async ($task) => {
484
+ const result_ = next_;
485
+ if((!cycle_)) {
486
+ next_ = ff_core_Option.None()
487
+ };
488
+ return result_
489
+ }), (async ($task) => {
490
+
491
+ }), $task))
492
+ }
493
+
494
+ export async function Option_filter$(self_, body_, $task) {
495
+ {
496
+ const _1 = self_;
497
+ {
498
+ if(_1.Some) {
499
+ const v_ = _1.value_;
500
+ const _guard1 = (await body_(v_, $task));
501
+ if(_guard1) {
502
+ return ff_core_Option.Some(v_)
503
+ return
504
+ }
505
+ }
506
+ }
507
+ {
508
+ return ff_core_Option.None()
509
+ return
510
+ }
511
+ }
512
+ }
513
+
514
+ export async function Option_map$(self_, body_, $task) {
515
+ {
516
+ const _1 = self_;
517
+ {
518
+ if(_1.None) {
519
+ return ff_core_Option.None()
520
+ return
521
+ }
522
+ }
523
+ {
524
+ if(_1.Some) {
525
+ const v_ = _1.value_;
526
+ return ff_core_Option.Some((await body_(v_, $task)))
527
+ return
528
+ }
529
+ }
530
+ }
531
+ }
532
+
533
+ export async function Option_flatMap$(self_, body_, $task) {
534
+ {
535
+ const _1 = self_;
536
+ {
537
+ if(_1.None) {
538
+ return ff_core_Option.None()
539
+ return
540
+ }
541
+ }
542
+ {
543
+ if(_1.Some) {
544
+ const v_ = _1.value_;
545
+ return (await body_(v_, $task))
546
+ return
547
+ }
548
+ }
549
+ }
550
+ }
551
+
552
+ export async function Option_each$(self_, body_, $task) {
553
+ {
554
+ const _1 = self_;
555
+ {
556
+ if(_1.None) {
557
+
558
+ return
559
+ }
560
+ }
561
+ {
562
+ if(_1.Some) {
563
+ const v_ = _1.value_;
564
+ (await body_(v_, $task))
565
+ return
566
+ }
567
+ }
568
+ }
569
+ }
570
+
571
+ export async function Option_all$(self_, body_, $task) {
572
+ {
573
+ const _1 = self_;
574
+ {
575
+ if(_1.None) {
576
+ return true
577
+ return
578
+ }
579
+ }
580
+ {
581
+ if(_1.Some) {
582
+ const v_ = _1.value_;
583
+ return (await body_(v_, $task))
584
+ return
585
+ }
586
+ }
587
+ }
588
+ }
589
+
590
+ export async function Option_any$(self_, body_, $task) {
591
+ {
592
+ const _1 = self_;
593
+ {
594
+ if(_1.None) {
595
+ return false
596
+ return
597
+ }
598
+ }
599
+ {
600
+ if(_1.Some) {
601
+ const v_ = _1.value_;
602
+ return (await body_(v_, $task))
603
+ return
604
+ }
605
+ }
606
+ }
607
+ }
608
+
609
+ export async function Option_grab$(self_, $task) {
610
+ {
611
+ const _1 = self_;
612
+ {
613
+ if(_1.None) {
614
+ return ff_core_Try.internalThrowGrabException_()
615
+ return
616
+ }
617
+ }
618
+ {
619
+ if(_1.Some) {
620
+ const v_ = _1.value_;
621
+ return v_
622
+ return
623
+ }
624
+ }
625
+ }
626
+ }
627
+
628
+ export function Option_contains(self_, value_, ff_core_Equal_Equal$T) {
629
+ {
630
+ const _1 = self_;
631
+ {
632
+ if(_1.None) {
633
+ return false
634
+ return
635
+ }
636
+ }
637
+ {
638
+ if(_1.Some) {
639
+ const v_ = _1.value_;
640
+ return ff_core_Equal_Equal$T.equals_(v_, value_)
641
+ return
642
+ }
643
+ }
644
+ }
645
+ }
646
+
647
+ export async function Option_contains$(self_, value_, ff_core_Equal_Equal$T, $task) {
648
+ {
649
+ const _1 = self_;
650
+ {
651
+ if(_1.None) {
652
+ return false
653
+ return
654
+ }
655
+ }
656
+ {
657
+ if(_1.Some) {
658
+ const v_ = _1.value_;
659
+ return ff_core_Equal_Equal$T.equals_(v_, value_)
660
+ return
661
+ }
662
+ }
663
+ }
664
+ }
665
+
666
+ export function Option_flatten(self_) {
667
+ {
668
+ const _1 = self_;
669
+ {
670
+ if(_1.None) {
671
+ return ff_core_Option.None()
672
+ return
673
+ }
674
+ }
675
+ {
676
+ if(_1.Some) {
677
+ const v_ = _1.value_;
678
+ return v_
679
+ return
680
+ }
681
+ }
682
+ }
683
+ }
684
+
685
+ export async function Option_flatten$(self_, $task) {
686
+ {
687
+ const _1 = self_;
688
+ {
689
+ if(_1.None) {
690
+ return ff_core_Option.None()
691
+ return
692
+ }
693
+ }
694
+ {
695
+ if(_1.Some) {
696
+ const v_ = _1.value_;
697
+ return v_
698
+ return
699
+ }
700
+ }
701
+ }
702
+ }
703
+
704
+ export function ff_core_Any_HasAnyTag$ff_core_Option_Option(ff_core_Any_HasAnyTag$T) { return {
705
+ anyTag_() {
706
+ return ff_core_Any.internalAnyTag_(((("ff:core/Option.Option" + "[") + ff_core_Any.AnyTag_show(ff_core_Any_HasAnyTag$T.anyTag_())) + "]"))
707
+ },
708
+ async anyTag_$($task) {
709
+ return ff_core_Any.internalAnyTag_(((("ff:core/Option.Option" + "[") + ff_core_Any.AnyTag_show(ff_core_Any_HasAnyTag$T.anyTag_())) + "]"))
710
+ }
711
+ }}
712
+
713
+ export function ff_core_Show_Show$ff_core_Option_Option(ff_core_Show_Show$T) { return {
714
+ show_(value_) {
715
+ {
716
+ const value_a = value_;
717
+ {
718
+ if(value_a.None) {
719
+ const z_ = value_a;
720
+ return "None"
721
+ return
722
+ }
723
+ }
724
+ {
725
+ if(value_a.Some) {
726
+ const z_ = value_a;
727
+ return ((("Some" + "(") + ff_core_Show_Show$T.show_(z_.value_)) + ")")
728
+ return
729
+ }
730
+ }
731
+ }
732
+ },
733
+ async show_$(value_, $task) {
734
+ {
735
+ const value_a = value_;
736
+ {
737
+ if(value_a.None) {
738
+ const z_ = value_a;
739
+ return "None"
740
+ return
741
+ }
742
+ }
743
+ {
744
+ if(value_a.Some) {
745
+ const z_ = value_a;
746
+ return ((("Some" + "(") + ff_core_Show_Show$T.show_(z_.value_)) + ")")
747
+ return
748
+ }
749
+ }
750
+ }
751
+ }
752
+ }}
753
+
754
+ export function ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal_Equal$T) { return {
755
+ equals_(x_, y_) {
756
+ {
757
+ const x_a = x_;
758
+ const y_a = y_;
759
+ {
760
+ const _guard1 = (x_ === y_);
761
+ if(_guard1) {
762
+ return true
763
+ return
764
+ }
765
+ }
766
+ {
767
+ if(x_a.Some) {
768
+ const x_ = x_a;
769
+ if(y_a.Some) {
770
+ const y_ = y_a;
771
+ return ff_core_Equal_Equal$T.equals_(x_.value_, y_.value_)
772
+ return
773
+ }
774
+ }
775
+ }
776
+ {
777
+ return false
778
+ return
779
+ }
780
+ }
781
+ },
782
+ async equals_$(x_, y_, $task) {
783
+ {
784
+ const x_a = x_;
785
+ const y_a = y_;
786
+ {
787
+ const _guard1 = (x_ === y_);
788
+ if(_guard1) {
789
+ return true
790
+ return
791
+ }
792
+ }
793
+ {
794
+ if(x_a.Some) {
795
+ const x_ = x_a;
796
+ if(y_a.Some) {
797
+ const y_ = y_a;
798
+ return ff_core_Equal_Equal$T.equals_(x_.value_, y_.value_)
799
+ return
800
+ }
801
+ }
802
+ }
803
+ {
804
+ return false
805
+ return
806
+ }
807
+ }
808
+ }
809
+ }}
810
+
811
+ export function ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering_Order$T) { return {
812
+ compare_(x_, y_) {
813
+ {
814
+ const x_a = x_;
815
+ const y_a = y_;
816
+ {
817
+ const _guard1 = (x_ === y_);
818
+ if(_guard1) {
819
+ return ff_core_Ordering.OrderingSame()
820
+ return
821
+ }
822
+ }
823
+ {
824
+ if(x_a.Some) {
825
+ const x_ = x_a;
826
+ if(y_a.Some) {
827
+ const y_ = y_a;
828
+ const valueOrdering_ = ff_core_Ordering_Order$T.compare_(x_.value_, y_.value_);
829
+ if((valueOrdering_ !== ff_core_Ordering.OrderingSame())) {
830
+ return valueOrdering_
831
+ } else {
832
+ return ff_core_Ordering.OrderingSame()
833
+ }
834
+ return
835
+ }
836
+ }
837
+ }
838
+ {
839
+ function number_(z_) {
840
+ {
841
+ const z_a = z_;
842
+ {
843
+ if(z_a.None) {
844
+ return 0
845
+ return
846
+ }
847
+ }
848
+ {
849
+ if(z_a.Some) {
850
+ return 1
851
+ return
852
+ }
853
+ }
854
+ }
855
+ }
856
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
857
+ return
858
+ }
859
+ }
860
+ },
861
+ async compare_$(x_, y_, $task) {
862
+ {
863
+ const x_a = x_;
864
+ const y_a = y_;
865
+ {
866
+ const _guard1 = (x_ === y_);
867
+ if(_guard1) {
868
+ return ff_core_Ordering.OrderingSame()
869
+ return
870
+ }
871
+ }
872
+ {
873
+ if(x_a.Some) {
874
+ const x_ = x_a;
875
+ if(y_a.Some) {
876
+ const y_ = y_a;
877
+ const valueOrdering_ = ff_core_Ordering_Order$T.compare_(x_.value_, y_.value_);
878
+ if((valueOrdering_ !== ff_core_Ordering.OrderingSame())) {
879
+ return valueOrdering_
880
+ } else {
881
+ return ff_core_Ordering.OrderingSame()
882
+ }
883
+ return
884
+ }
885
+ }
886
+ }
887
+ {
888
+ function number_(z_) {
889
+ {
890
+ const z_a = z_;
891
+ {
892
+ if(z_a.None) {
893
+ return 0
894
+ return
895
+ }
896
+ }
897
+ {
898
+ if(z_a.Some) {
899
+ return 1
900
+ return
901
+ }
902
+ }
903
+ }
904
+ }
905
+ return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
906
+ return
907
+ }
908
+ }
909
+ }
910
+ }}
911
+
912
+ export function ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable_Serializable$T) { return {
913
+ serializeUsing_(serialization_, value_) {
914
+ {
915
+ const serialization_a = serialization_;
916
+ const value_a = value_;
917
+ {
918
+ if(value_a.None) {
919
+ const v_ = value_a;
920
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
921
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
922
+ serialization_.offset_ += 1
923
+ return
924
+ }
925
+ }
926
+ {
927
+ if(value_a.Some) {
928
+ const v_ = value_a;
929
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
930
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
931
+ serialization_.offset_ += 1;
932
+ ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, v_.value_)
933
+ return
934
+ }
935
+ }
936
+ }
937
+ },
938
+ deserializeUsing_(serialization_) {
939
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
940
+ serialization_.offset_ += 1;
941
+ {
942
+ const _1 = variantIndex_;
943
+ {
944
+ if(_1 == 0) {
945
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
946
+ return ff_core_Option.None()
947
+ return
948
+ }
949
+ }
950
+ {
951
+ if(_1 == 1) {
952
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
953
+ return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
954
+ return
955
+ }
956
+ }
957
+ {
958
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
959
+ return
960
+ }
961
+ }
962
+ },
963
+ async serializeUsing_$(serialization_, value_, $task) {
964
+ {
965
+ const serialization_a = serialization_;
966
+ const value_a = value_;
967
+ {
968
+ if(value_a.None) {
969
+ const v_ = value_a;
970
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
971
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
972
+ serialization_.offset_ += 1
973
+ return
974
+ }
975
+ }
976
+ {
977
+ if(value_a.Some) {
978
+ const v_ = value_a;
979
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
980
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 1);
981
+ serialization_.offset_ += 1;
982
+ ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, v_.value_)
983
+ return
984
+ }
985
+ }
986
+ }
987
+ },
988
+ async deserializeUsing_$(serialization_, $task) {
989
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
990
+ serialization_.offset_ += 1;
991
+ {
992
+ const _1 = variantIndex_;
993
+ {
994
+ if(_1 == 0) {
995
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
996
+ return ff_core_Option.None()
997
+ return
998
+ }
999
+ }
1000
+ {
1001
+ if(_1 == 1) {
1002
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 19), 0);
1003
+ return ff_core_Option.Some(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_))
1004
+ return
1005
+ }
1006
+ }
1007
+ {
1008
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1009
+ return
1010
+ }
1011
+ }
1012
+ }
1013
+ }}
1014
+
1015
+