firefly-compiler 0.4.20 → 0.4.21

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 (62) hide show
  1. package/compiler/Builder.ff +23 -13
  2. package/compiler/JsEmitter.ff +120 -76
  3. package/compiler/LspHook.ff +4 -2
  4. package/compiler/Main.ff +13 -7
  5. package/compiler/Resolver.ff +15 -15
  6. package/compiler/Syntax.ff +1 -0
  7. package/core/Array.ff +6 -4
  8. package/core/Int.ff +12 -12
  9. package/core/List.ff +6 -4
  10. package/experimental/benchmarks/ListGrab.ff +23 -0
  11. package/experimental/benchmarks/ListGrab.java +55 -0
  12. package/experimental/benchmarks/Pyrotek45.ff +30 -0
  13. package/experimental/benchmarks/Pyrotek45.java +64 -0
  14. package/experimental/tests/TestJson.ff +26 -0
  15. package/lsp/Handler.ff +55 -59
  16. package/lsp/SignatureHelpHandler.ff +5 -4
  17. package/lsp/TestReferences.ff +15 -0
  18. package/lsp/TestReferencesCase.ff +8 -0
  19. package/output/js/ff/compiler/Builder.mjs +50 -44
  20. package/output/js/ff/compiler/Dependencies.mjs +0 -2
  21. package/output/js/ff/compiler/Deriver.mjs +16 -140
  22. package/output/js/ff/compiler/Dictionaries.mjs +8 -222
  23. package/output/js/ff/compiler/Environment.mjs +12 -154
  24. package/output/js/ff/compiler/Inference.mjs +127 -1013
  25. package/output/js/ff/compiler/JsEmitter.mjs +434 -2344
  26. package/output/js/ff/compiler/JsImporter.mjs +0 -12
  27. package/output/js/ff/compiler/LspHook.mjs +20 -446
  28. package/output/js/ff/compiler/Main.mjs +96 -550
  29. package/output/js/ff/compiler/Parser.mjs +36 -356
  30. package/output/js/ff/compiler/Patterns.mjs +20 -200
  31. package/output/js/ff/compiler/Resolver.mjs +26 -340
  32. package/output/js/ff/compiler/Substitution.mjs +2 -160
  33. package/output/js/ff/compiler/Syntax.mjs +449 -3293
  34. package/output/js/ff/compiler/Token.mjs +9 -1095
  35. package/output/js/ff/compiler/Tokenizer.mjs +4 -2
  36. package/output/js/ff/compiler/Unification.mjs +26 -360
  37. package/output/js/ff/compiler/Wildcards.mjs +0 -86
  38. package/output/js/ff/compiler/Workspace.mjs +8 -96
  39. package/output/js/ff/core/Array.mjs +15 -8
  40. package/output/js/ff/core/AssetSystem.mjs +4 -14
  41. package/output/js/ff/core/Bool.mjs +0 -12
  42. package/output/js/ff/core/Core.mjs +0 -30
  43. package/output/js/ff/core/Int.mjs +24 -24
  44. package/output/js/ff/core/IntMap.mjs +0 -8
  45. package/output/js/ff/core/Json.mjs +0 -40
  46. package/output/js/ff/core/List.mjs +23 -32
  47. package/output/js/ff/core/Lock.mjs +0 -10
  48. package/output/js/ff/core/Map.mjs +0 -24
  49. package/output/js/ff/core/Option.mjs +10 -286
  50. package/output/js/ff/core/Ordering.mjs +16 -158
  51. package/output/js/ff/core/Pair.mjs +2 -34
  52. package/output/js/ff/core/Path.mjs +2 -28
  53. package/output/js/ff/core/Random.mjs +4 -4
  54. package/output/js/ff/core/RbMap.mjs +56 -644
  55. package/output/js/ff/core/Show.mjs +0 -16
  56. package/output/js/ff/core/Stream.mjs +14 -144
  57. package/output/js/ff/core/StringMap.mjs +0 -8
  58. package/output/js/ff/core/Try.mjs +4 -108
  59. package/output/js/ff/core/Unit.mjs +2 -16
  60. package/package.json +1 -1
  61. package/postgresql/Pg.ff +23 -23
  62. package/vscode/package.json +1 -1
