firefly-compiler 0.4.17 → 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 +45 -34
  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
@@ -82,8 +82,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
82
82
 
83
83
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
84
84
 
85
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
86
-
87
85
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
88
86
 
89
87
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -112,10 +110,10 @@ export function check_(variants_, fields_, cases_, success_, guard_) {
112
110
  {
113
111
  const _1 = ff_core_Pair.Pair(fields_, cases_);
114
112
  {
115
- if(_1.first_.Link) {
116
- const f_ = _1.first_.head_.first_;
117
- const p_ = _1.first_.head_.second_;
118
- const fs_ = _1.first_.tail_;
113
+ if(_1.first_.length > 0) {
114
+ const f_ = _1.first_[0].first_;
115
+ const p_ = _1.first_[0].second_;
116
+ const fs_ = _1.first_.slice(1);
119
117
  const cs_ = _1.second_;
120
118
  const vs_ = ff_core_Option.Option_else(ff_core_Map.Map_get(variants_, f_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
121
119
  return ff_core_Set.Set_add(p_.otherVariants_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
@@ -127,13 +125,13 @@ return ((((f_ + ".") + p_.variant_) + "_") + _w1)
127
125
  }))
128
126
  }));
129
127
  if((ff_core_Set.Set_size(vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) === 1)) {
130
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_addAll(newFields_, fs_), cs_, true, guard_)
128
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [...newFields_, ...fs_], cs_, true, guard_)
131
129
  } else {
132
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_List.List_toSet(ff_core_List.Link(p_.variant_, ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_addAll(newFields_, fs_), cs_, true, guard_);
133
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_Set.Set_remove(vs_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), cs_, false, guard_)
130
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_List.List_toSet([p_.variant_], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [...newFields_, ...fs_], cs_, true, guard_);
131
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_Set.Set_remove(vs_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], cs_, false, guard_)
134
132
  }
135
133
  } else {
136
- ff_compiler_Patterns.check_(variants_, ff_core_List.Empty(), cs_, false, guard_)
134
+ ff_compiler_Patterns.check_(variants_, [], cs_, false, guard_)
137
135
  }
138
136
  return
139
137
  }
@@ -146,19 +144,19 @@ return
146
144
  }
147
145
  }
