firefly-compiler 0.4.15 → 0.4.17

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 (87) hide show
  1. package/compiler/Compiler.ff +0 -1
  2. package/compiler/Deriver.ff +3 -3
  3. package/core/Array.ff +154 -2
  4. package/core/BrowserSystem.ff +0 -4
  5. package/core/Int.ff +2 -2
  6. package/core/IntMap.ff +11 -0
  7. package/core/List.ff +2 -2
  8. package/core/Map.ff +11 -0
  9. package/core/StringMap.ff +11 -0
  10. package/guide/Main.ff +2 -1
  11. package/lsp/Handler.ff +48 -8
  12. package/lsp/LanguageServer.ff +9 -2
  13. package/output/js/ff/compiler/Builder.mjs +0 -2
  14. package/output/js/ff/compiler/Compiler.mjs +1 -3
  15. package/output/js/ff/compiler/Dependencies.mjs +0 -2
  16. package/output/js/ff/compiler/Deriver.mjs +4 -6
  17. package/output/js/ff/compiler/Dictionaries.mjs +0 -2
  18. package/output/js/ff/compiler/Environment.mjs +0 -2
  19. package/output/js/ff/compiler/Inference.mjs +0 -2
  20. package/output/js/ff/compiler/JsEmitter.mjs +0 -2
  21. package/output/js/ff/compiler/JsImporter.mjs +0 -2
  22. package/output/js/ff/compiler/LspHook.mjs +0 -2
  23. package/output/js/ff/compiler/Main.mjs +0 -2
  24. package/output/js/ff/compiler/Parser.mjs +0 -2
  25. package/output/js/ff/compiler/Patterns.mjs +0 -2
  26. package/output/js/ff/compiler/Resolver.mjs +0 -2
  27. package/output/js/ff/compiler/Substitution.mjs +0 -2
  28. package/output/js/ff/compiler/Syntax.mjs +0 -2
  29. package/output/js/ff/compiler/Token.mjs +0 -2
  30. package/output/js/ff/compiler/Tokenizer.mjs +0 -2
  31. package/output/js/ff/compiler/Unification.mjs +0 -2
  32. package/output/js/ff/compiler/Wildcards.mjs +0 -2
  33. package/output/js/ff/compiler/Workspace.mjs +0 -2
  34. package/output/js/ff/core/Any.mjs +0 -2
  35. package/output/js/ff/core/Array.mjs +368 -4
  36. package/output/js/ff/core/AssetSystem.mjs +0 -2
  37. package/output/js/ff/core/Atomic.mjs +0 -2
  38. package/output/js/ff/core/Bool.mjs +0 -2
  39. package/output/js/ff/core/Box.mjs +0 -2
  40. package/output/js/ff/core/BrowserSystem.mjs +0 -10
  41. package/output/js/ff/core/Buffer.mjs +0 -2
  42. package/output/js/ff/core/BuildSystem.mjs +0 -2
  43. package/output/js/ff/core/Channel.mjs +0 -2
  44. package/output/js/ff/core/Char.mjs +0 -2
  45. package/output/js/ff/core/Core.mjs +0 -2
  46. package/output/js/ff/core/Duration.mjs +0 -2
  47. package/output/js/ff/core/Equal.mjs +0 -2
  48. package/output/js/ff/core/Error.mjs +0 -2
  49. package/output/js/ff/core/FileHandle.mjs +0 -2
  50. package/output/js/ff/core/Float.mjs +0 -2
  51. package/output/js/ff/core/HttpClient.mjs +0 -2
  52. package/output/js/ff/core/Instant.mjs +0 -2
  53. package/output/js/ff/core/Int.mjs +4 -6
  54. package/output/js/ff/core/IntMap.mjs +38 -2
  55. package/output/js/ff/core/JsSystem.mjs +0 -2
  56. package/output/js/ff/core/JsValue.mjs +0 -2
  57. package/output/js/ff/core/Json.mjs +0 -2
  58. package/output/js/ff/core/List.mjs +4 -6
  59. package/output/js/ff/core/Lock.mjs +0 -2
  60. package/output/js/ff/core/Log.mjs +0 -2
  61. package/output/js/ff/core/Map.mjs +40 -2
  62. package/output/js/ff/core/NodeSystem.mjs +0 -2
  63. package/output/js/ff/core/Nothing.mjs +0 -2
  64. package/output/js/ff/core/Option.mjs +0 -2
  65. package/output/js/ff/core/Ordering.mjs +0 -2
  66. package/output/js/ff/core/Pair.mjs +0 -2
  67. package/output/js/ff/core/Path.mjs +0 -2
  68. package/output/js/ff/core/Random.mjs +0 -2
  69. package/output/js/ff/core/RbMap.mjs +0 -2
  70. package/output/js/ff/core/Serializable.mjs +0 -2
  71. package/output/js/ff/core/Set.mjs +0 -2
  72. package/output/js/ff/core/Show.mjs +0 -2
  73. package/output/js/ff/core/SourceLocation.mjs +0 -2
  74. package/output/js/ff/core/Stack.mjs +0 -2
  75. package/output/js/ff/core/Stream.mjs +0 -2
  76. package/output/js/ff/core/String.mjs +0 -2
  77. package/output/js/ff/core/StringMap.mjs +38 -2
  78. package/output/js/ff/core/Task.mjs +0 -2
  79. package/output/js/ff/core/Try.mjs +0 -2
  80. package/output/js/ff/core/Unit.mjs +0 -2
  81. package/package.json +1 -1
  82. package/vscode/README.md +1 -4
  83. package/vscode/client/src/extension.ts +12 -1
  84. package/vscode/package.json +1 -1
  85. package/websocket/.firefly/package.ff +1 -0
  86. package/{core → websocket}/WebSocket.ff +4 -0
  87. package/output/js/ff/core/WebSocket.mjs +0 -200