@@ -225,7 +225,6 @@ const _1 = info_;
225
225
  {
226
226
  const _c = _1;
227
227
  return ff_compiler_Syntax.PackageInfo(_c.package_, [coreDependency_, ...info_.dependencies_], _c.includes_)
228
- return
229
228
  }
230
229
  }
231
230
  }
@@ -324,7 +323,6 @@ const _1 = info_;
324
323
  {
325
324
  const _c = _1;
326
325
  return ff_compiler_Syntax.PackageInfo(_c.package_, [coreDependency_, ...info_.dependencies_], _c.includes_)
327
- return
328
326
  }
329
327
  }
330
328
  }
@@ -125,7 +125,6 @@ const _1 = module_;
125
125
  {
126
126
  const _c = _1;
127
127
  return ff_compiler_Syntax.Module(_c.file_, _c.packagePair_, _c.imports_, _c.types_, _c.traits_, [...module_.instances_, ...ff_compiler_Deriver.Deriver_makeHasAnyTagInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeShowInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeEqualInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeOrderingInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeSerializableInstances(self_, modulePrefix_, module_)], _c.extends_, _c.lets_, _c.functions_)
128
- return
129
128
  }
130
129
  }
131
130
  }
@@ -251,15 +250,10 @@ const wildcardPattern_ = ff_compiler_Syntax.PVariable(at_, ff_core_Option.None()
251
250
  const sameCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [ff_compiler_Syntax.MatchGuard(at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "===", [ff_compiler_Syntax.EVariable(at_, "x"), ff_compiler_Syntax.EVariable(at_, "y")], []), ff_compiler_Syntax.PVariant(at_, "ff:core/Bool.True", []))], ff_compiler_Syntax.EVariant(at_, "ff:core/Ordering.OrderingSame", [], ff_core_Option.None()));
252
251
  {
253
252
  const _1 = declaration_.variants_;
254
- {
255
- if(_1.length > 0) {
256
- const variant_ = _1[0];
257
253
  if(_1.length === 1) {
254
+ const variant_ = _1[0];
258
255
  const fields_ = [...declaration_.commonFields_, ...variant_.fields_];
259
256
  return [sameCase_, ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeOrderingFields(self_, modulePrefix_, declaration_, fields_))]
260
- return
261
- }
262
- }
263
257
  }
264
258
  {
265
259
  const variants_ = _1;
@@ -279,12 +273,10 @@ const index_ = _1.first_;
279
273
  const variant_ = _1.second_;
280
274
  const variantName_ = ((modulePrefix_ + ".") + variant_.name_);
281
275
  return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PVariantAs(at_, variantName_, at_, ff_core_Option.None())], [], ff_compiler_Syntax.EInt(at_, ("" + index_)))
282
- return
283
276
  }
284
277
  }));
285
278
  const differentVariant_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Syntax.EFunctions(at_, [ff_compiler_Syntax.DFunction(at_, numberSignature_, ff_compiler_Syntax.FireflyTarget(ff_compiler_Syntax.Lambda(at_, noEffect_, numberCases_)))], ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Ordering.compare", [ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "number", [ff_compiler_Syntax.EVariable(at_, "x")], []), ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "number", [ff_compiler_Syntax.EVariable(at_, "y")], [])], [])));
286
279
  return [sameCase_, ...sameVariantCases_, differentVariant_]
287
- return
288
280
  }
289
281
  }
290
282
  }
