text: "use strict";
  function __export(m) {
      for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  }
  Object.defineProperty(exports, "__esModule", { value: true });
  __export(require("fp-ts/lib/Array"));
  var Array_1 = require("fp-ts/lib/Array");
  var lodash_1 = require("lodash");
  exports.removeduplicate = lodash_1.uniq;
  exports.remove = function (a, predicate) {
      var b = Array_1.copy(a);
      lodash_1.remove(b, predicate);
      return b;
  };
  /**
   * removes the last element from an array and returns that array.
   * @param a
   */
  exports.deleteLast = function (a) { return a.length === 0 ? a : Array_1.unsafeDeleteAt(a.length - 1, a); };
  /**
   * removes the first element from an array and returns that array.
   * @param a
   */
  exports.deleteFirst = function (a) { return a.length === 0 ? a : Array_1.unsafeDeleteAt(0, a); };
  /**
   * move array forward left or right and fill with first or last value
   * @param a
   * @param n
   */
  exports.moveAndFillLeftOrRight = function (n) { return function (a) { return a.length === 0 ? a : n === 1 ?
      Array_1.cons(Array_1.head(a).getOrElse(0), exports.deleteLast(a)) : Array_1.snoc(exports.deleteFirst(a), Array_1.last(a).getOrElse(0)); }; };
  exports.moveAndFillLeft = exports.moveAndFillLeftOrRight(-1);
  exports.moveAndFillRight = exports.moveAndFillLeftOrRight(1);
  exports.timeSelf = function (i) { return function (p) { return function (func) {
      var value = p;
      while (i-- > 0) {
          value = func(value);
      }
      return value;
  }; }; };
  var findIndex = function (as, predicate) {
      var l = as.length;
      var i = 0;
      for (; i < l; i++) {
          if (predicate(as[i])) {
              break;
          }
      }
      return i;
  };
  exports.sliceBefore = function (predicate) { return function (as) {
      var i = findIndex(as, predicate);
      return as.slice(0, i);
  }; };
  exports.sliceAfter = function (predicate) { return function (as) {
      var i = findIndex(as, predicate);
      return as.slice(i + 1);
  }; };
  exports.sliceLast = function (n) { return function (as) {
      return as.slice(as.length - n);
  }; };
  exports.sliceFirst = function (n) { return function (as) {
      return as.slice(0, n);
  }; };
  exports.sliceSkip = function (n) { return function (as) {
      return as.slice(n);
  }; };
  exports.groupBy = function (a) { return function (as) { return lodash_1.groupBy(as, a); }; };
  //# sourceMappingURL=Array.js.map