All files / construct/domain_layer/library/structure ListSt.bs.js

80.43% Statements 37/46
50% Branches 2/4
56.25% Functions 9/16
80.43% Lines 37/46

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    7x 7x 7x                                   15x 8x   7x 7x 7x                                     57x 560005x       7x     6x       34x       7x             5x 8x       7x   7x   7x   7x   7x   7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x    
'use strict';
 
var Curry = require("bs-platform/lib/js/curry.js");
var Belt_List = require("bs-platform/lib/js/belt_List.js");
var Result$Wonderjs = require("./Result.bs.js");
 
function traverseResultM(list, f) {
  if (!list) {
    return Result$Wonderjs.succeed(/* [] */0);
  }
  var tail = list.tl;
  return Result$Wonderjs.bind(Curry._1(f, list.hd), (function (h) {
                return Result$Wonderjs.bind(traverseResultM(tail, f), (function (t) {
                              return Result$Wonderjs.succeed({
                                          hd: h,
                                          tl: t
                                        });
                            }));
              }));
}
 
function traverseReduceResultM(list, param, f) {
  if (!list) {
    return Result$Wonderjs.succeed(param);
  }
  var tail = list.tl;
  return Result$Wonderjs.bind(Curry._2(f, param, list.hd), (function (h) {
                return traverseReduceResultM(tail, h, f);
              }));
}
 
function _id(value) {
  return value;
}
 
function sequenceResultM(list) {
  return traverseResultM(list, _id);
}
 
function ignoreTraverseResultValue(traverseResult) {
  return Result$Wonderjs.mapSuccess(traverseResult, (function (param) {
                
              }));
}
 
function range(start, end_) {
  return Belt_List.makeBy((end_ - start | 0) + 1 | 0, (function (i) {
                return i + start | 0;
              }));
}
 
var map = Belt_List.map;
 
function _eq(source, target) {
  return source === target;
}
 
function includes(list, value) {
  return Belt_List.has(list, value, _eq);
}
 
function push(list, value) {
  return Belt_List.concat(list, {
              hd: value,
              tl: /* [] */0
            });
}
 
function remove(list, value) {
  return Belt_List.filter(list, (function (v) {
                return v !== value;
              }));
}
 
var getBy = Belt_List.getBy;
 
var reduce = Belt_List.reduce;
 
var forEach = Belt_List.forEach;
 
var toArray = Belt_List.toArray;
 
var fromArray = Belt_List.fromArray;
 
exports.traverseResultM = traverseResultM;
exports.traverseReduceResultM = traverseReduceResultM;
exports._id = _id;
exports.sequenceResultM = sequenceResultM;
exports.ignoreTraverseResultValue = ignoreTraverseResultValue;
exports.range = range;
exports.map = map;
exports._eq = _eq;
exports.includes = includes;
exports.getBy = getBy;
exports.reduce = reduce;
exports.forEach = forEach;
exports.push = push;
exports.toArray = toArray;
exports.fromArray = fromArray;
exports.remove = remove;
/* No side effect */