@@ -296,16 +288,11 @@ return ff_compiler_Syntax.Location((declaration_.at_.file_ + "/<derived>"), _c.l
296
288
  const orderingType_ = ff_compiler_Syntax.TConstructor(at_, "ff:core/Ordering.Ordering", []);
297
289
  const orderingSame_ = ff_compiler_Syntax.EVariant(at_, "ff:core/Ordering.OrderingSame", [], ff_core_Option.None());
298
290
  function go_(fields_) {
299
- {
300
291
  const fields_a = fields_;
301
- {
302
292
  if(fields_a.length === 0) {
303
293
  return orderingSame_
304
- return
305
294
  }
306
- }
307
- {
308
- if(fields_a.length > 0) {
295
+ if(fields_a.length >= 1) {
309
296
  const head_ = fields_a[0];
310
297
  const tail_ = fields_a.slice(1);
311
298
  const variableName_ = (head_.name_ + "Ordering");
@@ -313,9 +300,6 @@ const compareTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:
313
300
  const notEqualTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "!==", [ff_compiler_Syntax.EVariable(at_, variableName_), orderingSame_], []);
314
301
  const ifTerm_ = ff_compiler_Deriver.Deriver_makeIf(self_, at_, notEqualTerm_, ff_compiler_Syntax.EVariable(at_, variableName_), go_(tail_));
315
302
  return ff_compiler_Syntax.ELet(at_, false, variableName_, orderingType_, compareTerm_, ifTerm_)
316
- return
317
- }
318
- }
319
303
  }
320
304
  }
321
305
  return go_(fields_)
@@ -356,15 +340,10 @@ const wildcardPattern_ = ff_compiler_Syntax.PVariable(at_, ff_core_Option.None()
356
340
  const sameCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [ff_compiler_Syntax.MatchGuard(at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "===", [ff_compiler_Syntax.EVariable(at_, "x"), ff_compiler_Syntax.EVariable(at_, "y")], []), ff_compiler_Syntax.PVariant(at_, "ff:core/Bool.True", []))], ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.True", [], ff_core_Option.None()));
357
341
  {
358
342
  const _1 = declaration_.variants_;
359
- {
360
- if(_1.length > 0) {
361
- const variant_ = _1[0];
362
343
  if(_1.length === 1) {
344
+ const variant_ = _1[0];
363
345
  const fields_ = [...declaration_.commonFields_, ...variant_.fields_];
364
346
  return [sameCase_, ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeEqualFields(self_, modulePrefix_, declaration_, fields_))]
365
- return
366
- }
367
- }
368
347
  }
369
348
  {
370
349
  const variants_ = _1;
@@ -378,7 +357,6 @@ return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PVariantAs(at_, var
378
357
  }));
379
358
  const differentVariant_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.False", [], ff_core_Option.None()));
380
359
  return [sameCase_, ...sameVariantCases_, differentVariant_]
381
- return
382
360
  }
383
361
  }
384
362
  }
@@ -388,32 +366,19 @@ const at_ = (((_c) => {
388
366
  return ff_compiler_Syntax.Location((declaration_.at_.file_ + "/<derived>"), _c.line_, _c.column_)
389
367
  }))(declaration_.at_);
390
368
  function go_(fields_) {
391
- {
392
369
  const fields_a = fields_;
393
- {
394
370
  if(fields_a.length === 0) {
395
371
  return ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.True", [], ff_core_Option.None())
396
- return
397
- }
398
372
  }
399
- {
400
- if(fields_a.length > 0) {
401
- const head_ = fields_a[0];
402
373
  if(fields_a.length === 1) {
374
+ const head_ = fields_a[0];
403
375
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Equal.equals", [ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "x"), head_.name_), ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "y"), head_.name_)], [])
404
- return
405
- }
406
376
  }
407
- }
408
- {
409
- if(fields_a.length > 0) {
377
+ if(fields_a.length >= 1) {
410
378
  const head_ = fields_a[0];
411
379
  const tail_ = fields_a.slice(1);
412
380
  const equalsTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Equal.equals", [ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "x"), head_.name_), ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "y"), head_.name_)], []);
413
381
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "&&", [equalsTerm_, go_(tail_)], [])
414
- return
415
- }
416
- }
417
382
  }
418
383
  }
419
384
  return go_(fields_)
