# All files / src Relude_Set.bs.js

65.31% Statements 32/49
100% Branches 0/0
5.56% Functions 1/18
65.31% Lines 32/49

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

    26x
    26x
    26x
    26x
    26x
    26x
    26x

    26x

    42x

    42x

    42x
    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    42x

    26x

    26x
    26x
    26x

     'use strict';

    var Curry = require("bs-platform/lib/js/curry.js");
    var Belt_Id = require("bs-platform/lib/js/belt_Id.js");
    var Belt_Set = require("bs-platform/lib/js/belt_Set.js");
    var Belt_List = require("bs-platform/lib/js/belt_List.js");
    var Relude_Option = require("./Relude_Option.bs.js");
    var Relude_Function = require("./Relude_Function.bs.js");
    var Relude_Ordering = require("./Relude_Ordering.bs.js");

    var $great$great = Relude_Function.Infix.$great$great;

    function WithOrd(M) {
      var cmp = function (a, b) {
        return Relude_Ordering.toInt(Curry._2(M.compare, a, b));
      };
      var Comparable = Belt_Id.MakeComparable({
            cmp: cmp
          });
      var empty = Belt_Set.make(Comparable);
      var fromArray = function (__x) {
        return Belt_Set.fromArray(__x, Comparable);
      };
      var fromList = function (param) {
        return $great$great(Belt_List.toArray, fromArray, param);
      };
      var contains = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.has, param, param$1);
      };
      var add = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.add, param, param$1);
      };
      var mergeMany = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.mergeMany, param, param$1);
      };
      var remove = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.remove, param, param$1);
      };
      var removeMany = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.removeMany, param, param$1);
      };
      var forEach = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.forEach, param, param$1);
      };
      var foldLeft = function (fn, acc, __x) {
        return Belt_Set.reduce(__x, acc, fn);
      };
      var all = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.every, param, param$1);
      };
      var any = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.some, param, param$1);
      };
      var filter = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.keep, param, param$1);
      };
      var partition = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.partition, param, param$1);
      };
      var get = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.get, param, param$1);
      };
      var getOrElse = function (value, $$default, t) {
        return Relude_Option.getOrElse($$default, Relude_Function.flip(Belt_Set.get, value, t));
      };
      var split = function (param, param$1) {
        return Relude_Function.flip(Belt_Set.split, param, param$1);
      };
      return {
              Comparable: { },
              empty: empty,
              fromArray: fromArray,
              fromList: fromList,
              isEmpty: Belt_Set.isEmpty,
              contains: contains,
              add: add,
              mergeMany: mergeMany,
              remove: remove,
              removeMany: removeMany,
              union: Belt_Set.union,
              intersect: Belt_Set.intersect,
              diff: Belt_Set.diff,
              subset: Belt_Set.subset,
              compare: Belt_Set.cmp,
              eq: Belt_Set.eq,
              forEach: forEach,
              foldLeft: foldLeft,
              all: all,
              any: any,
              filter: filter,
              partition: partition,
              length: Belt_Set.size,
              toArray: Belt_Set.toArray,
              toList: Belt_Set.toList,
              minimum: Belt_Set.minimum,
              maximum: Belt_Set.maximum,
              get: get,
              getOrElse: getOrElse,
              split: split
            };
    }

    var flip = Relude_Function.flip;

    exports.flip = flip;
    exports.$great$great = $great$great;
    exports.WithOrd = WithOrd;
    /* Relude_Option Not a pure module */