@magnusopera/fscript 0.92.5 → 0.94.0

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.
@@ -326,198 +326,208 @@ function valueEquals(a_mut, b_mut) {
326
326
  valueEquals:
327
327
  while (true) {
328
328
  const a = a_mut, b = b_mut;
329
- let matchResult, x, y, x_1, y_1, x_2, y_2, x_3, y_3, xs, ys, xs_1, ys_1, xf, yf;
329
+ let matchResult, x, y, x_1, y_1, x_2, y_2, x_3, y_3, xs, ys, xs_1, ys_1, left_1, right_1, value_11;
330
330
  switch (a.tag) {
331
331
  case 0: {
332
- if (b.tag === 0) {
333
- matchResult = 0;
334
- }
335
- else {
336
- const activePatternResult = $007CRecordFields$007C_$007C(a);
337
- if (activePatternResult != null) {
338
- const activePatternResult_1 = $007CRecordFields$007C_$007C(b);
339
- if (activePatternResult_1 != null) {
340
- matchResult = 7;
341
- xf = activePatternResult;
342
- yf = activePatternResult_1;
332
+ switch (b.tag) {
333
+ case 0: {
334
+ matchResult = 0;
335
+ break;
336
+ }
337
+ case 16: {
338
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
339
+ matchResult = 8;
340
+ value_11 = b.fields[0];
343
341
  }
344
342
  else {
345
- matchResult = 8;
343
+ matchResult = 9;
346
344
  }
345
+ break;
347
346
  }
348
- else {
349
- matchResult = 8;
350
- }
347
+ default:
348
+ matchResult = 9;
351
349
  }
352
350
  break;
353
351
  }
354
352
  case 1: {
355
- if (b.tag === 1) {
356
- matchResult = 1;
357
- x = a.fields[0];
358
- y = b.fields[0];
359
- }
360
- else {
361
- const activePatternResult_2 = $007CRecordFields$007C_$007C(a);
362
- if (activePatternResult_2 != null) {
363
- const activePatternResult_3 = $007CRecordFields$007C_$007C(b);
364
- if (activePatternResult_3 != null) {
365
- matchResult = 7;
366
- xf = activePatternResult_2;
367
- yf = activePatternResult_3;
353
+ switch (b.tag) {
354
+ case 1: {
355
+ matchResult = 1;
356
+ x = a.fields[0];
357
+ y = b.fields[0];
358
+ break;
359
+ }
360
+ case 16: {
361
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
362
+ matchResult = 8;
363
+ value_11 = b.fields[0];
368
364
  }
369
365
  else {
370
- matchResult = 8;
366
+ matchResult = 9;
371
367
  }
368
+ break;
372
369
  }
373
- else {
374
- matchResult = 8;
375
- }
370
+ default:
371
+ matchResult = 9;
376
372
  }
377
373
  break;
378
374
  }
379
375
  case 2: {
380
- if (b.tag === 2) {
381
- matchResult = 2;
382
- x_1 = a.fields[0];
383
- y_1 = b.fields[0];
384
- }
385
- else {
386
- const activePatternResult_4 = $007CRecordFields$007C_$007C(a);
387
- if (activePatternResult_4 != null) {
388
- const activePatternResult_5 = $007CRecordFields$007C_$007C(b);
389
- if (activePatternResult_5 != null) {
390
- matchResult = 7;
391
- xf = activePatternResult_4;
392
- yf = activePatternResult_5;
376
+ switch (b.tag) {
377
+ case 2: {
378
+ matchResult = 2;
379
+ x_1 = a.fields[0];
380
+ y_1 = b.fields[0];
381
+ break;
382
+ }
383
+ case 16: {
384
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
385
+ matchResult = 8;
386
+ value_11 = b.fields[0];
393
387
  }
394
388
  else {
395
- matchResult = 8;
389
+ matchResult = 9;
396
390
  }
391
+ break;
397
392
  }
398
- else {
399
- matchResult = 8;
400
- }
393
+ default:
394
+ matchResult = 9;
401
395
  }
402
396
  break;
403
397
  }
404
398
  case 3: {
405
- if (b.tag === 3) {
406
- matchResult = 3;
407
- x_2 = a.fields[0];
408
- y_2 = b.fields[0];
409
- }
410
- else {
411
- const activePatternResult_6 = $007CRecordFields$007C_$007C(a);
412
- if (activePatternResult_6 != null) {
413
- const activePatternResult_7 = $007CRecordFields$007C_$007C(b);
414
- if (activePatternResult_7 != null) {
415
- matchResult = 7;
416
- xf = activePatternResult_6;
417
- yf = activePatternResult_7;
399
+ switch (b.tag) {
400
+ case 3: {
401
+ matchResult = 3;
402
+ x_2 = a.fields[0];
403
+ y_2 = b.fields[0];
404
+ break;
405
+ }
406
+ case 16: {
407
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
408
+ matchResult = 8;
409
+ value_11 = b.fields[0];
418
410
  }
419
411
  else {
420
- matchResult = 8;
412
+ matchResult = 9;
421
413
  }
414
+ break;
422
415
  }
423
- else {
424
- matchResult = 8;
425
- }
416
+ default:
417
+ matchResult = 9;
426
418
  }
427
419
  break;
428
420
  }
429
421
  case 4: {
430
- if (b.tag === 4) {
431
- matchResult = 4;
432
- x_3 = a.fields[0];
433
- y_3 = b.fields[0];
434
- }
435
- else {
436
- const activePatternResult_8 = $007CRecordFields$007C_$007C(a);
437
- if (activePatternResult_8 != null) {
438
- const activePatternResult_9 = $007CRecordFields$007C_$007C(b);
439
- if (activePatternResult_9 != null) {
440
- matchResult = 7;
441
- xf = activePatternResult_8;
442
- yf = activePatternResult_9;
422
+ switch (b.tag) {
423
+ case 4: {
424
+ matchResult = 4;
425
+ x_3 = a.fields[0];
426
+ y_3 = b.fields[0];
427
+ break;
428
+ }
429
+ case 16: {
430
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
431
+ matchResult = 8;
432
+ value_11 = b.fields[0];
443
433
  }
444
434
  else {
445
- matchResult = 8;
435
+ matchResult = 9;
446
436
  }
437
+ break;
447
438
  }
448
- else {
449
- matchResult = 8;
450
- }
439
+ default:
440
+ matchResult = 9;
451
441
  }
452
442
  break;
453
443
  }
454
444
  case 5: {
455
- if (b.tag === 5) {
456
- matchResult = 5;
457
- xs = a.fields[0];
458
- ys = b.fields[0];
459
- }
460
- else {
461
- const activePatternResult_10 = $007CRecordFields$007C_$007C(a);
462
- if (activePatternResult_10 != null) {
463
- const activePatternResult_11 = $007CRecordFields$007C_$007C(b);
464
- if (activePatternResult_11 != null) {
465
- matchResult = 7;
466
- xf = activePatternResult_10;
467
- yf = activePatternResult_11;
445
+ switch (b.tag) {
446
+ case 5: {
447
+ matchResult = 5;
448
+ xs = a.fields[0];
449
+ ys = b.fields[0];
450
+ break;
451
+ }
452
+ case 16: {
453
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
454
+ matchResult = 8;
455
+ value_11 = b.fields[0];
468
456
  }
469
457
  else {
470
- matchResult = 8;
458
+ matchResult = 9;
471
459
  }
460
+ break;
472
461
  }
473
- else {
474
- matchResult = 8;
475
- }
462
+ default:
463
+ matchResult = 9;
476
464
  }
477
465
  break;
478
466
  }
479
467
  case 6: {
480
- if (b.tag === 6) {
481
- matchResult = 6;
482
- xs_1 = a.fields[0];
483
- ys_1 = b.fields[0];
484
- }
485
- else {
486
- const activePatternResult_12 = $007CRecordFields$007C_$007C(a);
487
- if (activePatternResult_12 != null) {
488
- const activePatternResult_13 = $007CRecordFields$007C_$007C(b);
489
- if (activePatternResult_13 != null) {
490
- matchResult = 7;
491
- xf = activePatternResult_12;
492
- yf = activePatternResult_13;
468
+ switch (b.tag) {
469
+ case 6: {
470
+ matchResult = 6;
471
+ xs_1 = a.fields[0];
472
+ ys_1 = b.fields[0];
473
+ break;
474
+ }
475
+ case 16: {
476
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
477
+ matchResult = 8;
478
+ value_11 = b.fields[0];
493
479
  }
494
480
  else {
495
- matchResult = 8;
481
+ matchResult = 9;
496
482
  }
483
+ break;
497
484
  }
498
- else {
499
- matchResult = 8;
500
- }
485
+ default:
486
+ matchResult = 9;
501
487
  }
502
488
  break;
503
489
  }
504
- default: {
505
- const activePatternResult_14 = $007CRecordFields$007C_$007C(a);
506
- if (activePatternResult_14 != null) {
507
- const activePatternResult_15 = $007CRecordFields$007C_$007C(b);
508
- if (activePatternResult_15 != null) {
490
+ case 16: {
491
+ if (b.tag === 16) {
492
+ if (!(isEmpty(a.fields[0].Descriptor.TypeParameters) && isEmpty(b.fields[0].Descriptor.TypeParameters))) {
509
493
  matchResult = 7;
510
- xf = activePatternResult_14;
511
- yf = activePatternResult_15;
494
+ left_1 = a.fields[0];
495
+ right_1 = b.fields[0];
512
496
  }
513
- else {
497
+ else if (!isEmpty(a.fields[0].Descriptor.TypeParameters)) {
514
498
  matchResult = 8;
499
+ value_11 = a.fields[0];
500
+ }
501
+ else if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
502
+ matchResult = 8;
503
+ value_11 = b.fields[0];
504
+ }
505
+ else {
506
+ matchResult = 9;
515
507
  }
516
508
  }
517
- else {
509
+ else if (!isEmpty(a.fields[0].Descriptor.TypeParameters)) {
518
510
  matchResult = 8;
511
+ value_11 = a.fields[0];
512
+ }
513
+ else {
514
+ matchResult = 9;
519
515
  }
516
+ break;
520
517
  }
518
+ default:
519
+ if (b.tag === 16) {
520
+ if (!isEmpty(b.fields[0].Descriptor.TypeParameters)) {
521
+ matchResult = 8;
522
+ value_11 = b.fields[0];
523
+ }
524
+ else {
525
+ matchResult = 9;
526
+ }
527
+ }
528
+ else {
529
+ matchResult = 9;
530
+ }
521
531
  }
522
532
  switch (matchResult) {
523
533
  case 0:
@@ -545,137 +555,166 @@ function valueEquals(a_mut, b_mut) {
545
555
  return false;
546
556
  }
547
557
  case 7:
548
- if (FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) {
549
- return forAll((key, value) => exists((b_3) => valueEquals(value, b_3), toArray(tryFind(key, yf))), xf);
558
+ if (left_1.Descriptor.Name === right_1.Descriptor.Name) {
559
+ return left_1.Payload === right_1.Payload;
550
560
  }
551
561
  else {
552
562
  return false;
553
563
  }
564
+ case 8:
565
+ return false;
554
566
  default: {
555
- let matchResult_1, xf_1, yf_1, x_4, y_4, cx, cy, px, py, tx, ty, tx_1, ty_1;
556
- switch (a.tag) {
557
- case 8: {
558
- if (b.tag === 8) {
559
- matchResult_1 = 0;
560
- xf_1 = a.fields[0];
561
- yf_1 = b.fields[0];
562
- }
563
- else {
564
- matchResult_1 = 5;
565
- }
566
- break;
567
+ let matchResult_1, xf, yf;
568
+ const activePatternResult = $007CRecordFields$007C_$007C(a);
569
+ if (activePatternResult != null) {
570
+ const activePatternResult_1 = $007CRecordFields$007C_$007C(b);
571
+ if (activePatternResult_1 != null) {
572
+ matchResult_1 = 0;
573
+ xf = activePatternResult;
574
+ yf = activePatternResult_1;
567
575
  }
568
- case 9: {
569
- if (a.fields[0] != null) {
570
- if (b.tag === 9) {
571
- if (b.fields[0] != null) {
572
- matchResult_1 = 2;
573
- x_4 = a.fields[0];
574
- y_4 = b.fields[0];
575
- }
576
- else {
577
- matchResult_1 = 5;
578
- }
579
- }
580
- else {
581
- matchResult_1 = 5;
582
- }
583
- }
584
- else if (b.tag === 9) {
585
- if (b.fields[0] == null) {
586
- matchResult_1 = 1;
587
- }
588
- else {
589
- matchResult_1 = 5;
590
- }
591
- }
592
- else {
593
- matchResult_1 = 5;
594
- }
595
- break;
596
- }
597
- case 10: {
598
- if (b.tag === 10) {
599
- matchResult_1 = 3;
600
- cx = a.fields[1];
601
- cy = b.fields[1];
602
- px = a.fields[2];
603
- py = b.fields[2];
604
- tx = a.fields[0];
605
- ty = b.fields[0];
606
- }
607
- else {
608
- matchResult_1 = 5;
609
- }
610
- break;
611
- }
612
- case 12: {
613
- if (b.tag === 12) {
614
- matchResult_1 = 4;
615
- tx_1 = a.fields[0];
616
- ty_1 = b.fields[0];
617
- }
618
- else {
619
- matchResult_1 = 5;
620
- }
621
- break;
576
+ else {
577
+ matchResult_1 = 1;
622
578
  }
623
- default:
624
- matchResult_1 = 5;
579
+ }
580
+ else {
581
+ matchResult_1 = 1;
625
582
  }
626
583
  switch (matchResult_1) {
627
584
  case 0:
628
- if (FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) {
629
- return forAll((key_1, value_1) => exists((b_4) => valueEquals(value_1, b_4), toArray(tryFind(key_1, yf_1))), xf_1);
585
+ if (FSharpMap__get_Count(xf) === FSharpMap__get_Count(yf)) {
586
+ return forAll((key, value_12) => exists((b_3) => valueEquals(value_12, b_3), toArray(tryFind(key, yf))), xf);
630
587
  }
631
588
  else {
632
589
  return false;
633
590
  }
634
- case 1:
635
- return true;
636
- case 2: {
637
- a_mut = x_4;
638
- b_mut = y_4;
639
- continue valueEquals;
640
- }
641
- case 3:
642
- if ((tx === ty) && (cx === cy)) {
643
- let matchResult_2, xv, yv;
644
- if (px != null) {
645
- if (py != null) {
646
- matchResult_2 = 1;
647
- xv = px;
648
- yv = py;
591
+ default: {
592
+ let matchResult_2, xf_1, yf_1, x_4, y_4, cx, cy, px, py, tx, ty, tx_1, ty_1;
593
+ switch (a.tag) {
594
+ case 8: {
595
+ if (b.tag === 8) {
596
+ matchResult_2 = 0;
597
+ xf_1 = a.fields[0];
598
+ yf_1 = b.fields[0];
649
599
  }
650
600
  else {
651
- matchResult_2 = 2;
601
+ matchResult_2 = 5;
652
602
  }
603
+ break;
653
604
  }
654
- else if (py == null) {
655
- matchResult_2 = 0;
605
+ case 9: {
606
+ if (a.fields[0] != null) {
607
+ if (b.tag === 9) {
608
+ if (b.fields[0] != null) {
609
+ matchResult_2 = 2;
610
+ x_4 = a.fields[0];
611
+ y_4 = b.fields[0];
612
+ }
613
+ else {
614
+ matchResult_2 = 5;
615
+ }
616
+ }
617
+ else {
618
+ matchResult_2 = 5;
619
+ }
620
+ }
621
+ else if (b.tag === 9) {
622
+ if (b.fields[0] == null) {
623
+ matchResult_2 = 1;
624
+ }
625
+ else {
626
+ matchResult_2 = 5;
627
+ }
628
+ }
629
+ else {
630
+ matchResult_2 = 5;
631
+ }
632
+ break;
656
633
  }
657
- else {
658
- matchResult_2 = 2;
634
+ case 10: {
635
+ if (b.tag === 10) {
636
+ matchResult_2 = 3;
637
+ cx = a.fields[1];
638
+ cy = b.fields[1];
639
+ px = a.fields[2];
640
+ py = b.fields[2];
641
+ tx = a.fields[0];
642
+ ty = b.fields[0];
643
+ }
644
+ else {
645
+ matchResult_2 = 5;
646
+ }
647
+ break;
659
648
  }
660
- switch (matchResult_2) {
661
- case 0:
662
- return true;
663
- case 1: {
664
- a_mut = xv;
665
- b_mut = yv;
666
- continue valueEquals;
649
+ case 12: {
650
+ if (b.tag === 12) {
651
+ matchResult_2 = 4;
652
+ tx_1 = a.fields[0];
653
+ ty_1 = b.fields[0];
667
654
  }
668
- default:
669
- return false;
655
+ else {
656
+ matchResult_2 = 5;
657
+ }
658
+ break;
670
659
  }
660
+ default:
661
+ matchResult_2 = 5;
671
662
  }
672
- else {
673
- return false;
663
+ switch (matchResult_2) {
664
+ case 0:
665
+ if (FSharpMap__get_Count(xf_1) === FSharpMap__get_Count(yf_1)) {
666
+ return forAll((key_1, value_13) => exists((b_4) => valueEquals(value_13, b_4), toArray(tryFind(key_1, yf_1))), xf_1);
667
+ }
668
+ else {
669
+ return false;
670
+ }
671
+ case 1:
672
+ return true;
673
+ case 2: {
674
+ a_mut = x_4;
675
+ b_mut = y_4;
676
+ continue valueEquals;
677
+ }
678
+ case 3:
679
+ if ((tx === ty) && (cx === cy)) {
680
+ let matchResult_3, xv, yv;
681
+ if (px != null) {
682
+ if (py != null) {
683
+ matchResult_3 = 1;
684
+ xv = px;
685
+ yv = py;
686
+ }
687
+ else {
688
+ matchResult_3 = 2;
689
+ }
690
+ }
691
+ else if (py == null) {
692
+ matchResult_3 = 0;
693
+ }
694
+ else {
695
+ matchResult_3 = 2;
696
+ }
697
+ switch (matchResult_3) {
698
+ case 0:
699
+ return true;
700
+ case 1: {
701
+ a_mut = xv;
702
+ b_mut = yv;
703
+ continue valueEquals;
704
+ }
705
+ default:
706
+ return false;
707
+ }
708
+ }
709
+ else {
710
+ return false;
711
+ }
712
+ case 4:
713
+ return equals_1(tx_1, ty_1);
714
+ default:
715
+ return false;
674
716
  }
675
- case 4:
676
- return equals_1(tx_1, ty_1);
677
- default:
678
- return false;
717
+ }
679
718
  }
680
719
  }
681
720
  }