@@ -494,7 +459,6 @@ return ff_compiler_Syntax.Argument(at_, ff_core_Option.None(), ff_compiler_Deriv
494
459
  const updateChecksum_ = ff_compiler_Deriver.Deriver_makeUpdateChecksum(self_, at_, variantName_, declaration_, variant_);
495
460
  const makeVariant_ = ff_compiler_Syntax.EVariant(at_, variantName_, [], ff_core_Option.Some(fieldValues_));
496
461
  return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PInt(at_, ("" + index_))], [], ff_compiler_Syntax.ESequential(at_, updateChecksum_, makeVariant_))
497
- return
498
462
  }
499
463
  }));
500
464
  const otherwiseCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Core.throw", [ff_compiler_Syntax.EVariant(at_, "ff:core/Serializable.DeserializationChecksumException", [], ff_core_Option.None())], []));
@@ -514,8 +478,7 @@ const typesWithInstance_ = ff_core_List.List_toSet(ff_core_List.List_collect(mod
514
478
  {
515
479
  const instance_ = _1;
516
480
  const _guard1 = ff_core_List.List_first(instance_.typeArguments_);
517
- if(_guard1.Some) {
518
- if(_guard1.value_.TConstructor) {
481
+ if(_guard1.Some && _guard1.value_.TConstructor) {
519
482
  const name_ = _guard1.value_.name_;
520
483
  if((instance_.traitName_ === traitName_)) {
521
484
  return ff_core_Option.Some(name_)
@@ -523,10 +486,8 @@ return ff_core_Option.Some(name_)
523
486
  return
524
487
  }
525
488
  }
526
- }
527
489
  {
528
490
  return ff_core_Option.None()
529
- return
530
491
  }
531
492
  })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
532
493
  return ff_core_List.List_filter(module_.types_, ((t_) => {
@@ -566,7 +527,6 @@ const _1 = module_;
566
527
  {
567
528
  const _c = _1;
568
529
  return ff_compiler_Syntax.Module(_c.file_, _c.packagePair_, _c.imports_, _c.types_, _c.traits_, [...module_.instances_, ...ff_compiler_Deriver.Deriver_makeHasAnyTagInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeShowInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeEqualInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeOrderingInstances(self_, modulePrefix_, module_), ...ff_compiler_Deriver.Deriver_makeSerializableInstances(self_, modulePrefix_, module_)], _c.extends_, _c.lets_, _c.functions_)
569
- return
570
530
  }
571
531
  }
572
532
  }
@@ -692,15 +652,10 @@ const wildcardPattern_ = ff_compiler_Syntax.PVariable(at_, ff_core_Option.None()
692
652
  const sameCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [ff_compiler_Syntax.MatchGuard(at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "===", [ff_compiler_Syntax.EVariable(at_, "x"), ff_compiler_Syntax.EVariable(at_, "y")], []), ff_compiler_Syntax.PVariant(at_, "ff:core/Bool.True", []))], ff_compiler_Syntax.EVariant(at_, "ff:core/Ordering.OrderingSame", [], ff_core_Option.None()));
693
653
  {
694
654
  const _1 = declaration_.variants_;
695
- {
696
- if(_1.length > 0) {
697
- const variant_ = _1[0];
698
655
  if(_1.length === 1) {
656
+ const variant_ = _1[0];
699
657
  const fields_ = [...declaration_.commonFields_, ...variant_.fields_];
700
658
  return [sameCase_, ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeOrderingFields(self_, modulePrefix_, declaration_, fields_))]
701
- return
702
- }
703
- }
704
659
  }
705
660
  {
706
661
  const variants_ = _1;
@@ -720,12 +675,10 @@ const index_ = _1.first_;
720
675
  const variant_ = _1.second_;
721
676
  const variantName_ = ((modulePrefix_ + ".") + variant_.name_);
722
677
  return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PVariantAs(at_, variantName_, at_, ff_core_Option.None())], [], ff_compiler_Syntax.EInt(at_, ("" + index_)))
723
- return
724
678
  }
725
679
  }));
