firefly-compiler 0.4.18 → 0.4.19

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 (115) hide show
  1. package/compiler/Builder.ff +1 -1
  2. package/compiler/Compiler.ff +6 -5
  3. package/compiler/Inference.ff +31 -19
  4. package/compiler/JsEmitter.ff +98 -71
  5. package/compiler/JsImporter.ff +1 -1
  6. package/compiler/LspHook.ff +4 -4
  7. package/compiler/Main.ff +6 -6
  8. package/compiler/Parser.ff +39 -39
  9. package/compiler/Patterns.ff +2 -0
  10. package/compiler/Syntax.ff +1 -1
  11. package/compiler/Tokenizer.ff +2 -2
  12. package/compiler/Workspace.ff +2 -2
  13. package/core/Array.ff +135 -294
  14. package/core/Buffer.ff +3 -3
  15. package/core/BuildSystem.ff +1 -1
  16. package/core/Equal.ff +36 -52
  17. package/core/HttpClient.ff +1 -1
  18. package/core/IntMap.ff +14 -18
  19. package/core/JsSystem.ff +1 -1
  20. package/core/JsValue.ff +6 -12
  21. package/core/Json.ff +19 -28
  22. package/core/List.ff +281 -312
  23. package/core/Map.ff +4 -8
  24. package/core/NodeSystem.ff +2 -2
  25. package/core/Option.ff +0 -4
  26. package/core/Ordering.ff +10 -6
  27. package/core/Pair.ff +0 -4
  28. package/core/Random.ff +12 -26
  29. package/core/RbMap.ff +216 -216
  30. package/core/Serializable.ff +9 -18
  31. package/core/Set.ff +0 -1
  32. package/core/SourceLocation.ff +1 -1
  33. package/core/Stack.ff +32 -45
  34. package/core/Stream.ff +10 -14
  35. package/core/String.ff +24 -6
  36. package/core/StringMap.ff +15 -19
  37. package/guide/Main.ff +20 -2
  38. package/lsp/CompletionHandler.ff +4 -4
  39. package/lsp/Handler.ff +44 -33
  40. package/lsp/HoverHandler.ff +2 -2
  41. package/lsp/LanguageServer.ff +2 -2
  42. package/lsp/SignatureHelpHandler.ff +1 -1
  43. package/lsp/SymbolHandler.ff +1 -1
  44. package/lux/Lux.ff +3 -3
  45. package/output/js/ff/compiler/Builder.mjs +19 -21
  46. package/output/js/ff/compiler/Compiler.mjs +18 -20
  47. package/output/js/ff/compiler/Dependencies.mjs +8 -10
  48. package/output/js/ff/compiler/Deriver.mjs +234 -236
  49. package/output/js/ff/compiler/Dictionaries.mjs +6 -8
  50. package/output/js/ff/compiler/Environment.mjs +42 -44
  51. package/output/js/ff/compiler/Inference.mjs +346 -304
  52. package/output/js/ff/compiler/JsEmitter.mjs +907 -833
  53. package/output/js/ff/compiler/JsImporter.mjs +0 -2
  54. package/output/js/ff/compiler/LspHook.mjs +10 -12
  55. package/output/js/ff/compiler/Main.mjs +109 -111
  56. package/output/js/ff/compiler/Parser.mjs +405 -407
  57. package/output/js/ff/compiler/Patterns.mjs +64 -50
  58. package/output/js/ff/compiler/Resolver.mjs +36 -38
  59. package/output/js/ff/compiler/Substitution.mjs +4 -6
  60. package/output/js/ff/compiler/Syntax.mjs +160 -162
  61. package/output/js/ff/compiler/Token.mjs +52 -54
  62. package/output/js/ff/compiler/Tokenizer.mjs +16 -18
  63. package/output/js/ff/compiler/Unification.mjs +24 -26
  64. package/output/js/ff/compiler/Wildcards.mjs +0 -2
  65. package/output/js/ff/compiler/Workspace.mjs +18 -20
  66. package/output/js/ff/core/Any.mjs +0 -2
  67. package/output/js/ff/core/Array.mjs +216 -613
  68. package/output/js/ff/core/AssetSystem.mjs +2 -4
  69. package/output/js/ff/core/Atomic.mjs +0 -2
  70. package/output/js/ff/core/Bool.mjs +0 -2
  71. package/output/js/ff/core/Box.mjs +0 -2
  72. package/output/js/ff/core/BrowserSystem.mjs +0 -2
  73. package/output/js/ff/core/Buffer.mjs +0 -2
  74. package/output/js/ff/core/BuildSystem.mjs +12 -14
  75. package/output/js/ff/core/Channel.mjs +0 -2
  76. package/output/js/ff/core/Char.mjs +0 -2
  77. package/output/js/ff/core/Core.mjs +0 -2
  78. package/output/js/ff/core/Duration.mjs +0 -2
  79. package/output/js/ff/core/Equal.mjs +0 -22
  80. package/output/js/ff/core/Error.mjs +0 -2
  81. package/output/js/ff/core/FileHandle.mjs +0 -2
  82. package/output/js/ff/core/Float.mjs +0 -2
  83. package/output/js/ff/core/HttpClient.mjs +2 -4
  84. package/output/js/ff/core/Instant.mjs +0 -2
  85. package/output/js/ff/core/Int.mjs +8 -10
  86. package/output/js/ff/core/IntMap.mjs +32 -42
  87. package/output/js/ff/core/JsSystem.mjs +1 -3
  88. package/output/js/ff/core/JsValue.mjs +5 -12
  89. package/output/js/ff/core/Json.mjs +23 -56
  90. package/output/js/ff/core/List.mjs +648 -1989
  91. package/output/js/ff/core/Lock.mjs +0 -2
  92. package/output/js/ff/core/Log.mjs +0 -2
  93. package/output/js/ff/core/Map.mjs +10 -20
  94. package/output/js/ff/core/NodeSystem.mjs +6 -8
  95. package/output/js/ff/core/Nothing.mjs +0 -2
  96. package/output/js/ff/core/Option.mjs +8 -18
  97. package/output/js/ff/core/Ordering.mjs +20 -98
  98. package/output/js/ff/core/Pair.mjs +6 -16
  99. package/output/js/ff/core/Path.mjs +12 -14
  100. package/output/js/ff/core/Random.mjs +24 -54
  101. package/output/js/ff/core/RbMap.mjs +54 -56
  102. package/output/js/ff/core/Serializable.mjs +19 -36
  103. package/output/js/ff/core/Set.mjs +0 -14
  104. package/output/js/ff/core/Show.mjs +0 -2
  105. package/output/js/ff/core/SourceLocation.mjs +0 -2
  106. package/output/js/ff/core/Stream.mjs +34 -44
  107. package/output/js/ff/core/String.mjs +31 -5
  108. package/output/js/ff/core/StringMap.mjs +32 -42
  109. package/output/js/ff/core/Task.mjs +0 -2
  110. package/output/js/ff/core/Try.mjs +0 -2
  111. package/output/js/ff/core/Unit.mjs +0 -2
  112. package/package.json +1 -1
  113. package/vscode/package.json +1 -1
  114. package/webserver/WebServer.ff +8 -8
  115. package/output/js/ff/core/Stack.mjs +0 -603
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
78
 