@@ -98,8 +98,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
98
98
 
99
99
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
100
100
 
101
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
102
-
103
101
  // type Resolver
104
102
  export function Resolver(variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_) {
105
103
  return {variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Substitution
102
100
  export function Substitution(substitution_) {
103
101
  return {substitution_};
@@ -94,8 +94,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
94
94
 
95
95
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
96
96
 
97
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
98
-
99
97
  // type Location
100
98
  export function Location(file_, line_, column_) {
101
99
  return {file_, line_, column_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Token
102
100
  export function Token(file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_) {
103
101
  return {file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_};
@@ -100,8 +100,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
100
100
 
101
101
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
102
102
 
103
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
104
-
105
103
 
106
104
 
107
105
 
@@ -98,8 +98,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
98
98
 
99
99
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
100
100
 
101
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
102
-
103
101
  // type Unification
104
102
  export function Unification(substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_) {
105
103
  return {substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Wildcards
102
100
  export function Wildcards(seenWildcards_) {
103
101
  return {seenWildcards_};
@@ -96,8 +96,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
96
96
 
97
97
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
98
98
 
99
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
100
-
101
99
  // type Workspace
102
100
  export function Workspace(rules_, defaultLocation_, packageDirectory_) {
103
101
  return {rules_, defaultLocation_, packageDirectory_};
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Any
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Array
98
96
 
99
97
 
@@ -214,7 +212,34 @@ export function Array_dropLast(self_, count_ = 1) {
214
212
  return self_.slice(0, self_.length - count_)
215
213
  }
216
214
 
217
- export function Array_update(self_, index_, body_) {
215
+ export function Array_pairs(self_) {
216
+ let i_ = 0;
217
+ return ff_core_Array.Array_map(self_, ((x_) => {
218
+ const r_ = ff_core_Pair.Pair(i_, x_);
219
+ i_ += 1;
220
+ return r_
221
+ }))
222
+ }
223
+
224
+ export function Array_slice(self_, from_, until_) {
225
+ return ff_core_Array.Array_takeFirst(ff_core_Array.Array_dropFirst(self_, from_), (until_ - from_))
226
+ }
227
+
228
+ export function Array_foldLeft(self_, initial_, body_) {
229
+ let result_ = initial_;
230
+ ff_core_Array.Array_each(self_, ((x_) => {
231
+ result_ = body_(result_, x_)
232
+ }));
233
+ return result_
234
+ }
235
+
236
+ export function Array_update(self_, index_, value_) {
237
+ return ff_core_Array.Array_modify(self_, index_, ((_) => {
238
+ return value_
239
+ }))
240
+ }
241
+
242
+ export function Array_modify(self_, index_, body_) {
218
243
 
219
244
  if(index_ < 0 || index_ >= self_.length) {
220
245
  ff_core_Try.internalThrowGrabException_()
@@ -225,6 +250,22 @@ export function Array_update(self_, index_, body_) {
225
250
 
226
251
  }
227
252
 
253
+ export function Array_zip(self_, that_) {
254
+ if((ff_core_Array.Array_size(self_) <= ff_core_Array.Array_size(that_))) {
255
+ let i_ = (-1);
256
+ return ff_core_Array.Array_map(self_, ((x_) => {
257
+ i_ += 1;
258
+ return ff_core_Pair.Pair(x_, ff_core_Array.Array_grab(that_, i_))
259
+ }))
260
+ } else {
261
+ let i_ = (-1);
262
+ return ff_core_Array.Array_map(that_, ((y_) => {
263
+ i_ += 1;
264
+ return ff_core_Pair.Pair(ff_core_Array.Array_grab(self_, i_), y_)
265
+ }))
266
+ }
267
+ }
268
+
228
269
  export function Array_chunk(self_, chunkSize_) {
229
270
  const results_ = ff_core_Stack.make_();
230
271
  const result_ = ff_core_Stack.make_();
@@ -307,6 +348,35 @@ return (!result_)
307
348
  return result_
308
349
  }
309
350
 
351
+ export function Array_find(self_, body_) {
352
+ let result_ = ff_core_Option.None();
353
+ ff_core_Array.Array_eachWhile(self_, ((x_) => {
354
+ if(body_(x_)) {
355
+ result_ = ff_core_Option.Some(x_);
356
+ return false
357
+ } else {
358
+ return true
359
+ }
360
+ }));
361
+ return result_
362
+ }
363
+
364
+ export function Array_filter(self_, body_) {
365
+ const result_ = ff_core_Stack.make_();
366
+ ff_core_Array.Array_each(self_, ((x_) => {
367
+ if(body_(x_)) {
368
+ ff_core_Stack.Stack_push(result_, x_)
369
+ }
370
+ }));
371
+ return ff_core_Stack.Stack_drain(result_)
372
+ }
373
+
374
+ export function Array_partition(self_, body_) {
375
+ return ff_core_Pair.Pair(ff_core_Array.Array_filter(self_, body_), ff_core_Array.Array_filter(self_, ((_w1) => {
376
+ return (!body_(_w1))
377
+ })))
378
+ }
379
+
310
380
  export function Array_map(self_, body_) {
311
381
 
312
382
  return self_.map(body_)
@@ -321,6 +391,38 @@ ff_core_Stack.Stack_pushArray(results_, body_(x_))
321
391
  return ff_core_Stack.Stack_drain(results_)
322
392
  }
323
393
 
394
+ export function Array_collect(self_, body_) {
395
+ let result_ = ff_core_Stack.make_();
396
+ ff_core_Array.Array_each(self_, ((x_) => {
397
+ ff_core_Option.Option_each(body_(x_), ((_w1) => {
398
+ ff_core_Stack.Stack_push(result_, _w1)
399
+ }))
400
+ }));
401
+ return ff_core_Stack.Stack_drain(result_)
402
+ }
403
+
404
+ export function Array_collectFirst(self_, body_) {
405
+ let result_ = ff_core_Option.None();
406
+ ff_core_Array.Array_eachWhile(self_, ((x_) => {
407
+ {
408
+ const _1 = body_(x_);
409
+ {
410
+ if(_1.None) {
411
+ return true
412
+ return
413
+ }
414
+ }
415
+ {
416
+ const o_ = _1;
417
+ result_ = o_;
418
+ return false
419
+ return
420
+ }
421
+ }
422
+ }));
423
+ return result_
424
+ }
425
+
324
426
  export function Array_sortBy(self_, body_, ff_core_Ordering_Order$S) {
325
427
  return ff_core_Array.Array_sortWith(self_, ((_w1, _w2) => {
326
428
  return ff_core_Ordering_Order$S.compare_(body_(_w1), body_(_w2))
@@ -333,6 +435,28 @@ ff_core_Stack.Stack_sortWith(stack_, ordering_);
333
435
  return ff_core_Stack.Stack_drain(stack_)
334
436
  }
335
437
 
438
+ export function Array_reverse(self_) {
439
+ return ff_core_Array.Array_map(ff_core_List.List_toArray(ff_core_Int.Int_to(1, ff_core_Array.Array_size(self_))), ((i_) => {
440
+ return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - i_))
441
+ }))
442
+ }
443
+
444
+ export function Array_separate(self_, separator_) {
445
+ const stack_ = ff_core_Stack.make_();
446
+ ff_core_Array.Array_each(ff_core_Array.Array_pairs(self_), ((_1) => {
447
+ {
448
+ const i_ = _1.first_;
449
+ const x_ = _1.second_;
450
+ if((i_ !== 0)) {
451
+ ff_core_Stack.Stack_pushArray(stack_, separator_)
452
+ };
453
+ ff_core_Stack.Stack_push(stack_, x_)
454
+ return
455
+ }
456
+ }));
457
+ return ff_core_Stack.Stack_drain(stack_)
458
+ }
459
+
336
460
  export async function Array_addAll$(self_, that_, $task) {
337
461
  throw new Error('Function Array_addAll is missing on this target in async context.');
338
462
  }
@@ -385,7 +509,34 @@ export async function Array_dropLast$(self_, count_ = 1, $task) {
385
509
  throw new Error('Function Array_dropLast is missing on this target in async context.');
386
510
  }
387
511
 
388
- export async function Array_update$(self_, index_, body_, $task) {
512
+ export async function Array_pairs$(self_, $task) {
513
+ let i_ = 0;
514
+ return ff_core_Array.Array_map(self_, ((x_) => {
515
+ const r_ = ff_core_Pair.Pair(i_, x_);
516
+ i_ += 1;
517
+ return r_
518
+ }))
519
+ }
520
+
521
+ export async function Array_slice$(self_, from_, until_, $task) {
522
+ return ff_core_Array.Array_takeFirst(ff_core_Array.Array_dropFirst(self_, from_), (until_ - from_))
523
+ }
524
+
525
+ export async function Array_foldLeft$(self_, initial_, body_, $task) {
526
+ let result_ = initial_;
527
+ (await ff_core_Array.Array_each$(self_, (async (x_, $task) => {
528
+ result_ = (await body_(result_, x_, $task))
529
+ }), $task));
530
+ return result_
531
+ }
532
+
533
+ export async function Array_update$(self_, index_, value_, $task) {
534
+ return ff_core_Array.Array_modify(self_, index_, ((_) => {
535
+ return value_
536
+ }))
537
+ }
538
+
539
+ export async function Array_modify$(self_, index_, body_, $task) {
389
540
 
390
541
  if(index_ < 0 || index_ >= self_.length) {
391
542
  ff_core_Try.internalThrowGrabException_()
@@ -396,6 +547,22 @@ export async function Array_update$(self_, index_, body_, $task) {
396
547
 
397
548
  }
398
549
 
550
+ export async function Array_zip$(self_, that_, $task) {
551
+ if((ff_core_Array.Array_size(self_) <= ff_core_Array.Array_size(that_))) {
552
+ let i_ = (-1);
553
+ return ff_core_Array.Array_map(self_, ((x_) => {
554
+ i_ += 1;
555
+ return ff_core_Pair.Pair(x_, ff_core_Array.Array_grab(that_, i_))
556
+ }))
557
+ } else {
558
+ let i_ = (-1);
559
+ return ff_core_Array.Array_map(that_, ((y_) => {
560
+ i_ += 1;
561
+ return ff_core_Pair.Pair(ff_core_Array.Array_grab(self_, i_), y_)
562
+ }))
563
+ }
564
+ }
565
+
399
566
  export async function Array_chunk$(self_, chunkSize_, $task) {
400
567
  const results_ = ff_core_Stack.make_();
401
568
  const result_ = ff_core_Stack.make_();
@@ -474,6 +641,35 @@ return (!result_)
474
641
  return result_
475
642
  }
476
643
 
644
+ export async function Array_find$(self_, body_, $task) {
645
+ let result_ = ff_core_Option.None();
646
+ (await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
647
+ if((await body_(x_, $task))) {
648
+ result_ = ff_core_Option.Some(x_);
649
+ return false
650
+ } else {
651
+ return true
652
+ }
653
+ }), $task));
654
+ return result_
655
+ }
656
+
657
+ export async function Array_filter$(self_, body_, $task) {
658
+ const result_ = ff_core_Stack.make_();
659
+ (await ff_core_Array.Array_each$(self_, (async (x_, $task) => {
660
+ if((await body_(x_, $task))) {
661
+ ff_core_Stack.Stack_push(result_, x_)
662
+ }
663
+ }), $task));
664
+ return ff_core_Stack.Stack_drain(result_)
665
+ }
666
+
667
+ export async function Array_partition$(self_, body_, $task) {
668
+ return ff_core_Pair.Pair((await ff_core_Array.Array_filter$(self_, body_, $task)), (await ff_core_Array.Array_filter$(self_, (async (_w1, $task) => {
669
+ return (!(await body_(_w1, $task)))
670
+ }), $task)))
671
+ }
672
+
477
673
  export async function Array_map$(self_, body_, $task) {
478
674
 
479
675
  let result = [];
@@ -492,6 +688,38 @@ ff_core_Stack.Stack_pushArray(results_, (await body_(x_, $task)))
492
688
  return ff_core_Stack.Stack_drain(results_)
493
689
  }
494
690
 
691
+ export async function Array_collect$(self_, body_, $task) {
692
+ let result_ = ff_core_Stack.make_();
693
+ (await ff_core_Array.Array_each$(self_, (async (x_, $task) => {
694
+ ff_core_Option.Option_each((await body_(x_, $task)), ((_w1) => {
695
+ ff_core_Stack.Stack_push(result_, _w1)
696
+ }))
697
+ }), $task));
698
+ return ff_core_Stack.Stack_drain(result_)
699
+ }
700
+
701
+ export async function Array_collectFirst$(self_, body_, $task) {
702
+ let result_ = ff_core_Option.None();
703
+ (await ff_core_Array.Array_eachWhile$(self_, (async (x_, $task) => {
704
+ {
705
+ const _1 = (await body_(x_, $task));
706
+ {
707
+ if(_1.None) {
708
+ return true
709
+ return
710
+ }
711
+ }
712
+ {
713
+ const o_ = _1;
714
+ result_ = o_;
715
+ return false
716
+ return
717
+ }
718
+ }
719
+ }), $task));
720
+ return result_
721
+ }
722
+
495
723
  export async function Array_sortBy$(self_, body_, ff_core_Ordering_Order$S, $task) {
496
724
  return (await ff_core_Array.Array_sortWith$(self_, (async (_w1, _w2, $task) => {
497
725
  return ff_core_Ordering_Order$S.compare_((await body_(_w1, $task)), (await body_(_w2, $task)))
@@ -504,6 +732,28 @@ const stack_ = ff_core_Array.Array_toStack(self_);
504
732
  return ff_core_Stack.Stack_drain(stack_)
505
733
  }
506
734
 
735
+ export async function Array_reverse$(self_, $task) {
736
+ return ff_core_Array.Array_map(ff_core_List.List_toArray(ff_core_Int.Int_to(1, ff_core_Array.Array_size(self_))), ((i_) => {
737
+ return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - i_))
738
+ }))
739
+ }
740
+
741
+ export async function Array_separate$(self_, separator_, $task) {
742
+ const stack_ = ff_core_Stack.make_();
743
+ ff_core_Array.Array_each(ff_core_Array.Array_pairs(self_), ((_1) => {
744
+ {
745
+ const i_ = _1.first_;
746
+ const x_ = _1.second_;
747
+ if((i_ !== 0)) {
748
+ ff_core_Stack.Stack_pushArray(stack_, separator_)
749
+ };
750
+ ff_core_Stack.Stack_push(stack_, x_)
751
+ return
752
+ }
753
+ }));
754
+ return ff_core_Stack.Stack_drain(stack_)
755
+ }
756
+
507
757
  export function Array_sort(self_, ff_core_Ordering_Order$T) {
508
758
  return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
509
759
  return ff_core_Ordering_Order$T.compare_(x_, y_)
@@ -514,6 +764,25 @@ export function Array_toSet(self_, ff_core_Ordering_Order$T) {
514
764
  return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
515
765
  }
516
766
 
767
+ export function Array_distinct(self_, ff_core_Ordering_Order$T) {
768
+ let seen_ = ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering_Order$T);
769
+ return ff_core_Array.Array_filter(self_, ((_1) => {
770
+ {
771
+ const item_ = _1;
772
+ const _guard1 = (!ff_core_Set.Set_contains(seen_, item_, ff_core_Ordering_Order$T));
773
+ if(_guard1) {
774
+ seen_ = ff_core_Set.Set_add(seen_, item_, ff_core_Ordering_Order$T);
775
+ return true
776
+ return
777
+ }
778
+ }
779
+ {
780
+ return false
781
+ return
782
+ }
783
+ }))
784
+ }
785
+
517
786
  export async function Array_sort$(self_, ff_core_Ordering_Order$T, $task) {
518
787
  return ff_core_Array.Array_sortWith(self_, ((x_, y_) => {
519
788
  return ff_core_Ordering_Order$T.compare_(x_, y_)
@@ -524,14 +793,109 @@ export async function Array_toSet$(self_, ff_core_Ordering_Order$T, $task) {
524
793
  return ff_core_List.List_toSet(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$T)
525
794
  }
526
795
 
796
+ export async function Array_distinct$(self_, ff_core_Ordering_Order$T, $task) {
797
+ let seen_ = ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering_Order$T);
798
+ return ff_core_Array.Array_filter(self_, ((_1) => {
799
+ {
800
+ const item_ = _1;
801
+ const _guard1 = (!ff_core_Set.Set_contains(seen_, item_, ff_core_Ordering_Order$T));
802
+ if(_guard1) {
803
+ seen_ = ff_core_Set.Set_add(seen_, item_, ff_core_Ordering_Order$T);
804
+ return true
805
+ return
806
+ }
807
+ }
808
+ {
809
+ return false
810
+ return
811
+ }
812
+ }))
813
+ }
814
+
815
+ export function Array_flatten(self_) {
816
+ const result_ = ff_core_Stack.make_();
817
+ ff_core_Array.Array_each(self_, ((xs_) => {
818
+ ff_core_Stack.Stack_pushArray(result_, xs_)
819
+ }));
820
+ return ff_core_Stack.Stack_drain(result_)
821
+ }
822
+
823
+ export async function Array_flatten$(self_, $task) {
824
+ const result_ = ff_core_Stack.make_();
825
+ ff_core_Array.Array_each(self_, ((xs_) => {
826
+ ff_core_Stack.Stack_pushArray(result_, xs_)
827
+ }));
828
+ return ff_core_Stack.Stack_drain(result_)
829
+ }
830
+
527
831
  export function Array_toMap(self_, ff_core_Ordering_Order$K) {
528
832
  return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
529
833
  }
530
834
 
835
+ export function Array_group(self_, ff_core_Ordering_Order$K) {
836
+ let map_ = ff_core_Map.empty_();
837
+ ff_core_Array.Array_each(self_, ((_1) => {
838
+ {
839
+ const k_ = _1.first_;
840
+ const v_ = _1.second_;
841
+ map_ = ff_core_Map.Map_push(map_, k_, v_, ff_core_Ordering_Order$K)
842
+ return
843
+ }
844
+ }));
845
+ return ff_core_Map.Map_mapValues(map_, ((_, v_) => {
846
+ return ff_core_Stack.Stack_drain(v_)
847
+ }), ff_core_Ordering_Order$K)
848
+ }
849
+
531
850
  export async function Array_toMap$(self_, ff_core_Ordering_Order$K, $task) {
532
851
  return ff_core_List.List_toMap(ff_core_Array.Array_toList(self_), ff_core_Ordering_Order$K)
533
852
  }
534
853
 
854
+ export async function Array_group$(self_, ff_core_Ordering_Order$K, $task) {
855
+ let map_ = ff_core_Map.empty_();
856
+ ff_core_Array.Array_each(self_, ((_1) => {
857
+ {
858
+ const k_ = _1.first_;
859
+ const v_ = _1.second_;
860
+ map_ = ff_core_Map.Map_push(map_, k_, v_, ff_core_Ordering_Order$K)
861
+ return
862
+ }
863
+ }));
864
+ return ff_core_Map.Map_mapValues(map_, ((_, v_) => {
865
+ return ff_core_Stack.Stack_drain(v_)
866
+ }), ff_core_Ordering_Order$K)
867
+ }
868
+
869
+ export function Array_unzip(self_) {
870
+ const first_ = ff_core_Stack.make_();
871
+ const second_ = ff_core_Stack.make_();
872
+ ff_core_Array.Array_each(self_, ((_1) => {
873
+ {
874
+ const x_ = _1.first_;
875
+ const y_ = _1.second_;
876
+ ff_core_Stack.Stack_push(first_, x_);
877
+ ff_core_Stack.Stack_push(second_, y_)
878
+ return
879
+ }
880
+ }));
881
+ return ff_core_Pair.Pair(ff_core_Stack.Stack_drain(first_), ff_core_Stack.Stack_drain(second_))
882
+ }
883
+
884
+ export async function Array_unzip$(self_, $task) {
885
+ const first_ = ff_core_Stack.make_();
886
+ const second_ = ff_core_Stack.make_();
887
+ ff_core_Array.Array_each(self_, ((_1) => {
888
+ {
889
+ const x_ = _1.first_;
890
+ const y_ = _1.second_;
891
+ ff_core_Stack.Stack_push(first_, x_);
892
+ ff_core_Stack.Stack_push(second_, y_)
893
+ return
894
+ }
895
+ }));
896
+ return ff_core_Pair.Pair(ff_core_Stack.Stack_drain(first_), ff_core_Stack.Stack_drain(second_))
897
+ }
898
+
535
899
  export function Array_join(self_, separator_ = "") {
536
900
  return self_.join(separator_)
537
901
  }
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type AssetSystem
98
96
  export function AssetSystem(files_) {
99
97
  return {files_};
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Atomic
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Bool
98
96
  const False$ = {False: true};
99
97
  export function False() {
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Box
98
96
  export function Box(value_) {
99
97
  return {value_};
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type BrowserSystem
98
96
 
99
97
 
@@ -107,10 +105,6 @@ export function BrowserSystem_httpClient(self_) {
107
105
  throw new Error('Function BrowserSystem_httpClient is missing on this target in sync context.');
108
106
  }
109
107
 
110
- export function BrowserSystem_webSocket(self_, url_) {
111
- return ff_core_WebSocket.internalOpenBrowserWebSocket_(self_, url_)
112
- }
113
-
114
108
  export function BrowserSystem_mainTask(self_) {
115
109
  throw new Error('Function BrowserSystem_mainTask is missing on this target in sync context.');
116
110
  }
@@ -139,10 +133,6 @@ export async function BrowserSystem_httpClient$(self_, $task) {
139
133
  return null
140
134
  }
141
135
 
142
- export async function BrowserSystem_webSocket$(self_, url_, $task) {
143
- return (await ff_core_WebSocket.internalOpenBrowserWebSocket_$(self_, url_, $task))
144
- }
145
-
146
136
  export async function BrowserSystem_mainTask$(self_, $task) {
147
137
  return self_.task_
148
138
  }
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Buffer
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type BuildSystem
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type Channel
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // newtype Char
98
96
 
99
97
 
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // type GrabException
98
96
  const GrabException$ = {GrabException: true};
99
97
  export function GrabException() {
@@ -92,8 +92,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
92
 
93
93
  import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
94
 
95
- import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
96
-
97
95
  // newtype Duration
98
96
 
99
97