726
680
  const differentVariant_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Syntax.EFunctions(at_, [ff_compiler_Syntax.DFunction(at_, numberSignature_, ff_compiler_Syntax.FireflyTarget(ff_compiler_Syntax.Lambda(at_, noEffect_, numberCases_)))], ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Ordering.compare", [ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "number", [ff_compiler_Syntax.EVariable(at_, "x")], []), ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "number", [ff_compiler_Syntax.EVariable(at_, "y")], [])], [])));
727
681
  return [sameCase_, ...sameVariantCases_, differentVariant_]
728
- return
729
682
  }
730
683
  }
731
684
  }
@@ -737,16 +690,11 @@ return ff_compiler_Syntax.Location((declaration_.at_.file_ + "/<derived>"), _c.l
737
690
  const orderingType_ = ff_compiler_Syntax.TConstructor(at_, "ff:core/Ordering.Ordering", []);
738
691
  const orderingSame_ = ff_compiler_Syntax.EVariant(at_, "ff:core/Ordering.OrderingSame", [], ff_core_Option.None());
739
692
  function go_(fields_) {
740
- {
741
693
  const fields_a = fields_;
742
- {
743
694
  if(fields_a.length === 0) {
744
695
  return orderingSame_
745
- return
746
696
  }
747
- }
748
- {
749
- if(fields_a.length > 0) {
697
+ if(fields_a.length >= 1) {
750
698
  const head_ = fields_a[0];
751
699
  const tail_ = fields_a.slice(1);
752
700
  const variableName_ = (head_.name_ + "Ordering");
@@ -754,9 +702,6 @@ const compareTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:
754
702
  const notEqualTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "!==", [ff_compiler_Syntax.EVariable(at_, variableName_), orderingSame_], []);
755
703
  const ifTerm_ = ff_compiler_Deriver.Deriver_makeIf(self_, at_, notEqualTerm_, ff_compiler_Syntax.EVariable(at_, variableName_), go_(tail_));
756
704
  return ff_compiler_Syntax.ELet(at_, false, variableName_, orderingType_, compareTerm_, ifTerm_)
757
- return
758
- }
759
- }
760
705
  }
761
706
  }
762
707
  return go_(fields_)
@@ -797,15 +742,10 @@ const wildcardPattern_ = ff_compiler_Syntax.PVariable(at_, ff_core_Option.None()
797
742
  const sameCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [ff_compiler_Syntax.MatchGuard(at_, ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "===", [ff_compiler_Syntax.EVariable(at_, "x"), ff_compiler_Syntax.EVariable(at_, "y")], []), ff_compiler_Syntax.PVariant(at_, "ff:core/Bool.True", []))], ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.True", [], ff_core_Option.None()));
798
743
  {
799
744
  const _1 = declaration_.variants_;
800
- {
801
- if(_1.length > 0) {
802
- const variant_ = _1[0];
803
745
  if(_1.length === 1) {
746
+ const variant_ = _1[0];
804
747
  const fields_ = [...declaration_.commonFields_, ...variant_.fields_];
805
748
  return [sameCase_, ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeEqualFields(self_, modulePrefix_, declaration_, fields_))]
806
- return
807
- }
808
- }
809
749
  }
810
750
  {
811
751
  const variants_ = _1;
@@ -819,7 +759,6 @@ return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PVariantAs(at_, var
819
759
  }));
820
760
  const differentVariant_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_, wildcardPattern_], [], ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.False", [], ff_core_Option.None()));
821
761
  return [sameCase_, ...sameVariantCases_, differentVariant_]
822
- return
823
762
  }
824
763
  }
825
764
  }
@@ -829,32 +768,19 @@ const at_ = (((_c) => {
829
768
  return ff_compiler_Syntax.Location((declaration_.at_.file_ + "/<derived>"), _c.line_, _c.column_)
830
769
  }))(declaration_.at_);