79
79
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
80
 
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
81
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
82
 
85
83
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -215,51 +213,37 @@ export function Random_nextGauss(self_, mean_, standardDeviation_) {
215
213
 
216
214
  }
217
215
 
218
- export function Random_shuffleStack(self_, stack_) {
219
- ff_core_List.List_each(ff_core_Int.Int_until(0, (ff_core_Stack.Stack_size(stack_) - 1)), ((i_) => {
220
- const j_ = (ff_core_Random.Random_nextInt(self_, 0, (ff_core_Stack.Stack_size(stack_) - i_)) + i_);
221
- const value_ = ff_core_Stack.Stack_grab(stack_, i_);
222
- ff_core_Stack.Stack_set(stack_, i_, ff_core_Stack.Stack_grab(stack_, j_));
223
- ff_core_Stack.Stack_set(stack_, j_, value_)
224
- }))
225
- }
226
-
227
216
  export function Random_shuffleArray(self_, array_) {
228
- const stack_ = ff_core_Array.Array_toStack(array_);
229
- ff_core_Random.Random_shuffleStack(self_, ff_core_Array.Array_toStack(array_));
230
- return ff_core_Stack.Stack_drain(stack_)
217
+ ff_core_List.List_each(ff_core_Int.Int_until(0, (ff_core_Array.Array_size(array_) - 1)), ((i_) => {
218
+ const j_ = (ff_core_Random.Random_nextInt(self_, 0, (ff_core_Array.Array_size(array_) - i_)) + i_);
219
+ const value_ = ff_core_Array.Array_grab(array_, i_);
220
+ ff_core_Array.Array_set(array_, i_, ff_core_Array.Array_grab(array_, j_));
221
+ ff_core_Array.Array_set(array_, j_, value_)
222
+ }))
231
223
  }
