# All files / src Relude_SequenceZipper.bs.js

96.59% Statements 312/323
89.13% Branches 41/46
94.96% Functions 113/119
96.59% Lines 312/323

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x
    1x
    175x

    1x
    1x

    1x
    9x

    1x
    3x

    1x
    3x

    1x
    3x

    1x
    4x
    4x
    4x

    1x
    2x
    1x

    1x
    2x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x

    1x
    1x
    1x

    1x

    1x
    1x

    1x
    1x
    11x
    22x

    11x
    11x
    11x

    1x
    1x
    2x

    1x
    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x

    1x

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    2x

    1x
    1x
    5x

    1x

    1x
    7x

    1x
    1x

    1x
    3x

    1x
    2x
    2x
    2x
    1x

    1x

    1x
    2x
    2x
    2x
    1x

    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    2x

    1x
    1x
    5x

    1x
    30x
    30x
    30x
    30x
    30x
    30x
    30x
    30x

    1x
    5x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    1x

    1x
    2x

    1x
    2x

    1x
    2x

    1x
    1x

    1x
    1x

    1x
    46x
    46x
    46x
    37x

    1x
    49x
    49x
    49x
    42x

    1x
    2x

    1x
    2x

    1x
    4x
    4x
    4x
    1x

    3x

    1x
    4x
    4x
    4x
    1x

    3x

    1x
    2x
    1x

    1x
    2x
    1x

    1x
    20x
    1x
    19x
    2x

    17x
    17x
    15x

    1x
    20x
    1x
    19x
    2x

    17x
    17x
    15x

    1x
    1x
    1x

    1x
    1x
    1x

    1x
    27x
    27x
    27x
    11x
    16x
    11x
    10x

    5x
    5x

    1x
    4x
    4x

    1x
    4x
    4x

    4x

    1x
    22x
    22x
    4x

    18x
    18x
    14x

    1x
    22x
    22x
    7x

    15x
    15x
    14x

    1x
    1x
    1x
    1x

    1x
    4x
    4x
    4x

    1x
    4x
    4x
    4x

    1x
    1x
    1x
    1x
    1x

    1x

    1x
    2x
    2x

    1x
    2x
    2x

    1x
    1x
    1x
    1x

    1x
    1x

    1x
    1x

    1x
    4x
    4x
    2x

    1x
    3x
    3x
    2x

    1x
    3x
    2x

    1x
    2x

    1x
    1x

    1x

    1x
    2x
    2x

    1x

    1x

    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x

    1x

    1x

    1x
    1x

     'use strict';

    var Curry = require("bs-platform/lib/js/curry.js");
    var Caml_int32 = require("bs-platform/lib/js/caml_int32.js");
    var Relude_Int = require("./Relude_Int.bs.js");
    var Relude_List = require("./Relude_List.bs.js");
    var Relude_Option = require("./Relude_Option.bs.js");
    var Relude_Function = require("./Relude_Function.bs.js");
    var Relude_NonEmpty = require("./Relude_NonEmpty.bs.js");
    var Relude_List_Base = require("./list/Relude_List_Base.bs.js");
    var Relude_Array_Base = require("./array/Relude_Array_Base.bs.js");
    var Default$BsAbstract = require("bs-abstract/lib/js/src/utilities/Default.bs.js");
    var Relude_Extensions_Apply = require("./extensions/Relude_Extensions_Apply.bs.js");
    var Relude_Extensions_Functor = require("./extensions/Relude_Extensions_Functor.bs.js");
    var Relude_Extensions_Foldable = require("./extensions/Relude_Extensions_Foldable.bs.js");
    var Relude_Extensions_Applicative = require("./extensions/Relude_Extensions_Applicative.bs.js");

    function WithSequence(S) {
      var SFoldableExtensions = Relude_Extensions_Foldable.FoldableExtensions(S.Foldable);
      var make = function (left, focus, right) {
        return /* Zipper */[
                left,
                focus,
                right
              ];
      };
      var makeWithLeft = function (left, focus) {
        return /* Zipper */[
                left,
                focus,
                Curry._1(S.emptyLazy, /* () */0)
              ];
      };
      var makeWithRight = function (focus, right) {
        return /* Zipper */[
                Curry._1(S.emptyLazy, /* () */0),
                focus,
                right
              ];
      };
      var makeWithRightArray = function (focus, array) {
        return makeWithRight(focus, Curry._1(S.fromArray, array));
      };
      var makeWithRightList = function (focus, list) {
        return makeWithRight(focus, Curry._1(S.fromList, list));
      };
      var makeWithFocus = function (focus) {
        return /* Zipper */[
                Curry._1(S.emptyLazy, /* () */0),
                focus,
                Curry._1(S.emptyLazy, /* () */0)
              ];
      };
      var fromSequence = function (sequence) {
        var head = Curry._1(S.head, sequence);
        var tail = Curry._1(S.tail, sequence);
        return Curry._3(Relude_Option.map2, makeWithRight, head, tail);
      };
      var fromArray = function (array) {
        return Relude_Option.map((function (param) {
                      return Relude_Function.uncurry2(makeWithRightArray, param);
                    }), Relude_Array_Base.uncons(array));
      };
      var fromList = function (array) {
        return Relude_Option.map((function (param) {
                      return Relude_Function.uncurry2(makeWithRightList, param);
                    }), Relude_List_Base.uncons(array));
      };
      var fromNonEmptyArray = function (param) {
        return makeWithRightArray(param[0], param[1]);
      };
      var fromNonEmptyList = function (param) {
        return makeWithRightList(param[0], param[1]);
      };
      var map = function (f, param) {
        return /* Zipper */[
                Curry._2(S.Functor.map, f, param[0]),
                Curry._1(f, param[1]),
                Curry._2(S.Functor.map, f, param[2])
              ];
      };
      var Functor = {
        map: map
      };
      var include = Relude_Extensions_Functor.FunctorExtensions(Functor);
      var apply = function (param, param$1) {
        return /* Zipper */[
                Curry._3(S.zipWith, Relude_Function.id, param[0], param$1[0]),
                Curry._1(param[1], param$1[1]),
                Curry._3(S.zipWith, Relude_Function.id, param[2], param$1[2])
              ];
      };
      var Apply = {
        map: map,
        apply: apply
      };
      var include$1 = Relude_Extensions_Apply.ApplyExtensions(Apply);
      var Applicative = {
        map: map,
        apply: apply,
        pure: makeWithFocus
      };
      var include$2 = Relude_Extensions_Applicative.ApplicativeExtensions(Applicative);
      var foldLeft = function (f, acc, param) {
        var flipF = function (a, b) {
          return Curry._2(f, b, a);
        };
        var accL = Curry._3(S.Foldable.fold_right, flipF, acc, param[0]);
        var accF = Curry._2(f, accL, param[1]);
        return Curry._3(S.Foldable.fold_left, f, accF, param[2]);
      };
      var foldRight = function (f, acc, param) {
        var flipF = function (b, a) {
          return Curry._2(f, a, b);
        };
        var accR = Curry._3(S.Foldable.fold_right, f, acc, param[2]);
        var accF = Curry._2(f, param[1], accR);
        return Curry._3(S.Foldable.fold_left, flipF, accF, param[0]);
      };
      var Foldable_Fold_Map = function (funarg) {
        var D = Default$BsAbstract.Fold_Map(funarg)({
              fold_left: foldLeft,
              fold_right: foldRight
            });
        var fold_map = D.fold_map_default_left;
        return {
                fold_map: fold_map
              };
      };
      var Foldable_Fold_Map_Any = function (funarg) {
        var D = Default$BsAbstract.Fold_Map_Any(funarg)({
              fold_left: foldLeft,
              fold_right: foldRight
            });
        var fold_map = D.fold_map_default_left;
        return {
                fold_map: fold_map
              };
      };
      var Foldable_Fold_Map_Plus = function (funarg) {
        var D = Default$BsAbstract.Fold_Map_Plus(funarg)({
              fold_left: foldLeft,
              fold_right: foldRight
            });
        var fold_map = D.fold_map_default_left;
        return {
                fold_map: fold_map
              };
      };
      var Foldable = {
        fold_left: foldLeft,
        fold_right: foldRight,
        Fold_Map: Foldable_Fold_Map,
        Fold_Map_Any: Foldable_Fold_Map_Any,
        Fold_Map_Plus: Foldable_Fold_Map_Plus
      };
      var include$3 = Relude_Extensions_Foldable.FoldableExtensions(Foldable);
      var length = include$3.length;
      var Traversable = function (funarg) {
        var $less$$great = funarg.map;
        var $less$star$great = funarg.apply;
        var STraversable = Curry._1(S.Traversable, funarg);
        var traverse = function (f, param) {
          return Curry._2($less$star$great, Curry._2($less$star$great, Curry._2($less$$great, make, Curry._2(STraversable.traverse, f, param[0])), Curry._1(f, param[1])), Curry._2(STraversable.traverse, f, param[2]));
        };
        var sequence = function (fa) {
          return traverse((function (a) {
                        return a;
                      }), fa);
        };
        return {
                map: map,
                fold_left: foldLeft,
                fold_right: foldRight,
                Fold_Map: Foldable_Fold_Map,
                Fold_Map_Any: Foldable_Fold_Map_Any,
                Fold_Map_Plus: Foldable_Fold_Map_Plus,
                traverse: traverse,
                sequence: sequence
              };
      };
      var toSequence = function (param) {
        return Curry._2(S.concat, Curry._2(S.append, param[1], Curry._1(S.reverse, param[0])), param[2]);
      };
      var toArray = function (zipper) {
        return Curry._1(SFoldableExtensions.toArray, toSequence(zipper));
      };
      var toList = function (zipper) {
        return Curry._1(SFoldableExtensions.toList, toSequence(zipper));
      };
      var toNonEmptyArray = function (param) {
        var right = param[2];
        var focus = param[1];
        return Relude_Option.foldLazy((function (param) {
                      return Relude_NonEmpty.$$Array.make(focus, Curry._1(S.toArray, right));
                    }), (function (param) {
                      return Relude_NonEmpty.$$Array.make(param[0], Curry._1(S.toArray, Curry._2(S.concat, Curry._2(S.append, focus, param[1]), right)));
                    }), Curry._1(S.uncons, Curry._1(S.reverse, param[0])));
      };
      var toNonEmptyList = function (param) {
        var right = param[2];
        var focus = param[1];
        return Relude_Option.foldLazy((function (param) {
                      return Relude_NonEmpty.List.make(focus, Curry._1(S.toList, right));
                    }), (function (param) {
                      return Relude_NonEmpty.List.make(param[0], Curry._1(S.toList, Curry._2(S.concat, Curry._2(S.append, focus, param[1]), right)));
                    }), Curry._1(S.uncons, Curry._1(S.reverse, param[0])));
      };
      var concatWithKeepLeftFocus = function (prefix, suffix) {
        return /* Zipper */[
                prefix[0],
                prefix[1],
                Curry._2(S.concat, prefix[2], toSequence(suffix))
              ];
      };
      var concatWithKeepRightFocus = function (prefix, suffix) {
        return /* Zipper */[
                Curry._2(S.concat, suffix[0], Curry._1(S.reverse, toSequence(prefix))),
                suffix[1],
                suffix[2]
              ];
      };
      var append = concatWithKeepLeftFocus;
      var Semigroup_Any = {
        append: append
      };
      var reverse = function (param) {
        return /* Zipper */[
                param[2],
                param[1],
                param[0]
              ];
      };
      var zipWith = function (f, param, param$1) {
        return /* Zipper */[
                Curry._3(S.zipWith, f, param[0], param$1[0]),
                Curry._2(f, param[1], param$1[1]),
                Curry._3(S.zipWith, f, param[2], param$1[2])
              ];
      };
      var zip = function (z1, z2) {
        return zipWith((function (a, b) {
                      return /* tuple */[
                              a,
                              b
                            ];
                    }), z1, z2);
      };
      var zipWithIndex = function (param) {
        var right = param[2];
        var left = param[0];
        var leftLength = Curry._1(S.length, left);
        var rightLength = Curry._1(S.length, right);
        var totalLength = (leftLength + 1 | 0) + rightLength | 0;
        var leftRange = Relude_List.reverse(Relude_Int.rangeAsList(0, leftLength));
        var rightRange = Relude_Int.rangeAsList(leftLength + 1 | 0, totalLength);
        return /* Zipper */[
                Curry._2(S.zip, left, Curry._1(S.fromList, leftRange)),
                /* tuple */[
                  param[1],
                  leftLength
                ],
                Curry._2(S.zip, right, Curry._1(S.fromList, rightRange))
              ];
      };
      var getFocus = function (param) {
        return param[1];
      };
      var setFocusBy = function (f, param) {
        return /* Zipper */[
                param[0],
                Curry._1(f, param[1]),
                param[2]
              ];
      };
      var setFocus = function (focus, param) {
        return /* Zipper */[
                param[0],
                focus,
                param[2]
              ];
      };
      var getLeft = function (param) {
        return param[0];
      };
      var setLeft = function (left, param) {
        return /* Zipper */[
                left,
                param[1],
                param[2]
              ];
      };
      var getLeftInOrder = function (param) {
        return Curry._1(S.reverse, param[0]);
      };
      var setLeftFromInOrder = function (left, param) {
        return /* Zipper */[
                Curry._1(S.reverse, left),
                param[1],
                param[2]
              ];
      };
      var getRight = function (param) {
        return param[2];
      };
      var setRight = function (right, param) {
        return /* Zipper */[
                param[0],
                param[1],
                right
              ];
      };
      var peekLeft = function (param) {
        return Curry._1(S.head, param[0]);
      };
      var peekRight = function (param) {
        return Curry._1(S.head, param[2]);
      };
      var isAtStart = function (param) {
        return Curry._1(S.isEmpty, param[0]);
      };
      var isAtEnd = function (param) {
        return Curry._1(S.isEmpty, param[2]);
      };
      var isAtIndex = function (target, z) {
        return getFocus(zipWithIndex(z))[1] === target;
      };
      var isAtItemBy = function (eq, target, z) {
        return Curry._2(eq, getFocus(z), target);
      };
      var isAtItem = function (eq, item, zipper) {
        return Curry._2(eq.eq, getFocus(zipper), item);
      };
      var moveLeft = function (param) {
        var right = param[2];
        var focus = param[1];
        return Relude_Option.map((function (param) {
                      return /* Zipper */[
                              param[1],
                              param[0],
                              Curry._2(S.prepend, focus, right)
                            ];
                    }), Curry._1(S.uncons, param[0]));
      };
      var moveRight = function (param) {
        var focus = param[1];
        var left = param[0];
        return Relude_Option.map((function (param) {
                      return /* Zipper */[
                              Curry._2(S.prepend, focus, left),
                              param[0],
                              param[1]
                            ];
                    }), Curry._1(S.uncons, param[2]));
      };
      var moveLeftWithClamp = function (z) {
        return Relude_Option.getOrElse(z, moveLeft(z));
      };
      var moveRightWithClamp = function (z) {
        return Relude_Option.getOrElse(z, moveRight(z));
      };
      var moveStart = function (z) {
        var right = z[2];
        var focus = z[1];
        return Relude_Option.foldLazy((function (param) {
                      return z;
                    }), (function (param) {
                      return /* Zipper */[
                              Curry._1(S.emptyLazy, /* () */0),
                              param[0],
                              Curry._2(S.concat, Curry._2(S.append, focus, param[1]), right)
                            ];
                    }), Curry._1(S.uncons, Curry._1(S.reverse, z[0])));
      };
      var moveEnd = function (z) {
        var focus = z[1];
        var left = z[0];
        return Relude_Option.foldLazy((function (param) {
                      return z;
                    }), (function (param) {
                      return /* Zipper */[
                              Curry._2(S.concat, param[1], Curry._2(S.prepend, focus, left)),
                              param[0],
                              Curry._1(S.emptyLazy, /* () */0)
                            ];
                    }), Curry._1(S.uncons, Curry._1(S.reverse, z[2])));
      };
      var moveLeftWithWrap = function (z) {
        return Relude_Option.getOrElseLazy((function (param) {
                      return moveEnd(z);
                    }), moveLeft(z));
      };
      var moveRightWithWrap = function (z) {
        return Relude_Option.getOrElseLazy((function (param) {
                      return moveStart(z);
                    }), moveRight(z));
      };
      var moveLeftTimes = function (times, z) {
        if (times < 0) {
          return ;
        } else if (times === 0) {
          return z;
        } else {
          var partial_arg = times - 1 | 0;
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return moveLeftTimes(partial_arg, param);
                      }), moveLeft(z));
        }
      };
      var moveRightTimes = function (times, z) {
        if (times < 0) {
          return ;
        } else if (times === 0) {
          return z;
        } else {
          var partial_arg = times - 1 | 0;
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return moveRightTimes(partial_arg, param);
                      }), moveRight(z));
        }
      };
      var moveLeftTimesWithClamp = function (times, z) {
        return Relude_Option.getOrElseLazy((function (param) {
                      return moveStart(z);
                    }), moveLeftTimes(times, z));
      };
      var moveRightTimesWithClamp = function (times, z) {
        return Relude_Option.getOrElseLazy((function (param) {
                      return moveEnd(z);
                    }), moveRightTimes(times, z));
      };
      var moveToIndex = function (target, z) {
        var match = zipWithIndex(z);
        var index = match[1][1];
        if (index === target) {
          return z;
        } else if (index < target) {
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return moveToIndex(target, param);
                      }), moveRight(z));
        } else {
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return moveToIndex(target, param);
                      }), moveLeft(z));
        }
      };
      var moveToIndexWithMod = function (target, z) {
        var modTarget = Caml_int32.mod_(target, Curry._1(length, z));
        return Relude_Option.getOrThrow(moveToIndex(modTarget, z));
      };
      var moveToIndexWithClamp = function (target, z) {
        var maxIndex = Curry._1(length, z) - 1 | 0;
        var newTarget = target < 0 ? 0 : (
            target > maxIndex ? maxIndex : target
          );
        return Relude_Option.getOrThrow(moveToIndex(newTarget, z));
      };
      var findLeftBy = function ($staropt$star, f, z) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        if (checkFocus && Curry._1(f, z[1])) {
          return z;
        } else {
          var partial_arg = true;
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return findLeftBy(partial_arg, f, param);
                      }), moveLeft(z));
        }
      };
      var findRightBy = function ($staropt$star, f, z) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        if (checkFocus && Curry._1(f, z[1])) {
          return z;
        } else {
          var partial_arg = true;
          return Curry._2(Relude_Option.flatMap, (function (param) {
                        return findRightBy(partial_arg, f, param);
                      }), moveRight(z));
        }
      };
      var findBy = function ($staropt$star, f, z) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        return Relude_Option.orElseLazy((function (param) {
                      return findRightBy(false, f, z);
                    }), findLeftBy(checkFocus, f, z));
      };
      var findItemLeftBy = function ($staropt$star, eq, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        var p = Curry._1(eq, item);
        return findLeftBy(checkFocus, p, zipper);
      };
      var findItemRightBy = function ($staropt$star, eq, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        var p = Curry._1(eq, item);
        return findRightBy(checkFocus, p, zipper);
      };
      var findItemBy = function ($staropt$star, eq, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        var arg = findItemLeftBy(checkFocus, eq, item, zipper);
        return (function (param) {
                    return Relude_Option.orElseLazy(param, arg);
                  })((function (param) {
                      return findItemRightBy(false, eq, item, zipper);
                    }));
      };
      var findItemLeft = function (eq, $staropt$star, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        return findItemLeftBy(checkFocus, eq.eq, item, zipper);
      };
      var findItemRight = function (eq, $staropt$star, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        return findItemRightBy(checkFocus, eq.eq, item, zipper);
      };
      var findItem = function (eq, $staropt$star, item, zipper) {
        var checkFocus = $staropt$star !== undefined ? $staropt$star : true;
        return Relude_Option.orElseLazy((function (param) {
                      return findItemRight(eq, false, item, zipper);
                    }), findItemLeft(eq, checkFocus, item, zipper));
      };
      var insertWithPushLeft = function (item, param) {
        return /* Zipper */[
                Curry._2(S.prepend, param[1], param[0]),
                item,
                param[2]
              ];
      };
      var insertWithPushRight = function (item, param) {
        return /* Zipper */[
                param[0],
                item,
                Curry._2(S.prepend, param[1], param[2])
              ];
      };
      var deleteWithPullLeft = function (param) {
        var right = param[2];
        return Relude_Option.map((function (param) {
                      return /* Zipper */[
                              param[1],
                              param[0],
                              right
                            ];
                    }), Curry._1(S.uncons, param[0]));
      };
      var deleteWithPullRight = function (param) {
        var left = param[0];
        return Relude_Option.map((function (param) {
                      return /* Zipper */[
                              left,
                              param[0],
                              param[1]
                            ];
                    }), Curry._1(S.uncons, param[2]));
      };
      var deleteWithPullLeftOrRight = function (z) {
        return Relude_Option.orElseLazy((function (param) {
                      return deleteWithPullRight(z);
                    }), deleteWithPullLeft(z));
      };
      var showBy = function (showA, param) {
        return "Zipper(" + (Curry._2(S.showBy, showA, param[0]) + (", " + (Curry._1(showA, param[1]) + (", " + (Curry._2(S.showBy, showA, param[2]) + ")")))));
      };
      var show = function (showA, xs) {
        return showBy(showA.show, xs);
      };
      var Show = function (ShowA) {
        var show = function (xs) {
          return showBy(ShowA.show, xs);
        };
        return {
                show: show
              };
      };
      var eqBy = function (eqA, param, param$1) {
        Eif (Curry._3(S.eqBy, eqA, param[0], param$1[0]) && Curry._2(eqA, param[1], param$1[1])) {
          return Curry._3(S.eqBy, eqA, param[2], param$1[2]);
        } else {
          return false;
        }
      };
      var eq = function (eqA, xs, ys) {
        return eqBy(eqA.eq, xs, ys);
      };
      var Eq = function (EqA) {
        var eq = function (xs, ys) {
          return eqBy(EqA.eq, xs, ys);
        };
        return {
                eq: eq
              };
      };
      var include$4 = Relude_Extensions_Functor.FunctorInfix(Functor);
      var include$5 = Relude_Extensions_Apply.ApplyInfix(Apply);
      var Infix_FunctorExtensions = include$4.FunctorExtensions;
      var Infix_$less$dollar$great = include$4.$less$$great;
      var Infix_$less$hash$great = include$4.$less$hash$great;
      var Infix_$less$dollar = include$4.$less$;
      var Infix_$$great = include$4.$$great;
      var Infix_$less$at$great = include$4.$less$at$great;
      var Infix_ApplyExtensions = include$5.ApplyExtensions;
      var Infix_$less$star$great = include$5.$less$star$great;
      var Infix_$less$star = include$5.$less$star;
      var Infix_$star$great = include$5.$star$great;
      var Infix = {
        FunctorExtensions: Infix_FunctorExtensions,
        $less$$great: Infix_$less$dollar$great,
        $less$hash$great: Infix_$less$hash$great,
        $less$: Infix_$less$dollar,
        $$great: Infix_$$great,
        $less$at$great: Infix_$less$at$great,
        ApplyExtensions: Infix_ApplyExtensions,
        $less$star$great: Infix_$less$star$great,
        $less$star: Infix_$less$star,
        $star$great: Infix_$star$great
      };
      return {
              SFoldableExtensions: SFoldableExtensions,
              make: make,
              makeWithLeft: makeWithLeft,
              makeWithRight: makeWithRight,
              makeWithRightArray: makeWithRightArray,
              makeWithRightList: makeWithRightList,
              makeWithFocus: makeWithFocus,
              fromSequence: fromSequence,
              fromArray: fromArray,
              fromList: fromList,
              fromNonEmptyArray: fromNonEmptyArray,
              fromNea: fromNonEmptyArray,
              fromNonEmptyList: fromNonEmptyList,
              fromNel: fromNonEmptyList,
              map: map,
              Functor: Functor,
              BsFunctorExtensions: include.BsFunctorExtensions,
              flipMap: include.flipMap,
              $$void: include.$$void,
              voidRight: include.voidRight,
              voidLeft: include.voidLeft,
              flap: include.flap,
              apply: apply,
              Apply: Apply,
              BsApplyExtensions: include$1.BsApplyExtensions,
              applyFirst: include$1.applyFirst,
              applySecond: include$1.applySecond,
              map2: include$1.map2,
              map3: include$1.map3,
              map4: include$1.map4,
              map5: include$1.map5,
              tuple2: include$1.tuple2,
              tuple3: include$1.tuple3,
              tuple4: include$1.tuple4,
              tuple5: include$1.tuple5,
              mapTuple2: include$1.mapTuple2,
              mapTuple3: include$1.mapTuple3,
              mapTuple4: include$1.mapTuple4,
              mapTuple5: include$1.mapTuple5,
              pure: makeWithFocus,
              Applicative: Applicative,
              BsApplicativeExtensions: include$2.BsApplicativeExtensions,
              liftA1: include$2.liftA1,
              when_: include$2.when_,
              unless: include$2.unless,
              foldLeft: foldLeft,
              foldRight: foldRight,
              Foldable: Foldable,
              BsFoldableExtensions: include$3.BsFoldableExtensions,
              any: include$3.any,
              all: include$3.all,
              containsBy: include$3.containsBy,
              contains: include$3.contains,
              indexOfBy: include$3.indexOfBy,
              indexOf: include$3.indexOf,
              minBy: include$3.minBy,
              min: include$3.min,
              maxBy: include$3.maxBy,
              max: include$3.max,
              countBy: include$3.countBy,
              length: length,
              forEach: include$3.forEach,
              forEachWithIndex: include$3.forEachWithIndex,
              find: include$3.find,
              findWithIndex: include$3.findWithIndex,
              FoldableSemigroupExtensions: include$3.FoldableSemigroupExtensions,
              FoldableMonoidExtensions: include$3.FoldableMonoidExtensions,
              foldMap: include$3.foldMap,
              foldWithMonoid: include$3.foldWithMonoid,
              intercalate: include$3.intercalate,
              FoldableApplicativeExtensions: include$3.FoldableApplicativeExtensions,
              FoldableMonadExtensions: include$3.FoldableMonadExtensions,
              FoldableEqExtensions: include$3.FoldableEqExtensions,
              FoldableOrdExtensions: include$3.FoldableOrdExtensions,
              Traversable: Traversable,
              toSequence: toSequence,
              toArray: toArray,
              toList: toList,
              toNonEmptyArray: toNonEmptyArray,
              toNea: toNonEmptyArray,
              toNonEmptyList: toNonEmptyList,
              toNel: toNonEmptyList,
              concatWithKeepLeftFocus: concatWithKeepLeftFocus,
              concat: concatWithKeepLeftFocus,
              concatWithKeepRightFocus: concatWithKeepRightFocus,
              Semigroup_Any: Semigroup_Any,
              reverse: reverse,
              zipWith: zipWith,
              zip: zip,
              zipWithIndex: zipWithIndex,
              getFocus: getFocus,
              setFocusBy: setFocusBy,
              setFocus: setFocus,
              getLeft: getLeft,
              setLeft: setLeft,
              getLeftInOrder: getLeftInOrder,
              setLeftFromInOrder: setLeftFromInOrder,
              getRight: getRight,
              setRight: setRight,
              peekLeft: peekLeft,
              peekRight: peekRight,
              isAtStart: isAtStart,
              isAtEnd: isAtEnd,
              isAtIndex: isAtIndex,
              isAtItemBy: isAtItemBy,
              isAtItem: isAtItem,
              moveLeft: moveLeft,
              moveRight: moveRight,
              moveLeftWithClamp: moveLeftWithClamp,
              moveRightWithClamp: moveRightWithClamp,
              moveStart: moveStart,
              moveEnd: moveEnd,
              moveLeftWithWrap: moveLeftWithWrap,
              moveRightWithWrap: moveRightWithWrap,
              moveLeftTimes: moveLeftTimes,
              moveRightTimes: moveRightTimes,
              moveLeftTimesWithClamp: moveLeftTimesWithClamp,
              moveRightTimesWithClamp: moveRightTimesWithClamp,
              moveToIndex: moveToIndex,
              moveToIndexWithMod: moveToIndexWithMod,
              moveToIndexWithClamp: moveToIndexWithClamp,
              findLeftBy: findLeftBy,
              findRightBy: findRightBy,
              findBy: findBy,
              findItemLeftBy: findItemLeftBy,
              findItemRightBy: findItemRightBy,
              findItemBy: findItemBy,
              findItemLeft: findItemLeft,
              findItemRight: findItemRight,
              findItem: findItem,
              insertWithPushLeft: insertWithPushLeft,
              insertWithPushRight: insertWithPushRight,
              deleteWithPullLeft: deleteWithPullLeft,
              deleteWithPullRight: deleteWithPullRight,
              deleteWithPullLeftOrRight: deleteWithPullLeftOrRight,
              showBy: showBy,
              show: show,
              Show: Show,
              eqBy: eqBy,
              eq: eq,
              Eq: Eq,
              Infix: Infix
            };
    }

    var id = Relude_Function.id;

    exports.id = id;
    exports.WithSequence = WithSequence;
    /* Relude_Int Not a pure module */