148
146
  {
149
- if(_1.first_.Empty) {
150
- if(_1.second_.Link) {
151
- const fs_ = _1.second_.head_.fields_;
152
- const g_ = _1.second_.head_.guard_;
153
- const cs_ = _1.second_.tail_;
147
+ if(_1.first_.length === 0) {
148
+ if(_1.second_.length > 0) {
149
+ const fs_ = _1.second_[0].fields_;
150
+ const g_ = _1.second_[0].guard_;
151
+ const cs_ = _1.second_.slice(1);
154
152
  ff_compiler_Patterns.check_(variants_, fs_, cs_, true, g_)
155
153
  return
156
154
  }
157
155
  }
158
156
  }
159
157
  {
160
- if(_1.first_.Empty) {
161
- if(_1.second_.Empty) {
158
+ if(_1.first_.length === 0) {
159
+ if(_1.second_.length === 0) {
162
160
  const remaining_ = ff_core_List.List_map(ff_core_List.List_filter(ff_core_Map.Map_pairs(variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
163
161
  return (ff_core_Set.Set_size(_w1.second_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) !== 0)
164
162
  })), ((_1) => {
@@ -186,6 +184,12 @@ return (_w1 !== 46)
186
184
  })))
187
185
  }
188
186
  function otherVariants_(name_) {
187
+ if((name_ === "List$Empty")) {
188
+ return ff_core_List.List_toSet(["List$Link"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
189
+ } else {
190
+ if((name_ === "List$Link")) {
191
+ return ff_core_List.List_toSet(["List$Empty"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
192
+ } else {
189
193
  const variantName_ = unqualifiedName_(name_);
190
194
  const moduleName_ = ff_core_String.String_dropLast(name_, (ff_core_String.String_size(variantName_) + 1));
191
195
  const variantModule_ = ff_core_Map.Map_grab(modules_, moduleName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
@@ -201,24 +205,26 @@ return (_w1 !== variantName_)
201
205
  }))
202
206
  })))
203
207
  }
208
+ }
209
+ }
204
210
  function convertPattern_(pattern_) {
205
211
  {
206
212
  const pattern_a = pattern_;
207
213
  {
208
214
  if(pattern_a.PString) {
209
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("String literal", ff_core_List.List_toSet(ff_core_List.Link("Any other String literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
215
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("String literal", ff_core_List.List_toSet(["Any other String literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
210
216
  return
211
217
  }
212
218
  }
213
219
  {
214
220
  if(pattern_a.PInt) {
215
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Int literal", ff_core_List.List_toSet(ff_core_List.Link("Any other Int literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
221
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Int literal", ff_core_List.List_toSet(["Any other Int literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
216
222
  return
217
223
  }
218
224
  }
219
225
  {
220
226
  if(pattern_a.PChar) {
221
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Char literal", ff_core_List.List_toSet(ff_core_List.Link("Any other Char literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
227
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Char literal", ff_core_List.List_toSet(["Any other Char literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
222
228
  return
223
229
  }
224
230
  }
@@ -255,7 +261,7 @@ return
255
261
  {
256
262
  if(pattern_a.PVariantAs) {
257
263
  const p_ = pattern_a;
258
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo(unqualifiedName_(p_.name_), otherVariants_(p_.name_), ff_core_List.Empty()))
264
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo(unqualifiedName_(p_.name_), otherVariants_(p_.name_), []))
259
265
  return
260
266
  }
261
267
  }
@@ -289,9 +295,9 @@ return
289
295
  }
290
296
  }));
291
297
  const exhaustiveGuards_ = ff_core_List.List_all(case_.guards_, ((g_) => {
292
- const guardConverted_ = ff_compiler_Patterns.convert_(modules_, ff_core_List.Link(ff_compiler_Syntax.MatchCase(g_.at_, ff_core_List.Link(g_.pattern_, ff_core_List.Empty()), ff_core_List.Empty(), case_.body_), ff_core_List.Empty()));
298
+ const guardConverted_ = ff_compiler_Patterns.convert_(modules_, [ff_compiler_Syntax.MatchCase(g_.at_, [g_.pattern_], [], case_.body_)]);
293
299
  return ff_core_Try.Try_else(ff_core_Core.try_((() => {
294
- ff_compiler_Patterns.check_(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), guardConverted_, false, false);
300
+ ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], guardConverted_, false, false);
295
301
  return true
296
302
  })), (() => {
297
303
  return false
@@ -306,7 +312,7 @@ return
306
312
  export function convertAndCheck_(modules_, cases_) {
307
313
  const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
308
314
  ff_core_Try.Try_else(ff_core_Core.try_((() => {
309
- return ff_compiler_Patterns.check_(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), converted_, false, false)
315
+ return ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
310
316
  })), (() => {
311
317
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
312
318
  }))
@@ -320,10 +326,10 @@ export async function check_$(variants_, fields_, cases_, success_, guard_, $tas
320
326
  {
321
327
  const _1 = ff_core_Pair.Pair(fields_, cases_);
322
328
  {
323
- if(_1.first_.Link) {
324
- const f_ = _1.first_.head_.first_;
325
- const p_ = _1.first_.head_.second_;
326
- const fs_ = _1.first_.tail_;
329
+ if(_1.first_.length > 0) {
330
+ const f_ = _1.first_[0].first_;
331
+ const p_ = _1.first_[0].second_;
332
+ const fs_ = _1.first_.slice(1);
327
333
  const cs_ = _1.second_;
328
334
  const vs_ = ff_core_Option.Option_else(ff_core_Map.Map_get(variants_, f_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), (() => {
329
335
  return ff_core_Set.Set_add(p_.otherVariants_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
@@ -335,13 +341,13 @@ return ((((f_ + ".") + p_.variant_) + "_") + _w1)
335
341
  }))
336
342
  }));
337
343
  if((ff_core_Set.Set_size(vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) === 1)) {
338
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_addAll(newFields_, fs_), cs_, true, guard_)
344
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, vs_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [...newFields_, ...fs_], cs_, true, guard_)
339
345
  } else {
340
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_List.List_toSet(ff_core_List.Link(p_.variant_, ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_addAll(newFields_, fs_), cs_, true, guard_);
341
- ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_Set.Set_remove(vs_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), cs_, false, guard_)
346
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_List.List_toSet([p_.variant_], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [...newFields_, ...fs_], cs_, true, guard_);
347
+ ff_compiler_Patterns.check_(ff_core_Map.Map_add(variants_, f_, ff_core_Set.Set_remove(vs_, p_.variant_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], cs_, false, guard_)
342
348
  }
343
349
  } else {
344
- ff_compiler_Patterns.check_(variants_, ff_core_List.Empty(), cs_, false, guard_)
350
+ ff_compiler_Patterns.check_(variants_, [], cs_, false, guard_)
345
351
  }
346
352
  return
347
353
  }
@@ -354,19 +360,19 @@ return
354
360
  }
355
361
  }
356
362
  {
357
- if(_1.first_.Empty) {
358
- if(_1.second_.Link) {
359
- const fs_ = _1.second_.head_.fields_;
360
- const g_ = _1.second_.head_.guard_;
361
- const cs_ = _1.second_.tail_;
363
+ if(_1.first_.length === 0) {
364
+ if(_1.second_.length > 0) {
365
+ const fs_ = _1.second_[0].fields_;
366
+ const g_ = _1.second_[0].guard_;
367
+ const cs_ = _1.second_.slice(1);
362
368
  ff_compiler_Patterns.check_(variants_, fs_, cs_, true, g_)
363
369
  return
364
370
  }
365
371
  }
366
372
  }
367
373
  {
368
- if(_1.first_.Empty) {
369
- if(_1.second_.Empty) {
374
+ if(_1.first_.length === 0) {
375
+ if(_1.second_.length === 0) {
370
376
  const remaining_ = ff_core_List.List_map(ff_core_List.List_filter(ff_core_Map.Map_pairs(variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ((_w1) => {
371
377
  return (ff_core_Set.Set_size(_w1.second_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) !== 0)
372
378
  })), ((_1) => {
@@ -394,6 +400,12 @@ return (_w1 !== 46)
394
400
  })))
395
401
  }
396
402
  function otherVariants_(name_) {
403
+ if((name_ === "List$Empty")) {
404
+ return ff_core_List.List_toSet(["List$Link"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
405
+ } else {
406
+ if((name_ === "List$Link")) {
407
+ return ff_core_List.List_toSet(["List$Empty"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
408
+ } else {
397
409
  const variantName_ = unqualifiedName_(name_);
398
410
  const moduleName_ = ff_core_String.String_dropLast(name_, (ff_core_String.String_size(variantName_) + 1));
399
411
  const variantModule_ = ff_core_Map.Map_grab(modules_, moduleName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
@@ -409,24 +421,26 @@ return (_w1 !== variantName_)
409
421
  }))
410
422
  })))
411
423
  }
424
+ }
425
+ }
412
426
  function convertPattern_(pattern_) {
413
427
  {
414
428
  const pattern_a = pattern_;
415
429
  {
416
430
  if(pattern_a.PString) {
417
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("String literal", ff_core_List.List_toSet(ff_core_List.Link("Any other String literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
431
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("String literal", ff_core_List.List_toSet(["Any other String literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
418
432
  return
419
433
  }
420
434
  }
421
435
  {
422
436
  if(pattern_a.PInt) {
423
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Int literal", ff_core_List.List_toSet(ff_core_List.Link("Any other Int literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
437
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Int literal", ff_core_List.List_toSet(["Any other Int literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
424
438
  return
425
439
  }
426
440
  }
427
441
  {
428
442
  if(pattern_a.PChar) {
429
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Char literal", ff_core_List.List_toSet(ff_core_List.Link("Any other Char literal", ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty()))
443
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo("Char literal", ff_core_List.List_toSet(["Any other Char literal"], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), []))
430
444
  return
431
445
  }
432
446
  }
@@ -463,7 +477,7 @@ return
463
477
  {
464
478
  if(pattern_a.PVariantAs) {
465
479
  const p_ = pattern_a;
466
- return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo(unqualifiedName_(p_.name_), otherVariants_(p_.name_), ff_core_List.Empty()))
480
+ return ff_core_Option.Some(ff_compiler_Patterns.PatternInfo(unqualifiedName_(p_.name_), otherVariants_(p_.name_), []))
467
481
  return
468
482
  }
469
483
  }
@@ -497,9 +511,9 @@ return
497
511
  }
498
512
  }));
499
513
  const exhaustiveGuards_ = ff_core_List.List_all(case_.guards_, ((g_) => {
500
- const guardConverted_ = ff_compiler_Patterns.convert_(modules_, ff_core_List.Link(ff_compiler_Syntax.MatchCase(g_.at_, ff_core_List.Link(g_.pattern_, ff_core_List.Empty()), ff_core_List.Empty(), case_.body_), ff_core_List.Empty()));
514
+ const guardConverted_ = ff_compiler_Patterns.convert_(modules_, [ff_compiler_Syntax.MatchCase(g_.at_, [g_.pattern_], [], case_.body_)]);
501
515
  return ff_core_Try.Try_else(ff_core_Core.try_((() => {
502
- ff_compiler_Patterns.check_(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), guardConverted_, false, false);
516
+ ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], guardConverted_, false, false);
503
517
  return true
504
518
  })), (() => {
505
519
  return false
@@ -514,7 +528,7 @@ return
514
528
  export async function convertAndCheck_$(modules_, cases_, $task) {
515
529
  const converted_ = ff_compiler_Patterns.convert_(modules_, cases_);
516
530
  ff_core_Try.Try_else(ff_core_Core.try_((() => {
517
- return ff_compiler_Patterns.check_(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.Empty(), converted_, false, false)
531
+ return ff_compiler_Patterns.check_(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), [], converted_, false, false)
518
532
  })), (() => {
519
533
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_core_List.List_grab(cases_, 0).at_, "Unexhaustive match"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
520
534
  }))
@@ -812,7 +826,7 @@ serialization_.offset_ += 1;
812
826
  {
813
827
  const _1 = variantIndex_;
814
828
  {
815
- if(_1 == 0) {
829
+ if(_1 === 0) {
816
830
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 32), 0);
817
831
  return ff_compiler_Patterns.PatternInfo(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Set_Set(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).deserializeUsing_(serialization_), 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.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Patterns.ff_core_Serializable_Serializable$ff_compiler_Patterns_PatternInfo)).deserializeUsing_(serialization_))
818
832
  return
@@ -847,7 +861,7 @@ serialization_.offset_ += 1;
847
861
  {
848
862
  const _1 = variantIndex_;
849
863
  {
850
- if(_1 == 0) {
864
+ if(_1 === 0) {
851
865
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 32), 0);
852
866
  return ff_compiler_Patterns.PatternInfo(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Set_Set(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).deserializeUsing_(serialization_), 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.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Patterns.ff_core_Serializable_Serializable$ff_compiler_Patterns_PatternInfo)).deserializeUsing_(serialization_))
853
867
  return
@@ -884,7 +898,7 @@ serialization_.offset_ += 1;
884
898
  {
885
899
  const _1 = variantIndex_;
886
900
  {
887
- if(_1 == 0) {
901
+ if(_1 === 0) {
888
902
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
889
903
  return ff_compiler_Patterns.PatternCaseInfo(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.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Patterns.ff_core_Serializable_Serializable$ff_compiler_Patterns_PatternInfo)).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_))
890
904
  return
@@ -918,7 +932,7 @@ serialization_.offset_ += 1;
918
932
  {
919
933
  const _1 = variantIndex_;
920
934
  {
921
- if(_1 == 0) {
935
+ if(_1 === 0) {
922
936
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 36), 0);
923
937
  return ff_compiler_Patterns.PatternCaseInfo(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.ff_core_Serializable_Serializable$ff_core_String_String, ff_compiler_Patterns.ff_core_Serializable_Serializable$ff_compiler_Patterns_PatternInfo)).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Bool_Bool.deserializeUsing_(serialization_))
924
938
  return
@@ -84,8 +84,6 @@ import * as ff_core_Show from "../../ff/core/Show.mjs"
84
84
 
85
85
  import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
86
86
 
87
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
88
-
89
87
  import * as ff_core_Stream from "../../ff/core/Stream.mjs"
90
88
 
91
89
  import * as ff_core_String from "../../ff/core/String.mjs"
@@ -111,11 +109,11 @@ return {nextUnificationVariableIndex_};
111
109
 
112
110
 
113
111
  export function make_(packagePair_, moduleName_, lspHook_) {
114
- return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
112
+ return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
115
113
  }
116
114
 
117
115
  export async function make_$(packagePair_, moduleName_, lspHook_, $task) {
118
- return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
116
+ return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
119
117
  }
120
118
 
121
119
  export function Resolver_freshUnificationVariable(self_, at_) {
@@ -210,7 +208,7 @@ const full_ = ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_,
210
208
  const _1 = importAlias_;
211
209
  {
212
210
  if(_1.None) {
213
- return ff_core_List.Link(ff_core_Pair.Pair(name_, full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty()))
211
+ return [ff_core_Pair.Pair(name_, full_), ff_core_Pair.Pair(full_, full_)]
214
212
  return
215
213
  }
216
214
  }
@@ -219,7 +217,7 @@ if(_1.Some) {
219
217
  const alias_ = _1.value_;
220
218
  const _guard1 = unqualified_;
221
219
  if(_guard1) {
222
- return ff_core_List.Link(ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_List.Link(ff_core_Pair.Pair(name_, full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty())))
220
+ return [ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_Pair.Pair(name_, full_), ff_core_Pair.Pair(full_, full_)]
223
221
  return
224
222
  }
225
223
  }
@@ -227,7 +225,7 @@ return
227
225
  {
228
226
  if(_1.Some) {
229
227
  const alias_ = _1.value_;
230
- return ff_core_List.Link(ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty()))
228
+ return [ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_Pair.Pair(full_, full_)]
231
229
  return
232
230
  }
233
231
  }
@@ -311,7 +309,7 @@ return entry_(_w1.name_, true)
311
309
  const _1 = self_;
312
310
  {
313
311
  const _c = _1;
314
- return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
312
+ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
315
313
  return
316
314
  }
317
315
  }
@@ -330,9 +328,9 @@ return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.va
330
328
  if((!ff_core_Option.Option_any(ff_core_List.List_first(definition_.generics_), ((_w1) => {
331
329
  return (_w1 === "Q$")
332
330
  })))) {
333
- ff_core_List.List_each(ff_core_List.List_addAll(definition_.commonFields_, ff_core_List.List_flatMap(definition_.variants_, ((_w1) => {
331
+ ff_core_List.List_each([...definition_.commonFields_, ...ff_core_List.List_flatMap(definition_.variants_, ((_w1) => {
334
332
  return _w1.fields_
335
- }))), ((f_) => {
333
+ }))], ((f_) => {
336
334
  if(ff_compiler_Resolver.Resolver_containsAsyncType(self2_, f_.valueType_)) {
337
335
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(f_.at_, "Only capabilities can contain fields of concrete capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
338
336
  }
@@ -860,8 +858,8 @@ return constructor_.name_
860
858
  })));
861
859
  const isFunctionType_ = ff_core_String.String_startsWith(name_, "Function$", 0);
862
860
  const effect_ = ((isFunctionType_ || ff_core_Set.Set_contains(self_.asyncTypes_, constructor_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
863
- ? ff_core_List.Link(ff_compiler_Resolver.Resolver_makeEffectArgument(self_, constructor_.at_, topLevel_), ff_core_List.Empty())
864
- : ff_core_List.Empty());
861
+ ? [ff_compiler_Resolver.Resolver_makeEffectArgument(self_, constructor_.at_, topLevel_)]
862
+ : []);
865
863
  const generics_ = ff_core_List.List_map(constructor_.generics_, ((_w1) => {
866
864
  return ff_compiler_Resolver.Resolver_resolveType(self_, _w1, topLevel_)
867
865
  }));
@@ -872,7 +870,7 @@ const returnType_ = ff_core_List.List_grabLast(generics_);
872
870
  const _1 = constructor_;
873
871
  {
874
872
  const _c = _1;
875
- return ff_compiler_Syntax.TConstructor(_c.at_, name_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(arguments_, ff_core_List.Link(returnType_, ff_core_List.Empty()))))
873
+ return ff_compiler_Syntax.TConstructor(_c.at_, name_, [...effect_, ...arguments_, returnType_])
876
874
  return
877
875
  }
878
876
  }
@@ -881,7 +879,7 @@ return
881
879
  const _1 = constructor_;
882
880
  {
883
881
  const _c = _1;
884
- return ff_compiler_Syntax.TConstructor(_c.at_, name_, ff_core_List.List_addAll(effect_, generics_))
882
+ return ff_compiler_Syntax.TConstructor(_c.at_, name_, [...effect_, ...generics_])
885
883
  return
886
884
  }
887
885
  }
@@ -895,9 +893,9 @@ return
895
893
  export function Resolver_makeEffectArgument(self_, at_, topLevel_) {
896
894
  if(topLevel_) {
897
895
  if((!ff_core_Set.Set_contains(self_.typeParameters_, "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
898
- return ff_compiler_Syntax.TConstructor(at_, "ff:core/Nothing.Nothing", ff_core_List.Empty())
896
+ return ff_compiler_Syntax.TConstructor(at_, "ff:core/Nothing.Nothing", [])
899
897
  } else {
900
- return ff_compiler_Syntax.TConstructor(at_, "Q$", ff_core_List.Empty())
898
+ return ff_compiler_Syntax.TConstructor(at_, "Q$", [])
901
899
  }
902
900
  } else {
903
901
  return ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, at_)
@@ -950,7 +948,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveSign
950
948
  };
951
949
  const newSignature_ = (topLevel_
952
950
  ? (((_c) => {
953
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.Link("Q$", signature_.generics_), _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Syntax.TConstructor(signature_.at_, "Q$", ff_core_List.Empty()))
951
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ["Q$", ...signature_.generics_], _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Syntax.TConstructor(signature_.at_, "Q$", []))
954
952
  }))(signature_)
955
953
  : (((_c) => {
956
954
  return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, _c.generics_, _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, signature_.at_))
@@ -1033,7 +1031,7 @@ if(pattern_a.PVariable) {
1033
1031
  const at_ = pattern_a.at_;
1034
1032
  if(pattern_a.name_.Some) {
1035
1033
  const name_ = pattern_a.name_.value_;
1036
- return ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(name_, ff_core_Pair.Pair(at_, name_)), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1034
+ return ff_core_List.List_toMap([ff_core_Pair.Pair(name_, ff_core_Pair.Pair(at_, name_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1037
1035
  return
1038
1036
  }
1039
1037
  }
@@ -1073,7 +1071,7 @@ if(pattern_a.PAlias) {
1073
1071
  const at_ = pattern_a.at_;
1074
1072
  const pattern_ = pattern_a.pattern_;
1075
1073
  const variable_ = pattern_a.variable_;
1076
- return ff_core_Map.Map_addAll(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(variable_, ff_core_Pair.Pair(at_, variable_)), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), findVariables_(pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1074
+ return ff_core_Map.Map_addAll(ff_core_List.List_toMap([ff_core_Pair.Pair(variable_, ff_core_Pair.Pair(at_, variable_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), findVariables_(pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1077
1075
  return
1078
1076
  }
1079
1077
  }
@@ -1084,7 +1082,7 @@ return findVariables_(pattern_)
1084
1082
  })), ff_core_Map.empty_(), ((_w1, _w2) => {
1085
1083
  return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1086
1084
  }));
1087
- let guards_ = ff_core_List.Empty();
1085
+ let guards_ = [];
1088
1086
  const variableMap2_ = ff_core_List.List_foldLeft(case_.guards_, variableMap_, ((variableMap1_, g_) => {
1089
1087
  const self2_ = (((_c) => {
1090
1088
  return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
@@ -1096,7 +1094,7 @@ return p_.first_
1096
1094
  const guard_ = (((_c) => {
1097
1095
  return ff_compiler_Syntax.MatchGuard(_c.at_, ff_compiler_Resolver.Resolver_resolveTerm(self2_, g_.term_, topLevel_), ff_compiler_Resolver.Resolver_resolvePattern(self2_, g_.pattern_))
1098
1096
  }))(g_);
1099
- guards_ = ff_core_List.Link(guard_, guards_);
1097
+ guards_ = [guard_, ...guards_];
1100
1098
  return ff_core_Map.Map_addAll(variableMap1_, findVariables_(guard_.pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
1101
1099
  }));
1102
1100
  const self3_ = (((_c) => {
@@ -1304,7 +1302,7 @@ const full_ = ((((ff_compiler_Syntax.PackagePair_groupName(module_.packagePair_,
1304
1302
  const _1 = importAlias_;
1305
1303
  {
1306
1304
  if(_1.None) {
1307
- return ff_core_List.Link(ff_core_Pair.Pair(name_, full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty()))
1305
+ return [ff_core_Pair.Pair(name_, full_), ff_core_Pair.Pair(full_, full_)]
1308
1306
  return
1309
1307
  }
1310
1308
  }
@@ -1313,7 +1311,7 @@ if(_1.Some) {
1313
1311
  const alias_ = _1.value_;
1314
1312
  const _guard1 = unqualified_;
1315
1313
  if(_guard1) {
1316
- return ff_core_List.Link(ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_List.Link(ff_core_Pair.Pair(name_, full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty())))
1314
+ return [ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_Pair.Pair(name_, full_), ff_core_Pair.Pair(full_, full_)]
1317
1315
  return
1318
1316
  }
1319
1317
  }
@@ -1321,7 +1319,7 @@ return
1321
1319
  {
1322
1320
  if(_1.Some) {
1323
1321
  const alias_ = _1.value_;
1324
- return ff_core_List.Link(ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_List.Link(ff_core_Pair.Pair(full_, full_), ff_core_List.Empty()))
1322
+ return [ff_core_Pair.Pair(((alias_ + ".") + name_), full_), ff_core_Pair.Pair(full_, full_)]
1325
1323
  return
1326
1324
  }
1327
1325
  }
@@ -1405,7 +1403,7 @@ return entry_(_w1.name_, true)
1405
1403
  const _1 = self_;
1406
1404
  {
1407
1405
  const _c = _1;
1408
- return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
1406
+ return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variables_, lets_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functions_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethods_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(ff_core_Map.Map_addAll(self_.variableLocations_, letLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), functionLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), traitMethodLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.variants_, variants_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.types_, types_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeGenerics_, typeGenerics_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.typeLocations_, typeLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Set.Set_addAll(self_.asyncTypes_, asyncTypes_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet([], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traits_, traits_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_Map.Map_addAll(self_.traitLocations_, traitLocations_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), self_.state_, _c.lspHook_)
1409
1407
  return
1410
1408
  }
1411
1409
  }
@@ -1424,9 +1422,9 @@ return ff_compiler_Resolver.Resolver(_c.variables_, _c.variableLocations_, _c.va
1424
1422
  if((!ff_core_Option.Option_any(ff_core_List.List_first(definition_.generics_), ((_w1) => {
1425
1423
  return (_w1 === "Q$")
1426
1424
  })))) {
1427
- ff_core_List.List_each(ff_core_List.List_addAll(definition_.commonFields_, ff_core_List.List_flatMap(definition_.variants_, ((_w1) => {
1425
+ ff_core_List.List_each([...definition_.commonFields_, ...ff_core_List.List_flatMap(definition_.variants_, ((_w1) => {
1428
1426
  return _w1.fields_
1429
- }))), ((f_) => {
1427
+ }))], ((f_) => {
1430
1428
  if(ff_compiler_Resolver.Resolver_containsAsyncType(self2_, f_.valueType_)) {
1431
1429
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(f_.at_, "Only capabilities can contain fields of concrete capability types"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1432
1430
  }
@@ -1954,8 +1952,8 @@ return constructor_.name_
1954
1952
  })));
1955
1953
  const isFunctionType_ = ff_core_String.String_startsWith(name_, "Function$", 0);
1956
1954
  const effect_ = ((isFunctionType_ || ff_core_Set.Set_contains(self_.asyncTypes_, constructor_.name_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))
1957
- ? ff_core_List.Link(ff_compiler_Resolver.Resolver_makeEffectArgument(self_, constructor_.at_, topLevel_), ff_core_List.Empty())
1958
- : ff_core_List.Empty());
1955
+ ? [ff_compiler_Resolver.Resolver_makeEffectArgument(self_, constructor_.at_, topLevel_)]
1956
+ : []);
1959
1957
  const generics_ = ff_core_List.List_map(constructor_.generics_, ((_w1) => {
1960
1958
  return ff_compiler_Resolver.Resolver_resolveType(self_, _w1, topLevel_)
1961
1959
  }));
@@ -1966,7 +1964,7 @@ const returnType_ = ff_core_List.List_grabLast(generics_);
1966
1964
  const _1 = constructor_;
1967
1965
  {
1968
1966
  const _c = _1;
1969
- return ff_compiler_Syntax.TConstructor(_c.at_, name_, ff_core_List.List_addAll(effect_, ff_core_List.List_addAll(arguments_, ff_core_List.Link(returnType_, ff_core_List.Empty()))))
1967
+ return ff_compiler_Syntax.TConstructor(_c.at_, name_, [...effect_, ...arguments_, returnType_])
1970
1968
  return
1971
1969
  }
1972
1970
  }
@@ -1975,7 +1973,7 @@ return
1975
1973
  const _1 = constructor_;
1976
1974
  {
1977
1975
  const _c = _1;
1978
- return ff_compiler_Syntax.TConstructor(_c.at_, name_, ff_core_List.List_addAll(effect_, generics_))
1976
+ return ff_compiler_Syntax.TConstructor(_c.at_, name_, [...effect_, ...generics_])
1979
1977
  return
1980
1978
  }
1981
1979
  }
@@ -1989,9 +1987,9 @@ return
1989
1987
  export async function Resolver_makeEffectArgument$(self_, at_, topLevel_, $task) {
1990
1988
  if(topLevel_) {
1991
1989
  if((!ff_core_Set.Set_contains(self_.typeParameters_, "Q$", ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
1992
- return ff_compiler_Syntax.TConstructor(at_, "ff:core/Nothing.Nothing", ff_core_List.Empty())
1990
+ return ff_compiler_Syntax.TConstructor(at_, "ff:core/Nothing.Nothing", [])
1993
1991
  } else {
1994
- return ff_compiler_Syntax.TConstructor(at_, "Q$", ff_core_List.Empty())
1992
+ return ff_compiler_Syntax.TConstructor(at_, "Q$", [])
1995
1993
  }
1996
1994
  } else {
1997
1995
  return ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, at_)
@@ -2044,7 +2042,7 @@ ff_compiler_LspHook.LspHook_emit(self_.lspHook_, ff_compiler_LspHook.ResolveSign
2044
2042
  };
2045
2043
  const newSignature_ = (topLevel_
2046
2044
  ? (((_c) => {
2047
- return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ff_core_List.Link("Q$", signature_.generics_), _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Syntax.TConstructor(signature_.at_, "Q$", ff_core_List.Empty()))
2045
+ return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, ["Q$", ...signature_.generics_], _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Syntax.TConstructor(signature_.at_, "Q$", []))
2048
2046
  }))(signature_)
2049
2047
  : (((_c) => {
2050
2048
  return ff_compiler_Syntax.Signature(_c.at_, _c.name_, _c.member_, _c.generics_, _c.constraints_, _c.parameters_, _c.returnType_, ff_compiler_Resolver.Resolver_freshUnificationVariable(self_, signature_.at_))
@@ -2127,7 +2125,7 @@ if(pattern_a.PVariable) {
2127
2125
  const at_ = pattern_a.at_;
2128
2126
  if(pattern_a.name_.Some) {
2129
2127
  const name_ = pattern_a.name_.value_;
2130
- return ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(name_, ff_core_Pair.Pair(at_, name_)), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2128
+ return ff_core_List.List_toMap([ff_core_Pair.Pair(name_, ff_core_Pair.Pair(at_, name_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2131
2129
  return
2132
2130
  }
2133
2131
  }
@@ -2167,7 +2165,7 @@ if(pattern_a.PAlias) {
2167
2165
  const at_ = pattern_a.at_;
2168
2166
  const pattern_ = pattern_a.pattern_;
2169
2167
  const variable_ = pattern_a.variable_;
2170
- return ff_core_Map.Map_addAll(ff_core_List.List_toMap(ff_core_List.Link(ff_core_Pair.Pair(variable_, ff_core_Pair.Pair(at_, variable_)), ff_core_List.Empty()), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), findVariables_(pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2168
+ return ff_core_Map.Map_addAll(ff_core_List.List_toMap([ff_core_Pair.Pair(variable_, ff_core_Pair.Pair(at_, variable_))], ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), findVariables_(pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2171
2169
  return
2172
2170
  }
2173
2171
  }
@@ -2178,7 +2176,7 @@ return findVariables_(pattern_)
2178
2176
  })), ff_core_Map.empty_(), ((_w1, _w2) => {
2179
2177
  return ff_core_Map.Map_addAll(_w1, _w2, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2180
2178
  }));
2181
- let guards_ = ff_core_List.Empty();
2179
+ let guards_ = [];
2182
2180
  const variableMap2_ = ff_core_List.List_foldLeft(case_.guards_, variableMap_, ((variableMap1_, g_) => {
2183
2181
  const self2_ = (((_c) => {
2184
2182
  return ff_compiler_Resolver.Resolver(ff_core_Map.Map_addAll(self_.variables_, ff_core_Map.Map_mapValues(variableMap1_, ((_, p_) => {
@@ -2190,7 +2188,7 @@ return p_.first_
2190
2188
  const guard_ = (((_c) => {
2191
2189
  return ff_compiler_Syntax.MatchGuard(_c.at_, ff_compiler_Resolver.Resolver_resolveTerm(self2_, g_.term_, topLevel_), ff_compiler_Resolver.Resolver_resolvePattern(self2_, g_.pattern_))
2192
2190
  }))(g_);
2193
- guards_ = ff_core_List.Link(guard_, guards_);
2191
+ guards_ = [guard_, ...guards_];
2194
2192
  return ff_core_Map.Map_addAll(variableMap1_, findVariables_(guard_.pattern_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)
2195
2193
  }));
2196
2194
  const self3_ = (((_c) => {