831
770
  function go_(fields_) {
832
- {
833
771
  const fields_a = fields_;
834
- {
835
772
  if(fields_a.length === 0) {
836
773
  return ff_compiler_Syntax.EVariant(at_, "ff:core/Bool.True", [], ff_core_Option.None())
837
- return
838
774
  }
839
- }
840
- {
841
- if(fields_a.length > 0) {
842
- const head_ = fields_a[0];
843
775
  if(fields_a.length === 1) {
776
+ const head_ = fields_a[0];
844
777
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Equal.equals", [ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "x"), head_.name_), ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "y"), head_.name_)], [])
845
- return
846
- }
847
778
  }
848
- }
849
- {
850
- if(fields_a.length > 0) {
779
+ if(fields_a.length >= 1) {
851
780
  const head_ = fields_a[0];
852
781
  const tail_ = fields_a.slice(1);
853
782
  const equalsTerm_ = ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Equal.equals", [ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "x"), head_.name_), ff_compiler_Syntax.EField(at_, false, ff_compiler_Syntax.EVariable(at_, "y"), head_.name_)], []);
854
783
  return ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "&&", [equalsTerm_, go_(tail_)], [])
855
- return
856
- }
857
- }
858
784
  }
859
785
  }
860
786
  return go_(fields_)
@@ -935,7 +861,6 @@ return ff_compiler_Syntax.Argument(at_, ff_core_Option.None(), ff_compiler_Deriv
935
861
  const updateChecksum_ = ff_compiler_Deriver.Deriver_makeUpdateChecksum(self_, at_, variantName_, declaration_, variant_);
936
862
  const makeVariant_ = ff_compiler_Syntax.EVariant(at_, variantName_, [], ff_core_Option.Some(fieldValues_));
937
863
  return ff_compiler_Syntax.MatchCase(at_, [ff_compiler_Syntax.PInt(at_, ("" + index_))], [], ff_compiler_Syntax.ESequential(at_, updateChecksum_, makeVariant_))
938
- return
939
864
  }
940
865
  }));
941
866
  const otherwiseCase_ = ff_compiler_Syntax.MatchCase(at_, [wildcardPattern_], [], ff_compiler_Deriver.Deriver_makeSimpleCall(self_, at_, "ff:core/Core.throw", [ff_compiler_Syntax.EVariant(at_, "ff:core/Serializable.DeserializationChecksumException", [], ff_core_Option.None())], []));