232
224
 
233
225
  export function Random_shuffleList(self_, list_) {
234
- const stack_ = ff_core_List.List_toStack(list_);
235
- ff_core_Random.Random_shuffleStack(self_, ff_core_List.List_toStack(list_));
236
- return ff_core_Stack.Stack_toList(stack_, 0, 9007199254740991)
226
+ const array_ = ff_core_List.List_toArray(list_);
227
+ ff_core_Random.Random_shuffleArray(self_, ff_core_List.List_toArray(list_));
228
+ return ff_core_Array.Array_drain(array_)
237
229
  }
238
230
 
239
- export function Random_sampleStack(self_, count_, stack_, body_) {
240
- ff_core_Array.Array_each(ff_core_Array.Array_takeFirst(ff_core_Random.Random_shuffleArray(self_, ff_core_Stack.Stack_toArray(stack_, 0, 9007199254740991)), count_), ((_w1) => {
231
+ export function Random_sampleArray(self_, count_, array_, body_) {
232
+ ff_core_List.List_each(ff_core_List.List_takeFirst(ff_core_Random.Random_shuffleList(self_, ff_core_Array.Array_toList(array_, 0, 9007199254740991)), count_), ((_w1) => {
241
233
  body_(_w1)
242
234
  }))
243
235
  }
244
236
 
245
- export function Random_sampleArray(self_, count_, array_) {
246
- return ff_core_Array.Array_takeFirst(ff_core_Random.Random_shuffleArray(self_, array_), count_)
247
- }
248
-
249
237
  export function Random_sampleList(self_, count_, list_) {
250
238
  return ff_core_List.List_takeFirst(ff_core_Random.Random_shuffleList(self_, list_), count_)
251
239
  }
252
240
 
253
- export function Random_grabStack(self_, stack_) {
254
- return ff_core_Stack.Stack_grab(stack_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Stack.Stack_size(stack_)))
255
- }
256
-
257
241
  export function Random_grabArray(self_, array_) {
258
242
  return ff_core_Array.Array_grab(array_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Array.Array_size(array_)))
259
243
  }
260
244
 
261
245
  export function Random_grabList(self_, list_) {
262
- return ff_core_Stack.Stack_grab(list_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Stack.Stack_size(list_)))
246
+ return ff_core_List.List_grab(list_, ff_core_Random.Random_nextInt(self_, 0, ff_core_List.List_size(list_)))
263
247
  }
264
248
 
265
249
  export async function Random_copy$(self_, $task) {
@@ -288,51 +272,37 @@ export async function Random_nextGauss$(self_, mean_, standardDeviation_, $task)
288
272
  throw new Error('Function Random_nextGauss is missing on this target in async context.');
289
273
  }
290
274
 
291
- export async function Random_shuffleStack$(self_, stack_, $task) {
292
- ff_core_List.List_each(ff_core_Int.Int_until(0, (ff_core_Stack.Stack_size(stack_) - 1)), ((i_) => {
293
- const j_ = (ff_core_Random.Random_nextInt(self_, 0, (ff_core_Stack.Stack_size(stack_) - i_)) + i_);
294
- const value_ = ff_core_Stack.Stack_grab(stack_, i_);
295
- ff_core_Stack.Stack_set(stack_, i_, ff_core_Stack.Stack_grab(stack_, j_));
296
- ff_core_Stack.Stack_set(stack_, j_, value_)
297
- }))
298
- }
299
-
300
275
  export async function Random_shuffleArray$(self_, array_, $task) {
301
- const stack_ = ff_core_Array.Array_toStack(array_);
302
- ff_core_Random.Random_shuffleStack(self_, ff_core_Array.Array_toStack(array_));
303
- return ff_core_Stack.Stack_drain(stack_)
276
+ ff_core_List.List_each(ff_core_Int.Int_until(0, (ff_core_Array.Array_size(array_) - 1)), ((i_) => {
277
+ const j_ = (ff_core_Random.Random_nextInt(self_, 0, (ff_core_Array.Array_size(array_) - i_)) + i_);
278
+ const value_ = ff_core_Array.Array_grab(array_, i_);
279
+ ff_core_Array.Array_set(array_, i_, ff_core_Array.Array_grab(array_, j_));
280
+ ff_core_Array.Array_set(array_, j_, value_)
281
+ }))
304
282
  }
305
283
 
306
284
  export async function Random_shuffleList$(self_, list_, $task) {
307
- const stack_ = ff_core_List.List_toStack(list_);
308
- ff_core_Random.Random_shuffleStack(self_, ff_core_List.List_toStack(list_));
309
- return ff_core_Stack.Stack_toList(stack_, 0, 9007199254740991)
285
+ const array_ = ff_core_List.List_toArray(list_);
286
+ ff_core_Random.Random_shuffleArray(self_, ff_core_List.List_toArray(list_));
287
+ return ff_core_Array.Array_drain(array_)
310
288
  }
311
289
 
312
- export async function Random_sampleStack$(self_, count_, stack_, body_, $task) {
313
- (await ff_core_Array.Array_each$(ff_core_Array.Array_takeFirst(ff_core_Random.Random_shuffleArray(self_, ff_core_Stack.Stack_toArray(stack_, 0, 9007199254740991)), count_), (async (_w1, $task) => {
290
+ export async function Random_sampleArray$(self_, count_, array_, body_, $task) {
291
+ (await ff_core_List.List_each$(ff_core_List.List_takeFirst(ff_core_Random.Random_shuffleList(self_, ff_core_Array.Array_toList(array_, 0, 9007199254740991)), count_), (async (_w1, $task) => {
314
292
  (await body_(_w1, $task))
315
293
  }), $task))
316
294
  }
317
295
 
318
- export async function Random_sampleArray$(self_, count_, array_, $task) {
319
- return ff_core_Array.Array_takeFirst(ff_core_Random.Random_shuffleArray(self_, array_), count_)
320
- }
321
-
322
296
  export async function Random_sampleList$(self_, count_, list_, $task) {
323
297
  return ff_core_List.List_takeFirst(ff_core_Random.Random_shuffleList(self_, list_), count_)
324
298
  }
325
299
 
326
- export async function Random_grabStack$(self_, stack_, $task) {
327
- return ff_core_Stack.Stack_grab(stack_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Stack.Stack_size(stack_)))
328
- }
329
-
330
300
  export async function Random_grabArray$(self_, array_, $task) {
331
301
  return ff_core_Array.Array_grab(array_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Array.Array_size(array_)))
332
302
  }
333
303
 
334
304
  export async function Random_grabList$(self_, list_, $task) {
335
- return ff_core_Stack.Stack_grab(list_, ff_core_Random.Random_nextInt(self_, 0, ff_core_Stack.Stack_size(list_)))
305
+ return ff_core_List.List_grab(list_, ff_core_Random.Random_nextInt(self_, 0, ff_core_List.List_size(list_)))
336
306
  }
337
307
 
338
308
 
@@ -80,8 +80,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
80
80
 
81
81
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
82
82
 
83
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
84
-
85
83
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
86
84
 
87
85
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -1498,21 +1496,21 @@ return
1498
1496
  }
1499
1497
 
1500
1498
  export function RB_pairs(self_, ff_core_Ordering_Order$K) {
1501
- let result_ = ff_core_List.Empty();
1499
+ const result_ = ff_core_List.List_toArray([]);
1502
1500
  ff_core_RbMap.RB_each(self_, ((k_, v_) => {
1503
- result_ = ff_core_List.Link(ff_core_Pair.Pair(k_, v_), result_)
1501
+ ff_core_Array.Array_push(result_, ff_core_Pair.Pair(k_, v_))
1504
1502
  }), ff_core_Ordering_Order$K);
1505
- return ff_core_List.List_reverse(result_)
1503
+ return ff_core_Array.Array_drain(result_)
1506
1504
  }
1507
1505
 
1508
1506
  export function RB_toStream(self_, cycle_, ff_core_Ordering_Order$K) {
1509
- let stack_ = ff_core_List.Link(self_, ff_core_List.Empty());
1507
+ let array_ = [self_];
1510
1508
  function next_() {
1511
1509
  _tailcall: for(;;) {
1512
1510
  {
1513
- const _1 = stack_;
1511
+ const _1 = array_;
1514
1512
  {
1515
- if(_1.Empty) {
1513
+ if(_1.length === 0) {
1516
1514
  if((cycle_ && (((_1) => {
1517
1515
  {
1518
1516
  if(_1.E) {
@@ -1525,7 +1523,7 @@ return true
1525
1523
  return
1526
1524
  }
1527
1525
  }))(self_))) {
1528
- stack_ = ff_core_List.Link(self_, ff_core_List.Empty());
1526
+ array_ = [self_];
1529
1527
  {
1530
1528
 
1531
1529
 
@@ -1538,10 +1536,10 @@ return
1538
1536
  }
1539
1537
  }
1540
1538
  {
1541
- if(_1.Link) {
1542
- if(_1.head_.E) {
1543
- const tail_ = _1.tail_;
1544
- stack_ = tail_;
1539
+ if(_1.length > 0) {
1540
+ if(_1[0].E) {
1541
+ const tail_ = _1.slice(1);
1542
+ array_ = tail_;
1545
1543
  {
1546
1544
 
1547
1545
 
@@ -1552,14 +1550,14 @@ return
1552
1550
  }
1553
1551
  }
1554
1552
  {
1555
- if(_1.Link) {
1556
- if(_1.head_.T) {
1557
- if(_1.head_.left_.E) {
1558
- const k_ = _1.head_.key_;
1559
- const v_ = _1.head_.value_;
1560
- if(_1.head_.right_.E) {
1561
- const tail_ = _1.tail_;
1562
- stack_ = tail_;
1553
+ if(_1.length > 0) {
1554
+ if(_1[0].T) {
1555
+ if(_1[0].left_.E) {
1556
+ const k_ = _1[0].key_;
1557
+ const v_ = _1[0].value_;
1558
+ if(_1[0].right_.E) {
1559
+ const tail_ = _1.slice(1);
1560
+ array_ = tail_;
1563
1561
  return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1564
1562
  return
1565
1563
  }
@@ -1568,14 +1566,14 @@ return
1568
1566
  }
1569
1567
  }
1570
1568
  {
1571
- if(_1.Link) {
1572
- if(_1.head_.T) {
1573
- const l_ = _1.head_.left_;
1574
- const k_ = _1.head_.key_;
1575
- const v_ = _1.head_.value_;
1576
- const r_ = _1.head_.right_;
1577
- const tail_ = _1.tail_;
1578
- stack_ = ff_core_List.Link(l_, ff_core_List.Link(ff_core_RbMap.T(ff_core_RbMap.B(), ff_core_RbMap.E(), k_, v_, ff_core_RbMap.E()), ff_core_List.Link(r_, tail_)));
1569
+ if(_1.length > 0) {
1570
+ if(_1[0].T) {
1571
+ const l_ = _1[0].left_;
1572
+ const k_ = _1[0].key_;
1573
+ const v_ = _1[0].value_;
1574
+ const r_ = _1[0].right_;
1575
+ const tail_ = _1.slice(1);
1576
+ array_ = [l_, ff_core_RbMap.T(ff_core_RbMap.B(), ff_core_RbMap.E(), k_, v_, ff_core_RbMap.E()), r_, ...tail_];
1579
1577
  {
1580
1578
 
1581
1579
 
@@ -1750,21 +1748,21 @@ return
1750
1748
  }
1751
1749
 
1752
1750
  export async function RB_pairs$(self_, ff_core_Ordering_Order$K, $task) {
1753
- let result_ = ff_core_List.Empty();
1751
+ const result_ = ff_core_List.List_toArray([]);
1754
1752
  ff_core_RbMap.RB_each(self_, ((k_, v_) => {
1755
- result_ = ff_core_List.Link(ff_core_Pair.Pair(k_, v_), result_)
1753
+ ff_core_Array.Array_push(result_, ff_core_Pair.Pair(k_, v_))
1756
1754
  }), ff_core_Ordering_Order$K);
1757
- return ff_core_List.List_reverse(result_)
1755
+ return ff_core_Array.Array_drain(result_)
1758
1756
  }
1759
1757
 
1760
1758
  export async function RB_toStream$(self_, cycle_, ff_core_Ordering_Order$K, $task) {
1761
- let stack_ = ff_core_List.Link(self_, ff_core_List.Empty());
1759
+ let array_ = [self_];
1762
1760
  function next_() {
1763
1761
  _tailcall: for(;;) {
1764
1762
  {
1765
- const _1 = stack_;
1763
+ const _1 = array_;
1766
1764
  {
1767
- if(_1.Empty) {
1765
+ if(_1.length === 0) {
1768
1766
  if((cycle_ && (((_1) => {
1769
1767
  {
1770
1768
  if(_1.E) {
@@ -1777,7 +1775,7 @@ return true
1777
1775
  return
1778
1776
  }
1779
1777
  }))(self_))) {
1780
- stack_ = ff_core_List.Link(self_, ff_core_List.Empty());
1778
+ array_ = [self_];
1781
1779
  {
1782
1780
 
1783
1781
 
@@ -1790,10 +1788,10 @@ return
1790
1788
  }
1791
1789
  }
1792
1790
  {
1793
- if(_1.Link) {
1794
- if(_1.head_.E) {
1795
- const tail_ = _1.tail_;
1796
- stack_ = tail_;
1791
+ if(_1.length > 0) {
1792
+ if(_1[0].E) {
1793
+ const tail_ = _1.slice(1);
1794
+ array_ = tail_;
1797
1795
  {
1798
1796
 
1799
1797
 
@@ -1804,14 +1802,14 @@ return
1804
1802
  }
1805
1803
  }
1806
1804
  {
1807
- if(_1.Link) {
1808
- if(_1.head_.T) {
1809
- if(_1.head_.left_.E) {
1810
- const k_ = _1.head_.key_;
1811
- const v_ = _1.head_.value_;
1812
- if(_1.head_.right_.E) {
1813
- const tail_ = _1.tail_;
1814
- stack_ = tail_;
1805
+ if(_1.length > 0) {
1806
+ if(_1[0].T) {
1807
+ if(_1[0].left_.E) {
1808
+ const k_ = _1[0].key_;
1809
+ const v_ = _1[0].value_;
1810
+ if(_1[0].right_.E) {
1811
+ const tail_ = _1.slice(1);
1812
+ array_ = tail_;
1815
1813
  return ff_core_Option.Some(ff_core_Pair.Pair(k_, v_))
1816
1814
  return
1817
1815
  }
@@ -1820,14 +1818,14 @@ return
1820
1818
  }
1821
1819
  }
1822
1820
  {
1823
- if(_1.Link) {
1824
- if(_1.head_.T) {
1825
- const l_ = _1.head_.left_;
1826
- const k_ = _1.head_.key_;
1827
- const v_ = _1.head_.value_;
1828
- const r_ = _1.head_.right_;
1829
- const tail_ = _1.tail_;
1830
- stack_ = ff_core_List.Link(l_, ff_core_List.Link(ff_core_RbMap.T(ff_core_RbMap.B(), ff_core_RbMap.E(), k_, v_, ff_core_RbMap.E()), ff_core_List.Link(r_, tail_)));
1821
+ if(_1.length > 0) {
1822
+ if(_1[0].T) {
1823
+ const l_ = _1[0].left_;
1824
+ const k_ = _1[0].key_;
1825
+ const v_ = _1[0].value_;
1826
+ const r_ = _1[0].right_;
1827
+ const tail_ = _1.slice(1);
1828
+ array_ = [l_, ff_core_RbMap.T(ff_core_RbMap.B(), ff_core_RbMap.E(), k_, v_, ff_core_RbMap.E()), r_, ...tail_];
1831
1829
  {
1832
1830
 
1833
1831
 
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
78
 
79
79
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
80
 
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
81
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
82
 
85
83
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -237,21 +235,21 @@ return (result_ === 1)
237
235
  }
238
236
  };
239
237
 
240
- export function ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T) { return {
238
+ export function ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T) { return {
241
239
  serializeUsing_(serialization_, value_) {
242
- if((ff_core_Array.Array_size(value_) < 255)) {
240
+ if((ff_core_List.List_size(value_) < 255)) {
243
241
  ff_core_Serializable.Serialization_autoResize(serialization_, 1);
244
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
242
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_List.List_size(value_));
245
243
  serialization_.offset_ += 1
246
- } else if((ff_core_Array.Array_size(value_) < 1073741824)) {
244
+ } else if((ff_core_List.List_size(value_) < 1073741824)) {
247
245
  ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
248
246
  ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
249
- ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
247
+ ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_List.List_size(value_), true);
250
248
  serialization_.offset_ += (1 + 4)
251
249
  } else {
252
250
  ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
253
251
  };
254
- ff_core_Array.Array_each(value_, ((_w1) => {
252
+ ff_core_List.List_each(value_, ((_w1) => {
255
253
  ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
256
254
  }))
257
255
  },
@@ -281,19 +279,19 @@ return result;
281
279
  }
282
280
  },
283
281
  async serializeUsing_$(serialization_, value_, $task) {
284
- if((ff_core_Array.Array_size(value_) < 255)) {
282
+ if((ff_core_List.List_size(value_) < 255)) {
285
283
  ff_core_Serializable.Serialization_autoResize(serialization_, 1);
286
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
284
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_List.List_size(value_));
287
285
  serialization_.offset_ += 1
288
- } else if((ff_core_Array.Array_size(value_) < 1073741824)) {
286
+ } else if((ff_core_List.List_size(value_) < 1073741824)) {
289
287
  ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
290
288
  ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
291
- ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
289
+ ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_List.List_size(value_), true);
292
290
  serialization_.offset_ += (1 + 4)
293
291
  } else {
294
292
  ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
295
293
  };
296
- ff_core_Array.Array_each(value_, ((_w1) => {
294
+ ff_core_List.List_each(value_, ((_w1) => {
297
295
  ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
298
296
  }))
299
297
  },
@@ -324,48 +322,33 @@ return result;
324
322
  }
325
323
  }}
326
324
 
327
- export function ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T) { return {
328
- serializeUsing_(serialization_, value_) {
329
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
330
- },
331
- deserializeUsing_(serialization_) {
332
- return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
333
- },
334
- async serializeUsing_$(serialization_, value_, $task) {
335
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
336
- },
337
- async deserializeUsing_$(serialization_, $task) {
338
- return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
339
- }
340
- }}
341
-
342
325
  export function ff_core_Serializable_Serializable$ff_core_Set_Set(ff_core_Serializable_Serializable$T, ff_core_Ordering_Order$T) { return {
343
326
  serializeUsing_(serialization_, value_) {
344
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
327
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toList(value_, ff_core_Ordering_Order$T))
345
328
  },
346
329
  deserializeUsing_(serialization_) {
347
- return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
330
+ return ff_core_List.List_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
348
331
  },
349
332
  async serializeUsing_$(serialization_, value_, $task) {
350
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
333
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toList(value_, ff_core_Ordering_Order$T))
351
334
  },
352
335
  async deserializeUsing_$(serialization_, $task) {
353
- return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
336
+ return ff_core_List.List_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
354
337
  }
355
338
  }}
356
339
 
357
340
  export function ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable_Serializable$K, ff_core_Ordering_Order$K, ff_core_Serializable_Serializable$V) { return {
358
341
  serializeUsing_(serialization_, value_) {
359
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
342
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toList(value_, ff_core_Ordering_Order$K))
360
343
  },
361
344
  deserializeUsing_(serialization_) {
362
- return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
345
+ return ff_core_List.List_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
363
346
  },
364
347
  async serializeUsing_$(serialization_, value_, $task) {
365
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
348
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toList(value_, ff_core_Ordering_Order$K))
366
349
  },
367
350
  async deserializeUsing_$(serialization_, $task) {
368
- return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
351
+ return ff_core_List.List_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
369
352
  }
370
353
  }}
371
354
 
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
78
 
79
79
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
80
 
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
81
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
82
 
85
83
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -134,12 +132,6 @@ return _w1.first_
134
132
  }))
135
133
  }
136
134
 
137
- export function Set_toArray(self_, ff_core_Ordering_Order$T) {
138
- return ff_core_Array.Array_map(ff_core_Map.Map_toArray(self_, ff_core_Ordering_Order$T), ((_w1) => {
139
- return _w1.first_
140
- }))
141
- }
142
-
143
135
  export function Set_toStream(self_, cycle_ = false, ff_core_Ordering_Order$T) {
144
136
  return ff_core_Stream.Stream_map(ff_core_Map.Map_toStream(self_, cycle_, ff_core_Ordering_Order$T), ((_w1) => {
145
137
  return _w1.first_
@@ -196,12 +188,6 @@ return _w1.first_
196
188
  }))
197
189
  }
198
190
 
199
- export async function Set_toArray$(self_, ff_core_Ordering_Order$T, $task) {
200
- return ff_core_Array.Array_map(ff_core_Map.Map_toArray(self_, ff_core_Ordering_Order$T), ((_w1) => {
201
- return _w1.first_
202
- }))
203
- }
204
-
205
191
  export async function Set_toStream$(self_, cycle_ = false, ff_core_Ordering_Order$T, $task) {
206
192
  return (await ff_core_Stream.Stream_map$((await ff_core_Map.Map_toStream$(self_, cycle_, ff_core_Ordering_Order$T, $task)), (async (_w1, $task) => {
207
193
  return _w1.first_
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
78
 
79
79
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
80
 
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
81
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
82
 
85
83
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -78,8 +78,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
78
 
79
79
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
80
 
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
81
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
82
 
85
83
  import * as ff_core_String from "../../ff/core/String.mjs"