@@ -955,8 +880,7 @@ const typesWithInstance_ = ff_core_List.List_toSet(ff_core_List.List_collect(mod
955
880
  {
956
881
  const instance_ = _1;
957
882
  const _guard1 = ff_core_List.List_first(instance_.typeArguments_);
958
- if(_guard1.Some) {
959
- if(_guard1.value_.TConstructor) {
883
+ if(_guard1.Some && _guard1.value_.TConstructor) {
960
884
  const name_ = _guard1.value_.name_;
961
885
  if((instance_.traitName_ === traitName_)) {
962
886
  return ff_core_Option.Some(name_)
@@ -964,10 +888,8 @@ return ff_core_Option.Some(name_)
964
888
  return
965
889
  }
966
890
  }
967
- }
968
891
  {
969
892
  return ff_core_Option.None()
970
- return
971
893
  }
972
894
  })), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
973
895
  return ff_core_List.List_filter(module_.types_, ((t_) => {
@@ -1011,104 +933,69 @@ return ff_core_Any.internalAnyTag_((("ff:compiler/Deriver.Deriver" + "[") + "]")
1011
933
 
1012
934
  export const ff_core_Show_Show$ff_compiler_Deriver_Deriver = {
1013
935
  show_(value_) {
1014
- {
1015
936
  const value_a = value_;
1016
937
  {
1017
938
  const z_ = value_a;
1018
939
  return "Deriver"
1019
- return
1020
- }
1021
940
  }
1022
941
  },
1023
942
  async show_$(value_, $task) {
1024
- {
1025
943
  const value_a = value_;
1026
944
  {
1027
945
  const z_ = value_a;
1028
946
  return "Deriver"
1029
- return
1030
- }
1031
947
  }
1032
948
  }
1033
949
  };
1034
950
 
1035
951
  export const ff_core_Equal_Equal$ff_compiler_Deriver_Deriver = {
1036
952
  equals_(x_, y_) {
1037
- {
1038
953
  const x_a = x_;
1039
954
  const y_a = y_;
1040
- {
1041
- const _guard1 = (x_ === y_);
1042
- if(_guard1) {
955
+ if((x_ === y_)) {
1043
956
  return true
1044
- return
1045
- }
1046
957
  }
1047
958
  {
1048
959
  return true
1049
- return
1050
- }
1051
960
  }
1052
961
  },
1053
962
  async equals_$(x_, y_, $task) {
1054
- {
1055
963
  const x_a = x_;
1056
964
  const y_a = y_;
1057
- {
1058
- const _guard1 = (x_ === y_);
1059
- if(_guard1) {
965
+ if((x_ === y_)) {
1060
966
  return true
1061
- return
1062
- }
1063
967
  }
1064
968
  {
1065
969
  return true
1066
- return
1067
- }
1068
970
  }
1069
971
  }
1070
972
  };
1071
973
 
1072
974
  export const ff_core_Ordering_Order$ff_compiler_Deriver_Deriver = {
1073
975
  compare_(x_, y_) {
1074
- {
1075
976
  const x_a = x_;
1076
977
  const y_a = y_;
1077
- {
1078
- const _guard1 = (x_ === y_);
1079
- if(_guard1) {
978
+ if((x_ === y_)) {
1080
979
  return ff_core_Ordering.OrderingSame()
1081
- return
1082
- }
1083
980
  }
1084
981
  {
1085
982
  return ff_core_Ordering.OrderingSame()
1086
- return
1087
- }
1088
983
  }
1089
984
  },
1090
985
  async compare_$(x_, y_, $task) {
1091
- {
1092
986
  const x_a = x_;
1093
987
  const y_a = y_;
1094
- {
1095
- const _guard1 = (x_ === y_);
1096
- if(_guard1) {
988
+ if((x_ === y_)) {
1097
989
  return ff_core_Ordering.OrderingSame()
1098
- return
1099
- }
1100
990
  }
1101
991
  {
1102
992
  return ff_core_Ordering.OrderingSame()
1103
- return
1104
- }
1105
993
  }
1106
994
  }
1107
995
  };
1108
996
 
1109
997
  export const ff_core_Serializable_Serializable$ff_compiler_Deriver_Deriver = {
1110
998
  serializeUsing_(serialization_, value_) {
1111
- {
1112
999
  const serialization_a = serialization_;
1113
1000
  const value_a = value_;
1114
1001
  {
@@ -1119,28 +1006,22 @@ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0
1119
1006
  serialization_.offset_ += 1
1120
1007
  return
1121
1008
  }
1122
- }
1123
1009
  },
1124
1010
  deserializeUsing_(serialization_) {
1125
1011
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1126
1012
  serialization_.offset_ += 1;
1127
1013
  {
1128
1014
  const _1 = variantIndex_;
1129
- {
1130
1015
  if(_1 === 0) {
1131
1016
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1132
1017
  return ff_compiler_Deriver.Deriver()
1133
- return
1134
- }
1135
1018
  }
1136
1019
  {
1137
1020
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1138
- return
1139
1021
  }
1140
1022
  }
1141
1023
  },
1142
1024
  async serializeUsing_$(serialization_, value_, $task) {
1143
- {
1144
1025
  const serialization_a = serialization_;
1145
1026
  const value_a = value_;
1146
1027
  {
@@ -1151,23 +1032,18 @@ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0
1151
1032
  serialization_.offset_ += 1
1152
1033
  return
1153
1034
  }
1154
- }
1155
1035
  },
1156
1036
  async deserializeUsing_$(serialization_, $task) {
1157
1037
  const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
1158
1038
  serialization_.offset_ += 1;
1159
1039
  {
1160
1040
  const _1 = variantIndex_;
1161
- {
1162
1041
  if(_1 === 0) {
1163
1042
  serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 27), 0);
1164
1043
  return ff_compiler_Deriver.Deriver()
1165
- return
1166
- }
1167
1044
  }
1168
1045
  {
1169
1046
  throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
1170
- return
1171
1047
  }
1172
1048
  }
1173
1049
  }